Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

Command upgrades with permission requirements were not appearing in the /ob upgrade GUI despite users having correct permissions. Root cause: CommandUpgrade.isShowed() retrieved upgrade level using this.cmdId while data is stored under this.getName() (which is "command-" + cmdId).

Changes

  • CommandUpgrade.java line 90: Changed getUpgradeLevel(this.cmdId) to getUpgradeLevel(this.getName()) for consistency with updateUpgradeValue() and doUpgrade()
  • CommandUpgradeTest.java: Added regression tests covering permission scenarios

Context

When instantiated with cmdId="coal-upgrade", upgrade data is stored under key "command-coal-upgrade". The isShowed() method was looking up "coal-upgrade", always getting level 0, which corrupted the subsequent permission level check.

// Before - wrong key lookup
int upgradeLevel = islandData.getUpgradeLevel(this.cmdId); // "coal-upgrade" → not found → 0

// After - consistent with other methods
int upgradeLevel = islandData.getUpgradeLevel(this.getName()); // "command-coal-upgrade" → correct

User configuration aoneblock.upgrades.command-coal-upgrade.1 was already correct per docs.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • jitpack.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Upgrades/Upgrades org.codehaus.plexus.classworlds.launcher.Launcher clean test -Dtest=CommandUpgradeTest (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Upgrades/Upgrades org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip (dns block)
  • repo.codemc.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Upgrades/Upgrades org.codehaus.plexus.classworlds.launcher.Launcher clean test -Dtest=CommandUpgradeTest (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Upgrades/Upgrades org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip (dns block)
  • repo.papermc.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Upgrades/Upgrades org.codehaus.plexus.classworlds.launcher.Launcher clean test -Dtest=CommandUpgradeTest (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Upgrades/Upgrades org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>OB upgrades perm issues?</issue_title>
<issue_description>### Expected behavior

Goal: use upgrade addon to allow players with a certain permission to upgrade island range X amount.

Observed/Actual behavior

I've gotten this to work in the past but now it's no longer working.

Steps/models to reproduce

in config I have done under the commands section:

   coal-upgrade:
    # Permission upgrade name: command-coal-upgrade
    name: "&#FF5Iron Range Upgrade +10"
    tier1:
      max-level: 1
      island-min-level: "0"
      vault-cost: "0"
      console: true
      command:
        - "obadmin range add [player] 10"
      permission-level: 1

through LuckPerms using aoneblock.upgrades.command-coal-upgrade.1 per the wiki directions, have also tried aoneblock.upgrades.command-coal-upgrade but neither of these will make the upgrade show on /ob upgrade gui

I have made sure a command icon is set for the coal-upgrade:

command-icon:
  #lambda-upgrade: GRASS
  coal-upgrade: GRASS_BLOCK

BentoBox version

bentobox version
[09:01:27 INFO]: ISLAND | Running PAPER 1.21.10
[09:01:27 INFO]: (1.21.10-130-8043efd (MC: 1.21.10))
[09:01:27 INFO]: ISLAND | BentoBox version: 3.11.1
[09:01:27 INFO]: ISLAND | Database: JSON
[09:01:27 INFO]: ISLAND | Loaded Game Worlds:
[09:01:27 INFO]: ISLAND | oneblock - OneBlock - Overworld, Nether*, End*
[09:01:27 INFO]: ISLAND | Loaded Addons:
[09:01:27 INFO]: ISLAND | AOneBlock - 1.22.0 - ENABLED
[09:01:27 INFO]: ISLAND | AutoIslandPurge - 1.1.0-SNAPSHOT - ENABLED
[09:01:27 INFO]: ISLAND | Chat - 1.3.0 - ENABLED
[09:01:27 INFO]: ISLAND | ControlPanel - 1.14.0 - ENABLED
[09:01:27 INFO]: ISLAND | IslandFly - 1.14.3 - ENABLED
[09:01:27 INFO]: ISLAND | Level - 2.22.0 - ENABLED
[09:01:27 INFO]: ISLAND | Limits - 1.27.1 - ENABLED
[09:01:27 INFO]: ISLAND | MagicCobblestoneGenerator - 2.7.0 - ENABLED
[09:01:27 INFO]: ISLAND | Upgrades - 0.3.0-SNAPSHOT-b158 - ENABLED
[09:01:27 INFO]: ISLAND | Visit - 1.6.0 - ENABLED
[09:01:27 INFO]: ISLAND | Warps - 1.17.0 - ENABLED

Plugin list

No response

Other

No response</issue_description>

<agent_instructions>It's not clear if this is a bug or just user error. Look through the code and see if they are doing anything wrong, or if indeed there seems to be a bug. Document the investigation. If there is a bug, propose a fix and file a PR. If there isn't, then tell the user what they should be doing instead.</agent_instructions>

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


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…rehensive tests

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix upgrade permission issues for island range Fix CommandUpgrade permission check using wrong data key Jan 31, 2026
Copilot AI requested a review from tastybento January 31, 2026 17:27
@tastybento tastybento marked this pull request as ready for review January 31, 2026 17:38
@tastybento tastybento merged commit 2480ee8 into develop Jan 31, 2026
1 check failed
@tastybento tastybento deleted the copilot/fix-upgrade-permission-issues branch January 31, 2026 17:39
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.

OB upgrades perm issues?

2 participants