2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/BlockCrops.java
|
|
|
|
+++ b/net/minecraft/server/BlockCrops.java
|
2014-11-25 22:32:16 +01:00
|
|
|
@@ -2,6 +2,8 @@
|
|
|
|
|
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
|
|
+
|
|
|
|
public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement {
|
|
|
|
|
|
|
|
public static final BlockStateInteger AGE = BlockStateInteger.of("age", 0, 7);
|
2016-02-29 22:32:46 +01:00
|
|
|
@@ -53,7 +55,10 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
float f = a((Block) this, world, blockposition);
|
|
|
|
|
|
|
|
if (random.nextInt((int) (25.0F / f) + 1) == 0) {
|
2016-02-29 22:32:46 +01:00
|
|
|
- world.setTypeAndData(blockposition, this.setAge(i + 1), 2);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
2016-02-29 22:32:46 +01:00
|
|
|
+ IBlockData data = this.setAge(i + 1);
|
2015-02-26 23:41:06 +01:00
|
|
|
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(data));
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-02-29 22:32:46 +01:00
|
|
|
@@ -68,7 +73,10 @@
|
|
|
|
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);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
2016-02-29 22:32:46 +01:00
|
|
|
+ IBlockData data = this.setAge(i);
|
2015-02-26 23:41:06 +01:00
|
|
|
+ CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(data));
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
|
2016-02-29 22:32:46 +01:00
|
|
|
protected int b(World world) {
|