ToolPack - 1.8 1.4.1.1

ToolPack with different functions

  1. Juyas
    Tested Minecraft Versions:
    • 1.8
    INFO: ToolPack won't get any further updates!
    Because its old and should be deprecated!


    ToolPack with many tools for different usage.
    For developers.

    Just put it into build path and later as plugin for the server.
    Your plugin need a "depend: [BukkitToolPack]" in its plugin.yml to prevent bugs.

    If you have created a plugin with this package, tell me or send me a link, I would like to see it and I can show you options, you might not know :D

    --------------------------------------------------------------------------------------------
    PAY ATTENTION: older versions (before 1.3) may not work with the actual version!
    --------------------------------------------------------------------------------------------

    old and deprecated:
    • MiniPlayerTools (static access) // replaced with PlayerTools
    • FileManager (static access) (pre alpha) // replaced with (new) FileManager
    • ConvertObjects (static access) (pre alpha) // replaced with ObjectConverter

    normal access Tools:
    • ConfigEditor (beta)
    • PreJoinListener (add as Listener for simple usage playerPreJoin-actions)
    • ChatRecognizer (add as Listener for simple keyword recognizing)
    • ChatModifier (add as Listener for simple modifiing chat)
    static access Tools:
    • StaticConfigEditor (alpha)
    • ResourceLoader (alpha)
    instance access Tools:
    • FileManager (manage textfiles)
    • PlayerTools (advanced player functions)
    • ObjectConverter (easy converting object to another type)
    • DataSafe (pre alpha)
    • EssentialsTools (pre alpha)
    APIs:
    • JConomy (static access API) (alpha)
    • ClickInventoryAPI (static access API) (pre alpha)
    soon:
    • DBEditor

    information about instance access:
    Tools with instance access doesn't have a visible constructor, so you can't go this:
    Code (Text):
    ToolClass tool = new ToolClass();
    Every instance access tool has a static method called "instance()" or "getInstance()" instead of a usable constructor.

    Using tools with instance access:
    Code (Text):
    //for example: ObjectConverter

    ObjectConverter convert = ObjectConvert.instance();
    // then your code with convert.
    // for example:

    String[] array = new String[] { "Item1", "Item2", "Item3 };
    String randomItem = (String) convert.randomItem(array);

    functions and usage of the tools:
    v1.0.0.0 (alpha)

    instance access:
    • void chatAsPlayer(Player p, String message)
    • boolean executeCommandAsPlayer(Player p, String command)
    • void openPlayersInventoryToOtherPlayer(Player player, Player otherPlayer)
    • void sendMessageWithHint(Player p, String message, String hint)
    • void sendMessageWithHint(Player p, String premessage, String message, String hint)
    • void sendMessageWithHintAndCommand(Player p, String message, String hint, String command)
    • void sendMessageWithHintAndCommand(Player p, String preMessage, String message, String hint, String command)
    v0.1.0.0 (alpha)

    instance access:
    • List<String> getLinesOfTextFile(String path)
    • List<String> getLinesOfTextFile(InputStream is)
    • boolean writeLinesToTextFile(List<String> lines, String path)
    v1.0.0 (alpha)

    instance access:
    • Player[] playerCollectionToArray(Collection<? extends Player> col)
    • Object[] collectionToArray(Collection<?> col)
    • String[] string_listToArray(List<String> list)
    • List<String> string_arrayToList(String[] array)
    • Object[] addObjectToArray(Object o, Object[] array)
    • Object[] shuffleArray(Object[] array)
    • Object randomItem(Vector<Object> array)
    • Object randomItem(Object[] array)
    • Object[] exchange(Object[] array, int p1, int p2)
    • Comparable<Object>[] sortArray(Comparable<Object>[] array)
    • Object[] removeIndexFromArray(Object[] array, int index)
    • boolean containsArrayObject(Object[] array, Object o)
    • Object[] removeObjectFromArray(Object[] array, Object o)
    • int indexOfObject(Object[] array, Object o)
    v1.5.3.2

    constructors:
    • ConfigEditor(String path, boolean createIfNotExisting)
    • ConfigEditor(String path)
    functions:
    • void resetPath(String neuerPfad)
    • int load()
    • void createNewConfig()
    • int save()
    • boolean usable()
    • void set(String path, Object value)
    • void set(String path, Location loc, boolean saveWorld, boolean saveView)
    • ValueType getType(String path)
    • boolean contains(String path)
    • Object get(String path)
    • String getString(String path)
    • int getInt(String path)
    • double getDouble(String path)
    • float getFloat(String path)
    • long getLong(String path)
    • boolean getBoolean(String path)
    • UUID getUUID(String path)
    • List<String> getStringList(String path)
    • ItemStack getItemStack(String path)
    • OfflinePlayer getOfflinePlayer(String path)
    • Location getLocation(String path)
    • YamlConfiguration getRawConfigData() //deprecated
    usage:

    loading:

    1. ConfigEditor config = new ConfigEditor(path, true);
    2. config.load();
    3. now its your turn
    saving:
    1. config.save();
    2. thats all :D
    v0.1.0.6 (pre alpha)

    constructors:
    • ChatRecognizer(EventMethod eventMethod, String[] keyWords, int sensitivityLevel)
    • ChatRecognizer(EventMethod eventMethod, String[] keyWords)
    • ChatRecognizer(String[] keyWords)
    (sensitivityLevel: min: 1; max: 4; higher --> more precise)

    functions:

    • void setUseEvent(boolean useEvent)
    • boolean usingEvent()
    • boolean canWork()
    (using the Event is still not recommended)
    v0.1.0.5 (pre alpha)

    constructors:
    • ChatModifier(ChatFormat format)
    • ChatModifier(ChatFormat format, String playerPermission)
    ChatFormat:

    functions:
    • void setUp(String format, boolean replaceColors)
    • void setColorCodeCharacter(char cc)
    • void setGroupName(String name)
    • void setPrefix(String pre)
    • void setLookUpForEssentials(boolean b)
    • String message(String message, Player p) (format a message by settings)
    usage:
    1. new ChatFormat object
    2. setColorCodeCharacter(char char_for_color_codes) //standard: '&'
    3. setUp(format, if_you_want_to_use_color_codes) //the replacements for the specific values are constants in ChatFormat, see "constants"
    4. optional: setGroupName(name) & setPrefix(prefix)
    5. new ChatModifier(chatFormatObject)
    6. getServer().getPluginManager().registerEvents(chatModifierObject, plugin)
    if you want to use it with essentials:

    Important: remove EssentialsChat from your plugin folder
    1. new ChatFormat object
    2. setColorCodeCharacter(char char_for_color_codes) //standard: '&'
    3. setUp(format, if_you_want_to_use_color_codes) //the replacements for the specific values are constants in ChatFormat, see "constants"
    4. setLookUpForEssentials(true)
    5. use "essentialsNameReplacement" instead of "playerDisplayNameReplacement" or "playerNameReplacement"
    v0.1.1.2

    // since 1.3: moved to another path

    constructor:
    • PreJoinListener(EventMethod eventMethod)

    functions:
    • void setMessageforKicking(String message)
    • void setGeneralResult(Result result)
    • void setSuccessResult(Result result)
    • void enableWhiteList(String[] playerNameList)
    • void disableWhiteList()
    • boolean canWork()
    usage:
    1. new EventMethod
    2. new PreJoinListener(eventMethodObject)
    3. setMessageForKicking(message) //mustn't be null!
    4. setGeneralResult(result) //eventMethod returns false
    5. setSuccessResult(result) //eventMethod returns true
    6. optional: enableWhitelist(playerNames_in_array)
    7. getServer().getPluginManager().registerEvents(preJoinListenerObject, plugin)
    whitelist handling:
    if (the player is not listed) ---> generalResult
    if (the player is listed) ---> eventMethod ---> result
    v0.1.0.0 (pre alpha)

    static functions:
    • YamlConfiguration getConfig(String path)
    • YamlConfiguration getConfig(InputStream is)
    • boolean createConfigIfNotExisting(String path)
    • boolean setValue(String file, String path, Object value)
    • Object getValue(String file, String path)
    • boolean contains(String file, String path)
    • ValueType getType(String file, String path)
    • List<?> getList(String file, String path)
    • Location getLocation(File file, String path)
    • int getInt(File file, String path)
    • String getString(File file, String path)
    • double getDouble(File file, String path)
    • float getFloat(File file, String path)
    • long getLong(File file, String path)
    • Color getColor(File file, String path)
    • ItemStack getItemStack(File file, String path)
    • OfflinePlayer getOfflinePlayer(File file, String path)
    • boolean getBoolean(File file, String path)
    • List<String> getStringList(File file, String path)
    • List<Byte> getByteList(File file, String path)
    • List<Character> getCharacterList(File file, String path)
    • List<Integer> getIntegerList(File file, String path)
    • List<Float> getFloatList(File file, String path)
    • List<Double> getDoubleList(File file, String path)
    • List<Boolean> getBooleanList(File file, String path)
    v1.0.0.0 (alpha)

    functions:
    • boolean setUp()
    • boolean hasPlayerWallet(OfflinePlayer player)
    • void addPlayerWallet(OfflinePlayer player)
    • void addPlayerBank(OfflinePlayer player)
    • boolean hasPlayerBank(OfflinePlayer player)
    • int depositToPlayer(OfflinePlayer player, double amount, boolean bank)
    • double balanceOfPlayer(OfflinePlayer player, boolean bank)
    • int getFromPlayer(OfflinePlayer player, double amount, boolean bank)
    • String getMoneyName()
    • void setMoneyName(String name)
    • String format(double d)
    • double getBankZins() // means bank interest
    additional classes:
    • JConomyListener (for automatic bank and wallet account generating)
    • JConomySheduler (for bank interest, add as Runnable in a Sheduler)
    • MoneyKind (soon as support for more than one currency)
    events:
    • if you use the methods "depositToPlayer" or "getFromPlayer", JConomy will call an BalanceChangedEvent
    • if your using the JConomySheduler, it will call an BankInterestEvent, when it had given money to online players as interest.
    usage:
    1. setUp() //to check for errors and repair them
    2. optional: add JConomyListener:
      Code (Text):
      getServer().getPluginManager().registerEvents(new JConomyListener(), this);
    3. optional: add JConomySheduler:
      Code (Text):
      int scheduler = getServer().getScheduler().scheduleSyncRepeatingTask(this, new JConomySheduler(), 0, 1200);
    4. then: you can do your stuff...
    version: 0.1.0.0 (pre alpha)

    // since 1.3: moved to another path

    soon...
    version: 0.1.0.0 (pre alpha)

    functions:
    • static DataSafe instance() // important
    • boolean hasValue(String name)
    • boolean addValue(Value<?> var)
    • Value<?> getValue(String name)
    • boolean removeValue(Plugin p, String name)
    usage:
    1. adding value:
      Code (Java):
      DataSafe safe = DataSafe.instance();
      StringValue s = new StringValue(plugin, "valueName", "The value!"); //the "plugin" is your plugin, could be "this in main class
      boolean done = safe.addValue(s);
    2. checking for value:
      Code (Java):
      DataSafe safe = DataSafe.instance();
      boolean exists = safe.hasValue("nameOfTheValue");
    3. resetting value:
      Code (Java):
      DataSafe safe = DataSafe.instance();
      StringValue s = (StringValue) safe.getValue("nameOfTheValue");
      s.setValue(plugin, "newValue");
    4. removing value:
      Code (Java):
      DataSafe safe = DataSafe.instance();
      boolean done = safe.removeValue(plugin, "nameOfTheValue");
    available value formats:
    • StringValue
    • IntegerValue
    • DoubleValue
    • FloatValue
    • LocationValue
    value functions:
    • Type getType()
    • String getName()
    • Plugin getCreator()
    • Plugin getLastEditor()
    • T getValue() // T is a replacement for the type you have chosen
    • void setValue(Plugin p, T value) // T is a replacement for the type you have chosen

    soon...


    Many classes have a "version" constant with their actual version.

    ChatFormat
    • .groupReplacement
    • .playerNameReplacement
    • .playerDisplayNameReplacement
    • .messageReplacement
    • .prefixReplacement
    • .essentialsNameReplacement
    StaticConfigEditor (default values for return)
    • def_int
    • def_float
    • def_double
    • def_long

    If there are any problems, report them to me.
    If you have any ideas for my tool-pack or for a new plugin/plugin-api/tool-pack, tell me. (in english or in german)
    Please rate, if you enjoy.


    Some functions (MiniPlayerTools) are only compatible with spigot version 1.8.3 but most are compatible with all versions of spigot and bukkit.

    Vote:
    Which one would you like to get first?

    1. ArenaSystemApi (simplifying arena-based minigame creation)
    2. ClickInventoryApi (simplifying click-inventory creation)

    please tell me your choice by writing a comment or sending an E-Mail.

    Coming soon:
    - ArenaSystemApi
    - ClickInventoryApi

    - Scoreboarder (later)

    if you have any idea, please tell me.
    TheNeXXus likes this.

Recent Updates

  1. Update Checker added
  2. More functions and fixes
  3. NEW SYSTEM!

Recent Reviews

  1. xXkguyXx
    xXkguyXx
    5/5,
    Version: 1.2.2.0
    Thanks :D Amazing Update, Fast and your amazing! Please make more amazing plugins and keep up the amazing work :D, Question how would i use the new ChatModifer to Modify chat? TY
    1. Juyas
      Author's Response
      the usage is described in the ChatModifier spoiler. I think its quite easy :D
      If there are bug, tell me. Note: this is compiled with the lastest version of essentials and spigot 1.8.7
  2. xXkguyXx
    xXkguyXx
    5/5,
    Version: 1.2.1.0 - fixed
    Seems nice, this might seem hard but can you add it so it supports essentials?, so I want is so that in your pack, if the chat modified if used, essentials would pick up prefixes and suffix's ty :D
    1. Juyas
      Author's Response
      I will try :D