Class InputReader
java.lang.Object
studio.magemonkey.genesis.managers.misc.InputReader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleangetBoolean(String s, boolean def) Get boolean from stringstatic doubleGet a double from an objectstatic intGet an int from an objectstatic booleanstatic net.md_5.bungee.api.chat.BaseComponentreadChatComponent(String rawJson) Reads a ChatComponent from its raw json string.static EnchantGet enchant from an objectstatic org.bukkit.enchantments.EnchantmentreadEnchantment(String name) Get enchant by namestatic org.bukkit.entity.EntityTypeRead entity type from stringstatic org.bukkit.inventory.ItemStackGet itemstack from objectstatic List<org.bukkit.inventory.ItemStack> readItemList(Object o, boolean finalVersion) Get list of ItemStacks from objectstatic org.bukkit.MaterialRead material from stringstatic StringreadString(Object o, boolean lowercase) Get a string from an objectGet a string list from an objectGet a list of string list from an objectGet timed commands from an object
-
Constructor Details
-
InputReader
public InputReader()
-
-
Method Details
-
readString
Get a string from an object- Parameters:
o- object to checklowercase- lowercase or not- Returns:
- string
-
readStringList
Get a string list from an object- Parameters:
o- object to check- Returns:
- string list
-
readStringListList
Get a list of string list from an object- Parameters:
o- object to check- Returns:
- list of string list
-
readItemList
Get list of ItemStacks from object- Parameters:
o- object to checkfinalVersion- final version or not- Returns:
- list of ItemStacks
-
readItem
Get itemstack from object- Parameters:
o- object to checkfinalVersion- final version or not- Returns:
- itemstack
-
readEnchant
Get enchant from an object- Parameters:
o- object to check- Returns:
- enchant
-
readEnchantment
Get enchant by name- Parameters:
name- name of enchant- Returns:
- enchant
-
getBoolean
Get boolean from string- Parameters:
s- string to get fromdef- default value- Returns:
- boolean
-
getDouble
Get a double from an object- Parameters:
o- objecct to get fromexception- exception- Returns:
- double
-
isInt
-
getInt
Get an int from an object- Parameters:
o- object to get fromexception- exception- Returns:
- int
-
readTimedCommands
Get timed commands from an object- Parameters:
o- object to check- Returns:
- timed commands
-
readMaterial
Read material from string- Parameters:
s- string to check- Returns:
- material
-
readEntityType
Read entity type from string- Parameters:
s- string to check- Returns:
- entity type
-
readChatComponent
Reads a ChatComponent from its raw json string.- Parameters:
rawJson- JSON String containing the chat components, may be a single component or an array of components- Returns:
- a single BaseComponent. If the provided JSON String is an array,
a single
TextComponentwill be returned, with the components in the String attached as extras. Null if aJsonParseExceptionis caught in the process.
-