Fix NETHER_PORTAL flag bypass when paper misc.enable-nether is false#2802
Open
tastybento wants to merge 1 commit intodevelopfrom
Open
Fix NETHER_PORTAL flag bypass when paper misc.enable-nether is false#2802tastybento wants to merge 1 commit intodevelopfrom
tastybento wants to merge 1 commit intodevelopfrom
Conversation
…2796) When the server nether (or end) is disabled via paper-global.yml, Paper does not fire PlayerPortalEvent, so BentoBox's EntityPortalEnterEvent handler manually created one and passed it directly to portalProcess(). This bypassed the Bukkit event bus entirely, meaning PortalListener (which checks the NETHER_PORTAL / END_PORTAL protection flags) never ran and /bsb why returned nothing. Fix: post the manually-constructed PlayerPortalEvent through Bukkit.getPluginManager().callEvent() instead. This lets PortalListener (LOW priority) inspect and potentially cancel the event before PlayerTeleportListener.onPlayerPortalEvent (HIGH priority) processes the teleport, restoring correct flag behaviour for both nether and end portals when the server dimension is disabled. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Fixes #2796
When
paper-global.yml misc.enable-nether: false(orenable-end: false) is set, Paper does not firePlayerPortalEventfor portals. BentoBox'sEntityPortalEnterEventhandler compensated by manually constructing aPlayerPortalEventand callingportalProcess()on it directly — completely bypassing the Bukkit event bus.This meant
PortalListener(which enforces theNETHER_PORTAL/END_PORTALprotection flags) never saw the event, so:/bsb whyreturned nothing (no flag check was ever recorded)Fix: replace the direct
portalProcess()call withBukkit.getPluginManager().callEvent(en). The event now travels through the event bus normally:PortalListener(LOW priority) checks the protection flag and cancels the event if the player lacks permissionPlayerTeleportListener.onPlayerPortalEvent(HIGH priority,ignoreCancelled = true) processes the teleport only if the flag allowed itThe same fix applies to the end portal / end gateway path under
!Bukkit.getAllowEnd().Test plan
paper-global.yml misc.enable-nether: false, keep the BentoBox skyblock nether world enabledNETHER_PORTALflag to block visitors on an island/bsb whynow reports the flag decision./gradlew test— all tests pass🤖 Generated with Claude Code