1
0
forked from xjboss/KCauldronX
KCauldronX/patches/net/minecraft/entity/ai/EntityAIBreakDoor.java.patch

18 lines
976 B
Diff
Raw Normal View History

2015-03-22 17:38:04 +00:00
--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.java
+++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIBreakDoor.java
@@ -58,6 +58,14 @@
if (this.breakingTime == 240 && this.theEntity.worldObj.difficultySetting == EnumDifficulty.HARD)
{
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityBreakDoorEvent(this.theEntity, this.entityPosX, this.entityPosY, this.entityPosZ).isCancelled())
+ {
+ this.updateTask();
+ return;
+ }
+
+ // CraftBukkit end
this.theEntity.worldObj.setBlockToAir(this.entityPosX, this.entityPosY, this.entityPosZ);
this.theEntity.worldObj.playAuxSFX(1012, this.entityPosX, this.entityPosY, this.entityPosZ, 0);
this.theEntity.worldObj.playAuxSFX(2001, this.entityPosX, this.entityPosY, this.entityPosZ, Block.getIdFromBlock(this.field_151504_e));