Class EntityDrop

java.lang.Object
fr.olympus.prometheus.entity.EntityDrop

public class EntityDrop extends Object
Represents a drop that an entity can have upon defeat.
  • Constructor Summary

    Constructors
    Constructor
    Description
    EntityDrop(int quantity)
    Constructs an EntityDrop with a fixed quantity and a drop chance of 1.0.
    EntityDrop(int quantity, double dropChance)
    Constructs an EntityDrop with a fixed quantity and drop chance.
    EntityDrop(int minimalQuantity, int maximalQuantity, double dropChance)
    Constructs an EntityDrop with specified minimal and maximal quantities and drop chance.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Gets the chance of the drop occurring.
    int
    Gets the maximal quantity of the drop.
    int
    Gets the minimal quantity of the drop.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EntityDrop

      public EntityDrop(int minimalQuantity, int maximalQuantity, double dropChance)
      Constructs an EntityDrop with specified minimal and maximal quantities and drop chance.
      Parameters:
      minimalQuantity - the minimal quantity of the drop
      maximalQuantity - the maximal quantity of the drop
      dropChance - the chance of the drop occurring (between 0.0 and 1.0)
      Throws:
      IllegalArgumentException - if minimalQuantity is greater than maximalQuantity or if dropChance is not between 0.0 and 1.0
    • EntityDrop

      public EntityDrop(int quantity, double dropChance)
      Constructs an EntityDrop with a fixed quantity and drop chance.
      Parameters:
      quantity - the fixed quantity of the drop
      dropChance - the chance of the drop occurring (between 0.0 and 1.0)
    • EntityDrop

      public EntityDrop(int quantity)
      Constructs an EntityDrop with a fixed quantity and a drop chance of 1.0.
      Parameters:
      quantity - the fixed quantity of the drop
  • Method Details

    • getMinimalQuantity

      public int getMinimalQuantity()
      Gets the minimal quantity of the drop.
      Returns:
      the minimal quantity
    • getMaximalQuantity

      public int getMaximalQuantity()
      Gets the maximal quantity of the drop.
      Returns:
      the maximal quantity
    • getDropChance

      public double getDropChance()
      Gets the chance of the drop occurring.
      Returns:
      the drop chance