File tree Expand file tree Collapse file tree 6 files changed +45
-4
lines changed
java/world/bentobox/level
test/java/world/bentobox/level Expand file tree Collapse file tree 6 files changed +45
-4
lines changed Original file line number Diff line number Diff line change 67
67
<!-- Do not change unless you want different name for local builds. -->
68
68
<build .number>-LOCAL</build .number>
69
69
<!-- This allows to change between versions. -->
70
- <build .version>2.20 .0</build .version>
70
+ <build .version>2.21 .0</build .version>
71
71
<sonar .projectKey>BentoBoxWorld_Level</sonar .projectKey>
72
72
<sonar .organization>bentobox-world</sonar .organization>
73
73
<sonar .host.url>https://sonarcloud.io</sonar .host.url>
Original file line number Diff line number Diff line change 26
26
import world .bentobox .level .commands .AdminSetInitialLevelCommand ;
27
27
import world .bentobox .level .commands .AdminStatsCommand ;
28
28
import world .bentobox .level .commands .AdminTopCommand ;
29
+ import world .bentobox .level .commands .IslandDetailCommand ;
29
30
import world .bentobox .level .commands .IslandLevelCommand ;
30
31
import world .bentobox .level .commands .IslandTopCommand ;
31
32
import world .bentobox .level .commands .IslandValueCommand ;
34
35
import world .bentobox .level .listeners .IslandActivitiesListeners ;
35
36
import world .bentobox .level .listeners .JoinLeaveListener ;
36
37
import world .bentobox .level .listeners .MigrationListener ;
37
- import world .bentobox .level .objects .LevelsData ;
38
38
import world .bentobox .level .requests .LevelRequestHandler ;
39
39
import world .bentobox .level .requests .TopTenRequestHandler ;
40
40
import world .bentobox .visit .VisitAddon ;
@@ -249,6 +249,7 @@ private void registerCommands(GameModeAddon gm) {
249
249
new IslandLevelCommand (this , playerCmd );
250
250
new IslandTopCommand (this , playerCmd );
251
251
new IslandValueCommand (this , playerCmd );
252
+ new IslandDetailCommand (this , playerCmd );
252
253
});
253
254
}
254
255
Original file line number Diff line number Diff line change
1
+ package world .bentobox .level .commands ;
2
+
3
+ import java .util .List ;
4
+
5
+ import world .bentobox .bentobox .api .commands .CompositeCommand ;
6
+ import world .bentobox .bentobox .api .user .User ;
7
+ import world .bentobox .level .Level ;
8
+ import world .bentobox .level .panels .DetailsPanel ;
9
+
10
+
11
+ public class IslandDetailCommand extends CompositeCommand {
12
+
13
+ private final Level addon ;
14
+
15
+ public IslandDetailCommand (Level addon , CompositeCommand parent ) {
16
+ super (parent , "detail" );
17
+ this .addon = addon ;
18
+ }
19
+
20
+ @ Override
21
+ public void setup () {
22
+ setPermission ("island.detail" );
23
+ setDescription ("island.detail.description" );
24
+ setOnlyPlayer (true );
25
+ }
26
+
27
+ @ Override
28
+ public boolean execute (User user , String label , List <String > list ) {
29
+ if (getIslands ().hasIsland (getWorld (), user )) {
30
+ DetailsPanel .openPanel (this .addon , getWorld (), user );
31
+ } else {
32
+ user .sendMessage ("general.errors.no-island" );
33
+ }
34
+ return true ;
35
+ }
36
+ }
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ permissions:
13
13
' [gamemode].island.level ' :
14
14
description : Player can use level command
15
15
default : true
16
+ ' [gamemode].island.detail ' :
17
+ description : Player can use island detail command
18
+ default : true
16
19
' [gamemode].island.top ' :
17
20
description : Player can use top ten command
18
21
default : true
Original file line number Diff line number Diff line change @@ -51,7 +51,8 @@ island:
51
51
cooldown : " &c You must wait &b[time] &c seconds until you can do that again"
52
52
in-progress : " &6 Island level calculation is in progress..."
53
53
time-out : " &c The level calculation took too long. Please try again later."
54
-
54
+ detail :
55
+ description : " shows detail of your island blocks"
55
56
top :
56
57
description : " show the Top Ten"
57
58
gui-title : " &a Top Ten"
Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ private static void deleteAll(File file) throws IOException {
287
287
public void testAllLoaded () {
288
288
addon .allLoaded ();
289
289
verify (plugin ).log ("[Level] Level hooking into BSkyBlock" );
290
- verify (cmd , times (3 )).getAddon (); // 3 commands
290
+ verify (cmd , times (4 )).getAddon (); // 4 commands
291
291
verify (adminCmd , times (5 )).getAddon (); // Five commands
292
292
// Placeholders
293
293
verify (phm ).registerPlaceholder (eq (addon ), eq ("bskyblock_island_level" ), any ());
You can’t perform that action at this time.
0 commit comments