[API] PlayerSave 1.1.2

Map attributes to players and retain that data on next login!

  1. Qatell
    Description
    Take out all the hassle with creating a database or configuration file for each plugin you make! Let my plugin do the work for you. Carefully crafted, my plugin will enable you to easily implement editing and saving custom variables associated with a player.​

    Examples

    Editing kills/deaths
    Code (Text):
        @EventHandler
        public void event(PlayerDeathEvent event) {
            Player player = event.getEntity();
            Player killer = player.getKiller();
            PlayerSave playerSave = JavaPlugin.getPlugin(PlayerSave.class);
            playerSave.data(player).getInt("deaths").add(1);
            if (killer != null) {
                playerSave.data(killer).getInt("kills").add(1);
            }
        }
    In the above example you can see we're adding kills and deaths to the players. It's this simple to use, and don't worry, it can even handle some of the more complex things you may need.

    Information
    The plugin loads data before the player is able to log in, but it should never cause a player to timeout. Once a player logs out the plugin will keep the information in memory for a minute before it saves it to disk. It will not save it to disk unless the player logs out, so if the server crashes any information from login will be lost. Although dependant plugins have an option to manually save if they so wish.

    All data is stored inside the plugin folder and is compressed using Gzip to conserve space. The files names are based on a players UUID, exactly how Minecraft handles their saves.

    The download comes bundled with the Javadoc.​

    Plugins that use this API

    (Message me to be added to this list)​

    Donations
    I enjoy programming, and working for Minecraft. I however have a family to think about, so I cannot do this much unless I am earning from it. If you like what I'm doing, you can donate to my Paypal or Skrill. My email is [email protected]
    [​IMG][​IMG]