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

Deserialization of spawn egg itemstacks created in 1.12 throws an exception in 1.13

XMLWordPrintable

    • This server is running CraftBukkit version git-Spigot-a85f7ec-5870145 (MC: 1.13) (Implementing API version 1.13-R0.1-SNAPSHOT)

      Using Bukkit's serialization API in 1.12.2 for ItemStacks of spawn eggs results in an output that throws an exception when deserializing it in 1.13. The attached plugin serializes and deserializes your inventory (though /serialize and /deserialize, respectively), using Bukkit's YamlConfiguration API, which in turn uses the problematic serialization API. With some spawn eggs the deserialization ends up working besides the console spam, but with other eggs they may revert to a pig spawn egg, or fail to deserialize entirely, resulting in an empty ItemStack. This behavior seems to be consistent per spawn egg type (e.g. vindicator spawn eggs seem to always revert to pig spawn eggs).

       

      Here's the message that appears in console when attempting to deserialize a witch spawn egg (for example), including the stack trace: https://hastebin.com/iyatohesut.php

      Source of the attached plugin: https://gitlab.com/zombachu/Tester

       

      Steps to reproduce:

      1. Create a 1.12.2 server and install Tester.
      2. Start the server, log in, and put any spawn egg into your inventory.
      3. Run /serialize (alias: /s, permission node: tester.serialize). A file in the format <your uuid>.yml should be created in Tester's plugin directory containing your serialized inventory with item slot indexes as the key for each ItemStack.
      4. Shut the server down and install 1.13.
      5. Start the server, and log in, and clear your inventory.
      6. Run /deserialize (alias: /ds, permission node: tester.deserialize). Your inventory should be loaded from the saved file, but if any spawn eggs were present in your 1.12.2 inventory then the previously-described behavior will occur.

       

      Required statement: "PPS: Bug reports which do not 1) contain a declaration of testing in Vanilla and without plugins, or 2) in the case of plugin API bugs, contain a minimal reproduction case (source + jar please) will be closed. Bug reports must contain step by step instructions to reproduce the bug from a clean server install with no assumptions or prior knowledge. Also make sure you include the full output of /version in your report. Please copy and paste this statement to the bottom of your report to indicate that you have read and understood it."

            Unassigned Unassigned
            zombachu zombachu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: