2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/animal/EntityRabbit.java
|
|
|
|
+++ b/net/minecraft/world/entity/animal/EntityRabbit.java
|
2022-02-28 16:00:00 +01:00
|
|
|
@@ -89,8 +89,14 @@
|
2019-04-23 04:00:00 +02:00
|
|
|
super(entitytypes, world);
|
2021-06-11 07:00:00 +02:00
|
|
|
this.jumpControl = new EntityRabbit.ControllerJumpRabbit(this);
|
|
|
|
this.moveControl = new EntityRabbit.ControllerMoveRabbit(this);
|
2014-12-06 22:45:51 +01:00
|
|
|
+ this.initializePathFinderGoals(); // CraftBukkit - moved code
|
|
|
|
+ }
|
2015-02-26 23:41:06 +01:00
|
|
|
+
|
2014-12-06 22:45:51 +01:00
|
|
|
+ // CraftBukkit start - code from constructor
|
|
|
|
+ public void initializePathFinderGoals(){
|
2021-11-21 23:00:00 +01:00
|
|
|
this.setSpeedModifier(0.0D);
|
2014-12-06 22:45:51 +01:00
|
|
|
}
|
|
|
|
+ // CraftBukkit end
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2021-11-21 23:00:00 +01:00
|
|
|
public void registerGoals() {
|
2022-02-28 16:00:00 +01:00
|
|
|
@@ -558,9 +564,23 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
int i = (Integer) iblockdata.getValue(BlockCarrots.AGE);
|
2016-06-30 08:15:38 +02:00
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
if (i == 0) {
|
2016-06-30 08:15:38 +02:00
|
|
|
+ // CraftBukkit start
|
2021-11-21 23:00:00 +01:00
|
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.rabbit, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) {
|
2016-06-30 08:15:38 +02:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
world.setBlock(blockposition, Blocks.AIR.defaultBlockState(), 2);
|
|
|
|
world.destroyBlock(blockposition, true, this.rabbit);
|
2016-06-30 08:15:38 +02:00
|
|
|
} else {
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(
|
2021-06-11 07:00:00 +02:00
|
|
|
+ this.rabbit,
|
2016-07-08 03:12:40 +02:00
|
|
|
+ blockposition,
|
2021-11-21 23:00:00 +01:00
|
|
|
+ iblockdata.setValue(BlockCarrots.AGE, i - 1)
|
2016-06-30 08:15:38 +02:00
|
|
|
+ ).isCancelled()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockCarrots.AGE, i - 1), 2);
|
|
|
|
world.levelEvent(2001, blockposition, Block.getId(iblockdata));
|
2016-06-30 08:15:38 +02:00
|
|
|
}
|