From 6f7cd030e6a3eee0a5fac3a0808ffda2dea0dd8b Mon Sep 17 00:00:00 2001 From: WayofTime Date: Sun, 15 Nov 2020 12:09:18 -0500 Subject: [PATCH] Green Grove Sigil fix. Fixed the Green Grove sigil so that it checs if a plant can grow first. --- .../common/item/sigil/ItemSigilGreenGrove.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/wayoftime/bloodmagic/common/item/sigil/ItemSigilGreenGrove.java b/src/main/java/wayoftime/bloodmagic/common/item/sigil/ItemSigilGreenGrove.java index 67ce33e5..c8169481 100644 --- a/src/main/java/wayoftime/bloodmagic/common/item/sigil/ItemSigilGreenGrove.java +++ b/src/main/java/wayoftime/bloodmagic/common/item/sigil/ItemSigilGreenGrove.java @@ -27,8 +27,7 @@ public class ItemSigilGreenGrove extends ItemSigilToggleableBase if (PlayerHelper.isFakePlayer(player)) return false; - if (NetworkHelper.getSoulNetwork(player).syphonAndDamage(player, SoulTicket.item(stack, world, player, getLpUsed())).isSuccess() - && applyBonemeal(stack, world, blockPos, player)) + if (NetworkHelper.getSoulNetwork(player).syphonAndDamage(player, SoulTicket.item(stack, world, player, getLpUsed())).isSuccess() && applyBonemeal(stack, world, blockPos, player)) { if (!world.isRemote) { @@ -70,11 +69,14 @@ public class ItemSigilGreenGrove extends ItemSigilToggleableBase if (worldIn.rand.nextInt(50) == 0) { BlockState preBlockState = worldIn.getBlockState(blockPos); - ((IGrowable) state.getBlock()).grow(serverWorld, worldIn.rand, blockPos, state); + if (((IGrowable) state.getBlock()).canGrow(serverWorld, blockPos, preBlockState, worldIn.isRemote)) + { + ((IGrowable) state.getBlock()).grow(serverWorld, worldIn.rand, blockPos, state); - BlockState newState = worldIn.getBlockState(blockPos); - if (!newState.equals(preBlockState) && !worldIn.isRemote) - worldIn.playEvent(2005, blockPos, 0); + BlockState newState = worldIn.getBlockState(blockPos); + if (!newState.equals(preBlockState) && !worldIn.isRemote) + worldIn.playEvent(2005, blockPos, 0); + } } } }