Package io.github.djtpj.origin
Class Origin
java.lang.Object
io.github.djtpj.origin.Origin
An Origin is a collection of Traits as defined by the "origins.json" file
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Origin
public Origin(org.json.simple.JSONObject object) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException, IllDefinedTraitException - Parameters:
object
- The JSONObject to define this origin with- Throws:
NoSuchMethodException
- Thrown if a trait does not possess a constructor that matches the arguments it was passedInvocationTargetException
- Thrown if a trait's constructor throws an errorInstantiationException
- Thrown if an abstract trait is attempted to be instantiatedIllegalAccessException
- Thrown if a trait's constructor is not publicIllDefinedTraitException
- Thrown in a trait does not possess the required static ID field- See Also:
-
Trait
JSONObject
-
-
Method Details
-
getName
- Returns:
- Returns the formatted name of the Origin
-
enable
public void enable(org.bukkit.entity.Player player) Enables all of the Origin's traits for a specific player- Parameters:
player
- the player to enable the traits for
-
disable
public void disable(org.bukkit.entity.Player player) Disables all of the Origin's traits for a specific player- Parameters:
player
- the player to disable the traits for
-
getAllTraits
- Returns:
- All the traits, including the traits inside a
CompoundTrait
.
-