diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/VineBlock.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/VineBlock.java.patch | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/VineBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/VineBlock.java.patch new file mode 100644 index 0000000000..f01a593599 --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/VineBlock.java.patch @@ -0,0 +1,73 @@ +--- a/net/minecraft/world/level/block/VineBlock.java ++++ b/net/minecraft/world/level/block/VineBlock.java +@@ -24,6 +24,7 @@ + import net.minecraft.world.phys.shapes.CollisionContext; + import net.minecraft.world.phys.shapes.Shapes; + import net.minecraft.world.phys.shapes.VoxelShape; ++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit + + public class VineBlock extends Block { + +@@ -209,10 +204,13 @@ + BlockPos blockpos3 = blockpos2.relative(direction1); + BlockPos blockpos4 = blockpos2.relative(direction2); + +- if (flag && isAcceptableNeighbour(serverlevel, blockpos3, direction1)) { +- serverlevel.setBlock(blockpos2, (BlockState) this.defaultBlockState().setValue(getPropertyForFace(direction1), true), 2); +- } else if (flag1 && isAcceptableNeighbour(serverlevel, blockpos4, direction2)) { +- serverlevel.setBlock(blockpos2, (BlockState) this.defaultBlockState().setValue(getPropertyForFace(direction2), true), 2); ++ // CraftBukkit start - Call BlockSpreadEvent ++ BlockPos source = pos; ++ ++ if (flag && isAcceptableNeighbour(level, blockposition3, enumdirection1)) { ++ CraftEventFactory.handleBlockSpreadEvent(level, source, blockposition2, (IBlockData) this.defaultBlockState().setValue(getPropertyForFace(enumdirection1), true), 2); ++ } else if (flag1 && isAcceptableNeighbour(level, blockposition4, enumdirection2)) { ++ CraftEventFactory.handleBlockSpreadEvent(level, source, blockposition2, (IBlockData) this.defaultBlockState().setValue(getPropertyForFace(enumdirection2), true), 2); + } else { + Direction direction3 = direction.getOpposite(); + +@@ -223,16 +221,17 @@ + } else if ((double) randomsource.nextFloat() < 0.05D && isAcceptableNeighbour(serverlevel, blockpos2.above(), Direction.UP)) { + serverlevel.setBlock(blockpos2, (BlockState) this.defaultBlockState().setValue(VineBlock.UP, true), 2); + } ++ // CraftBukkit end + } +- } else if (isAcceptableNeighbour(serverlevel, blockpos2, direction)) { +- serverlevel.setBlock(blockpos, (BlockState) blockstate.setValue(getPropertyForFace(direction), true), 2); ++ } else if (isAcceptableNeighbour(level, blockposition2, enumdirection)) { ++ CraftEventFactory.handleBlockGrowEvent(level, pos, (IBlockData) state.setValue(getPropertyForFace(enumdirection), true), 2); // CraftBukkit + } + + } + } else { +- if (direction == Direction.UP && blockpos.getY() < serverlevel.getMaxBuildHeight() - 1) { +- if (this.canSupportAtFace(serverlevel, blockpos, direction)) { +- serverlevel.setBlock(blockpos, (BlockState) blockstate.setValue(VineBlock.UP, true), 2); ++ if (enumdirection == Direction.UP && pos.getY() < level.getMaxBuildHeight() - 1) { ++ if (this.canSupportAtFace(level, pos, enumdirection)) { ++ CraftEventFactory.handleBlockGrowEvent(level, pos, (IBlockData) state.setValue(VineBlock.UP, true), 2); // CraftBukkit + return; + } + +@@ -251,8 +250,8 @@ + } + } + +- if (this.hasHorizontalConnection(blockstate2)) { +- serverlevel.setBlock(blockpos1, blockstate2, 2); ++ if (this.hasHorizontalConnection(iblockdata2)) { ++ CraftEventFactory.handleBlockSpreadEvent(level, pos, blockposition1, iblockdata2, 2); // CraftBukkit + } + + return; +@@ -266,8 +265,8 @@ + BlockState blockstate3 = blockstate1.isAir() ? this.defaultBlockState() : blockstate1; + BlockState blockstate4 = this.copyRandomFaces(blockstate, blockstate3, randomsource); + +- if (blockstate3 != blockstate4 && this.hasHorizontalConnection(blockstate4)) { +- serverlevel.setBlock(blockpos2, blockstate4, 2); ++ if (iblockdata3 != iblockdata4 && this.hasHorizontalConnection(iblockdata4)) { ++ CraftEventFactory.handleBlockSpreadEvent(level, pos, blockposition2, iblockdata4, 2); // CraftBukkit + } + } + } |