improve prestige customisation

add prestiges section of messages.yml
add prestige gui title
add first rank for prestiges
This commit is contained in:
okx-code
2018-09-06 21:30:21 +01:00
parent f78bc81d0f
commit 4c7c4ef7f5
10 changed files with 72 additions and 50 deletions
@@ -9,7 +9,6 @@ import sh.okx.rankup.Rankup;
import sh.okx.rankup.messages.Message;
import sh.okx.rankup.prestige.Prestige;
import sh.okx.rankup.prestige.Prestiges;
import sh.okx.rankup.ranks.Rank;
@RequiredArgsConstructor
public class PrestigesCommand implements CommandExecutor {
@@ -27,18 +26,15 @@ public class PrestigesCommand implements CommandExecutor {
Message message = playerRank == null ? Message.PRESTIGES_INCOMPLETE : Message.PRESTIGES_COMPLETE;
Prestige prestige = prestiges.getFirst();
if(!prestige.isLast()) {
prestige = prestiges.next(prestige);
while (!prestige.isLast()) {
Prestige next = prestiges.next(prestige);
if (prestige.equals(playerRank)) {
plugin.sendMessage(sender, Message.PRESTIGES_CURRENT, prestige, next);
message = Message.PRESTIGES_INCOMPLETE;
} else {
plugin.sendMessage(sender, message, prestige, next);
}
prestige = next;
while (!prestige.isLast()) {
Prestige next = prestiges.next(prestige);
if (prestige.equals(playerRank)) {
plugin.sendMessage(sender, Message.PRESTIGES_CURRENT, prestige, next);
message = Message.PRESTIGES_INCOMPLETE;
} else {
plugin.sendMessage(sender, message, prestige, next);
}
prestige = next;
}
plugin.sendHeaderFooter(sender, playerRank, Message.PRESTIGES_FOOTER);