2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/BlockCrops.java
|
|
|
|
+++ b/net/minecraft/server/BlockCrops.java
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -2,6 +2,8 @@
|
|
|
|
|
2014-11-25 22:32:16 +01:00
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
|
|
+
|
|
|
|
public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement {
|
|
|
|
|
2020-06-25 02:00:00 +02:00
|
|
|
public static final BlockStateInteger AGE = BlockProperties.ai;
|
|
|
|
@@ -56,7 +58,7 @@
|
2019-12-10 23:00:00 +01:00
|
|
|
float f = a((Block) this, (IBlockAccess) worldserver, blockposition);
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
if (random.nextInt((int) (25.0F / f) + 1) == 0) {
|
2019-12-10 23:00:00 +01:00
|
|
|
- worldserver.setTypeAndData(blockposition, this.setAge(i + 1), 2);
|
|
|
|
+ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, this.setAge(i + 1), 2); // CraftBukkit
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -71,7 +73,7 @@
|
2016-02-29 22:32:46 +01:00
|
|
|
i = j;
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
2016-02-29 22:32:46 +01:00
|
|
|
- world.setTypeAndData(blockposition, this.setAge(i), 2);
|
2018-07-15 02:00:00 +02:00
|
|
|
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition, this.setAge(i), 2); // CraftBukkit
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
2018-07-15 02:00:00 +02:00
|
|
|
protected int a(World world) {
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -129,7 +131,7 @@
|
2019-08-28 12:03:43 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
|
|
|
- if (entity instanceof EntityRavager && world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
|
|
|
|
+ if (entity instanceof EntityRavager && !CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, Blocks.AIR.getBlockData(), !world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)).isCancelled()) { // CraftBukkit
|
2019-12-10 23:00:00 +01:00
|
|
|
world.a(blockposition, true, entity);
|
2019-08-28 12:03:43 +02:00
|
|
|
}
|
|
|
|
|