Class FireworkMechanic
java.lang.Object
me.deecaad.core.mechanics.defaultmechanics.Mechanic
me.deecaad.core.mechanics.PlayerEffectMechanic
me.deecaad.core.mechanics.defaultmechanics.FireworkMechanic
- All Implemented Interfaces:
InlineSerializer<Mechanic>,Serializer<Mechanic>,net.kyori.adventure.key.Keyed,org.bukkit.Keyed
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface me.deecaad.core.file.InlineSerializer
InlineSerializer.FormatException -
Field Summary
Fields inherited from class me.deecaad.core.mechanics.defaultmechanics.Mechanic
conditions, targeterFields inherited from interface me.deecaad.core.file.InlineSerializer
NAME_FINDER, UNIQUE_IDENTIFIER -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for serializer.FireworkMechanic(org.bukkit.inventory.ItemStack fireworkItem, int flightTime, Targeter viewers, List<Condition> viewerConditions) -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStackint@NotNull org.bukkit.NamespacedKeygetKey()@Nullable Targeter@Nullable StringReturns a link to the page on the wiki that describes this serializer.voidSimilar toMechanic.use0(CastData)but instead of using this Mechanic's viewer targeter and viewer conditions, the mechanic is used for the given viewer.@NotNull Mechanicserialize(@NotNull me.deecaad.core.file.SerializeData data) Instantiates a new Object to be added into the finalized configuration.voidThis method should be overridden to define the behavior of the Mechanic.Methods inherited from class me.deecaad.core.mechanics.defaultmechanics.Mechanic
applyParentArgs, getChance, getConditions, getDelayBeforePlay, getRepeatAmount, getRepeatInterval, getTargeter, handleTargetersAndConditions, useMethods 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, getKeyword, shouldSerializeMethods inherited from interface org.bukkit.Keyed
keyMethods inherited from interface me.deecaad.core.file.Serializer
canUsePathTo, getName, getParentKeywords, letPassThrough, tryPathTo, useLater
-
Constructor Details
-
FireworkMechanic
public FireworkMechanic()Default constructor for serializer. -
FireworkMechanic
-
-
Method Details
-
getFireworkItem
public org.bukkit.inventory.ItemStack getFireworkItem() -
getFlightTime
public int getFlightTime() -
getViewers
-
getViewerConditions
- Specified by:
getViewerConditionsin classPlayerEffectMechanic
-
use0
Description copied from class:MechanicThis 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. -
getKey
@NotNull public @NotNull org.bukkit.NamespacedKey getKey() -
getWikiLink
Description copied from interface:SerializerReturns a link to the page on the wiki that describes this serializer. This method is called fromSerializeData, and is used to help the user find potential solutions to their problem.- Returns:
- The nullable link to the wiki.
-
serialize
@NotNull public @NotNull Mechanic serialize(@NotNull @NotNull me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException Description copied from interface:SerializerInstantiates a new Object to be added into the finalized configuration. The object should be built off ofSerializeData.getConfig(). If there is any misconfiguration (or any other issue preventing the construction of an object), then this method should throw aSerializerException. This method may not return null.- Parameters:
data- The non-null data containing config- Returns:
- The non-null serialized data.
- Throws:
me.deecaad.core.file.SerializerException- If there is an error in config.
-
playFor
Description copied from class:PlayerEffectMechanicSimilar toMechanic.use0(CastData)but instead of using this Mechanic's viewer targeter and viewer conditions, the mechanic is used for the given viewer.This is done to address a performance issue associated with having multiple per-player mechanics in the same list. See #311 for more info.
- Specified by:
playForin classPlayerEffectMechanic- Parameters:
cast- The source of the mechanic... who is casting.viewers- The target of the mechanic.
-
getViewerTargeter
- Specified by:
getViewerTargeterin classPlayerEffectMechanic
-