Class Experiment
java.lang.Object
ua.mcchickenstudio.opencreative.commands.experiments.Experiment
- Direct Known Subclasses:
CodeDownloaderExperiment, TestificationExperiment, WandersExperiment, WorldDownloaderExperiment
Experiment
Represents an experimental feature, that can be enabled in settings for testing new content.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract @NotNull StringReturns description of experiment, that will tell purpose of experiment and describes what it adds.abstract @NotNull StringgetId()Returns id of experiment.abstract @NotNull StringgetName()Returns name of experiment, that will be used for displaying in experiments list.abstract voidhandleCommand(@NotNull org.bukkit.command.CommandSender sender, @NotNull String[] args) Handles command for experiment.inthashCode()booleanChecks whether experiment is enabled or not.voidExecutes disable operations for experiment.voidonEnable()Executes enable operations for experiment.voidsetEnabled(boolean enabled) Sets enabled state of experiment.tabCommand(@NotNull org.bukkit.command.CommandSender sender, @NotNull String[] args) Returns list of command suggestions for experiment.toString()
-
Constructor Details
-
Experiment
public Experiment()
-
-
Method Details
-
getId
Returns id of experiment.- Returns:
- short id of experiment that will be used in settings.
It must be lower-snake-cased, for example: "future_update", "code_downloader".
-
getName
Returns name of experiment, that will be used for displaying in experiments list.- Returns:
- name of experiment.
-
getDescription
Returns description of experiment, that will tell purpose of experiment and describes what it adds.- Returns:
- description of content in experiment.
-
handleCommand
public abstract void handleCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String[] args) Handles command for experiment.- Parameters:
sender- sender of command.args- arguments of command.
-
tabCommand
@Nullable public abstract @Nullable List<String> tabCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull String[] args) Returns list of command suggestions for experiment.- Parameters:
sender- sender of command.args- arguments of command.- Returns:
- list of command suggestions.
-
onEnable
public void onEnable()Executes enable operations for experiment. -
onDisable
public void onDisable()Executes disable operations for experiment. -
isEnabled
public boolean isEnabled()Checks whether experiment is enabled or not.- Returns:
- true - enabled, false - disabled.
-
setEnabled
public void setEnabled(boolean enabled) Sets enabled state of experiment.- Parameters:
enabled- true - enabled, false - disabled.
-
toString
-
hashCode
-