2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/BlockCrops.java
|
|
|
|
+++ b/net/minecraft/server/BlockCrops.java
|
2016-05-10 13:47:39 +02:00
|
|
|
@@ -3,6 +3,8 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
import java.util.Random;
|
2016-05-10 13:47:39 +02:00
|
|
|
import javax.annotation.Nullable;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
+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-05-10 13:47:39 +02:00
|
|
|
@@ -54,7 +56,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-05-10 13:47:39 +02:00
|
|
|
@@ -69,7 +74,10 @@
|
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);
|
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) {
|