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

Tile data not cleaned up when replacing various blocks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • Spigot 1.8, bug is new and was not present in the builds available at the end of December 2014

      This may effect any block with an inventory or tile data, my users have reported it with enchanting tables, signs, and other blocks. But in my test case I used a furnace and I can verify it occurs with that block.

      Basically if your plugin replaces a furnace with, say, a chest, and fills the inventory of the chest, the chest will then be empty and you may (but will not always) get this on the server console:

      [Server thread/ERROR]: Block at 10,008,134,9,945 is CHEST but has net.minecraft.server.v1_8_R1.TileEntityFurnace@3224f772. Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.

      I am not sure the exact build where this started, however I can confirm it does not happen with:
      git-Spigot-"606148f" (MC: 1.8) (Implementing API version 1.8-R0.1-SNAPSHOT)

      but it does happen with:
      git-Spigot-35348a5-e
      e6d0fa (MC: 1.8) (Implementing API version 1.8-R0.1-SNAPSHOT)

      The code I am using to replace the block is similar to:
      w.getBlockAt(x, y, z).setType(org.bukkit.Material.CHEST);
      and then filling it with:
      InventoryHolder inventoryHolder = ( InventoryHolder ) w.getBlockAt( l.getX(), l.getY(), l.getZ() ).getState();
      inventoryHolder.getInventory().setContents( invData.getInvetory() );

      Where x,y,z refers to a block that is a furnace.

            Unassigned Unassigned
            baccayarro Mark Summers
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: