Class CustomAttributeContainer

java.lang.Object
net.buildtheearth.terraminusminus.util.CustomAttributeContainer
Direct Known Subclasses:
CachedChunkData, CachedChunkData.Builder, GeneratorDatasets

public abstract class CustomAttributeContainer extends Object
  • Field Details

  • Constructor Details

    • CustomAttributeContainer

      public CustomAttributeContainer(@NonNull @NonNull Map<String,Object> custom)
  • Method Details

    • getCustom

      public <T> T getCustom(@NonNull @NonNull String key)
      Gets the custom attribute with the given key.
      Parameters:
      key - the key of the attribute to get
      Returns:
      the attribute
      Throws:
      IllegalArgumentException - if a property with the given name couldn't be found
    • getCustom

      public <T> T getCustom(@NonNull @NonNull String key, T fallback)
      Gets the custom attribute with the given key.
      Parameters:
      key - the key of the attribute to get
      fallback - the value to return if the key couldn't be found
      Returns:
      the attribute