change invntory logic
This commit is contained in:
parent
bfee96d5b5
commit
f93075f211
7 changed files with 48 additions and 8 deletions
|
@ -955,6 +955,11 @@ public class Player extends User implements Executor, IPlayer
|
|||
--this.entity.hurtResistance;
|
||||
}
|
||||
|
||||
Container.removeEmptySlots(this.entity, 0, this.entity.getInventoryCapacity());
|
||||
if(this.entity.openContainer instanceof ContainerChest chest)
|
||||
Container.removeEmptySlots(chest.getChestInventory(), 0, chest.getChestInventory().getSizeInventory());
|
||||
else if(this.entity.openContainer instanceof ContainerEntityInventory ent && ent.getEntityInventory() != null)
|
||||
Container.removeEmptySlots(ent.getEntityInventory(), 2, ent.getEntityInventory().getSizeInventory() - 2);
|
||||
this.entity.openContainer.detectAndSendChanges();
|
||||
// if(!this.worldObj.client)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue