use of com.alessiodp.parties.common.players.RankManager in project Parties by AlessioDP.
the class PartiesPlaceholderTest method testPlaceholderListRank.
@Test
public void testPlaceholderListRank() {
RankManager mockRankManager = mock(RankManager.class);
when(mockPlugin.getRankManager()).thenReturn(mockRankManager);
when(mockRankManager.searchRankByHardName(any())).thenReturn(new PartyRankImpl("myrank", "myrank", "", 20, 0, null, Collections.emptyList(), true));
when(mockMessageUtils.convertPlaceholders(any(), any(), any())).thenReturn("Dummy");
PartiesPlaceholder placeholder = PartiesPlaceholder.getPlaceholder("list_rank_myrank");
assertEquals(PartiesPlaceholder.LIST_RANK, placeholder);
assertEquals(player1.getName(), placeholder.formatPlaceholder(null, party1, "list_rank_myrank"));
placeholder = PartiesPlaceholder.getPlaceholder("list_rank_myrank_total");
assertEquals(PartiesPlaceholder.LIST_RANK_TOTAL, placeholder);
placeholder = PartiesPlaceholder.getPlaceholder("list_rank_myrank_1");
assertEquals(PartiesPlaceholder.LIST_RANK_NUMBER, placeholder);
placeholder = PartiesPlaceholder.getPlaceholder("list_rank_myrank_1_placeholder");
assertEquals(PartiesPlaceholder.LIST_RANK_NUMBER_PLACEHOLDER, placeholder);
}
use of com.alessiodp.parties.common.players.RankManager in project Parties by AlessioDP.
the class RankManagerTest method setUp.
@BeforeAll
public static void setUp() {
// Ranks
rank1 = new PartyRankImpl("rank1", "rank1", "rank1", 1, 0, null, Lists.newArrayList(RankPermission.EDIT_COLOR.toString(), RankPermission.EDIT_DESC.toString()), true);
rank2 = new PartyRankImpl("rank2", "rank2", "rank2", 2, 0, null, Lists.newArrayList("-" + RankPermission.EDIT_FOLLOW, "-" + RankPermission.EDIT_HOME, "*"), false);
rank3 = new PartyRankImpl("rank3", "rank3", "rank3", 3, 0, null, Lists.newArrayList("-" + RankPermission.EDIT_HOME, "*"), false);
// Configuration
ConfigParties.RANK_LIST = Sets.newSet(rank1, rank2, rank3);
rankManager = new RankManager(mockPlugin);
rankManager.reload();
}
use of com.alessiodp.parties.common.players.RankManager in project Parties by AlessioDP.
the class PartiesPlugin method postHandle.
@Override
protected void postHandle() {
api = new ApiHandler(this, initApiOptions());
colorManager = new ColorManager();
cooldownManager = new CooldownManager(this);
expManager = new ExpManager(this);
playerUtils = new PartiesPlayerUtils(this);
rankManager = new RankManager(this);
getPartyManager().reload();
getPlayerManager().reload();
getCommandManager().setup();
getMessenger().reload();
getExpManager().reload();
registerListeners();
reloadAdpUpdater();
getAddonManager().loadAddons();
Parties.setApi(api);
}
Aggregations