mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-05 18:20:18 +01:00
Add settings for player-sort-permission-nodes support
This commit is contained in:
parent
3a88ac66a6
commit
b7abfe7c06
@ -111,6 +111,8 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
private Method ismodloaded;
|
||||
private HashMap<String, BukkitWorld> world_by_name = new HashMap<String, BukkitWorld>();
|
||||
private HashSet<String> modsused = new HashSet<String>();
|
||||
|
||||
private HashMap<String, Integer> sortWeights = new HashMap<String, Integer>();
|
||||
/* Lookup cache */
|
||||
private World last_world;
|
||||
private BukkitWorld last_bworld;
|
||||
@ -629,6 +631,22 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public int getSortWeight() {
|
||||
Integer wt = sortWeights.get(getName());
|
||||
if (wt != null)
|
||||
return wt;
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public void setSortWeight(int wt) {
|
||||
if (wt == 0) {
|
||||
sortWeights.remove(getName());
|
||||
}
|
||||
else {
|
||||
sortWeights.put(getName(), wt);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Handler for generic console command sender */
|
||||
public class BukkitCommandSender implements DynmapCommandSender {
|
||||
@ -664,6 +682,13 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
else
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean hasPermissionNode(String node) {
|
||||
if (sender != null) {
|
||||
return sender.hasPermission(node);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void loadExtraBiomes() {
|
||||
|
@ -39,7 +39,7 @@ public class BukkitPermissions implements PermissionProvider {
|
||||
}
|
||||
@Override
|
||||
public Set<String> hasOfflinePermissions(String player, Set<String> perms) {
|
||||
Player p = Bukkit.getPlayerExact(name);
|
||||
Player p = Bukkit.getPlayerExact(player);
|
||||
HashSet<String> hasperms = null;
|
||||
if (p != null) {
|
||||
hasperms = new HashSet<String>();
|
||||
|
@ -319,6 +319,11 @@ showplayerfacesinmenu: true
|
||||
# Control whether players that are hidden or not on current map are grayed out (true=yes)
|
||||
grayplayerswhenhidden: true
|
||||
|
||||
# Use player permissions to order player list: first to last, players are ordered by first permission listed that they have
|
||||
# That is, anyone with first listed permission goes before anyone with second, etc, with users with none of the nodes going last
|
||||
player-sort-permission-nodes:
|
||||
- bukkit.command.op
|
||||
|
||||
# Set sidebaropened: 'true' to pin menu sidebar opened permanently, 'pinned' to default the sidebar to pinned, but allow it to unpin
|
||||
#sidebaropened: true
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user