Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>2.20.0</build.version>
<build.version>2.21.0</build.version>
<sonar.projectKey>BentoBoxWorld_Level</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/world/bentobox/level/Level.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import world.bentobox.level.commands.AdminSetInitialLevelCommand;
import world.bentobox.level.commands.AdminStatsCommand;
import world.bentobox.level.commands.AdminTopCommand;
import world.bentobox.level.commands.IslandDetailCommand;
import world.bentobox.level.commands.IslandLevelCommand;
import world.bentobox.level.commands.IslandTopCommand;
import world.bentobox.level.commands.IslandValueCommand;
Expand All @@ -34,7 +35,6 @@
import world.bentobox.level.listeners.IslandActivitiesListeners;
import world.bentobox.level.listeners.JoinLeaveListener;
import world.bentobox.level.listeners.MigrationListener;
import world.bentobox.level.objects.LevelsData;
import world.bentobox.level.requests.LevelRequestHandler;
import world.bentobox.level.requests.TopTenRequestHandler;
import world.bentobox.visit.VisitAddon;
Expand Down Expand Up @@ -249,6 +249,7 @@ private void registerCommands(GameModeAddon gm) {
new IslandLevelCommand(this, playerCmd);
new IslandTopCommand(this, playerCmd);
new IslandValueCommand(this, playerCmd);
new IslandDetailCommand(this, playerCmd);
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package world.bentobox.level.commands;

import java.util.List;

import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.level.Level;
import world.bentobox.level.panels.DetailsPanel;


public class IslandDetailCommand extends CompositeCommand {

private final Level addon;

public IslandDetailCommand(Level addon, CompositeCommand parent) {
super(parent, "detail");
this.addon = addon;
}

@Override
public void setup() {
setPermission("island.detail");
setDescription("island.detail.description");
setOnlyPlayer(true);
}

@Override
public boolean execute(User user, String label, List<String> list) {
if (getIslands().hasIsland(getWorld(), user)) {
DetailsPanel.openPanel(this.addon, getWorld(), user);
} else {
user.sendMessage("general.errors.no-island");
}
return true;
}
}
3 changes: 3 additions & 0 deletions src/main/resources/addon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ permissions:
'[gamemode].island.level':
description: Player can use level command
default: true
'[gamemode].island.detail':
description: Player can use island detail command
default: true
'[gamemode].island.top':
description: Player can use top ten command
default: true
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ island:
cooldown: "&c You must wait &b[time] &c seconds until you can do that again"
in-progress: "&6 Island level calculation is in progress..."
time-out: "&c The level calculation took too long. Please try again later."

detail:
description: "shows detail of your island blocks"
top:
description: "show the Top Ten"
gui-title: "&a Top Ten"
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/world/bentobox/level/LevelTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private static void deleteAll(File file) throws IOException {
public void testAllLoaded() {
addon.allLoaded();
verify(plugin).log("[Level] Level hooking into BSkyBlock");
verify(cmd, times(3)).getAddon(); // 3 commands
verify(cmd, times(4)).getAddon(); // 4 commands
verify(adminCmd, times(5)).getAddon(); // Five commands
// Placeholders
verify(phm).registerPlaceholder(eq(addon), eq("bskyblock_island_level"), any());
Expand Down