Package io.github.djtpj.trait.traits
Class RunnableSimpleTrait
java.lang.Object
io.github.djtpj.trait.Trait
io.github.djtpj.trait.SimpleTrait
io.github.djtpj.trait.traits.RunnableSimpleTrait
- All Implemented Interfaces:
org.bukkit.event.Listener
- Direct Known Subclasses:
ArmorSetRestriction
,Gourdophobic
,PermanentEffect
,Photosensitivity
,Photosynthesis
A RunnableSimpleTrait is an ability that runs over and over again every
x
ticks-
Nested Class Summary
Nested classes/interfaces inherited from class io.github.djtpj.trait.Trait
Trait.Type
-
Field Summary
Fields inherited from class io.github.djtpj.trait.Trait
icon, playerTraitMap, type
-
Constructor Summary
ConstructorsConstructorDescriptionRunnableSimpleTrait
(int loopTicks) RunnableSimpleTrait
(int delayTicks, int loopTicks) RunnableSimpleTrait
(ItemIcon icon, Trait.Type type) RunnableSimpleTrait
(ItemIcon icon, Trait.Type type, int loopTicks) RunnableSimpleTrait
(ItemIcon icon, Trait.Type type, int delayTicks, int loopTicks) RunnableSimpleTrait
(String name, String description, org.bukkit.ChatColor color, org.bukkit.Material material, Trait.Type type) RunnableSimpleTrait
(String name, String description, org.bukkit.ChatColor color, org.bukkit.Material material, Trait.Type type, int loopTicks) RunnableSimpleTrait
(String name, String description, org.bukkit.ChatColor color, org.bukkit.Material material, Trait.Type type, int delayTicks, int loopTicks) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.bukkit.entity.Player[]
Returns the players with an origin that posses this abilityprotected abstract void
onTick
(org.bukkit.entity.Player player) The method to run on each player every ten ticks
-
Constructor Details
-
RunnableSimpleTrait
public RunnableSimpleTrait(String name, String description, org.bukkit.ChatColor color, org.bukkit.Material material, Trait.Type type) -
RunnableSimpleTrait
public RunnableSimpleTrait(String name, String description, org.bukkit.ChatColor color, org.bukkit.Material material, Trait.Type type, int loopTicks) -
RunnableSimpleTrait
public RunnableSimpleTrait(String name, String description, org.bukkit.ChatColor color, org.bukkit.Material material, Trait.Type type, int delayTicks, int loopTicks) -
RunnableSimpleTrait
public RunnableSimpleTrait() -
RunnableSimpleTrait
public RunnableSimpleTrait(int loopTicks) -
RunnableSimpleTrait
public RunnableSimpleTrait(int delayTicks, int loopTicks) -
RunnableSimpleTrait
-
RunnableSimpleTrait
-
RunnableSimpleTrait
-
-
Method Details
-
onTick
protected abstract void onTick(org.bukkit.entity.Player player) The method to run on each player every ten ticks- Parameters:
player
- The player to run the method on
-
getApplicablePlayers
protected org.bukkit.entity.Player[] getApplicablePlayers()Returns the players with an origin that posses this ability- Returns:
- the players that have this ability
-