java.lang.Object
codechicken.lib.gui.modular.lib.container.SlotGroup

public class SlotGroup extends Object
Used to configure slots a set of slots in a ContainerMenu. The SlotGroup can then be passed to ModularGui elements such as GuiSlots in order to give the gui control over slot positioning and rendering.

Ideally you should use a separate SlotGroup for each 'group' of slots, Meaning the players main inventory and hot bar should be separate ranges. That said, if you have multiple slots spread out across something like a machine gui, You can add them all to one SlotGroup then pass each individual slot from that range to a GuiSlots.singleSlot(GuiParent, ContainerScreenAccess, SlotGroup, int)

Created by brandon3055 on 08/09/2023

  • Field Details

    • zone

      public final int zone
    • quickMoveTo

      public final List<Integer> quickMoveTo
  • Constructor Details

  • Method Details

    • addSlot

      public ModularSlot addSlot(ModularSlot slot)
    • addSlots

      public void addSlots(int slotCount, int startIndex, Function<Integer,ModularSlot> makeSlot)
      Convenient method for adding multiple slots.
      Parameters:
      slotCount - The number of slots to be added.
      startIndex - Slot starting index.
      makeSlot - Builder used to create the slots, Input integer will start at startIndex and increment by one for each slot.
    • addAllSlots

      public void addAllSlots(net.minecraft.world.Container container)
    • addAllSlots

      public void addAllSlots(net.minecraft.world.Container container, BiFunction<net.minecraft.world.Container,Integer,ModularSlot> makeSlot)
    • addPlayerMain

      public void addPlayerMain(net.minecraft.world.entity.player.Inventory inventory)
    • addPlayerBar

      public void addPlayerBar(net.minecraft.world.entity.player.Inventory inventory)
    • addPlayerArmor

      public void addPlayerArmor(net.minecraft.world.entity.player.Inventory inventory)
    • addPlayerOffhand

      public void addPlayerOffhand(net.minecraft.world.entity.player.Inventory inventory)
    • size

      public int size()
    • getSlot

      public ModularSlot getSlot(int index)
    • indexOf

      public int indexOf(net.minecraft.world.inventory.Slot slot)
    • slots

      public List<ModularSlot> slots()