diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java index 431e58ed..42127f67 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java @@ -463,7 +463,12 @@ public class PlayerPhysics extends EntityPhysics implements Tickab } if (entity.getWorld().random.nextInt(damageInterval) == 0) { - stack.damage(minDamage + entity.getWorld().random.nextInt(50), entity, e -> e.sendEquipmentBreakStatus(EquipmentSlot.CHEST)); + int damageLeft = stack.getMaxDamage() - stack.getDamage(); + int damageApplied = Math.min(damageLeft - 1, minDamage + entity.getWorld().random.nextInt(50)); + + if (damageApplied > 0) { + stack.damage(damageApplied, entity, e -> e.sendEquipmentBreakStatus(EquipmentSlot.CHEST)); + } } if (!getFlightType().canFly()) { diff --git a/src/main/java/com/minelittlepony/unicopia/item/AmuletItem.java b/src/main/java/com/minelittlepony/unicopia/item/AmuletItem.java index d02d0041..5011e727 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/AmuletItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/AmuletItem.java @@ -85,7 +85,7 @@ public class AmuletItem extends WearableItem implements ChargeableItem { return stack.getItem() == this && (!isChargable() || ChargeableItem.getEnergy(stack) > 0); } - public boolean isApplicable(LivingEntity entity) { + public final boolean isApplicable(LivingEntity entity) { return isApplicable(getForEntity(entity)); } diff --git a/src/main/java/com/minelittlepony/unicopia/item/PegasusAmuletItem.java b/src/main/java/com/minelittlepony/unicopia/item/PegasusAmuletItem.java index 65cdb292..371ceb36 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/PegasusAmuletItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/PegasusAmuletItem.java @@ -25,6 +25,11 @@ public class PegasusAmuletItem extends AmuletItem implements ItemTracker.Trackab } + @Override + public boolean isApplicable(ItemStack stack) { + return stack.getDamage() < stack.getMaxDamage() - 1 && super.isApplicable(stack); + } + @Override public int getDefaultCharge() { return getMaxCharge() / 2;