Psi

Psi

48M Downloads

[1.21.1] Incorrect Usage of ItemAttributeModifierEvent

Nyxane opened this issue ยท 0 comments

commented

Version Information

NeoForge version: 21.1.213
Psi version: Mod says 2.0.0, CF says 1.0.5

The following lines of code are all using the ItemAttributeModifierEvent that applies to ALL items.
IPsimetalTool.isEnabled(ItemStack) will return false if getMaxDamage() returns 0; It will remove the Attack Damage, Armor, and Armor Toughness of any items that meet this condition not just Psi tools/armor.

Please ensure this applied to only Psi tools/armor
Currently known affects:
Mekanism Armor
Mekanism Jetpack
ProjectE Armor/Tools
Draconic Evolution Armors/Tools

static boolean isEnabled(ItemStack stack) {
return stack.getDamageValue() < stack.getMaxDamage();
}

public static void adjustAttributes(ItemAttributeModifierEvent event) {
if(!IPsimetalTool.isEnabled(event.getItemStack())) {
event.removeAllModifiersFor(Attributes.ATTACK_DAMAGE);
}
}

public static void adjustAttributes(ItemAttributeModifierEvent event) {
if(!IPsimetalTool.isEnabled(event.getItemStack())) {
event.removeAllModifiersFor(Attributes.ATTACK_DAMAGE);
}
}

public static void adjustAttributes(ItemAttributeModifierEvent event) {
if(!IPsimetalTool.isEnabled(event.getItemStack())) {
event.removeAllModifiersFor(Attributes.ATTACK_DAMAGE);
}
}

public static void adjustAttributes(ItemAttributeModifierEvent event) {
if(!IPsimetalTool.isEnabled(event.getItemStack())) {
event.removeAllModifiersFor(Attributes.ATTACK_DAMAGE);
}
}

public static void adjustAttributes(ItemAttributeModifierEvent event) {
if(!IPsimetalTool.isEnabled(event.getItemStack())) {
event.removeAllModifiersFor(Attributes.ARMOR);
event.removeAllModifiersFor(Attributes.ARMOR_TOUGHNESS);
}
}