Skip to content

Notify bypass-lock players when entering a locked island#2869

Merged
tastybento merged 3 commits intodevelopfrom
copilot/add-bypass-protect-message
Mar 14, 2026
Merged

Notify bypass-lock players when entering a locked island#2869
tastybento merged 3 commits intodevelopfrom
copilot/add-bypass-protect-message

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 14, 2026

Players with mod.bypasslock permission were silently allowed into locked islands with no feedback. They now receive a chat notification indicating the island is locked but they have permission to enter.

Changes

  • LockAndBanListener: Added BYPASS_LOCK to CheckResult enum alongside an isAllowed() helper (returns true for OPEN and BYPASS_LOCK). check() now returns BYPASS_LOCK instead of OPEN when a player bypasses a lock. checkAndNotify() sends protection.locked-island-bypass for that case. All event handlers updated to use isAllowed().

  • en-US.yml: Added locale key:

    protection:
      locked-island-bypass: '&6 This [prefix_island] is locked, but you have permission to bypass.'
  • All locale files: Added translations for protection.locked-island-bypass to all 22 supported language files (cs, de, es, fr, hr, hu, id, it, ja, ko, lv, nl, pl, pt-BR, pt, ro, ru, tr, uk, vi, zh-CN, zh-HK).

  • LockAndBanListenerTest: Updated three tests that previously asserted no notification was sent on bypass — they now assert a notification is sent. Fixed two tests that instantiated bare Player mocks without a world, causing NPE in translation, and corrected stubs that used a specific User mock which never matched User.getInstance(player).

Original prompt

This section details on the original issue you should resolve

<issue_title>Bypass Protect Enter Message </issue_title>
<issue_description>### Is your feature request related to a problem?

no

Describe the solution you'd like.

add an message for bypass protect to allow players if they enter an island to see instantly, if that island is protected or not.

players with the permissions aoneblock.mod.bypassprotect should see that message.

Describe alternatives you've considered.

customzie the enter island message (ENTER_EXIT_MESSAGES), but theres no solution to getPermissions

Agreements

  • I have searched for and ensured there isn't already an open issue regarding this.
  • I have ensured the feature I'm requesting isn't already in the latest supported BentoBox build or Addons.

Other

No response</issue_description>

Comments on the Issue (you are @copilot in this section)

@tastybento If you have that permission, then you would see that message for every island, always. Is that the intent? Will it be that useful? @BONNe Hmm, i don't understand this... All bentobox islands are protected. What do you mean with not protected islands? @BONNe Well, that is a different question :D Now it is much clearer what you meant with your request. @tastybento I am pretty sure that if a user can bypass the island lock, they will still see the message that the island is locked when they enter it. (Reference is `protection.locked`). So, I think this is already supported. @tastybento This is what happens now - if you have the bypass permission and enter a locked island then you get a message in chat that the island you are entering is currently locked. Have you tried it? Maybe I am still misunderstanding... @tastybento Can you explain more what you set? This is island locking right? So i'm not sure what is being set here. Also, what perms did the account that was entering have? If you've locked the island and a normal player tries to enter, they cannot. If a Mod or Admin enter then they can but will see the status that the island is locked. Are you actually locking the island?

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

…th bypass permission

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copilot AI changed the title [WIP] Add message for bypass protect on island entry Notify bypass-lock players when entering a locked island Mar 14, 2026
Copilot AI requested a review from tastybento March 14, 2026 21:49
@tastybento
Copy link
Copy Markdown
Member

@copilot Add translations for the locale that was added.

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 14, 2026

@copilot Add translations for the locale that was added.

Done in 65ac2b3. Added protection.locked-island-bypass translations to all 22 locale files (cs, de, es, fr, hr, hu, id, it, ja, ko, lv, nl, pl, pt-BR, pt, ro, ru, tr, uk, vi, zh-CN, zh-HK).

@tastybento tastybento marked this pull request as ready for review March 14, 2026 22:11
@sonarqubecloud
Copy link
Copy Markdown

@tastybento tastybento merged commit a6d95b1 into develop Mar 14, 2026
3 checks passed
@tastybento tastybento deleted the copilot/add-bypass-protect-message branch March 14, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bypass Protect Enter Message

2 participants