mirror of
https://e.coding.net/circlecloud/Residence.git
synced 2025-11-26 22:06:07 +00:00
@@ -184,63 +184,6 @@ public class ConfigManager {
|
|||||||
return selectionToolId;
|
return selectionToolId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private void load(FileConfiguration config) {
|
|
||||||
defaultGroup = config.getString("Global.DefaultGroup", "default").toLowerCase();
|
|
||||||
adminsOnly = config.getBoolean("Global.AdminOnlyCommands", false);
|
|
||||||
useLeases = config.getBoolean("Global.UseLeaseSystem", false);
|
|
||||||
leaseAutoRenew = config.getBoolean("Global.LeaseAutoRenew", true);
|
|
||||||
enableEconomy = config.getBoolean("Global.EnableEconomy", false);
|
|
||||||
economySystem = config.getString("Global.EconomySystem", "iConomy");
|
|
||||||
infoToolId = config.getInt("Global.InfoToolId", Material.STRING.getId());
|
|
||||||
selectionToolId = config.getInt("Global.SelectionToolId", Material.WOOD_AXE.getId());
|
|
||||||
adminOps = config.getBoolean("Global.AdminOPs", true);
|
|
||||||
multiworldPlugin = config.getString("Global.MultiWorldPlugin");
|
|
||||||
enableRentSystem = config.getBoolean("Global.EnableRentSystem", false);
|
|
||||||
rentCheckInterval = config.getInt("Global.RentCheckInterval", 10);
|
|
||||||
leaseCheckInterval = config.getInt("Global.LeaseCheckInterval", 10);
|
|
||||||
autoSaveInt = config.getInt("Global.SaveInterval", 10);
|
|
||||||
flagsInherit = config.getBoolean("Global.ResidenceFlagsInherit", false);
|
|
||||||
minMoveUpdate = config.getInt("Global.MoveCheckInterval", 500);
|
|
||||||
chatEnable = config.getBoolean("Global.ResidenceChatEnable", true);
|
|
||||||
actionBar = config.getBoolean("Global.UseActionBar", true);
|
|
||||||
enforceAreaInsideArea = config.getBoolean("Global.EnforceAreaInsideArea", false);
|
|
||||||
language = config.getString("Global.Language", "English");
|
|
||||||
globalCreatorDefaults = FlagPermissions.parseFromConfigNode("CreatorDefault",
|
|
||||||
config.getConfigurationSection("Global"));
|
|
||||||
globalResidenceDefaults = FlagPermissions.parseFromConfigNode("ResidenceDefault",
|
|
||||||
config.getConfigurationSection("Global"));
|
|
||||||
preventBuildInRent = config.getBoolean("Global.PreventRentModify", true);
|
|
||||||
stopOnSaveError = config.getBoolean("Global.StopOnSaveFault", true);
|
|
||||||
legacyperms = config.getBoolean("Global.LegacyPermissions", false);
|
|
||||||
namefix = config.getString("Global.ResidenceNameRegex", null);// "[^a-zA-Z0-9\\-\\_]"
|
|
||||||
showIntervalMessages = config.getBoolean("Global.ShowIntervalMessages", false);
|
|
||||||
spoutEnable = config.getBoolean("Global.EnableSpout", false);
|
|
||||||
enableLeaseMoneyAccount = config.getBoolean("Global.EnableLeaseMoneyAccount", true);
|
|
||||||
enableDebug = config.getBoolean("Global.EnableDebug", false);
|
|
||||||
customContainers = config.getIntegerList("Global.CustomContainers");
|
|
||||||
customBothClick = config.getIntegerList("Global.CustomBothClick");
|
|
||||||
customRightClick = config.getIntegerList("Global.CustomRightClick");
|
|
||||||
ConfigurationSection node = config.getConfigurationSection("Global.GroupDefault");
|
|
||||||
if (node != null) {
|
|
||||||
Set<String> keys = node.getConfigurationSection(defaultGroup).getKeys(false);
|
|
||||||
if (keys != null) {
|
|
||||||
for (String key : keys) {
|
|
||||||
globalGroupDefaults.put(
|
|
||||||
key,
|
|
||||||
FlagPermissions.parseFromConfigNode(key,
|
|
||||||
config.getConfigurationSection("Global.GroupDefault")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
chatColor = ChatColor.valueOf(config.getString("Global.ResidenceChatColor",
|
|
||||||
"DARK_PURPLE"));
|
|
||||||
} catch (Exception ex) {
|
|
||||||
chatColor = ChatColor.DARK_PURPLE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean preventRentModify() {
|
public boolean preventRentModify() {
|
||||||
return preventBuildInRent;
|
return preventBuildInRent;
|
||||||
}
|
}
|
||||||
@@ -264,4 +207,57 @@ public class ConfigManager {
|
|||||||
public boolean useLegacyPermissions() {
|
public boolean useLegacyPermissions() {
|
||||||
return legacyperms;
|
return legacyperms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
private void load(FileConfiguration config) {
|
||||||
|
defaultGroup = config.getString("Global.DefaultGroup", "default").toLowerCase();
|
||||||
|
adminsOnly = config.getBoolean("Global.AdminOnlyCommands", false);
|
||||||
|
useLeases = config.getBoolean("Global.UseLeaseSystem", false);
|
||||||
|
leaseAutoRenew = config.getBoolean("Global.LeaseAutoRenew", true);
|
||||||
|
enableEconomy = config.getBoolean("Global.EnableEconomy", false);
|
||||||
|
economySystem = config.getString("Global.EconomySystem", "iConomy");
|
||||||
|
infoToolId = config.getInt("Global.InfoToolId", Material.STRING.getId());
|
||||||
|
selectionToolId = config.getInt("Global.SelectionToolId", Material.WOOD_AXE.getId());
|
||||||
|
adminOps = config.getBoolean("Global.AdminOPs", true);
|
||||||
|
multiworldPlugin = config.getString("Global.MultiWorldPlugin");
|
||||||
|
enableRentSystem = config.getBoolean("Global.EnableRentSystem", false);
|
||||||
|
rentCheckInterval = config.getInt("Global.RentCheckInterval", 10);
|
||||||
|
leaseCheckInterval = config.getInt("Global.LeaseCheckInterval", 10);
|
||||||
|
autoSaveInt = config.getInt("Global.SaveInterval", 10);
|
||||||
|
flagsInherit = config.getBoolean("Global.ResidenceFlagsInherit", false);
|
||||||
|
minMoveUpdate = config.getInt("Global.MoveCheckInterval", 500);
|
||||||
|
chatEnable = config.getBoolean("Global.ResidenceChatEnable", true);
|
||||||
|
actionBar = config.getBoolean("Global.UseActionBar", true);
|
||||||
|
enforceAreaInsideArea = config.getBoolean("Global.EnforceAreaInsideArea", false);
|
||||||
|
language = config.getString("Global.Language", "English");
|
||||||
|
globalCreatorDefaults = FlagPermissions.parseFromConfigNode("CreatorDefault", config.getConfigurationSection("Global"));
|
||||||
|
globalResidenceDefaults = FlagPermissions.parseFromConfigNode("ResidenceDefault", config.getConfigurationSection("Global"));
|
||||||
|
preventBuildInRent = config.getBoolean("Global.PreventRentModify", true);
|
||||||
|
stopOnSaveError = config.getBoolean("Global.StopOnSaveFault", true);
|
||||||
|
legacyperms = config.getBoolean("Global.LegacyPermissions", false);
|
||||||
|
namefix = config.getString("Global.ResidenceNameRegex", null);// "[^a-zA-Z0-9\\-\\_]"
|
||||||
|
showIntervalMessages = config.getBoolean("Global.ShowIntervalMessages", false);
|
||||||
|
spoutEnable = config.getBoolean("Global.EnableSpout", false);
|
||||||
|
enableLeaseMoneyAccount = config.getBoolean("Global.EnableLeaseMoneyAccount", true);
|
||||||
|
enableDebug = config.getBoolean("Global.EnableDebug", false);
|
||||||
|
customContainers = config.getIntegerList("Global.CustomContainers");
|
||||||
|
customBothClick = config.getIntegerList("Global.CustomBothClick");
|
||||||
|
customRightClick = config.getIntegerList("Global.CustomRightClick");
|
||||||
|
ConfigurationSection node = config.getConfigurationSection("Global.GroupDefault");
|
||||||
|
|
||||||
|
if (!Residence.is1_8())
|
||||||
|
actionBar = false;
|
||||||
|
|
||||||
|
if (node != null) {
|
||||||
|
Set<String> keys = node.getConfigurationSection(defaultGroup).getKeys(false);
|
||||||
|
if (keys != null)
|
||||||
|
for (String key : keys)
|
||||||
|
globalGroupDefaults.put(key, FlagPermissions.parseFromConfigNode(key, config.getConfigurationSection("Global.GroupDefault")));
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
chatColor = ChatColor.valueOf(config.getString("Global.ResidenceChatColor", "DARK_PURPLE"));
|
||||||
|
} catch (Exception ex) {
|
||||||
|
chatColor = ChatColor.DARK_PURPLE;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,10 +50,10 @@ public class ResidenceCommandListener extends Residence {
|
|||||||
if (!(sender instanceof Player) || sender instanceof Player && gmanager.isResidenceAdmin((Player) sender))
|
if (!(sender instanceof Player) || sender instanceof Player && gmanager.isResidenceAdmin((Player) sender))
|
||||||
try {
|
try {
|
||||||
this.loadYml();
|
this.loadYml();
|
||||||
sender.sendMessage(ChatColor.GREEN + "[Residence] Reloaded save file...");
|
sender.sendMessage(ChatColor.GREEN + "[Residence] 从配置保存文件重新载入数据...");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
sender.sendMessage(ChatColor.RED + "[Residence] Unable to reload the save file, exception occured!");
|
sender.sendMessage(ChatColor.RED + "[Residence] 无法从配置保存文件重新载入数据, 请查看控制台异常信息!");
|
||||||
sender.sendMessage(ChatColor.RED + ex.getMessage());
|
sender.sendMessage(ChatColor.RED + "[Residence] 异常: " + ex.getMessage());
|
||||||
Logger.getLogger(Residence.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(Residence.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -63,7 +63,7 @@ public class ResidenceCommandListener extends Residence {
|
|||||||
rmanager.removeAllFromWorld(sender, args[1]);
|
rmanager.removeAllFromWorld(sender, args[1]);
|
||||||
return true;
|
return true;
|
||||||
} else
|
} else
|
||||||
sender.sendMessage(ChatColor.RED + "MUST be run from console.");
|
sender.sendMessage(ChatColor.RED + "当前命令必须从控制台执行.");
|
||||||
return false;
|
return false;
|
||||||
} else if (command.getName().equals("rc")) {
|
} else if (command.getName().equals("rc")) {
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
@@ -1114,7 +1114,7 @@ public class ResidenceCommandListener extends Residence {
|
|||||||
return false;
|
return false;
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
if (!deleteConfirm.containsKey(player.getName()) || !args[1].equalsIgnoreCase(deleteConfirm.get(player.getName()))) {
|
if (!deleteConfirm.containsKey(player.getName()) || !args[1].equalsIgnoreCase(deleteConfirm.get(player.getName()))) {
|
||||||
String words = "";
|
String words = null;
|
||||||
if (rmanager.getByName(args[1]) != null) {
|
if (rmanager.getByName(args[1]) != null) {
|
||||||
ClaimedResidence res = rmanager.getByName(args[1]);
|
ClaimedResidence res = rmanager.getByName(args[1]);
|
||||||
if (res.getParent() != null) {
|
if (res.getParent() != null) {
|
||||||
@@ -1122,7 +1122,7 @@ public class ResidenceCommandListener extends Residence {
|
|||||||
words = split[split.length - 1];
|
words = split[split.length - 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (words == "")
|
if (words == null)
|
||||||
player.sendMessage(ChatColor.RED + language.getPhrase("DeleteConfirm", ChatColor.YELLOW + args[1] + ChatColor.RED));
|
player.sendMessage(ChatColor.RED + language.getPhrase("DeleteConfirm", ChatColor.YELLOW + args[1] + ChatColor.RED));
|
||||||
else
|
else
|
||||||
player.sendMessage(ChatColor.RED + language.getPhrase("DeleteSubzoneConfirm", ChatColor.YELLOW + words + ChatColor.RED));
|
player.sendMessage(ChatColor.RED + language.getPhrase("DeleteSubzoneConfirm", ChatColor.YELLOW + words + ChatColor.RED));
|
||||||
@@ -1130,7 +1130,7 @@ public class ResidenceCommandListener extends Residence {
|
|||||||
} else
|
} else
|
||||||
rmanager.removeResidence(player, args[1], resadmin);
|
rmanager.removeResidence(player, args[1], resadmin);
|
||||||
} else if (!deleteConfirm.containsKey("Console") || !args[1].equalsIgnoreCase(deleteConfirm.get("Console"))) {
|
} else if (!deleteConfirm.containsKey("Console") || !args[1].equalsIgnoreCase(deleteConfirm.get("Console"))) {
|
||||||
String words = "";
|
String words = null;
|
||||||
if (rmanager.getByName(args[1]) != null) {
|
if (rmanager.getByName(args[1]) != null) {
|
||||||
ClaimedResidence res = rmanager.getByName(args[1]);
|
ClaimedResidence res = rmanager.getByName(args[1]);
|
||||||
if (res.getParent() != null) {
|
if (res.getParent() != null) {
|
||||||
@@ -1138,7 +1138,7 @@ public class ResidenceCommandListener extends Residence {
|
|||||||
words = split[split.length - 1];
|
words = split[split.length - 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (words == "")
|
if (words == null)
|
||||||
server.getConsoleSender().sendMessage(ChatColor.RED + language.getPhrase("DeleteConfirm", ChatColor.YELLOW + args[1] + ChatColor.RED));
|
server.getConsoleSender().sendMessage(ChatColor.RED + language.getPhrase("DeleteConfirm", ChatColor.YELLOW + args[1] + ChatColor.RED));
|
||||||
else
|
else
|
||||||
server.getConsoleSender().sendMessage(ChatColor.RED + language.getPhrase("DeleteSubzoneConfirm", ChatColor.YELLOW + words + ChatColor.RED));
|
server.getConsoleSender().sendMessage(ChatColor.RED + language.getPhrase("DeleteSubzoneConfirm", ChatColor.YELLOW + words + ChatColor.RED));
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ public class ResidencePlayerListener implements Listener {
|
|||||||
|
|
||||||
if (leave != null && !leave.equals("") && ResOld != res.getParent())
|
if (leave != null && !leave.equals("") && ResOld != res.getParent())
|
||||||
if (Residence.getConfigManager().useActionBar())
|
if (Residence.getConfigManager().useActionBar())
|
||||||
ActionBar.send(player, (new StringBuilder()).append(ChatColor.YELLOW).append(insertMessages(player, ResOld.getName(), ResOld, leave)).toString());
|
ActionBar.send(player, ChatColor.YELLOW + insertMessages(player, ResOld.getName(), ResOld, leave));
|
||||||
else
|
else
|
||||||
player.sendMessage(ChatColor.YELLOW + this.insertMessages(player, ResOld.getName(), ResOld, leave));
|
player.sendMessage(ChatColor.YELLOW + this.insertMessages(player, ResOld.getName(), ResOld, leave));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,20 +5,21 @@
|
|||||||
|
|
||||||
package com.bekvon.bukkit.residence.permissions;
|
package com.bekvon.bukkit.residence.permissions;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
|
|
||||||
import com.bekvon.bukkit.residence.Residence;
|
|
||||||
import com.bekvon.bukkit.residence.protection.CuboidArea;
|
|
||||||
import com.bekvon.bukkit.residence.protection.FlagPermissions;
|
|
||||||
import com.bekvon.bukkit.residence.protection.FlagPermissions.FlagState;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.bekvon.bukkit.residence.Residence;
|
||||||
|
import com.bekvon.bukkit.residence.protection.CuboidArea;
|
||||||
|
import com.bekvon.bukkit.residence.protection.FlagPermissions;
|
||||||
|
import com.bekvon.bukkit.residence.protection.FlagPermissions.FlagState;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Administrator
|
* @author Administrator
|
||||||
@@ -76,10 +77,160 @@ public class PermissionGroup {
|
|||||||
flagPerms.setParent(parentFlagPerms);
|
flagPerms.setParent(parentFlagPerms);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseGroup(ConfigurationSection limits) {
|
public boolean buyLandIgnoreLimits() {
|
||||||
if (limits == null) {
|
return buyIgnoreLimits;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean canBuyLand() {
|
||||||
|
return canBuy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canCreateResidences() {
|
||||||
|
return cancreate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canSellLand() {
|
||||||
|
return canSell;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canSetEnterLeaveMessages() {
|
||||||
|
return messageperms;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getCostPerBlock() {
|
||||||
|
return costperarea;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Entry<String, Boolean>> getDefaultCreatorFlags() {
|
||||||
|
return creatorDefaultFlags.entrySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultEnterMessage() {
|
||||||
|
return defaultEnterMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Entry<String, Map<String, Boolean>>> getDefaultGroupFlags() {
|
||||||
|
return groupDefaultFlags.entrySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultLeaveMessage() {
|
||||||
|
return defaultLeaveMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Entry<String, Boolean>> getDefaultResidenceFlags() {
|
||||||
|
return residenceDefaultFlags.entrySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLeaseGiveTime() {
|
||||||
|
return leaseGiveTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getLeaseRenewCost() {
|
||||||
|
return renewcostperarea;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxHeight() {
|
||||||
|
return maxHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxLeaseTime() {
|
||||||
|
return maxLeaseTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxPhysicalPerResidence() {
|
||||||
|
return maxPhysical;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxRentables() {
|
||||||
|
return maxRentables;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxRents() {
|
||||||
|
return maxRents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxSubzoneDepth() {
|
||||||
|
return subzonedepth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxX() {
|
||||||
|
return xmax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxY() {
|
||||||
|
return ymax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxZ() {
|
||||||
|
return zmax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxZones() {
|
||||||
|
return resmax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinHeight() {
|
||||||
|
return minHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasFlagAccess(String flag) {
|
||||||
|
return flagPerms.has(flag, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasKickAccess() {
|
||||||
|
return kick;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasTpAccess() {
|
||||||
|
return tpaccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasUnstuckAccess() {
|
||||||
|
return unstuck;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean inLimits(CuboidArea area) {
|
||||||
|
if (area.getXSize() > xmax || area.getYSize() > ymax || area.getZSize() > zmax)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean itemListAccess() {
|
||||||
|
return itemListAccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printLimits(Player player) {
|
||||||
|
player.sendMessage(ChatColor.GRAY + "---------------------------");
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "权限 组:" + ChatColor.DARK_AQUA + " " + Residence.getPermissionManager().getPermissionsGroup(player));
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "领地 组:" + ChatColor.DARK_AQUA + " " + groupname);
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "领地 管理:" + ChatColor.DARK_AQUA + " " + Residence.getPermissionManager().isResidenceAdmin(player));
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "允许创建领地:" + ChatColor.DARK_AQUA + " " + cancreate);
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "最大领地个数:" + ChatColor.DARK_AQUA + " " + resmax);
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "X轴最大长度:" + ChatColor.DARK_AQUA + " " + xmax);
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "Z轴最大长度:" + ChatColor.DARK_AQUA + " " + zmax);
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "Y轴最大高度:" + ChatColor.DARK_AQUA + " " + ymax);
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "高度限制:" + ChatColor.DARK_AQUA + " " + minHeight + " - " + maxHeight);
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "最大子领地深度:" + ChatColor.DARK_AQUA + " " + subzonedepth);
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "是否允许设置进出消息:" + ChatColor.DARK_AQUA + " " + messageperms);
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "你所拥有的领地:" + ChatColor.DARK_AQUA + " " + Residence.getResidenceManager().getOwnedZoneCount(player.getName()));
|
||||||
|
if (Residence.getEconomyManager() != null)
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "每个方块需要金钱:" + ChatColor.DARK_AQUA + " " + costperarea);
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "Flag 权限:" + ChatColor.DARK_AQUA + " " + flagPerms.listFlags());
|
||||||
|
if (Residence.getConfigManager().useLeases()) {
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "最大租赁日:" + ChatColor.DARK_AQUA + " " + maxLeaseTime);
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "续租日期:" + ChatColor.DARK_AQUA + " " + leaseGiveTime);
|
||||||
|
player.sendMessage(ChatColor.YELLOW + "续租方块需要金钱:" + ChatColor.DARK_AQUA + " " + renewcostperarea);
|
||||||
|
}
|
||||||
|
player.sendMessage(ChatColor.GRAY + "---------------------------");
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean selectCommandAccess() {
|
||||||
|
return selectCommandAccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void parseGroup(ConfigurationSection limits) {
|
||||||
|
if (limits == null)
|
||||||
|
return;
|
||||||
cancreate = limits.getBoolean("Residence.CanCreate", false);
|
cancreate = limits.getBoolean("Residence.CanCreate", false);
|
||||||
resmax = limits.getInt("Residence.MaxResidences", 0);
|
resmax = limits.getInt("Residence.MaxResidences", 0);
|
||||||
maxPhysical = limits.getInt("Residence.MaxAreasPerResidence", 2);
|
maxPhysical = limits.getInt("Residence.MaxAreasPerResidence", 2);
|
||||||
@@ -108,9 +259,8 @@ public class PermissionGroup {
|
|||||||
itemListAccess = limits.getBoolean("Residence.ItemListAccess", true);
|
itemListAccess = limits.getBoolean("Residence.ItemListAccess", true);
|
||||||
ConfigurationSection node = limits.getConfigurationSection("Flags.Permission");
|
ConfigurationSection node = limits.getConfigurationSection("Flags.Permission");
|
||||||
Set<String> flags = null;
|
Set<String> flags = null;
|
||||||
if (node != null) {
|
if (node != null)
|
||||||
flags = node.getKeys(false);
|
flags = node.getKeys(false);
|
||||||
}
|
|
||||||
if (flags != null) {
|
if (flags != null) {
|
||||||
Iterator<String> flagit = flags.iterator();
|
Iterator<String> flagit = flags.iterator();
|
||||||
while (flagit.hasNext()) {
|
while (flagit.hasNext()) {
|
||||||
@@ -120,9 +270,8 @@ public class PermissionGroup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
node = limits.getConfigurationSection("Flags.CreatorDefault");
|
node = limits.getConfigurationSection("Flags.CreatorDefault");
|
||||||
if (node != null) {
|
if (node != null)
|
||||||
flags = node.getKeys(false);
|
flags = node.getKeys(false);
|
||||||
}
|
|
||||||
if (flags != null) {
|
if (flags != null) {
|
||||||
Iterator<String> flagit = flags.iterator();
|
Iterator<String> flagit = flags.iterator();
|
||||||
while (flagit.hasNext()) {
|
while (flagit.hasNext()) {
|
||||||
@@ -133,9 +282,8 @@ public class PermissionGroup {
|
|||||||
|
|
||||||
}
|
}
|
||||||
node = limits.getConfigurationSection("Flags.Default");
|
node = limits.getConfigurationSection("Flags.Default");
|
||||||
if (node != null) {
|
if (node != null)
|
||||||
flags = node.getKeys(false);
|
flags = node.getKeys(false);
|
||||||
}
|
|
||||||
if (flags != null) {
|
if (flags != null) {
|
||||||
Iterator<String> flagit = flags.iterator();
|
Iterator<String> flagit = flags.iterator();
|
||||||
while (flagit.hasNext()) {
|
while (flagit.hasNext()) {
|
||||||
@@ -146,9 +294,8 @@ public class PermissionGroup {
|
|||||||
}
|
}
|
||||||
node = limits.getConfigurationSection("Flags.GroupDefault");
|
node = limits.getConfigurationSection("Flags.GroupDefault");
|
||||||
Set<String> groupDef = null;
|
Set<String> groupDef = null;
|
||||||
if (node != null) {
|
if (node != null)
|
||||||
groupDef = node.getKeys(false);
|
groupDef = node.getKeys(false);
|
||||||
}
|
|
||||||
if (groupDef != null) {
|
if (groupDef != null) {
|
||||||
Iterator<String> groupit = groupDef.iterator();
|
Iterator<String> groupit = groupDef.iterator();
|
||||||
while (groupit.hasNext()) {
|
while (groupit.hasNext()) {
|
||||||
@@ -166,155 +313,4 @@ public class PermissionGroup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxX() {
|
|
||||||
return xmax;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMaxY() {
|
|
||||||
return ymax;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMaxZ() {
|
|
||||||
return zmax;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMinHeight() {
|
|
||||||
return minHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMaxHeight() {
|
|
||||||
return maxHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMaxZones() {
|
|
||||||
return resmax;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getCostPerBlock() {
|
|
||||||
return costperarea;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasTpAccess() {
|
|
||||||
return tpaccess;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMaxSubzoneDepth() {
|
|
||||||
return subzonedepth;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canSetEnterLeaveMessages() {
|
|
||||||
return messageperms;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefaultEnterMessage() {
|
|
||||||
return defaultEnterMessage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDefaultLeaveMessage() {
|
|
||||||
return defaultLeaveMessage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMaxLeaseTime() {
|
|
||||||
return maxLeaseTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getLeaseGiveTime() {
|
|
||||||
return leaseGiveTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getLeaseRenewCost() {
|
|
||||||
return renewcostperarea;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canBuyLand() {
|
|
||||||
return canBuy;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canSellLand() {
|
|
||||||
return canSell;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMaxRents() {
|
|
||||||
return maxRents;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMaxRentables() {
|
|
||||||
return maxRentables;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean buyLandIgnoreLimits() {
|
|
||||||
return buyIgnoreLimits;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasUnstuckAccess() {
|
|
||||||
return unstuck;
|
|
||||||
}
|
|
||||||
public boolean hasKickAccess() {
|
|
||||||
return kick;
|
|
||||||
}
|
|
||||||
public int getMaxPhysicalPerResidence() {
|
|
||||||
return maxPhysical;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<Entry<String, Boolean>> getDefaultResidenceFlags() {
|
|
||||||
return residenceDefaultFlags.entrySet();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<Entry<String, Boolean>> getDefaultCreatorFlags() {
|
|
||||||
return creatorDefaultFlags.entrySet();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<Entry<String, Map<String, Boolean>>> getDefaultGroupFlags() {
|
|
||||||
return groupDefaultFlags.entrySet();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canCreateResidences() {
|
|
||||||
return cancreate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasFlagAccess(String flag) {
|
|
||||||
return flagPerms.has(flag, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean inLimits(CuboidArea area) {
|
|
||||||
if (area.getXSize() > xmax || area.getYSize() > ymax || area.getZSize() > zmax) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean selectCommandAccess() {
|
|
||||||
return selectCommandAccess;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean itemListAccess() {
|
|
||||||
return itemListAccess;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void printLimits(Player player) {
|
|
||||||
player.sendMessage(ChatColor.GRAY + "---------------------------");
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Permissions Group:" + ChatColor.DARK_AQUA + " " + Residence.getPermissionManager().getPermissionsGroup(player));
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Residence Group:" + ChatColor.DARK_AQUA + " " + groupname);
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Residence Admin:" + ChatColor.DARK_AQUA + " " + Residence.getPermissionManager().isResidenceAdmin(player));
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Can Create Residences:" + ChatColor.DARK_AQUA + " " + cancreate);
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Max Residences:" + ChatColor.DARK_AQUA + " " + resmax);
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Max East/West Size:" + ChatColor.DARK_AQUA + " " + xmax);
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Max North/South Size:" + ChatColor.DARK_AQUA + " " + zmax);
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Max Up/Down Size:" + ChatColor.DARK_AQUA + " " + ymax);
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Min/Max Protection Height:" + ChatColor.DARK_AQUA + " " + minHeight + " to " + maxHeight);
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Max Subzone Depth:" + ChatColor.DARK_AQUA + " " + subzonedepth);
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Can Set Enter/Leave Messages:" + ChatColor.DARK_AQUA + " " + messageperms);
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Number of Residences you own:" + ChatColor.DARK_AQUA + " " + Residence.getResidenceManager().getOwnedZoneCount(player.getName()));
|
|
||||||
if (Residence.getEconomyManager() != null) {
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Residence Cost Per Block:" + ChatColor.DARK_AQUA + " " + costperarea);
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Flag Permissions:" + ChatColor.DARK_AQUA + " " + flagPerms.listFlags());
|
|
||||||
if (Residence.getConfigManager().useLeases()) {
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Max Lease Days:" + ChatColor.DARK_AQUA + " " + maxLeaseTime);
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Lease Time Given on Renew:" + ChatColor.DARK_AQUA + " " + leaseGiveTime);
|
|
||||||
player.sendMessage(ChatColor.YELLOW + "Renew Cost Per Block:" + ChatColor.DARK_AQUA + " " + renewcostperarea);
|
|
||||||
}
|
|
||||||
player.sendMessage(ChatColor.GRAY + "---------------------------");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -796,12 +796,6 @@ public class ClaimedResidence {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setEnterLeaveMessage(Player player, String message, boolean enter, boolean resadmin) {
|
public void setEnterLeaveMessage(Player player, String message, boolean enter, boolean resadmin) {
|
||||||
// if(message!=null &&
|
|
||||||
// Residence.getConfigManager().getResidenceNameRegex() != null) {
|
|
||||||
// Removed pending further action
|
|
||||||
// player.sendMessage(ChatColor.RED+Residence.getLanguage().getPhrase("InvalidCharacters"));
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
if (message != null)
|
if (message != null)
|
||||||
if (message.equals(""))
|
if (message.equals(""))
|
||||||
message = null;
|
message = null;
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ CommandHelp: #this is just a holder node, that holds the entire help
|
|||||||
Description: '设置选区为WorldEdit的已选择区域.'
|
Description: '设置选区为WorldEdit的已选择区域.'
|
||||||
Info:
|
Info:
|
||||||
- 'Usage /res select worldedit'
|
- 'Usage /res select worldedit'
|
||||||
- 'Sets selection area using the current WorldEdit selection.'
|
- '设置领地的选区为WorldEdit的已选择区域.'
|
||||||
create: #creation command
|
create: #creation command
|
||||||
Description: '创建领地'
|
Description: '创建领地'
|
||||||
Info:
|
Info:
|
||||||
@@ -326,9 +326,11 @@ CommandHelp: #this is just a holder node, that holds the entire help
|
|||||||
Description: '删除某位玩家所属的全部领地.'
|
Description: '删除某位玩家所属的全部领地.'
|
||||||
Info:
|
Info:
|
||||||
- 'Usage: /res removeall [owner]'
|
- 'Usage: /res removeall [owner]'
|
||||||
- 'Removes all residences owned by a specific player.'
|
- '移除某一个玩家的所有领地.'
|
||||||
- 'Requires /resadmin if you use it on anyone besides yourself.'
|
- '必须使用 /resadmin 如果你是移除别人的领地.'
|
||||||
confirm:
|
confirm:
|
||||||
|
Description: '确认领地的删除操作.'
|
||||||
|
info:
|
||||||
- 'Usage: /res confirm'
|
- 'Usage: /res confirm'
|
||||||
- '确认你要删除某个领地'
|
- '确认你要删除某个领地'
|
||||||
subzone:
|
subzone:
|
||||||
@@ -476,6 +478,7 @@ CommandHelp: #this is just a holder node, that holds the entire help
|
|||||||
- 'note - 允许或禁止领地内使用音符盒'
|
- 'note - 允许或禁止领地内使用音符盒'
|
||||||
- 'redstone - 同时配置 lever, diode, button, pressure, note 属性'
|
- 'redstone - 同时配置 lever, diode, button, pressure, note 属性'
|
||||||
- 'craft - 同时配置 table, enchant, brew 属性'
|
- 'craft - 同时配置 table, enchant, brew 属性'
|
||||||
|
- ''
|
||||||
list:
|
list:
|
||||||
Description: 查看某个玩家领地
|
Description: 查看某个玩家领地
|
||||||
Info:
|
Info:
|
||||||
|
|||||||
Reference in New Issue
Block a user