1
0
Fork 0

increase hotbar size

This commit is contained in:
Sen 2025-08-18 13:27:26 +02:00
parent 69bb1e6ffb
commit 5641c5c834
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
7 changed files with 27 additions and 17 deletions

View file

@ -2483,6 +2483,10 @@ public abstract class EntityNPC extends EntityLiving implements IInventory
}
}
public int getHotbarSize() {
return 12;
}
public int getSelectedIndex() {
return this.currentItem;
}
@ -2493,7 +2497,7 @@ public abstract class EntityNPC extends EntityLiving implements IInventory
public ItemStack getHeldItem()
{
return this.isPlayer() || this.dummy ? (this.getSelectedIndex() < 9 && this.getSelectedIndex() >= 0 ? this.getStackInSlot(this.getSelectedIndex()) : null) : this.heldItem;
return this.isPlayer() || this.dummy ? (this.getSelectedIndex() < this.getHotbarSize() && this.getSelectedIndex() >= 0 ? this.getStackInSlot(this.getSelectedIndex()) : null) : this.heldItem;
}
public ItemStack[] getArmor()

View file

@ -391,7 +391,7 @@ public abstract class Container
}
}
}
else if (mode == 2 && clickedButton >= 0 && clickedButton < 9)
else if (mode == 2 && clickedButton >= 0 && clickedButton < 12)
{
Slot slot5 = (Slot)this.inventorySlots.get(slotId);