ForgePatch/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch

41 lines
1.5 KiB
Diff

--- ../src-base/minecraft/net/minecraft/entity/EntityLiving.java
+++ ../src-work/minecraft/net/minecraft/entity/EntityLiving.java
@@ -121,6 +121,7 @@
public void func_70624_b(EntityLivingBase p_70624_1_)
{
this.field_70696_bz = p_70624_1_;
+ net.minecraftforge.common.ForgeHooks.onLivingSetAttackTarget(this, p_70624_1_);
}
public boolean func_70686_a(Class <? extends EntityLivingBase > p_70686_1_)
@@ -498,10 +499,22 @@
protected void func_70623_bb()
{
+ net.minecraftforge.fml.common.eventhandler.Event.Result result = null;
if (this.field_82179_bU)
{
this.field_70708_bq = 0;
}
+ else if ((this.field_70708_bq & 0x1F) == 0x1F && (result = net.minecraftforge.event.ForgeEventFactory.canEntityDespawn(this)) != net.minecraftforge.fml.common.eventhandler.Event.Result.DEFAULT)
+ {
+ if (result == net.minecraftforge.fml.common.eventhandler.Event.Result.DENY)
+ {
+ this.field_70708_bq = 0;
+ }
+ else
+ {
+ this.func_70106_y();
+ }
+ }
else
{
Entity entity = this.field_70170_p.func_72890_a(this, -1.0D);
@@ -621,7 +634,6 @@
return this.field_70170_p.func_72917_a(this.func_174813_aQ(), this) && this.field_70170_p.func_72945_a(this, this.func_174813_aQ()).isEmpty() && !this.field_70170_p.func_72953_d(this.func_174813_aQ());
}
- @SideOnly(Side.CLIENT)
public float func_70603_bj()
{
return 1.0F;