aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/CropBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/CropBlock.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/CropBlock.java.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/CropBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/CropBlock.java.patch
new file mode 100644
index 0000000000..3514aeeca0
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/CropBlock.java.patch
@@ -0,0 +1,44 @@
+--- a/net/minecraft/world/level/block/CropBlock.java
++++ b/net/minecraft/world/level/block/CropBlock.java
+@@ -21,6 +21,7 @@
+ import net.minecraft.world.level.block.state.properties.IntegerProperty;
+ import net.minecraft.world.phys.shapes.CollisionContext;
+ import net.minecraft.world.phys.shapes.VoxelShape;
++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
+ public class CropBlock extends BushBlock implements BonemealableBlock {
+
+@@ -87,8 +83,8 @@
+ if (i < this.getMaxAge()) {
+ float f = getGrowthSpeed(this, serverlevel, blockpos);
+
+- if (randomsource.nextInt((int) (25.0F / f) + 1) == 0) {
+- serverlevel.setBlock(blockpos, this.getStateForAge(i + 1), 2);
++ if (random.nextInt((int) (25.0F / f) + 1) == 0) {
++ CraftEventFactory.handleBlockGrowEvent(level, pos, this.getStateForAge(i + 1), 2); // CraftBukkit
+ }
+ }
+ }
+@@ -103,7 +99,7 @@
+ i = j;
+ }
+
+- level.setBlock(blockpos, this.getStateForAge(i), 2);
++ CraftEventFactory.handleBlockGrowEvent(level, pos, this.getStateForAge(i), 2); // CraftBukkit
+ }
+
+ protected int getBonemealAgeIncrease(Level level) {
+@@ -165,10 +160,9 @@
+ }
+
+ @Override
+- @Override
+- public void entityInside(BlockState blockstate, Level level, BlockPos blockpos, Entity entity) {
+- if (entity instanceof Ravager && level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+- level.destroyBlock(blockpos, true, entity);
++ public void entityInside(IBlockData state, Level level, BlockPos pos, Entity entity) {
++ if (entity instanceof Ravager && CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState(), !level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { // CraftBukkit
++ level.destroyBlock(pos, true, entity);
+ }
+
+ super.entityInside(blockstate, level, blockpos, entity);