From 17e5480b6e280bf221cae6b32d9da4822b6c03dc Mon Sep 17 00:00:00 2001 From: Lex Manos Date: Fri, 28 Nov 2014 07:43:10 -0800 Subject: [PATCH] Fix Entityies not taking damage correctly. Closes #1511 --- .../minecraft/net/minecraft/entity/EntityLivingBase.java.patch | 2 +- src/main/java/net/minecraftforge/common/ForgeHooks.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch index 39dd54d3f..6d203c4a3 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLivingBase.java.patch @@ -29,7 +29,7 @@ public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) { -+ if (net.minecraftforge.common.ForgeHooks.onLivingAttack(this, p_70097_1_, p_70097_2_)) return false; ++ if (!net.minecraftforge.common.ForgeHooks.onLivingAttack(this, p_70097_1_, p_70097_2_)) return false; if (this.func_180431_b(p_70097_1_)) { return false; diff --git a/src/main/java/net/minecraftforge/common/ForgeHooks.java b/src/main/java/net/minecraftforge/common/ForgeHooks.java index b84a09594..5dc730cda 100644 --- a/src/main/java/net/minecraftforge/common/ForgeHooks.java +++ b/src/main/java/net/minecraftforge/common/ForgeHooks.java @@ -326,7 +326,7 @@ public class ForgeHooks public static boolean onLivingAttack(EntityLivingBase entity, DamageSource src, float amount) { - return MinecraftForge.EVENT_BUS.post(new LivingAttackEvent(entity, src, amount)); + return !MinecraftForge.EVENT_BUS.post(new LivingAttackEvent(entity, src, amount)); } public static float onLivingHurt(EntityLivingBase entity, DamageSource src, float amount)