|
|
|
|
@ -96,9 +96,6 @@ public class CinderEventHandler implements IFuelHandler {
|
|
|
|
|
EntityPlayerMP player = (EntityPlayerMP) event.entity;
|
|
|
|
|
ItemStack sword = player.getHeldItem();
|
|
|
|
|
|
|
|
|
|
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Player Yaw " + player.getRotationYawHead()));
|
|
|
|
|
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Attacker Yaw " + attacker.getRotationYawHead()));
|
|
|
|
|
|
|
|
|
|
float playerYaw = player.getRotationYawHead();
|
|
|
|
|
float attackerYaw = attacker.getRotationYawHead();
|
|
|
|
|
|
|
|
|
|
@ -108,16 +105,10 @@ public class CinderEventHandler implements IFuelHandler {
|
|
|
|
|
|
|
|
|
|
// Calculate the angle difference
|
|
|
|
|
float angleDifference = Math.abs(playerYaw - attackerYaw);
|
|
|
|
|
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Player Yaw " + playerYaw));
|
|
|
|
|
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Attacker Yaw " + attackerYaw));
|
|
|
|
|
player.addChatMessage(new ChatComponentText(EnumChatFormatting.GOLD + "Angle Difference " + angleDifference));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (angleDifference > 180) {
|
|
|
|
|
angleDifference = 360 - angleDifference;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "DEBUG: Initial Damage: " + event.ammount));
|
|
|
|
|
ItemStack weapon = attacker.getHeldItem();
|
|
|
|
|
if (weapon != null) {
|
|
|
|
|
if (player.isBlocking() && angleDifference >= 135 && angleDifference <=225) {
|
|
|
|
|
@ -147,8 +138,6 @@ public class CinderEventHandler implements IFuelHandler {
|
|
|
|
|
event.ammount = player.getHealth(); // Ensure player dies if health reaches 0 or below
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "DEBUG: Total Additional Damage: " + newDamage));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|