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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidbuildGui(ModularGui gui) Use this method to build the modular gui.abstract voidbuildGui(ModularGui gui, ContainerScreenAccess<T> screenAccess) This is the same asGuiProvider.buildGui(ModularGui)except you have access to theMenuAccessThe given menu accessor should always be the parent screen unless your using some custom modular gui implementation.voidsetMenuAccess(ContainerScreenAccess<T> screenAccess) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface codechicken.lib.gui.modular.lib.GuiProvider
createRootElement
-
Constructor Details
-
ContainerGuiProvider
public ContainerGuiProvider()
-
-
Method Details
-
setMenuAccess
-
buildGui
Description copied from interface:GuiProviderUse 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:
buildGuiin interfaceGuiProvider- Parameters:
gui- The modular gui instance.
-
buildGui
This is the same asGuiProvider.buildGui(ModularGui)except you have access to theMenuAccessThe 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 extendsModularGuiContainer
-