PaperMC/paper-server/nms-patches/net/minecraft/world/level/block/BlockCocoa.patch

30 lines
1.4 KiB
Diff
Raw Normal View History

2021-03-15 23:00:00 +01:00
--- a/net/minecraft/world/level/block/BlockCocoa.java
+++ b/net/minecraft/world/level/block/BlockCocoa.java
@@ -20,6 +20,8 @@
2021-03-15 23:00:00 +01:00
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public class BlockCocoa extends BlockFacingHorizontal implements IBlockFragilePlantElement {
public static final int MAX_AGE = 2;
@@ -54,7 +56,7 @@
int i = (Integer) iblockdata.getValue(BlockCocoa.AGE);
if (i < 2) {
- worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockCocoa.AGE, i + 1), 2);
+ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, (IBlockData) iblockdata.setValue(BlockCocoa.AGE, i + 1), 2); // CraftBukkkit
}
}
@@ -124,7 +126,7 @@
@Override
public void performBonemeal(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) {
- worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockCocoa.AGE, (Integer) iblockdata.getValue(BlockCocoa.AGE) + 1), 2);
+ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, (IBlockData) iblockdata.setValue(BlockCocoa.AGE, (Integer) iblockdata.getValue(BlockCocoa.AGE) + 1), 2); // CraftBukkit
}
@Override