aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/level/block/BlockCrops.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockCrops.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/level/block/BlockCrops.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/BlockCrops.patch b/patch-remap/og/net/minecraft/world/level/block/BlockCrops.patch
new file mode 100644
index 0000000000..1d40ca9bfd
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/level/block/BlockCrops.patch
@@ -0,0 +1,38 @@
+--- a/net/minecraft/world/level/block/BlockCrops.java
++++ b/net/minecraft/world/level/block/BlockCrops.java
+@@ -22,6 +22,8 @@
+ import net.minecraft.world.phys.shapes.VoxelShape;
+ import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+
++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
++
+ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement {
+
+ public static final MapCodec<BlockCrops> CODEC = simpleCodec(BlockCrops::new);
+@@ -83,7 +85,7 @@
+ float f = getGrowthSpeed(this, worldserver, blockposition);
+
+ if (randomsource.nextInt((int) (25.0F / f) + 1) == 0) {
+- worldserver.setBlock(blockposition, this.getStateForAge(i + 1), 2);
++ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, this.getStateForAge(i + 1), 2); // CraftBukkit
+ }
+ }
+ }
+@@ -98,7 +100,7 @@
+ i = j;
+ }
+
+- world.setBlock(blockposition, this.getStateForAge(i), 2);
++ CraftEventFactory.handleBlockGrowEvent(world, blockposition, this.getStateForAge(i), 2); // CraftBukkit
+ }
+
+ protected int getBonemealAgeIncrease(World world) {
+@@ -160,7 +162,7 @@
+
+ @Override
+ public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
+- if (entity instanceof EntityRavager && world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
++ if (entity instanceof EntityRavager && CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.AIR.defaultBlockState(), !world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit
+ world.destroyBlock(blockposition, true, entity);
+ }
+