Class ContainerGuiProvider<T extends net.minecraft.world.inventory.AbstractContainerMenu>

java.lang.Object
codechicken.lib.gui.modular.lib.container.ContainerGuiProvider<T>
All Implemented Interfaces:
GuiProvider

public abstract class ContainerGuiProvider<T extends net.minecraft.world.inventory.AbstractContainerMenu> extends Object implements GuiProvider
Created by brandon3055 on 08/09/2023
  • Constructor Details

    • ContainerGuiProvider

      public ContainerGuiProvider()
  • Method Details

    • setMenuAccess

      public void setMenuAccess(ContainerScreenAccess<T> screenAccess)
    • buildGui

      public final void buildGui(ModularGui gui)
      Description copied from interface: GuiProvider
      Use this method to build the modular gui.

      Initialize the gui root element with ModularGui.initStandardGui(int, int), ModularGui.initFullscreenGui() This applies bindings to fix the size and position of the root element, you can also do this manually for custom configurations.

      Build your gui by adding and configuring your desired gui elements. Elements must be added to the root gui element which is obtainable via gui.getRoot()

      Note: gui elements are added on construction, meaning you do not need to use element.addChild. Instead, just construct the elements, and pass in the root element (or any other initialized element) as the parent.

      Specified by:
      buildGui in interface GuiProvider
      Parameters:
      gui - The modular gui instance.
    • buildGui

      public abstract void buildGui(ModularGui gui, ContainerScreenAccess<T> screenAccess)
      This is the same as GuiProvider.buildGui(ModularGui) except you have access to the MenuAccess The given menu accessor should always be the parent screen unless your using some custom modular gui implementation.
      Parameters:
      gui - The modular gui instance.
      screenAccess - The screen access (This will be a gui class that extends ModularGuiContainer