diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/StemBlock.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/StemBlock.java.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/StemBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/StemBlock.java.patch new file mode 100644 index 0000000000..675d69cf74 --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/StemBlock.java.patch @@ -0,0 +1,45 @@ +--- a/net/minecraft/world/level/block/StemBlock.java ++++ b/net/minecraft/world/level/block/StemBlock.java +@@ -26,6 +26,7 @@ + import net.minecraft.world.level.block.state.properties.IntegerProperty; + import net.minecraft.world.phys.shapes.CollisionContext; + import net.minecraft.world.phys.shapes.VoxelShape; ++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit + + public class StemBlock extends BushBlock implements BonemealableBlock { + +@@ -82,8 +79,8 @@ + int i = (Integer) blockstate.getValue(StemBlock.AGE); + + if (i < 7) { +- blockstate = (BlockState) blockstate.setValue(StemBlock.AGE, i + 1); +- serverlevel.setBlock(blockpos, blockstate, 2); ++ state = (IBlockData) state.setValue(StemBlock.AGE, i + 1); ++ CraftEventFactory.handleBlockGrowEvent(level, pos, state, 2); // CraftBukkit + } else { + Direction direction = Direction.Plane.HORIZONTAL.getRandomDirection(randomsource); + BlockPos blockpos1 = blockpos.relative(direction); +@@ -95,8 +92,12 @@ + Optional<Block> optional1 = registry.getOptional(this.attachedStem); + + if (optional.isPresent() && optional1.isPresent()) { +- serverlevel.setBlockAndUpdate(blockpos1, ((Block) optional.get()).defaultBlockState()); +- serverlevel.setBlockAndUpdate(blockpos, (BlockState) ((Block) optional1.get()).defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, direction)); ++ // CraftBukkit start ++ if (!CraftEventFactory.handleBlockGrowEvent(level, blockposition1, ((Block) optional.get()).defaultBlockState())) { ++ return; ++ } ++ // CraftBukkit end ++ level.setBlockAndUpdate(pos, (IBlockData) ((Block) optional1.get()).defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, enumdirection)); + } + } + } +@@ -129,7 +126,7 @@ + int i = Math.min(7, (Integer) blockstate.getValue(StemBlock.AGE) + Mth.nextInt(serverlevel.random, 2, 5)); + BlockState blockstate1 = (BlockState) blockstate.setValue(StemBlock.AGE, i); + +- serverlevel.setBlock(blockpos, blockstate1, 2); ++ CraftEventFactory.handleBlockGrowEvent(level, pos, iblockdata1, 2); // CraftBukkit + if (i == 7) { + blockstate1.randomTick(serverlevel, blockpos, serverlevel.random); + } |