Class ParsedLootTable

java.lang.Object
pl.szczurowsky.loottableparser.ParsedLootTable

public class ParsedLootTable extends Object
Parsed, convenient loot table object with methods to get loot.
  • Constructor Details

    • ParsedLootTable

      public ParsedLootTable(String jsonString)
      Get loot table from json string.
      Parameters:
      jsonString - json string
    • ParsedLootTable

      public ParsedLootTable(File file)
      Get loot table from json file.
      Parameters:
      file - json file
    • ParsedLootTable

      public ParsedLootTable(URL siteURL)
      Get loot table from json url.
      Parameters:
      siteURL - json url
  • Method Details

    • parse

      public void parse() throws NotALootTableException
      Parse loot table.
      Throws:
      NotALootTableException - if json is not a loot table
    • getLootTableObject

      public LootTableObject getLootTableObject()
      Get loot table object.
      Returns:
      loot table object
    • getLoot

      public List<org.bukkit.inventory.ItemStack> getLoot(boolean bonus)
      Get loot in list of ItemStacks.
      Parameters:
      bonus - if true, bonus loot will be returned
      Returns:
      list of ItemStacks