Files
CatServer/patches/net/minecraft/entity/ai/EntityAIBreakDoor.java.patch
2019-02-24 22:29:41 +08:00

23 lines
1.4 KiB
Diff

--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.java
+++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.java
@@ -21,7 +21,7 @@
{
return false;
}
- else if (!this.entity.world.getGameRules().getBoolean("mobGriefing"))
+ else if (!net.minecraftforge.event.ForgeEventFactory.getMobGriefingEvent(this.entity.world, this.entity) || !this.entity.world.getBlockState(this.doorPosition).getBlock().canEntityDestroy(this.entity.world.getBlockState(this.doorPosition), this.entity.world, this.doorPosition, this.entity) || !net.minecraftforge.event.ForgeEventFactory.onEntityDestroyBlock(this.entity, this.doorPosition, this.entity.world.getBlockState(this.doorPosition)))
{
return false;
}
@@ -84,6 +84,10 @@
if (this.breakingTime == 240 && this.entity.world.getDifficulty() == EnumDifficulty.HARD)
{
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityBreakDoorEvent(this.entity, this.doorPosition.getX(), this.doorPosition.getY(), this.doorPosition.getZ()).isCancelled()) {
+ this.startExecuting();
+ return;
+ }
this.entity.world.setBlockToAir(this.doorPosition);
this.entity.world.playEvent(1021, this.doorPosition, 0);
this.entity.world.playEvent(2001, this.doorPosition, Block.getIdFromBlock(this.doorBlock));