diff --git a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch index 746c3041b..60065bb3c 100644 --- a/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch +++ b/patches/minecraft/net/minecraft/entity/EntityLiving.java.patch @@ -160,7 +160,25 @@ /** * Remove the speified potion effect from this entity. */ -@@ -3077,4 +3124,42 @@ +@@ -2982,6 +3029,17 @@ + */ + public void swingItem() + { ++ ItemStack stack = this.getHeldItem(); ++ ++ if (stack != null && stack.getItem() != null) ++ { ++ Item item = stack.getItem(); ++ if (item.onEntitySwing(this, stack)) ++ { ++ return; ++ } ++ } ++ + if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0) + { + this.swingProgressInt = -1; +@@ -3077,4 +3135,42 @@ { this.canPickUpLoot = par1; } diff --git a/patches/minecraft/net/minecraft/item/Item.java.patch b/patches/minecraft/net/minecraft/item/Item.java.patch index 8a9cbb5b3..e5015a08f 100644 --- a/patches/minecraft/net/minecraft/item/Item.java.patch +++ b/patches/minecraft/net/minecraft/item/Item.java.patch @@ -58,7 +58,7 @@ Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3); return par1World.rayTraceBlocks_do_do(vec3, vec31, par3, !par3); } -@@ -720,4 +734,407 @@ +@@ -720,4 +734,419 @@ { StatList.initStats(); } @@ -464,5 +464,17 @@ + public ModelBiped getArmorModel(EntityLiving entityLiving, ItemStack itemStack, int armorSlot) + { + return null; ++ } ++ ++ /** ++ * Called when a entity tries to play the 'swing' animation. ++ * ++ * @param entityLiving The entity swinging the item. ++ * @param stack The Item stack ++ * @return True to cancel any further processing by EntityLiving ++ */ ++ public boolean onEntitySwing(EntityLiving entityLiving, ItemStack stack) ++ { ++ return false; + } }