1
0
Fork 0

fix item weight calculation

This commit is contained in:
Sen 2025-09-07 12:51:15 +02:00
parent 00ac4146bc
commit d44352c40e
Signed by: sen
GPG key ID: 3AC50A6F47D1B722

View file

@ -2763,8 +2763,11 @@ public abstract class EntityNPC extends EntityLiving implements IInventory
public int getInventoryWeight() {
int total = 0;
for(int z = 0; z < Equipment.INVENTORY_SLOTS; z++) {
ItemStack stack = this.getInventory()[z];
for(ItemStack stack : this.getInventory()) {
if(stack != null)
total += stack.getSize() * stack.getItem().getWeight();
}
for(ItemStack stack : this.getArmor()) {
if(stack != null)
total += stack.getSize() * stack.getItem().getWeight();
}