Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-921

ItemStack serialization and deserialization

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Will not matter, since it is a code error.

      Serialization of ItemStack works perfectly with gjson, {"type":"DIAMOND_SWORD","meta":{"enchantments":

      {"Enchantment[16, DAMAGE_ALL]":5}

      ,"repairCost":0,"hideFlag":0,"unhandledTags":{}}}

      But deserialization do not work. But it worked in 1.7.9. I guess its becuse of this change.

      ItemStack.java
      Object raw = args.get("meta");
                  if (raw instanceof ItemMeta) {
                      result.setItemMeta((ItemMeta) raw);
                  }
      

      Theres no code to check for HashMap and convert it into ItemMeta. In a later version of spigot, version 1.7.9 there was code for this.

            Unassigned Unassigned
            The_Defman Jacob Emil Ulvedal Rosborg
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: