NPCGroup class

Пакет: com.hypixel.hytale.builtin.tagset.config

Файл: com/hypixel/hytale/builtin/tagset/config/NPCGroup.java

implements: JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, NPCGroup>>, TagSet

Поля (2)

МодификаторыТипИмя
ASSET_STORE
final AssetBuilderCodec<String, NPCGroup> CODEC

Методы (4)

МодификаторыВозвратСигнатура
static IndexedLookupTableAssetMap<String, NPCGroup> getAssetMapIndexedLookupTableAssetMap<String, NPCGroup> getAssetMap()
static AssetStore<String, NPCGroup, IndexedLookupTableAssetMap<String, NPCGroup>> getAssetStoreAssetStore<String, NPCGroup, IndexedLookupTableAssetMap<String, NPCGroup>> getAssetStore()
public String getIdString getId()
if if(ASSET_STORE == null)

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.tagset.config;

class="kw">import com.hypixel.hytale.assetstore.AssetExtraInfo;
class="kw">import com.hypixel.hytale.assetstore.AssetKeyValidator;
class="kw">import com.hypixel.hytale.assetstore.AssetRegistry;
class="kw">import com.hypixel.hytale.assetstore.AssetStore;
class="kw">import com.hypixel.hytale.assetstore.codec.AssetBuilderCodec;
class="kw">import com.hypixel.hytale.assetstore.codec.ContainedAssetCodec;
class="kw">import com.hypixel.hytale.assetstore.map.IndexedLookupTableAssetMap;
class="kw">import com.hypixel.hytale.assetstore.map.JsonAssetWithMap;
class="kw">import com.hypixel.hytale.builtin.tagset.TagSet;
class="kw">import com.hypixel.hytale.codec.Codec;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.codecs.array.ArrayCodec;
class="kw">import com.hypixel.hytale.codec.validation.ValidatorCache;
class="kw">import javax.annotation.Nonnull;

class="kw">public class NPCGroup class="kw">implements JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, NPCGroup>>, TagSet {
   class="kw">public class="kw">static class="kw">final AssetBuilderCodec<String, NPCGroup> CODEC = AssetBuilderCodec.<String, NPCGroup>builder(
         NPCGroup.class, NPCGroup::new, Codec.STRING, (var0, var1) -> var0.id = var1, var0 -> var0.id, (var0, var1) -> var0.data = var1, var0 -> var0.data
      )
      .documentation("Defines a group or collection of NPC types.")
      .<String[]>append(new KeyedCodec<>("IncludeRoles", Codec.STRING_ARRAY), (var0, var1) -> var0.includedRoles = var1, var0 -> var0.includedRoles)
      .documentation("A list of individual types to include.")
      .add()
      .<String[]>append(new KeyedCodec<>("ExcludeRoles", Codec.STRING_ARRAY), (var0, var1) -> var0.excludedRoles = var1, var0 -> var0.excludedRoles)
      .documentation("A list of individual types to exclude.")
      .add()
      .<String[]>append(new KeyedCodec<>("IncludeGroups", Codec.STRING_ARRAY), (var0, var1) -> var0.includedGroupTags = var1, var0 -> var0.includedGroupTags)
      .documentation("A list of other groups to include.")
      .add()
      .<String[]>append(new KeyedCodec<>("ExcludeGroups", Codec.STRING_ARRAY), (var0, var1) -> var0.excludedGroupTags = var1, var0 -> var0.excludedGroupTags)
      .documentation("A list of other groups to exclude.")
      .add()
      .build();
   @Nonnull
   class="kw">public class="kw">static class="kw">final Codec<String> CHILD_ASSET_CODEC = new ContainedAssetCodec<>(NPCGroup.class, CODEC);
   class="kw">public class="kw">static class="kw">final Codec<String[]> CHILD_ASSET_CODEC_ARRAY = new ArrayCodec<>(CHILD_ASSET_CODEC, String[]::new);
   class="kw">public class="kw">static class="kw">final ValidatorCache<String> VALIDATOR_CACHE = new ValidatorCache<>(new AssetKeyValidator<>(NPCGroup::getAssetStore));
   class="kw">private class="kw">static AssetStore<String, NPCGroup, IndexedLookupTableAssetMap<String, NPCGroup>> ASSET_STORE;
   class="kw">protected AssetExtraInfo.Data data;
   class="kw">protected String id;
   class="kw">protected String[] includedGroupTags;
   class="kw">protected String[] excludedGroupTags;
   class="kw">protected String[] includedRoles;
   class="kw">protected String[] excludedRoles;

   class="kw">public class="kw">static AssetStore<String, NPCGroup, IndexedLookupTableAssetMap<String, NPCGroup>> getAssetStore() {
      if (ASSET_STORE == null) {
         ASSET_STORE = AssetRegistry.getAssetStore(NPCGroup.class);
      }

      class="kw">return ASSET_STORE;
   }

   class="kw">public class="kw">static IndexedLookupTableAssetMap<String, NPCGroup> getAssetMap() {
      class="kw">return (IndexedLookupTableAssetMap<String, NPCGroup>)getAssetStore().getAssetMap();
   }

   class="kw">public NPCGroup(String var1) {
      this.id = var1;
   }

   class="kw">protected NPCGroup() {
   }

   class="kw">public String getId() {
      class="kw">return this.id;
   }

   @Override
   class="kw">public String[] getIncludedTagSets() {
      class="kw">return this.includedGroupTags;
   }

   @Override
   class="kw">public String[] getExcludedTagSets() {
      class="kw">return this.excludedGroupTags;
   }

   @Override
   class="kw">public String[] getIncludedTags() {
      class="kw">return this.includedRoles;
   }

   @Override
   class="kw">public String[] getExcludedTags() {
      class="kw">return this.excludedRoles;
   }
}