ForgePatch/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch
2016-11-15 19:26:10 -08:00

41 lines
1.6 KiB
Diff

--- ../src-base/minecraft/net/minecraft/entity/EntityLiving.java
+++ ../src-work/minecraft/net/minecraft/entity/EntityLiving.java
@@ -171,6 +171,7 @@
public void func_70624_b(@Nullable 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_)
@@ -708,10 +709,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);
@@ -845,7 +858,6 @@
return !this.field_70170_p.func_72953_d(this.func_174813_aQ()) && this.field_70170_p.func_184144_a(this, this.func_174813_aQ()).isEmpty() && this.field_70170_p.func_72917_a(this.func_174813_aQ(), this);
}
- @SideOnly(Side.CLIENT)
public float func_70603_bj()
{
return 1.0F;