Class BlockMechanic
java.lang.Object
studio.magemonkey.fabled.dynamic.EffectComponent
studio.magemonkey.fabled.dynamic.mechanic.MechanicComponent
studio.magemonkey.fabled.dynamic.mechanic.BlockMechanic
Mechanic that changes blocks for a duration before
returning them to what they were
-
Field Summary
Fields inherited from class studio.magemonkey.fabled.dynamic.EffectComponent
children, preview, settings, skill
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doCleanUp
(org.bukkit.entity.LivingEntity caster) boolean
execute
(org.bukkit.entity.LivingEntity caster, int level, List<org.bukkit.entity.LivingEntity> targets, boolean force) Executes the component (to be implemented)getKey()
static boolean
isPending
(org.bukkit.Location loc) Checks whether the location is modified by a block mechanicvoid
playPreview
(List<Runnable> onPreviewStop, org.bukkit.entity.Player caster, int level, Supplier<List<org.bukkit.entity.LivingEntity>> targetSupplier) Starts the component's preview effects.Methods inherited from class studio.magemonkey.fabled.dynamic.mechanic.MechanicComponent
getType
Methods inherited from class studio.magemonkey.fabled.dynamic.EffectComponent
cleanUp, execute, executeChildren, filter, getInstanceKey, getNum, getSettings, getSkillData, isPreviewEnabled, lastPassed, load, parseValues, playChildrenPreviews, save
-
Constructor Details
-
BlockMechanic
public BlockMechanic()
-
-
Method Details
-
isPending
public static boolean isPending(org.bukkit.Location loc) Checks whether the location is modified by a block mechanic- Parameters:
loc
- location to check- Returns:
- true if modified, false otherwise
-
getKey
- Specified by:
getKey
in classEffectComponent
-
doCleanUp
protected void doCleanUp(org.bukkit.entity.LivingEntity caster) - Overrides:
doCleanUp
in classEffectComponent
-
execute
public boolean execute(org.bukkit.entity.LivingEntity caster, int level, List<org.bukkit.entity.LivingEntity> targets, boolean force) Description copied from class:EffectComponent
Executes the component (to be implemented)- Specified by:
execute
in classEffectComponent
- Parameters:
caster
- caster of the skilllevel
- level of the skilltargets
- targets to execute onforce
- whether skill should be forced- Returns:
- true if executed, false if conditions not met
-
playPreview
public void playPreview(List<Runnable> onPreviewStop, org.bukkit.entity.Player caster, int level, Supplier<List<org.bukkit.entity.LivingEntity>> targetSupplier) Description copied from class:EffectComponent
Starts the component's preview effects. Removal of any registered listeners, tasks, entities, or other temporary effects should be included in aRunnable
added to the providedList
.- Overrides:
playPreview
in classEffectComponent
- Parameters:
onPreviewStop
-List
ofRunnable
s to add tocaster
- caster referencelevel
- the level of the skill to preview fortargetSupplier
- targets to preview on
-