Package fr.olympus.prometheus.entity
Class EntityDrop
java.lang.Object
fr.olympus.prometheus.entity.EntityDrop
Represents a drop that an entity can have upon defeat.
-
Constructor Summary
ConstructorsConstructorDescriptionEntityDrop(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 TypeMethodDescriptiondoubleGets the chance of the drop occurring.intGets the maximal quantity of the drop.intGets the minimal quantity of the drop.
-
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 dropmaximalQuantity- the maximal quantity of the dropdropChance- 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 dropdropChance- 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
-