Class TexSourceDataHolder
java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.client.generators.TexSourceDataHolder
Data available during the generation of a texture within a
TexSource.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA token used to store and retrieve data from aTexSourceDataHolder. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TexSourceDataHolder.Token<org.slf4j.Logger> The token used to store and retrieve the logger from aTexSourceDataHolder. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newTexSourceDataHolderwith the default logger and no other data.Creates a newTexSourceDataHolderwith the data from the provided holder. -
Method Summary
Modifier and TypeMethodDescription<T> @Nullable Tget(TexSourceDataHolder.Token<T> token) Gets the data stored in this holder, with the provided class as a key.org.slf4j.Logger<T> voidput(TexSourceDataHolder.Token<T> token, T data) Adds the provided data to this holder, with the provided class as a key.
-
Field Details
-
LOGGER_TOKEN
The token used to store and retrieve the logger from aTexSourceDataHolder.
-
-
Constructor Details
-
TexSourceDataHolder
public TexSourceDataHolder()Creates a newTexSourceDataHolderwith the default logger and no other data. -
TexSourceDataHolder
Creates a newTexSourceDataHolderwith the data from the provided holder.- Parameters:
old- the holder to copy data from
-
-
Method Details
-
put
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 datadata- the data to store
-
get
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
-