Fixed some code smells in AdminGetRankCommand

This commit is contained in:
Florian CUNY 2018-07-19 12:22:36 +02:00
parent 90be5e5de6
commit b37df7ef7c

View File

@ -51,14 +51,14 @@ public class AdminGetRankCommand extends CompositeCommand {
user.sendMessage("general.errors.unknown-player"); user.sendMessage("general.errors.unknown-player");
return false; return false;
} }
if (!getPlugin().getIslands().hasIsland(getWorld(), targetUUID)) { if (!getIslands().hasIsland(getWorld(), targetUUID)) {
user.sendMessage("general.errors.player-has-no-island"); user.sendMessage("general.errors.player-has-no-island");
return false; return false;
} }
// Get rank // Get rank
RanksManager rm = getPlugin().getRanksManager(); RanksManager rm = getPlugin().getRanksManager();
User target = User.getInstance(targetUUID); User target = User.getInstance(targetUUID);
Island island = getPlugin().getIslands().getIsland(getWorld(), targetUUID); Island island = getIslands().getIsland(getWorld(), targetUUID);
int currentRank = island.getRank(target); int currentRank = island.getRank(target);
user.sendMessage("commands.admin.getrank.rank-is", TextVariables.RANK, user.getTranslation(rm.getRank(currentRank))); user.sendMessage("commands.admin.getrank.rank-is", TextVariables.RANK, user.getTranslation(rm.getRank(currentRank)));
return true; return true;