diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Rabbit.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Rabbit.java.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Rabbit.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Rabbit.java.patch new file mode 100644 index 0000000000..0bdf9432a9 --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Rabbit.java.patch @@ -0,0 +1,40 @@ +--- a/net/minecraft/world/entity/animal/Rabbit.java ++++ b/net/minecraft/world/entity/animal/Rabbit.java +@@ -66,6 +66,9 @@ + import net.minecraft.world.level.gameevent.GameEvent; + import net.minecraft.world.level.pathfinder.Path; + import net.minecraft.world.phys.Vec3; ++// CraftBukkit start ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++// CraftBukkit end + + public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> { + +@@ -607,12 +579,22 @@ + int i = (Integer) blockstate.getValue(CarrotBlock.AGE); + + if (i == 0) { +- level.setBlock(blockpos, Blocks.AIR.defaultBlockState(), 2); +- level.destroyBlock(blockpos, true, this.rabbit); ++ // CraftBukkit start ++ if (!CraftEventFactory.callEntityChangeBlockEvent(this.rabbit, blockposition, Blocks.AIR.defaultBlockState())) { ++ return; ++ } ++ // CraftBukkit end ++ world.setBlock(blockposition, Blocks.AIR.defaultBlockState(), 2); ++ world.destroyBlock(blockposition, true, this.rabbit); + } else { +- level.setBlock(blockpos, (BlockState) blockstate.setValue(CarrotBlock.AGE, i - 1), 2); +- level.gameEvent(GameEvent.BLOCK_CHANGE, blockpos, GameEvent.Context.of((Entity) this.rabbit)); +- level.levelEvent(2001, blockpos, Block.getId(blockstate)); ++ // CraftBukkit start ++ if (!CraftEventFactory.callEntityChangeBlockEvent(this.rabbit, blockposition, iblockdata.setValue(CarrotBlock.AGE, i - 1))) { ++ return; ++ } ++ // CraftBukkit end ++ world.setBlock(blockposition, (IBlockData) iblockdata.setValue(CarrotBlock.AGE, i - 1), 2); ++ world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.Context.of((Entity) this.rabbit)); ++ world.levelEvent(2001, blockposition, Block.getId(iblockdata)); + } + + this.rabbit.moreCarrotTicks = 40; |