mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-02-26 00:31:44 +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 Method ismodloaded;
|
||||||
private HashMap<String, BukkitWorld> world_by_name = new HashMap<String, BukkitWorld>();
|
private HashMap<String, BukkitWorld> world_by_name = new HashMap<String, BukkitWorld>();
|
||||||
private HashSet<String> modsused = new HashSet<String>();
|
private HashSet<String> modsused = new HashSet<String>();
|
||||||
|
|
||||||
|
private HashMap<String, Integer> sortWeights = new HashMap<String, Integer>();
|
||||||
/* Lookup cache */
|
/* Lookup cache */
|
||||||
private World last_world;
|
private World last_world;
|
||||||
private BukkitWorld last_bworld;
|
private BukkitWorld last_bworld;
|
||||||
@ -629,6 +631,22 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||||||
}
|
}
|
||||||
return false;
|
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 */
|
/* Handler for generic console command sender */
|
||||||
public class BukkitCommandSender implements DynmapCommandSender {
|
public class BukkitCommandSender implements DynmapCommandSender {
|
||||||
@ -664,6 +682,13 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public boolean hasPermissionNode(String node) {
|
||||||
|
if (sender != null) {
|
||||||
|
return sender.hasPermission(node);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadExtraBiomes() {
|
public void loadExtraBiomes() {
|
||||||
|
@ -39,7 +39,7 @@ public class BukkitPermissions implements PermissionProvider {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public Set<String> hasOfflinePermissions(String player, Set<String> perms) {
|
public Set<String> hasOfflinePermissions(String player, Set<String> perms) {
|
||||||
Player p = Bukkit.getPlayerExact(name);
|
Player p = Bukkit.getPlayerExact(player);
|
||||||
HashSet<String> hasperms = null;
|
HashSet<String> hasperms = null;
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
hasperms = new HashSet<String>();
|
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)
|
# Control whether players that are hidden or not on current map are grayed out (true=yes)
|
||||||
grayplayerswhenhidden: true
|
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
|
# Set sidebaropened: 'true' to pin menu sidebar opened permanently, 'pinned' to default the sidebar to pinned, but allow it to unpin
|
||||||
#sidebaropened: true
|
#sidebaropened: true
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user