mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
eed041d629
By: md_5 <git@md-5.net>
41 lines
2 KiB
Diff
41 lines
2 KiB
Diff
--- a/net/minecraft/world/entity/animal/EntityRabbit.java
|
|
+++ b/net/minecraft/world/entity/animal/EntityRabbit.java
|
|
@@ -67,6 +67,10 @@
|
|
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;
|
|
@@ -91,7 +95,6 @@
|
|
super(entitytypes, world);
|
|
this.jumpControl = new EntityRabbit.ControllerJumpRabbit(this);
|
|
this.moveControl = new EntityRabbit.ControllerMoveRabbit(this);
|
|
- this.setSpeedModifier(0.0D);
|
|
}
|
|
|
|
@Override
|
|
@@ -578,9 +581,19 @@
|
|
int i = (Integer) iblockdata.getValue(BlockCarrots.AGE);
|
|
|
|
if (i == 0) {
|
|
+ // 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 {
|
|
+ // CraftBukkit start
|
|
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.rabbit, blockposition, iblockdata.setValue(BlockCarrots.AGE, i - 1))) {
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockCarrots.AGE, i - 1), 2);
|
|
world.gameEvent((Holder) GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of((Entity) this.rabbit));
|
|
world.levelEvent(2001, blockposition, Block.getId(iblockdata));
|