Paper/nms-patches/BlockCrops.patch

36 lines
1.4 KiB
Diff
Raw Normal View History

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 @@
import java.util.Random;
2016-05-10 13:47:39 +02:00
import javax.annotation.Nullable;
+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 @@
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);
+ // 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));
+ // CraftBukkit end
}
}
}
2016-05-10 13:47:39 +02:00
@@ -69,7 +74,10 @@
2016-02-29 22:32:46 +01:00
i = j;
}
2016-02-29 22:32:46 +01:00
- world.setTypeAndData(blockposition, this.setAge(i), 2);
+ // 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));
+ // CraftBukkit end
}
2016-02-29 22:32:46 +01:00
protected int b(World world) {