2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/animal/EntityRabbit.java
|
|
|
|
+++ b/net/minecraft/world/entity/animal/EntityRabbit.java
|
2024-06-13 17:05:00 +02:00
|
|
|
@@ -67,6 +67,10 @@
|
2023-06-24 09:15:05 +02:00
|
|
|
import net.minecraft.world.level.pathfinder.PathEntity;
|
|
|
|
import net.minecraft.world.phys.Vec3D;
|
|
|
|
|
|
|
|
+// CraftBukkit start
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
|
|
+// CraftBukkit end
|
|
|
|
+
|
|
|
|
public class EntityRabbit extends EntityAnimal implements VariantHolder<EntityRabbit.Variant> {
|
|
|
|
|
|
|
|
public static final double STROLL_SPEED_MOD = 0.6D;
|
2024-06-13 17:05:00 +02:00
|
|
|
@@ -91,7 +95,6 @@
|
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);
|
2023-06-24 09:15:05 +02:00
|
|
|
- this.setSpeedModifier(0.0D);
|
2014-12-06 22:45:51 +01:00
|
|
|
}
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2024-06-13 17:05:00 +02:00
|
|
|
@@ -578,9 +581,19 @@
|
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
|
2023-06-24 09:15:05 +02:00
|
|
|
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.rabbit, blockposition, Blocks.AIR.defaultBlockState())) {
|
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
|
2023-06-24 09:15:05 +02:00
|
|
|
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.rabbit, blockposition, iblockdata.setValue(BlockCarrots.AGE, i - 1))) {
|
2016-06-30 08:15:38 +02:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockCarrots.AGE, i - 1), 2);
|
2024-04-23 17:15:00 +02:00
|
|
|
world.gameEvent((Holder) GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of((Entity) this.rabbit));
|
2021-11-21 23:00:00 +01:00
|
|
|
world.levelEvent(2001, blockposition, Block.getId(iblockdata));
|