The New Item Library 0.1.2.0

An item serialize, and utility library.

  1. creatorfromhell
    Native Minecraft Version:
    1.13
    Tested Minecraft Versions:
    • 1.13
    Source Code:
    https://github.com/TheNewEconomy/TheNewItemLibrary
    About
    The New Item Library is an item library that allows for easy serialization, and deserialization of items(enchanted, potions, books, shulker boxes of potions, etc). It also provides a calculations class that may be used to count, add, and remove items from a library, with plans for expanding the utility classes with future releases.


    How To Use
    In order to use this library, you must first download the library and add it as a dependency to your project. After that please use the example code below on how to use it, or if you'd like to visually learn, check out the source code to the project
    here.

    Code (Java):

        //First we setup our itemstack.
        ItemStack stack = new ItemStack(Material.DIAMOND_SWORD);
        ItemMeta meta = stack.getItemMeta();
        meta.setDisplayName(ChatColor.GOLD + "Non-Epic Sword");
        stack.addEnchantment(Enchantment.FIRE_ASPECT, 2);
        stack.addEnchantment(Enchantment.KNOCKBACK, 2);
        stack.addEnchantment(Enchantment.DAMAGE_ALL, 5);

        //Now we Serialize our ItemStack.
        final String serialized = new SerialItem(stack).serialize();
        System.out.println(serialized);

        //Now we unserialize it.
        try {
          stack = SerialItem.unserialize(serialized).getStack();
        } catch(ParseException ignore) {
          //Invalid JSON String
        }

        //Now we re-serialize for our sanity check.
        final String reserialized = new SerialItem(stack).serialize();
        System.out.println(reserialized);


    MAVEN
    The New Item Library also supports maven. In order to use it with your maven project use the following information:


    Code (YAML):
    <repositories>
          <repository>
              <id>tne-repo</id>
              <url>https://dl.bintray.com/theneweconomy/java/</url>
          </repository>
      </repositories>

        <dependencies>
          <dependency>
              <groupId>net.tnemc</groupId>
              <artifactId>TheNewItemLibrary</artifactId>
              <version>0.1.2.0</version>
          </dependency>
      </dependencies>

    Known Caveats
    This is a list of known caveats:


    Support
    For support choose one of the following.


    Team

    • creatorfromhell
    Contribute
    To contribute to The New Economy you may fork our Github Repository, and make a Pull Request. The repository is located at: https://github.com/TheNewEconomy/TheNewItemLibrary.

Recent Updates

  1. 1.14 Items