Class LootRandomValues

java.lang.Object
net.glowstone.util.loot.LootRandomValues

public class LootRandomValues extends Object
  • Constructor Details

    • LootRandomValues

      public LootRandomValues(int min, int max)
      Creates an instance for a given range.
      Parameters:
      min - the minimum number
      max - the maximum number
    • LootRandomValues

      public LootRandomValues(org.json.simple.JSONObject object)
      Reads an instance from its JSON form.
      Parameters:
      object - a LootRandomValues instance in JSON form
  • Method Details

    • generate

      public int generate(Random random, org.bukkit.entity.LivingEntity entity)
      Selects a random value between min and max, inclusively.
      Parameters:
      random - the random object to generate the number from
      entity - the entity
      Returns:
      the random value
    • getMin

      public Optional<Integer> getMin()
    • getMax

      public Optional<Integer> getMax()
    • getReflectiveCount

      public Optional<String> getReflectiveCount()
    • getProbabilities

      public Map<Integer,Double> getProbabilities()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object