Class Mechanic
java.lang.Object
me.deecaad.core.mechanics.defaultmechanics.Mechanic
- All Implemented Interfaces:
InlineSerializer<Mechanic>,Serializer<Mechanic>,net.kyori.adventure.key.Keyed,org.bukkit.Keyed
- Direct Known Subclasses:
ActionBarMechanic,ActivateBlockMechanic,BossBarMechanic,CommandMechanic,DamageMechanic,DropItemMechanic,IgniteMechanic,LeapMechanic,LightningMechanic,MessageMechanic,PlayerEffectMechanic,PlayerEffectMechanicList,PotionMechanic,PushMechanic,TitleMechanic
-
Nested Class Summary
Nested classes/interfaces inherited from interface me.deecaad.core.file.InlineSerializer
InlineSerializer.FormatException -
Field Summary
FieldsFields inherited from interface me.deecaad.core.file.InlineSerializer
NAME_FINDER, UNIQUE_IDENTIFIER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyParentArgs(me.deecaad.core.file.SerializeData data, Mechanic mechanic) doubleintintintprotected voidvoidThis method will trigger this Mechanic.protected abstract voidThis method should be overridden to define the behavior of the Mechanic.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.deecaad.core.file.InlineSerializer
getInlineKeyword, getKey, getKeyword, shouldSerializeMethods inherited from interface org.bukkit.Keyed
keyMethods inherited from interface me.deecaad.core.file.Serializer
canUsePathTo, getName, getParentKeywords, getWikiLink, letPassThrough, serialize, tryPathTo, useLater
-
Field Details
-
targeter
-
conditions
-
-
Constructor Details
-
Mechanic
public Mechanic()Default constructor for serializer.
-
-
Method Details
-
getTargeter
-
getConditions
-
getRepeatAmount
public int getRepeatAmount() -
getRepeatInterval
public int getRepeatInterval() -
getDelayBeforePlay
public int getDelayBeforePlay() -
getChance
public double getChance() -
use
This method will trigger this Mechanic.This method probably shouldn't be overridden. It handles the global repeat, delay, targeter, and condition code. The behavior of the specific Mechanic is handled by the protected
use0(CastData)method.- Parameters:
cast- The non-null cast data.
-
handleTargetersAndConditions
-
use0
This method should be overridden to define the behavior of the Mechanic. For example, a Potion mechanic may use theCastData.getTarget()method to apply a potion effect.- Parameters:
cast- The non-null data including source/target information.
-
applyParentArgs
public Mechanic applyParentArgs(me.deecaad.core.file.SerializeData data, Mechanic mechanic) throws me.deecaad.core.file.SerializerException - Throws:
me.deecaad.core.file.SerializerException
-