|
|
|
|
@ -20,6 +20,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
|
import net.minecraft.nbt.NBTTagList;
|
|
|
|
|
import net.minecraft.nbt.NBTTagString;
|
|
|
|
|
import net.minecraft.network.play.server.S04PacketEntityEquipment;
|
|
|
|
|
import net.minecraft.network.play.server.S09PacketHeldItemChange;
|
|
|
|
|
import net.minecraft.network.play.server.S19PacketEntityStatus;
|
|
|
|
|
import net.minecraft.potion.Potion;
|
|
|
|
|
import net.minecraft.potion.PotionEffect;
|
|
|
|
|
@ -125,18 +126,18 @@ public class CinderEventHandler implements IFuelHandler {
|
|
|
|
|
float additionalDamage = 0.0f;
|
|
|
|
|
if (weapon.getItem() instanceof ItemAxe || weapon.getItem() instanceof LOTRItemAxe || weapon.getItem() instanceof LOTRItemBattleaxe) {
|
|
|
|
|
sword.damageItem((int) (event.ammount *1.5), player); // Axes deal 150% the Durability damage
|
|
|
|
|
((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S19PacketEntityStatus(player, (byte) 29));
|
|
|
|
|
((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S09PacketHeldItemChange());
|
|
|
|
|
world.playSoundAtEntity(player, "random.anvil_land", 1F, 2F);
|
|
|
|
|
additionalDamage = 0.75f; // Only 25% Passes through
|
|
|
|
|
} else if (weapon.getItem() instanceof LOTRItemHammer) {
|
|
|
|
|
sword.damageItem((int) event.ammount, player); // Hammers bypass the block better, but only deal 100% of the durability damage
|
|
|
|
|
((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S19PacketEntityStatus(player, (byte) 29));
|
|
|
|
|
((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S09PacketHeldItemChange());
|
|
|
|
|
world.playSoundAtEntity(player, "random.anvil_land", 1F, 2F);
|
|
|
|
|
additionalDamage = 0.5f; // Only 50% Passes through
|
|
|
|
|
} else {
|
|
|
|
|
additionalDamage = 0.0f; // 0% Damage Passes through
|
|
|
|
|
sword.damageItem((int) (event.ammount/2), player); //Swords only deal 50% of durability damage
|
|
|
|
|
((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S19PacketEntityStatus(player, (byte) 29));
|
|
|
|
|
((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S09PacketHeldItemChange());
|
|
|
|
|
world.playSoundAtEntity(player, "random.anvil_land", 1F, 2F);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|