increase hotbar size
This commit is contained in:
parent
69bb1e6ffb
commit
5641c5c834
7 changed files with 27 additions and 17 deletions
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue