Fixed building issues
This commit is contained in:
parent
92840b7864
commit
b048cc59cd
1 changed files with 32 additions and 5 deletions
|
@ -653,18 +653,36 @@ public class V10LiftAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the whitelist of a lift
|
* Get the userWhitelist of a lift
|
||||||
*
|
*
|
||||||
* @param liftName The name of the lift
|
* @param liftName The name of the lift
|
||||||
* @param floorName The name of the floor
|
* @param floorName The name of the floor
|
||||||
* @return list with UUIDs of the players
|
* @return list with UUIDs of the players
|
||||||
*/
|
*/
|
||||||
public HashSet<UUID> getWhitelist(String liftName, String floorName) {
|
public HashSet<UUID> getUserWhitelist(String liftName, String floorName) {
|
||||||
HashSet<UUID> ret = new HashSet<>();
|
HashSet<UUID> ret = new HashSet<>();
|
||||||
if (liftName != null && floorName != null && DataManager.containsLift(liftName)) {
|
if (liftName != null && floorName != null && DataManager.containsLift(liftName)) {
|
||||||
Lift lift = DataManager.getLift(liftName);
|
Lift lift = DataManager.getLift(liftName);
|
||||||
if (lift.getFloors().containsKey(floorName)) {
|
if (lift.getFloors().containsKey(floorName)) {
|
||||||
ret = lift.getFloors().get(floorName).getWhitelist();
|
ret = lift.getFloors().get(floorName).getUserWhitelist();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the groupWhitelist of a lift
|
||||||
|
*
|
||||||
|
* @param liftName The name of the lift
|
||||||
|
* @param floorName The name of the floor
|
||||||
|
* @return list with groupnames
|
||||||
|
*/
|
||||||
|
public HashSet<String> getGroupWhitelist(String liftName, String floorName) {
|
||||||
|
HashSet<String> ret = new HashSet<>();
|
||||||
|
if (liftName != null && floorName != null && DataManager.containsLift(liftName)) {
|
||||||
|
Lift lift = DataManager.getLift(liftName);
|
||||||
|
if (lift.getFloors().containsKey(floorName)) {
|
||||||
|
ret = lift.getFloors().get(floorName).getGroupWhitelist();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -823,11 +841,12 @@ public class V10LiftAPI {
|
||||||
p.sendMessage(ChatColor.YELLOW + " World: " + ChatColor.GREEN + f.getWorld());
|
p.sendMessage(ChatColor.YELLOW + " World: " + ChatColor.GREEN + f.getWorld());
|
||||||
p.sendMessage(ChatColor.YELLOW + " Height: " + ChatColor.GREEN + f.getY());
|
p.sendMessage(ChatColor.YELLOW + " Height: " + ChatColor.GREEN + f.getY());
|
||||||
p.sendMessage(ChatColor.YELLOW + " Whitelist:");
|
p.sendMessage(ChatColor.YELLOW + " Whitelist:");
|
||||||
if (f.getWhitelist().isEmpty()) {
|
if (f.getUserWhitelist().isEmpty() && f.getGroupWhitelist().isEmpty()) {
|
||||||
p.sendMessage(ChatColor.GOLD + " None.");
|
p.sendMessage(ChatColor.GOLD + " None.");
|
||||||
} else {
|
} else {
|
||||||
ChatColor color = ChatColor.DARK_PURPLE;
|
ChatColor color = ChatColor.DARK_PURPLE;
|
||||||
Iterator<UUID> iter = f.getWhitelist().iterator();
|
Iterator<UUID> iter = f.getUserWhitelist().iterator();
|
||||||
|
Iterator<String> iter2 = f.getGroupWhitelist().iterator();
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(" ").append(color).append(Bukkit.getOfflinePlayer(iter.next()).getName());
|
sb.append(" ").append(color).append(Bukkit.getOfflinePlayer(iter.next()).getName());
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
|
@ -838,6 +857,14 @@ public class V10LiftAPI {
|
||||||
}
|
}
|
||||||
sb.append(ChatColor.AQUA).append(", ").append(color).append(Bukkit.getOfflinePlayer(iter.next()).getName());
|
sb.append(ChatColor.AQUA).append(", ").append(color).append(Bukkit.getOfflinePlayer(iter.next()).getName());
|
||||||
}
|
}
|
||||||
|
while (iter2.hasNext()) {
|
||||||
|
if (color == ChatColor.DARK_PURPLE) {
|
||||||
|
color = ChatColor.LIGHT_PURPLE;
|
||||||
|
} else {
|
||||||
|
color = ChatColor.DARK_PURPLE;
|
||||||
|
}
|
||||||
|
sb.append(ChatColor.AQUA).append(", ").append(color).append("Group: ").append(iter2.next());
|
||||||
|
}
|
||||||
p.sendMessage(sb.toString());
|
p.sendMessage(sb.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue