update placeholders
This commit is contained in:
parent
5086fb4a00
commit
1d85e99534
1 changed files with 2 additions and 2 deletions
|
@ -45,14 +45,14 @@ public class PAPIExpansion extends PlaceholderExpansion {
|
||||||
try { uuid = UUIDFetcher.getUUID(args[2]); } catch (Exception e) { return placeholderError; }
|
try { uuid = UUIDFetcher.getUUID(args[2]); } catch (Exception e) { return placeholderError; }
|
||||||
PlayerInfo info = Database.playerInfo.getInfo(uuid);
|
PlayerInfo info = Database.playerInfo.getInfo(uuid);
|
||||||
return getValue(info, args[1]);
|
return getValue(info, args[1]);
|
||||||
} else if(args[0].equals("rank") && args.length == 3){
|
} else if((args[0].equals("rank-score") || args[0].equals("rank-name") ) && args.length == 3){
|
||||||
int place;
|
int place;
|
||||||
try { place = Integer.parseInt(args[2]); } catch (NumberFormatException e) { return placeholderError; }
|
try { place = Integer.parseInt(args[2]); } catch (NumberFormatException e) { return placeholderError; }
|
||||||
if(place < 1) { return placeholderError; }
|
if(place < 1) { return placeholderError; }
|
||||||
if(getRanking(args[1]) == null) { return placeholderError; }
|
if(getRanking(args[1]) == null) { return placeholderError; }
|
||||||
PlayerInfo info = Database.playerInfo.getInfoRanking(getRanking(args[1]), place);
|
PlayerInfo info = Database.playerInfo.getInfoRanking(getRanking(args[1]), place);
|
||||||
if(info == null) return placeholderNoData;
|
if(info == null) return placeholderNoData;
|
||||||
if(args[0].equals("rankStat")){
|
if(args[0].equals("rank-score")){
|
||||||
return getValue(info, args[1]);
|
return getValue(info, args[1]);
|
||||||
} else {
|
} else {
|
||||||
return UUIDFetcher.getPlayer(info.uuid).getName();
|
return UUIDFetcher.getPlayer(info.uuid).getName();
|
||||||
|
|
Loading…
Reference in a new issue