mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
40076782ed
By: md_5 <git@md-5.net>
59 lines
4.8 KiB
Diff
59 lines
4.8 KiB
Diff
--- a/net/minecraft/world/level/block/BlockVine.java
|
|
+++ b/net/minecraft/world/level/block/BlockVine.java
|
|
@@ -24,6 +24,8 @@
|
|
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
|
import net.minecraft.world.phys.shapes.VoxelShapes;
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
+
|
|
public class BlockVine extends Block {
|
|
|
|
public static final BlockStateBoolean UP = BlockSprawling.UP;
|
|
@@ -196,20 +198,24 @@
|
|
BlockPosition blockposition3 = blockposition2.relative(enumdirection1);
|
|
BlockPosition blockposition4 = blockposition2.relative(enumdirection2);
|
|
|
|
+ // CraftBukkit start - Call BlockSpreadEvent
|
|
+ BlockPosition source = blockposition;
|
|
+
|
|
if (flag && isAcceptableNeighbour(worldserver, blockposition3, enumdirection1)) {
|
|
- worldserver.setBlock(blockposition2, (IBlockData) this.defaultBlockState().setValue(getPropertyForFace(enumdirection1), true), 2);
|
|
+ CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition2, (IBlockData) this.defaultBlockState().setValue(getPropertyForFace(enumdirection1), true), 2);
|
|
} else if (flag1 && isAcceptableNeighbour(worldserver, blockposition4, enumdirection2)) {
|
|
- worldserver.setBlock(blockposition2, (IBlockData) this.defaultBlockState().setValue(getPropertyForFace(enumdirection2), true), 2);
|
|
+ CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition2, (IBlockData) this.defaultBlockState().setValue(getPropertyForFace(enumdirection2), true), 2);
|
|
} else {
|
|
EnumDirection enumdirection3 = enumdirection.getOpposite();
|
|
|
|
if (flag && worldserver.isEmptyBlock(blockposition3) && isAcceptableNeighbour(worldserver, blockposition.relative(enumdirection1), enumdirection3)) {
|
|
- worldserver.setBlock(blockposition3, (IBlockData) this.defaultBlockState().setValue(getPropertyForFace(enumdirection3), true), 2);
|
|
+ CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition3, (IBlockData) this.defaultBlockState().setValue(getPropertyForFace(enumdirection3), true), 2);
|
|
} else if (flag1 && worldserver.isEmptyBlock(blockposition4) && isAcceptableNeighbour(worldserver, blockposition.relative(enumdirection2), enumdirection3)) {
|
|
- worldserver.setBlock(blockposition4, (IBlockData) this.defaultBlockState().setValue(getPropertyForFace(enumdirection3), true), 2);
|
|
+ CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition4, (IBlockData) this.defaultBlockState().setValue(getPropertyForFace(enumdirection3), true), 2);
|
|
} else if ((double) randomsource.nextFloat() < 0.05D && isAcceptableNeighbour(worldserver, blockposition2.above(), EnumDirection.UP)) {
|
|
- worldserver.setBlock(blockposition2, (IBlockData) this.defaultBlockState().setValue(BlockVine.UP, true), 2);
|
|
+ CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition2, (IBlockData) this.defaultBlockState().setValue(BlockVine.UP, true), 2);
|
|
}
|
|
+ // CraftBukkit end
|
|
}
|
|
} else if (isAcceptableNeighbour(worldserver, blockposition2, enumdirection)) {
|
|
worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(getPropertyForFace(enumdirection), true), 2);
|
|
@@ -239,7 +245,7 @@
|
|
}
|
|
|
|
if (this.hasHorizontalConnection(iblockdata2)) {
|
|
- worldserver.setBlock(blockposition1, iblockdata2, 2);
|
|
+ CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, iblockdata2, 2); // CraftBukkit
|
|
}
|
|
|
|
return;
|
|
@@ -254,7 +260,7 @@
|
|
IBlockData iblockdata4 = this.copyRandomFaces(iblockdata, iblockdata3, randomsource);
|
|
|
|
if (iblockdata3 != iblockdata4 && this.hasHorizontalConnection(iblockdata4)) {
|
|
- worldserver.setBlock(blockposition2, iblockdata4, 2);
|
|
+ CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition2, iblockdata4, 2); // CraftBukkit
|
|
}
|
|
}
|
|
}
|