[SPIGOT-6492] PortalCreateEvent#getBlocks() returns not all blocks by reason fire Created: 06/Jun/21  Updated: 07/Jun/21  Resolved: 07/Jun/21

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Marvin Rieple Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: 1.16.4, api, bug, event, portal

Attachments: PNG File 1.14.4-1.15.2.png     PNG File 1.16.4.png     File test-plugin-1.0-SNAPSHOT.jar    
Version: This server is running CraftBukkit version 3092-Spigot-9fb885e-ebe18b9 (MC: 1.16.5)
Guidelines Read: Yes

 Description   

The PortalCreateEvent does not return the correct amount of blocks. It only returns the portal blocks and a single obsidian left and right (See picture). In version 1.15.2 and 1.14.4 more blocks of the frame are present in the list, but still not all (See second picture). I didn't test it in 1.13.2, since the methode changed from 1.13.2 to 1.14.4.

Going from the description of the event, the old behavior and the behavior of the reason nether pair. getBlocks should return all obsidian blocks of the frame.

The cause is in the patch BlockPortalShape where not at all places the blocks are added to the list. A PR to fix this can be found here.

 

The provided test plugin prints the amount of blocks in the list and the reason to the console. It also places the blocks which are present in the list 10 blocks higher in the air. (orange wool for obsidian and purple for nether portal). The source of the test plugin can be seen here.



 Comments   
Comment by Marvin Rieple [ 07/Jun/21 ]

Your version (3092-Spigot-9fb885e-ebe18b9 (MC: 1.16.5)) does not have the corresponding commit. Means it is not the latest and can therefor not be the cause of your issue.

Comment by Bobcat00 [ 07/Jun/21 ]

With this change (3092-Spigot-9fb885e-ebe18b9 (MC: 1.16.5)), I'm getting exceptions after passing through a nether portal a couple times.  It doesn't happen with 3091.

[ERROR] Failed to save chunk -3,2

net.minecraft.server.v1_16_R3.ReportedException: Writing into PalettedContainer from multiple threads

I can't get JIRA to format the exception correctly, so here's a pastebin - https://pastebin.com/x4aLJNmj

 

 

Comment by md_5 [ 07/Jun/21 ]

Further info:

Seemingly the behaviour can be justified on the basis that the event is trying to only return the modified blocks, and therefore the bug is actually the inclusion of the obsidian corners.

Looking at the patch history all the way back to 1.8.3 however it seems like the intention of the event was to include the frame as well. This is arguably supported by the documentation which states that the list includes 'all the blocks associated', which arguably includes the frame. The lack of the bottom pieces was therefore a bug in 1.14.4 too.

The bug is therefore probably valid and the best fix is indeed including all the pieces of the frame.

Generated at Fri Mar 14 15:12:55 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.