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:
- Create a Nether Portal
- Go into the portal
- Cancel PortalCreateEvent
- 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