Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions src/main/java/witchinggadgets/client/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,26 +130,25 @@ public void registerHandlers() {
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity tile = world.getTileEntity(x, y, z);
if (ID == 0) return new GuiSpinningWheel(player.inventory, (TileEntitySpinningWheel) tile);

if (ID == 3) return new GuiBag(player.inventory, world);
if (ID == 4 || ID == 5) return new GuiCloakBag(
player.inventory,
world,
BaublesApi.getBaubles(player).getStackInSlot(
BaubleExpandedSlots.getIndexOfTypeInRegisteredTypes(BaubleExpandedSlots.capeType)));

if (ID == 6) return new GuiPatchedFocusPouch(player.inventory, world, x, y, z);

if (ID == 7) return new GuiPrimordialGlove(player.inventory, world, x, y, z);

if (ID == 8) return new GuiLabelLibrary(player.inventory, (TileEntityLabelLibrary) tile);

if (ID == 9) return new GuiCuttingTable(player.inventory, (TileEntityCuttingTable) tile);

if (ID == 11) return new GuiVoidBag(player.inventory, world);

return null;
return switch (ID) {
case 0 -> new GuiSpinningWheel(player.inventory, (TileEntitySpinningWheel) tile);
case 3 -> new GuiBag(player.inventory, world);
case 4, 5 -> {
String baubleSlot = ID == 4 ? BaubleExpandedSlots.capeType : BaubleExpandedSlots.beltType;
yield new GuiCloakBag(
player.inventory,
world,
BaublesApi.getBaubles(player)
.getStackInSlot(BaubleExpandedSlots.getIndexOfTypeInRegisteredTypes(baubleSlot)));
}
case 6 -> new GuiPatchedFocusPouch(player.inventory, world, x, y, z);
case 7 -> new GuiPrimordialGlove(player.inventory, world, x, y, z);
case 8 -> new GuiLabelLibrary(player.inventory, (TileEntityLabelLibrary) tile);
case 9 -> new GuiCuttingTable(player.inventory, (TileEntityCuttingTable) tile);
case 11 -> new GuiVoidBag(player.inventory, world);
default -> null;
};
}

@Override
Expand Down
36 changes: 18 additions & 18 deletions src/main/java/witchinggadgets/common/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ public void registerHandlers() {}
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity tile = world.getTileEntity(x, y, z);
if (ID == 0) return new ContainerSpinningWheel(player.inventory, (TileEntitySpinningWheel) tile);

if (ID == 3) return new ContainerBag(player.inventory, world);
if (ID == 4 || ID == 5) return new ContainerCloak(
player.inventory,
world,
BaublesApi.getBaubles(player).getStackInSlot(
BaubleExpandedSlots.getIndexesOfAssignedSlotsOfType(BaubleExpandedSlots.capeType)[0]));

if (ID == 6) return new ContainerPatchedFocusPouch(player.inventory, world, x, y, z);

if (ID == 7) return new ContainerPrimordialGlove(player.inventory, world, x, y, z);
if (ID == 8) return new ContainerLabelLibrary(player.inventory, (TileEntityLabelLibrary) tile);

if (ID == 9) return new ContainerCuttingTable(player.inventory, (TileEntityCuttingTable) tile);

if (ID == 11) return new ContainerVoidBag(player.inventory, world);

return null;
return switch (ID) {
case 0 -> new ContainerSpinningWheel(player.inventory, (TileEntitySpinningWheel) tile);
case 3 -> new ContainerBag(player.inventory, world);
case 4, 5 -> {
String baubleSlot = ID == 4 ? BaubleExpandedSlots.capeType : BaubleExpandedSlots.beltType;
yield new ContainerCloak(
player.inventory,
world,
BaublesApi.getBaubles(player)
.getStackInSlot(BaubleExpandedSlots.getIndexesOfAssignedSlotsOfType(baubleSlot)[0]));
}
case 6 -> new ContainerPatchedFocusPouch(player.inventory, world, x, y, z);
case 7 -> new ContainerPrimordialGlove(player.inventory, world, x, y, z);
case 8 -> new ContainerLabelLibrary(player.inventory, (TileEntityLabelLibrary) tile);
case 9 -> new ContainerCuttingTable(player.inventory, (TileEntityCuttingTable) tile);
case 11 -> new ContainerVoidBag(player.inventory, world);
default -> null;
};
}

@Override
Expand Down