Class AliasesProvider

java.lang.Object
ch.njol.skript.aliases.AliasesProvider

public class AliasesProvider extends Object
Provides aliases on Bukkit/Spigot platform.
  • Constructor Details

    • AliasesProvider

      public AliasesProvider(int expectedCount, @Nullable @Nullable AliasesProvider parent)
      Constructs a new aliases provider with no data.
  • Method Details

    • parseMojangson

      public Map<String,Object> parseMojangson(String raw)
      Uses GSON to parse Mojang's JSON format to a map.
      Parameters:
      raw - Raw JSON.
      Returns:
      String,Object map.
    • applyTags

      public int applyTags(org.bukkit.inventory.ItemStack stack, Map<String,Object> tags)
      Applies given tags to an item stack.
      Parameters:
      stack - Item stack.
      tags - Tags.
      Returns:
      Additional flags for the item.
    • addAlias

      public void addAlias(AliasesProvider.AliasName name, String id, @Nullable @Nullable Map<String,Object> tags, Map<String,String> blockStates)
      Adds an alias to this provider.
      Parameters:
      name - Name of alias without any patterns or variation blocks.
      id - Id of material.
      tags - Tags for material.
      blockStates - Block states.
    • addVariationGroup

      public void addVariationGroup(String name, AliasesProvider.VariationGroup group)
    • getVariationGroup

      @Nullable public @Nullable AliasesProvider.VariationGroup getVariationGroup(String name)
    • getAlias

      @Nullable public @Nullable ItemType getAlias(String alias)
    • getAliasData

      public @Nullable AliasesMap.AliasData getAliasData(ItemData item)
    • getMinecraftId

      @Nullable public @Nullable String getMinecraftId(ItemData item)
    • getMaterialName

      @Nullable public @Nullable ch.njol.skript.aliases.MaterialName getMaterialName(ItemData item)
    • getRelatedEntity

      @Nullable public @Nullable EntityData<?> getRelatedEntity(ItemData item)
    • clearAliases

      public void clearAliases()
    • getAliasCount

      public int getAliasCount()
    • hasAliasForMaterial

      public boolean hasAliasForMaterial(org.bukkit.Material material)
      Check if this provider has an alias for the given material.
      Parameters:
      material - Material to check alias for
      Returns:
      True if this material has an alias