Package io.github.apfelcreme.Pipes.Pipe
Class AbstractPipePart.Option<T>
java.lang.Object
io.github.apfelcreme.Pipes.Pipe.AbstractPipePart.Option<T>
- Enclosing class:
- AbstractPipePart
-
Method Summary
Modifier and TypeMethodDescriptionGet the default value for this option if it isn't setde.themoep.inventorygui.GuiStateElement
getElement
(org.bukkit.command.CommandSender player, AbstractPipePart pipePart) Get the GUI element of this option for a certain pipe partio.github.apfelcreme.Pipes.Pipe.AbstractPipePart.Option.GuiPosition
Get the position where to display this option in the GUIGet the array of possible values<Z> org.bukkit.persistence.PersistentDataType<Z,
T> Get the persistent data type of the optionClass<?>
Get the class of the values that this option acceptsboolean
isValid
(AbstractPipePart.Value<?> value) Check whether or not this option can be set to a valuename()
parseValue
(Object object) Parse the value for this option from an objectvoid
set
(org.bukkit.persistence.PersistentDataContainer container, AbstractPipePart.Value<T> value) Set the value in a specific containervoid
store
(AbstractPipePart pipePart, org.bukkit.persistence.PersistentDataContainer container) Store the value of an option of a certain PipePart to a PersistentDataContinerGet the enum name as a lowercase string with underscores replaced with dashes
-
Method Details
-
name
-
getValueType
Get the class of the values that this option accepts- Returns:
- The class of the values that this option accepts
-
getDefaultValue
Get the default value for this option if it isn't set- Returns:
- The default value of this option
-
getPossibleValues
Get the array of possible values- Returns:
- The array of possible values
-
getTagType
Get the persistent data type of the option- Type Parameters:
Z
- The primitive value for NBT- Returns:
- The persistent data type
-
toConfigKey
Get the enum name as a lowercase string with underscores replaced with dashes- Returns:
- The enum name as a config key
-
isValid
Check whether or not this option can be set to a value- Parameters:
value
- The value to check- Returns:
true
if this option accepts it;false
otherwhise
-
getElement
public de.themoep.inventorygui.GuiStateElement getElement(org.bukkit.command.CommandSender player, AbstractPipePart pipePart) Get the GUI element of this option for a certain pipe part- Parameters:
player
- The player viewing the GUIpipePart
- The pipe part to get the element for- Returns:
- The GuiStateElement of this option
-
getGuiPosition
public io.github.apfelcreme.Pipes.Pipe.AbstractPipePart.Option.GuiPosition getGuiPosition()Get the position where to display this option in the GUI- Returns:
- The position to display this option in the GUI in
-
store
public void store(AbstractPipePart pipePart, org.bukkit.persistence.PersistentDataContainer container) Store the value of an option of a certain PipePart to a PersistentDataContiner- Parameters:
pipePart
- The PipePart to store the option value fromcontainer
- The container to store the option value to
-
set
public void set(org.bukkit.persistence.PersistentDataContainer container, AbstractPipePart.Value<T> value) Set the value in a specific container- Parameters:
container
- The container to store the option value tovalue
- The value to store
-
parseValue
Parse the value for this option from an object- Parameters:
object
- The object to parse the value from- Returns:
- The parsed Value
- Throws:
IllegalArgumentException
- thrown if the object can't be parsed
-