fix item weight calculation
This commit is contained in:
parent
00ac4146bc
commit
d44352c40e
1 changed files with 5 additions and 2 deletions
|
@ -2763,8 +2763,11 @@ public abstract class EntityNPC extends EntityLiving implements IInventory
|
||||||
|
|
||||||
public int getInventoryWeight() {
|
public int getInventoryWeight() {
|
||||||
int total = 0;
|
int total = 0;
|
||||||
for(int z = 0; z < Equipment.INVENTORY_SLOTS; z++) {
|
for(ItemStack stack : this.getInventory()) {
|
||||||
ItemStack stack = this.getInventory()[z];
|
if(stack != null)
|
||||||
|
total += stack.getSize() * stack.getItem().getWeight();
|
||||||
|
}
|
||||||
|
for(ItemStack stack : this.getArmor()) {
|
||||||
if(stack != null)
|
if(stack != null)
|
||||||
total += stack.getSize() * stack.getItem().getWeight();
|
total += stack.getSize() * stack.getItem().getWeight();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue