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

Crash at Player Portal Tp when portal creation is cancelled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • 17d78db-a339310
    • Yes

      Just updated from 1.16.1 to 1.16.3 and this issue appeared.

       

      I have attached a test plugin to make it easier to test.

      Steps to reproduce:

      1. Create a Nether Portal
      2. Go into the portal
      3. Cancel PortalCreateEvent
      4. Server crashes with IllegalArgumentException

       

      Explanation:

      As EntityPortalEvent is processed before PortalCreateEvent, if the portal creation is cancelled the server still checks for the axis the portal would be looking to to make the player appear on the proper location. As the portal does not exist at that location BlockPortalShape throws  an IllegalArgumentException when trying to get the axis orientation of, probably in most cases, an air block.

       

       

      Posible origin of the issue:

      I have not tested it as I have not been able to, but looking at commit history the commit that probably introduced the issue is this one: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/1e76d09fad502bf33504afe8c10a6f39cb0df239

            Unassigned Unassigned
            Dyens Dyens
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: