Class InputReader

java.lang.Object
studio.magemonkey.genesis.managers.misc.InputReader

public class InputReader extends Object
  • Constructor Details

    • InputReader

      public InputReader()
  • Method Details

    • readString

      public static String readString(Object o, boolean lowercase)
      Get a string from an object
      Parameters:
      o - object to check
      lowercase - lowercase or not
      Returns:
      string
    • readStringList

      public static List<String> readStringList(Object o)
      Get a string list from an object
      Parameters:
      o - object to check
      Returns:
      string list
    • readStringListList

      public static List<List<String>> readStringListList(Object o)
      Get a list of string list from an object
      Parameters:
      o - object to check
      Returns:
      list of string list
    • readItemList

      public static List<org.bukkit.inventory.ItemStack> readItemList(Object o, boolean finalVersion)
      Get list of ItemStacks from object
      Parameters:
      o - object to check
      finalVersion - final version or not
      Returns:
      list of ItemStacks
    • readItem

      public static org.bukkit.inventory.ItemStack readItem(Object o, boolean finalVersion)
      Get itemstack from object
      Parameters:
      o - object to check
      finalVersion - final version or not
      Returns:
      itemstack
    • readEnchant

      public static Enchant readEnchant(Object o)
      Get enchant from an object
      Parameters:
      o - object to check
      Returns:
      enchant
    • readEnchantment

      public static org.bukkit.enchantments.Enchantment readEnchantment(String name)
      Get enchant by name
      Parameters:
      name - name of enchant
      Returns:
      enchant
    • getBoolean

      public static boolean getBoolean(String s, boolean def)
      Get boolean from string
      Parameters:
      s - string to get from
      def - default value
      Returns:
      boolean
    • getDouble

      public static double getDouble(Object o, double exception)
      Get a double from an object
      Parameters:
      o - objecct to get from
      exception - exception
      Returns:
      double
    • isInt

      public static boolean isInt(String s)
    • getInt

      public static int getInt(Object o, int exception)
      Get an int from an object
      Parameters:
      o - object to get from
      exception - exception
      Returns:
      int
    • readTimedCommands

      public static HashMap<Integer,String> readTimedCommands(Object o)
      Get timed commands from an object
      Parameters:
      o - object to check
      Returns:
      timed commands
    • readMaterial

      public static org.bukkit.Material readMaterial(String s)
      Read material from string
      Parameters:
      s - string to check
      Returns:
      material
    • readEntityType

      public static org.bukkit.entity.EntityType readEntityType(String s)
      Read entity type from string
      Parameters:
      s - string to check
      Returns:
      entity type
    • readChatComponent

      @Nullable public static net.md_5.bungee.api.chat.BaseComponent readChatComponent(String rawJson)
      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 TextComponent will be returned, with the components in the String attached as extras. Null if a JsonParseException is caught in the process.