initial large chests
This commit is contained in:
parent
2e43f24e23
commit
92b7214c69
8 changed files with 99 additions and 58 deletions
|
@ -668,12 +668,12 @@ public class Player extends User implements Executor, IPlayer
|
|||
}
|
||||
else if(object instanceof Entity entity) {
|
||||
InventoryBasic inv = entity.getEntityInventory();
|
||||
this.sendPacket(new SPacketOpenWindow(this.getNextWindowId(), entity.getId(), entity.getName(), inv.getSizeInventory()));
|
||||
this.sendPacket(new SPacketOpenWindow(this.getNextWindowId(), entity.getId(), inv.getSizeInventory()));
|
||||
this.entity.openContainer = new ContainerEntityInventory(this.entity.inventory, inv, entity, this.entity);
|
||||
}
|
||||
else if (object instanceof Device device)
|
||||
{
|
||||
this.sendPacket(new SPacketOpenWindow(this.getNextWindowId(), device.getPos(), device.getBlockType().getDisplay(), device.getSizeInventory()));
|
||||
this.sendPacket(new SPacketOpenWindow(this.getNextWindowId(), device.getPos(), device.getSizeInventory()));
|
||||
this.entity.openContainer = new ContainerTile(this.entity.inventory, device, device, this.entity);
|
||||
}
|
||||
else if (object instanceof TileEntityChest chest)
|
||||
|
@ -684,17 +684,17 @@ public class Player extends User implements Executor, IPlayer
|
|||
this.sendPacket(new SPacketSoundEffect(SoundEvent.DOOR, this.entity.posX, this.entity.posY, this.entity.posZ, 1.0F));
|
||||
return;
|
||||
}
|
||||
this.sendPacket(new SPacketOpenWindow(this.getNextWindowId(), chest.getBlockType(), chest.getName(), chest.getSizeInventory()));
|
||||
this.sendPacket(new SPacketOpenWindow(this.getNextWindowId(), chest.getBlockType(), chest.getSizeInventory()));
|
||||
this.entity.openContainer = new ContainerChest(this.entity.inventory, chest, this.entity);
|
||||
}
|
||||
else if (object instanceof TileEntityInventory tile)
|
||||
{
|
||||
this.sendPacket(new SPacketOpenWindow(this.getNextWindowId(), tile.getBlockType(), tile.getBlockType().getDisplay(), tile.getSizeInventory()));
|
||||
this.sendPacket(new SPacketOpenWindow(this.getNextWindowId(), tile.getBlockType(), tile.getSizeInventory()));
|
||||
this.entity.openContainer = tile.createContainer(this.entity.inventory, this.entity);
|
||||
}
|
||||
else if (object instanceof InteractionObject obj)
|
||||
{
|
||||
this.sendPacket(new SPacketOpenWindow(this.getNextWindowId(), obj.getBlock(), obj.getBlock().getDisplay(), 0));
|
||||
this.sendPacket(new SPacketOpenWindow(this.getNextWindowId(), obj.getBlock(), 0));
|
||||
this.entity.openContainer = obj.createContainer(this.entity.inventory, this.entity);
|
||||
}
|
||||
else {
|
||||
|
@ -706,7 +706,7 @@ public class Player extends User implements Executor, IPlayer
|
|||
|
||||
if(object instanceof EntityNPC npc) {
|
||||
IInventory merchant = ((ContainerMerchant)this.entity.openContainer).getMerchantInventory();
|
||||
this.sendPacket(new SPacketOpenWindow(this.currentWindowId, npc.getId(), npc.getName(), merchant.getSizeInventory()));
|
||||
this.sendPacket(new SPacketOpenWindow(this.currentWindowId, npc.getId(), merchant.getSizeInventory()));
|
||||
MerchantRecipeList trades = npc.getTrades(this.entity);
|
||||
if(trades != null)
|
||||
this.sendPacket(new SPacketTrades(trades, this.currentWindowId));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue