Class GuiTextures

java.lang.Object
codechicken.lib.gui.modular.sprite.GuiTextures

public class GuiTextures extends Object
Gui texture handler implementation. This sets up a custom atlas that will be populated with all textures in "modid:textures/gui/"

Created by brandon3055 on 21/10/2023

  • Constructor Details

    • GuiTextures

      public GuiTextures(String modId)
  • Method Details

    • init

      public void init(net.minecraftforge.eventbus.api.IEventBus bus)
      Called to initialize the GuiTextures helper
      Parameters:
      bus - Your mod event bus.
    • getAtlasHolder

      public ModAtlasHolder getAtlasHolder()
      Returns:
      The underlying ModAtlasHolder instance.
    • get

      public Material get(String texture)
      Returns a cached Material for the specified gui texture. Warning: Do not use this if you intend to use the material with multiple render types. The material will cache the first render type it is used with. Instead use getUncached(String)
      Parameters:
      texture - The texture path relative to "modid:gui/"
    • get

      public Material get(Supplier<String> texture)
    • getter

      public Supplier<Material> getter(Supplier<String> texture)
    • getUncached

      public Material getUncached(String texture)
      Use this to retrieve a new uncached material for the specified gui texture. Feel free to hold onto the returned material. Storing it somewhere is more efficient than recreating it every render frame.
      Parameters:
      texture - The texture path relative to "modid:gui/"
      Returns:
      A new Material for the specified gui texture.