Fix Heavy Damage Attribute not working

Fix heavy damage attribute not correctly detecting damage since integer division
This commit is contained in:
Flemmli97 2022-12-24 16:46:52 +01:00 committed by GitHub
parent 8d89080bc0
commit dd0c49f8da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -138,7 +138,7 @@ public interface ItemAttribute {
MAX_ENCHANTED(StandardTraits::maxEnchanted), MAX_ENCHANTED(StandardTraits::maxEnchanted),
RENAMED(ItemStack::hasCustomHoverName), RENAMED(ItemStack::hasCustomHoverName),
DAMAGED(ItemStack::isDamaged), DAMAGED(ItemStack::isDamaged),
BADLY_DAMAGED(s -> s.isDamaged() && s.getDamageValue() / s.getMaxDamage() > 3 / 4f), BADLY_DAMAGED(s -> s.isDamaged() && (float) s.getDamageValue() / s.getMaxDamage() > 3 / 4f),
NOT_STACKABLE(((Predicate<ItemStack>) ItemStack::isStackable).negate()), NOT_STACKABLE(((Predicate<ItemStack>) ItemStack::isStackable).negate()),
EQUIPABLE(s -> LivingEntity.getEquipmentSlotForItem(s) EQUIPABLE(s -> LivingEntity.getEquipmentSlotForItem(s)
.getType() != EquipmentSlot.Type.HAND), .getType() != EquipmentSlot.Type.HAND),