Snapshot tile entities can end up with a non-null world

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None
    • None
    • This server is running CraftBukkit version git-Spigot-935adb3-bf0ea33 (MC: 1.14.3) (Implementing API version 1.14.3-R0.1-SNAPSHOT)
    • Yes

      I hadn't yet the time to actually look into this in detail. This is just a quick write-down to document this potential issue.

       

      Originally all snapshots were created with null as world. This was used to differentiate whether the TileEntity is 'virtual' / a snapshot, or actually placed in the world. For some reason the tile entity snapshots for blocks are being created with a world since somewhere in 1.13: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/421c1728c81e2f729dff88da2ac96535d2b8e5e8#src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java . And they can also end up with a world assigned if their snapshot inventory is attempted to be opened via CraftHumanEntity#openInventory or before already when accessing the snapshot inventory of a furnace (see https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/3599dbe3c27ad950700b9a76d198951e15f882ba#src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java). If I remember correctly, the intend there has been to allow custom-created furnace inventories to 'work' to some degree when opened for a player.

      This however poses the issue that in various circumstances changes to these tile entity snapshots (as part of BlockState snapshots) trigger updates in the world, which they should not actually do.

       

      Maybe it might make sense to exempt these snapshot tile entities from certain API (like opening their inventories to players), or (maybe preferably if there are no issues with opening snapshot inventories per-se) remove some expectations (like that furnace snapshot inventories are working like normal furnaces when opened to a player).

            Assignee:
            Unassigned
            Reporter:
            blablubbabc
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: