java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.client.generators.TexSourceDataHolder

public class TexSourceDataHolder extends Object
Data available during the generation of a texture within a TexSource.
  • Field Details

  • Constructor Details

    • TexSourceDataHolder

      public TexSourceDataHolder()
      Creates a new TexSourceDataHolder with the default logger and no other data.
    • TexSourceDataHolder

      public TexSourceDataHolder(TexSourceDataHolder old)
      Creates a new TexSourceDataHolder with the data from the provided holder.
      Parameters:
      old - the holder to copy data from
  • Method Details

    • put

      public <T> void put(TexSourceDataHolder.Token<T> token, T data)
      Adds the provided data to this holder, with the provided class as a key.
      Type Parameters:
      T - the type of the data
      Parameters:
      token - acts as a key for the data
      data - the data to store
    • get

      public <T> @Nullable T get(TexSourceDataHolder.Token<T> token)
      Gets the data stored in this holder, with the provided class as a key.
      Type Parameters:
      T - the type of the data
      Parameters:
      token - acts as a key for the data
      Returns:
      the data stored, or null if none is stored
    • getLogger

      public org.slf4j.Logger getLogger()
      Returns:
      the logger stored, or the default logger if none is stored