Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-58964

Nether portal destination cache is not validated before re-use

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • None
    • Minecraft 1.7.9, Minecraft 14w26b
    • None
    • Unconfirmed

      When a Nether portal is used by a player for the first time, it computes the ideal target coordinates in the other dimension and searches +/- 128 blocks from that point for an active portal to be the destination. This destination is then cached for up to 70 seconds (every 100 ticks, destinations for portals not used in the last 600 ticks are purged) so it can be re-used without re-running the search algorithm.

      However, when the source portal is found in the destination cache, the player is sent to the cached destination coordinates without any test to make sure that destination is still valid.

      This means that in multiplayer, a player can go through a portal, immediately deactivate it on the other side, and other players can still follow them through for the next 60 seconds and appear in the same place, even though there is no longer an active portal there.

      The same thing happens in single player if you have two or more portals in one dimension. If you teleport to one of them, disable it, return through the other, and teleport again within 60 seconds, you are sent to the location of the now-disabled portal.

      A simple fix would be to confirm that the destination retrieved from the cache still contains a portal block before accepting it for re-use, and if not, re-run the search algorithm and cache the new (valid) destination in place of the old (invalid) one.

            Unassigned Unassigned
            atfrase Alex Frase
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: