Hacky fix for carry on firing a forge event at the wrong time
@@ -245,6 +245,9 @@ public class InteractionHandler {
/** Handles attacking using the chestplate */
@SubscribeEvent(priority = EventPriority.LOW)
static void onChestplateAttack(AttackEntityEvent event) {
+ // Carry On is dumb and fires the attack entity event when they are not attacking entities, causing us to punch instead
+ // they should not be doing that, but the author has not done anything to fix it, so just use a hacky check
+ if (event.getClass() == AttackEntityEvent.class) {
Player attacker = event.getPlayer();
if (attacker.getMainHandItem().isEmpty()) {
ItemStack chestplate = attacker.getItemBySlot(EquipmentSlot.CHEST);
@@ -257,6 +260,7 @@ public class InteractionHandler {
}
}
}
+ }
/**
* Handles interaction from a helmet
