mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-24 11:36:11 +01:00
Added worldguard.region.flag.regions permissions and flags.<flag>.own for consistency. The old ones will probably be deprecated at some point. Also cleaned up /wg report output slightly.
This commit is contained in:
parent
4194b2ca86
commit
dec469caef
@ -122,6 +122,7 @@ private void appendGlobalConfiguration(ConfigurationManager config) {
|
|||||||
Class<? extends ConfigurationManager> cls = config.getClass();
|
Class<? extends ConfigurationManager> cls = config.getClass();
|
||||||
for (Field field : cls.getFields()) {
|
for (Field field : cls.getFields()) {
|
||||||
try {
|
try {
|
||||||
|
if (field.getName().equalsIgnoreCase("CONFIG_HEADER")) continue;
|
||||||
Object val = field.get(config);
|
Object val = field.get(config);
|
||||||
configLog.put(field.getName(), val);
|
configLog.put(field.getName(), val);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
@ -204,7 +205,7 @@ private void appendWorldInformation(List<World> worlds) {
|
|||||||
LogListBlock infoLog = worldLog.putChild("Information");
|
LogListBlock infoLog = worldLog.putChild("Information");
|
||||||
LogListBlock entitiesLog = worldLog.putChild("Entities");
|
LogListBlock entitiesLog = worldLog.putChild("Entities");
|
||||||
|
|
||||||
infoLog.put("ID", world.getId());
|
infoLog.put("Seed", world.getSeed());
|
||||||
infoLog.put("Environment", world.getEnvironment().toString());
|
infoLog.put("Environment", world.getEnvironment().toString());
|
||||||
infoLog.put("Player count", world.getPlayers().size());
|
infoLog.put("Player count", world.getPlayers().size());
|
||||||
infoLog.put("Entity count", world.getEntities().size());
|
infoLog.put("Entity count", world.getEntities().size());
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
import com.sk89q.minecraft.util.commands.CommandContext;
|
import com.sk89q.minecraft.util.commands.CommandContext;
|
||||||
import com.sk89q.minecraft.util.commands.CommandException;
|
import com.sk89q.minecraft.util.commands.CommandException;
|
||||||
import com.sk89q.minecraft.util.commands.CommandPermissions;
|
import com.sk89q.minecraft.util.commands.CommandPermissions;
|
||||||
|
import com.sk89q.minecraft.util.commands.CommandPermissionsException;
|
||||||
import com.sk89q.worldedit.BlockVector;
|
import com.sk89q.worldedit.BlockVector;
|
||||||
import com.sk89q.worldedit.Vector;
|
import com.sk89q.worldedit.Vector;
|
||||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||||
@ -592,14 +593,20 @@ public static void flag(CommandContext args, WorldGuardPlugin plugin,
|
|||||||
throw new CommandException("Could not find a region by that ID.");
|
throw new CommandException("Could not find a region by that ID.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @TODO deprecate "flag.[own./member./blank]"
|
||||||
|
boolean hasPerm = false;
|
||||||
if (region.isOwner(localPlayer)) {
|
if (region.isOwner(localPlayer)) {
|
||||||
plugin.checkPermission(sender, "worldguard.region.flag.own." + id.toLowerCase());
|
if (plugin.hasPermission(sender, "worldguard.region.flag.own." + id.toLowerCase())) hasPerm = true;
|
||||||
|
else if (plugin.hasPermission(sender, "worldguard.region.flag.regions.own." + id.toLowerCase())) hasPerm = true;
|
||||||
} else if (region.isMember(localPlayer)) {
|
} else if (region.isMember(localPlayer)) {
|
||||||
plugin.checkPermission(sender, "worldguard.region.flag.member." + id.toLowerCase());
|
if (plugin.hasPermission(sender, "worldguard.region.flag.member." + id.toLowerCase())) hasPerm = true;
|
||||||
|
else if (plugin.hasPermission(sender, "worldguard.region.flag.regions.member." + id.toLowerCase())) hasPerm = true;
|
||||||
} else {
|
} else {
|
||||||
plugin.checkPermission(sender, "worldguard.region.flag." + id.toLowerCase());
|
if (plugin.hasPermission(sender, "worldguard.region.flag." + id.toLowerCase())) hasPerm = true;
|
||||||
}
|
else if (plugin.hasPermission(sender, "worldguard.region.flag.regions." + id.toLowerCase())) hasPerm = true;
|
||||||
|
}
|
||||||
|
if (!hasPerm) throw new CommandPermissionsException();
|
||||||
|
|
||||||
Flag<?> foundFlag = null;
|
Flag<?> foundFlag = null;
|
||||||
|
|
||||||
@ -621,9 +628,12 @@ public static void flag(CommandContext args, WorldGuardPlugin plugin,
|
|||||||
list.append(", ");
|
list.append(", ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @TODO deprecate inconsistant "owner" permission
|
||||||
if (region.isOwner(localPlayer)) {
|
if (region.isOwner(localPlayer)) {
|
||||||
if (!plugin.hasPermission(sender, "worldguard.region.flag.flags."
|
if (!plugin.hasPermission(sender, "worldguard.region.flag.flags."
|
||||||
+ flag.getName() + ".owner." + id.toLowerCase())) {
|
+ flag.getName() + ".owner." + id.toLowerCase())
|
||||||
|
&& !plugin.hasPermission(sender, "worldguard.region.flag.flags."
|
||||||
|
+ flag.getName() + ".own." + id.toLowerCase())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if (region.isMember(localPlayer)) {
|
} else if (region.isMember(localPlayer)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user