Include offhand inventory in imbued item updating (and armour, while we're at it), fixes #493
This commit is contained in:
@@ -346,6 +346,21 @@ public class WizardData implements INBTSerializable<NBTTagCompound> {
|
||||
|
||||
// For each item in the player's inventory
|
||||
for(ItemStack stack : player.inventory.mainInventory){
|
||||
updateImbutedItem(stack, activeImbuements);
|
||||
}
|
||||
for(ItemStack stack : player.inventory.armorInventory){
|
||||
updateImbutedItem(stack, activeImbuements);
|
||||
}
|
||||
for(ItemStack stack : player.inventory.offHandInventory){
|
||||
updateImbutedItem(stack, activeImbuements);
|
||||
}
|
||||
|
||||
// Removes all imbuements from the map that are no longer active
|
||||
this.imbuementDurations.keySet().retainAll(activeImbuements);
|
||||
}
|
||||
|
||||
private void updateImbutedItem(ItemStack stack, Set<Imbuement> activeImbuements){
|
||||
|
||||
if(stack.isItemEnchanted()){
|
||||
|
||||
NBTTagList enchantmentList = stack.getItem() == Items.ENCHANTED_BOOK ?
|
||||
@@ -373,9 +388,6 @@ public class WizardData implements INBTSerializable<NBTTagCompound> {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Removes all imbuements from the map that are no longer active
|
||||
this.imbuementDurations.keySet().retainAll(activeImbuements);
|
||||
}
|
||||
|
||||
// Ally designation system
|
||||
|
||||
|
||||
Reference in New Issue
Block a user