51 lines
1.7 KiB
Diff
51 lines
1.7 KiB
Diff
--- ../src-base/minecraft/net/minecraft/entity/EntityLiving.java
|
|
+++ ../src-work/minecraft/net/minecraft/entity/EntityLiving.java
|
|
@@ -34,6 +34,9 @@
|
|
import net.minecraft.world.EnumDifficulty;
|
|
import net.minecraft.world.World;
|
|
import net.minecraft.world.WorldServer;
|
|
+import net.minecraftforge.common.ForgeHooks;
|
|
+import cpw.mods.fml.common.eventhandler.Event.Result;
|
|
+import net.minecraftforge.event.ForgeEventFactory;
|
|
|
|
public abstract class EntityLiving extends EntityLivingBase
|
|
{
|
|
@@ -117,6 +120,7 @@
|
|
public void func_70624_b(EntityLivingBase p_70624_1_)
|
|
{
|
|
this.field_70696_bz = p_70624_1_;
|
|
+ ForgeHooks.onLivingSetAttackTarget(this, p_70624_1_);
|
|
}
|
|
|
|
public boolean func_70686_a(Class p_70686_1_)
|
|
@@ -476,10 +480,22 @@
|
|
|
|
protected void func_70623_bb()
|
|
{
|
|
+ Result result = null;
|
|
if (this.field_82179_bU)
|
|
{
|
|
this.field_70708_bq = 0;
|
|
}
|
|
+ else if ((this.field_70708_bq & 0x1F) == 0x1F && (result = ForgeEventFactory.canEntityDespawn(this)) != Result.DEFAULT)
|
|
+ {
|
|
+ if (result == Result.DENY)
|
|
+ {
|
|
+ this.field_70708_bq = 0;
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ this.func_70106_y();
|
|
+ }
|
|
+ }
|
|
else
|
|
{
|
|
EntityPlayer entityplayer = this.field_70170_p.func_72890_a(this, -1.0D);
|
|
@@ -642,7 +658,6 @@
|
|
return this.field_70170_p.func_72855_b(this.field_70121_D) && this.field_70170_p.func_72945_a(this, this.field_70121_D).isEmpty() && !this.field_70170_p.func_72953_d(this.field_70121_D);
|
|
}
|
|
|
|
- @SideOnly(Side.CLIENT)
|
|
public float func_70603_bj()
|
|
{
|
|
return 1.0F;
|