Skip to content

Commit

Permalink
Added %[gamemode]_visited_island_rank% #2390 (#2395)
Browse files Browse the repository at this point in the history
* Added %[gamemode]_visited_island_rank% #2390

* Fix test
  • Loading branch information
tastybento committed Jun 1, 2024
1 parent 250c795 commit affb0c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,14 @@ public enum GameModePlaceholder {
RANK("rank",
(addon, user, island) -> (island == null || user == null) ? ""
: user.getTranslation(RanksManager.getInstance().getRank(island.getRank(user)))),
/**
* Returns the rank this player has on this island.
* @since 2.4.0
*/
VISITED_ISLAND_RANK("visited_island_rank",
(addon, user, island) -> getVisitedIsland(addon, user)
.map(is -> user.getTranslation(RanksManager.getInstance().getRank(is.getRank(user)))).orElse("")),

/**
* Returns how many times this player reset his island.
* @since 1.5.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,11 @@ public void testGetIslandLocation() throws InstantiationException, IllegalAccess
when(h.loadObject(anyString())).thenReturn(island);
im.createIsland(location, uuid);
assertEquals(world, im.getIslandLocation(world, uuid).getWorld());
assertEquals(location, im.getIslandLocation(world, uuid));
Location l = im.getIslandLocation(world, uuid);
assertEquals(location.getWorld(), l.getWorld());
assertEquals(location.getBlockX(), l.getBlockX());
assertEquals(location.getBlockY(), l.getBlockY());
assertEquals(location.getBlockZ(), l.getBlockZ());
assertNull(im.getIslandLocation(world, UUID.randomUUID()));
}

Expand Down

0 comments on commit affb0c2

Please sign in to comment.