1
0
Fork 0

change inventory system

This commit is contained in:
Sen 2025-09-04 16:36:37 +02:00
parent 771a8bfa89
commit 6bb1c7c050
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
18 changed files with 333 additions and 1082 deletions

View file

@ -655,7 +655,7 @@ public abstract class GuiContainer extends Gui
}
Slot slot = this.getSlotAtPosition(mouseX, mouseY);
if(slot != null && Bind.CRAFT.isDown() && slot.canCheatItem() && slot.getHasStack() && this.gm.player.inventoryContainer.getSingleRecipe(slot.getStack()) != null) {
this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.CRAFT_ITEM, slot.slotNumber));
this.gm.player.client.addToSendQueue(new CPacketAction(CPacketAction.Action.CRAFT_SINGLE, slot.slotNumber));
this.ignoreMouseUp = true;
return;
}
@ -1026,7 +1026,7 @@ public abstract class GuiContainer extends Gui
this.gm.player.client.addToSendQueue(new CPacketCheat(ITEM_LIST.get(idx).getItem(), slot < 0 ? slot : -2 - slot, full));
}
else {
this.cheatStack = ITEM_LIST.get(idx).copy(full ? ITEM_LIST.get(idx).getMaxStackSize() : 1);
this.cheatStack = ITEM_LIST.get(idx).copy(full ? Math.min(ITEM_LIST.get(idx).getMaxStackSize(), 100) : 1);
}
return true;
}

View file

@ -12,11 +12,11 @@ public class GuiCrafting extends GuiContainer {
public GuiCrafting(EntityNPC inv, World world, BlockWorkbench type) {
super(new ContainerWorkbench(inv, world, LocalPos.ORIGIN, type));
this.type = type;
this.ySize = 36 + 18 * ((inv.getInventoryCapacity() + 11) / 12) + 18 * this.type.getSize();
this.ySize = 36 + 18 * ((inv.getInventoryCapacity() + 11) / 12) + 18 * 3;
}
public void addElements() {
this.label(this.type.getDisplay(), 8, 16);
this.label("Inventar", 8, 36 - 8 + 18 * this.type.getSize());
this.label("Inventar", 8, 36 - 8 + 18 * 3);
}
}

View file

@ -1128,7 +1128,7 @@ public class ClientPlayer implements IClientPlayer
// flag = true; // guicontainercreative.getSelectedTabIndex() != CheatTab.tabInventory.getIndex();
// }
if (packetIn.getWindowId() == 0 && packetIn.getSlot() >= 5 + Equipment.ARMOR_SLOTS && packetIn.getSlot() < 5 + Equipment.ARMOR_SLOTS + entityplayer.getInventoryCapacity())
if (packetIn.getWindowId() == 0 && packetIn.getSlot() >= Equipment.ARMOR_SLOTS && packetIn.getSlot() < Equipment.ARMOR_SLOTS + entityplayer.getInventoryCapacity())
{
ItemStack itemstack = entityplayer.inventoryContainer.getSlot(packetIn.getSlot()).getStack();