1
0
Fork 0

change invntory logic

This commit is contained in:
Sen 2025-09-05 14:15:32 +02:00
parent bfee96d5b5
commit f93075f211
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
7 changed files with 48 additions and 8 deletions

View file

@ -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)