Class Cycle
java.lang.Object
ua.mcchickenstudio.opencreative.coding.blocks.executors.Executor
ua.mcchickenstudio.opencreative.coding.blocks.executors.other.NameableExecutor
ua.mcchickenstudio.opencreative.coding.blocks.executors.other.Cycle
- All Implemented Interfaces:
CodingBlock, ExtensionContent
Cycle
This class represents cycle, that executes actions after passing a time, like timer.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull StringReturns description of extension content.@NotNull StringReturns lower-cased simple id of extension.@NotNull StringgetName()Returns name of extension content.booleanvoidrun(@NotNull WorldEvent event) Checks executor, executes actions and sends information about executor.voidsetRepeatTime(int repeatTime) voidstop()Methods inherited from class NameableExecutor
getCallName, setCallNameModifier and TypeMethodDescriptionfinal @NotNull StringReturns name of executor for calling it.voidsetCallName(@NotNull String name) Sets name of executor for calling it.Methods inherited from class Executor
decreaseCall, equals, executeActions, getActions, getBlockCategory, getEvent, getHandler, getID, getLastCalls, getLocaleName, getPlanet, getX, getY, getZ, hashCode, increaseCall, init, isDebug, isDisabled, setActions, setDebug, toStringModifier and TypeMethodDescriptionfinal voidDecreases calls amount by 1.final booleanprotected voidexecuteActions(@NotNull WorldEvent event) Executes all actions with specified event.final @NotNull ExecutorCategoryReturns coding block category of this executor.final WorldEventgetEvent()Returns last world event of executor.final ActionsHandlerfinal @NotNull StringgetID()Returns id of executor, that will be used to find it in registry.final intReturns how many times executor was called to execute actions.final @NotNull StringReturns localized name of executor.final @NotNull PlanetReturns planet, that was associated with executor.final intgetX()Returns X coordinate of coding block's location.final intgetY()Returns Y coordinate of coding block's location.final intgetZ()Returns Z coordinate of coding block's location.final inthashCode()final voidIncreases calls amount by 1.voidInitializes an executor and sets planet and coding block location.final booleanisDebug()Checks whether is executor block marked for debugging.final booleanChecks whether executor is disabled and cannot be called.final voidsetActions(@NotNull List<Action> actions) Sets actions list for executor.final voidsetDebug(boolean debug) Enables or disables sending debug logs about executor and actions inside.toString()
-
Constructor Details
-
Cycle
public Cycle()
-
-
Method Details
-
setRepeatTime
public void setRepeatTime(int repeatTime) -
run
Description copied from class:ExecutorChecks executor, executes actions and sends information about executor. -
stop
public void stop() -
isEnabled
public boolean isEnabled() -
getName
Description copied from interface:ExtensionContentReturns name of extension content. Will be displayed in list of extension content.- Returns:
- name of content.
-
getExtensionId
Description copied from interface:ExtensionContentReturns lower-cased simple id of extension. Will be used to identify author of content.ID "default" is reserved for OpenCreative+ developers.
- Returns:
- id of extension.
-
getDescription
Description copied from interface:ExtensionContentReturns description of extension content. Describes purpose of new additional content.- Returns:
- description of content.
-