Class BlockTypeAssetMap<K, T extends JsonAssetWithMap<K, BlockTypeAssetMap<K,T>>>

Type Parameters:
K - The key type of the assets.
T - The type of asset being stored.

public class BlockTypeAssetMap<K, T extends JsonAssetWithMap<K, BlockTypeAssetMap<K,T>>> extends AssetMapWithIndexes<K,T>
An extension of AssetMap that stores block type assets with an index mapping.

The index is calculated at load time and is a runtime-only value.

  • Constructor Details

  • Method Details

    • getIndex

      public int getIndex(K key)
      Parameters:
      key - to key to find get index for
      Returns:
      the index assigned to the key or AssetMapWithIndexes.NOT_FOUND if not found
    • getIndexOrDefault

      public int getIndexOrDefault(K key, int def)
      Parameters:
      key - to key to find get index for
      def - to default value to return if the key isn't found
      Returns:
      the index assigned to the key or def if not found
    • getNextIndex

      public int getNextIndex()
    • getAsset

      @Nullable public T getAsset(int index)
    • getAssetOrDefault

      public T getAssetOrDefault(int index, T def)
    • getSubKeys

      @Nonnull public it.unimi.dsi.fastutil.objects.ObjectSet<K> getSubKeys(K key)
    • getGroupId

      public int getGroupId(String group)
    • getGroups

      @Nonnull public String[] getGroups()