1
0
mirror of https://e.coding.net/circlecloud/Residence.git synced 2025-11-24 21:46:16 +00:00

fix Permission load error...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092
2015-09-25 08:46:39 +08:00
parent 2efa4a4248
commit 9b24f0dfae
4 changed files with 25 additions and 22 deletions

View File

@@ -247,14 +247,17 @@ public class ConfigManager {
customRightClick = config.getIntegerList("Global.CustomRightClick"); customRightClick = config.getIntegerList("Global.CustomRightClick");
final ConfigurationSection node = config.getConfigurationSection("Global.GroupDefault"); final ConfigurationSection node = config.getConfigurationSection("Global.GroupDefault");
if (!plugin.is1_8()) if (!plugin.is1_8()) {
actionBar = false; actionBar = false;
}
if (node != null) { if (node != null) {
final Set<String> keys = node.getConfigurationSection(defaultGroup).getKeys(false); final Set<String> keys = node.getConfigurationSection(defaultGroup).getKeys(false);
if (keys != null) if (keys != null) {
for (final String key : keys) for (final String key : keys) {
globalGroupDefaults.put(key, FlagPermissions.parseFromConfigNode(key, config.getConfigurationSection("Global.GroupDefault"))); globalGroupDefaults.put(key, FlagPermissions.parseFromConfigNode(key, config.getConfigurationSection("Global.GroupDefault")));
}
}
} }
try { try {
chatColor = ChatColor.valueOf(config.getString("Global.ResidenceChatColor", "DARK_PURPLE")); chatColor = ChatColor.valueOf(config.getString("Global.ResidenceChatColor", "DARK_PURPLE"));

View File

@@ -83,8 +83,7 @@ public class Residence extends JavaPlugin {
public static float bukkitver; public static float bukkitver;
public final static int saveVersion = 1; public final static int saveVersion = 1;
public final static String[] validLanguages = { "English", public final static String[] validLanguages = { "English", "Chinese" };
"Chinese" };
protected static Residence instance; protected static Residence instance;
protected ResidenceBlockListener blistener; protected ResidenceBlockListener blistener;
protected ChatManager chatmanager; protected ChatManager chatmanager;
@@ -341,6 +340,7 @@ public class Residence extends JavaPlugin {
@Override @Override
public void onEnable() { public void onEnable() {
try { try {
instance = this;
bukkitver = Float.parseFloat(this.getServer().getBukkitVersion().substring(0, 3)); bukkitver = Float.parseFloat(this.getServer().getBukkitVersion().substring(0, 3));
init = false; init = false;
deleteConfirm = new HashMap<String, String>(); deleteConfirm = new HashMap<String, String>();

View File

@@ -28,13 +28,13 @@ import com.bekvon.bukkit.residence.protection.ResidenceManager;
*/ */
public class TransactionManager { public class TransactionManager {
private Map<String, Integer> sellAmount; private Map<String, Integer> sellAmount;
PermissionManager gm; PermissionManager gmanager;
ResidenceManager manager; ResidenceManager manager;
Residence plugin; Residence plugin;
public TransactionManager(final Residence plugin, final ResidenceManager m, final PermissionManager g) { public TransactionManager(final Residence plugin, final ResidenceManager m, final PermissionManager g) {
this.plugin = plugin; this.plugin = plugin;
gm = g; gmanager = g;
manager = m; manager = m;
sellAmount = Collections.synchronizedMap(new HashMap<String, Integer>()); sellAmount = Collections.synchronizedMap(new HashMap<String, Integer>());
} }
@@ -65,7 +65,7 @@ public class TransactionManager {
} }
public void buyPlot(final String areaname, final Player player, final boolean resadmin) { public void buyPlot(final String areaname, final Player player, final boolean resadmin) {
final PermissionGroup group = gm.getGroup(player); final PermissionGroup group = gmanager.getGroup(player);
if (!resadmin) { if (!resadmin) {
if (!plugin.getConfigManager().enableEconomy() || plugin.getEconomyManager() == null) { if (!plugin.getConfigManager().enableEconomy() || plugin.getEconomyManager() == null) {
player.sendMessage(ChatColor.RED + plugin.getLanguage().getPhrase("MarketDisabled")); player.sendMessage(ChatColor.RED + plugin.getLanguage().getPhrase("MarketDisabled"));

View File

@@ -235,16 +235,16 @@ public class PermissionGroup {
if (limits == null) { if (limits == null) {
return; return;
} }
cancreate = limits.getBoolean("plugin.CanCreate", false); cancreate = limits.getBoolean("Residence.CanCreate", false);
resmax = limits.getInt("plugin.MaxResidences", 0); resmax = limits.getInt("Residence.MaxResidences", 0);
maxPhysical = limits.getInt("plugin.MaxAreasPerResidence", 2); maxPhysical = limits.getInt("Residence.MaxAreasPerResidence", 2);
xmax = limits.getInt("plugin.MaxEastWest", 0); xmax = limits.getInt("Residence.MaxEastWest", 0);
ymax = limits.getInt("plugin.MaxUpDown", 0); ymax = limits.getInt("Residence.MaxUpDown", 0);
zmax = limits.getInt("plugin.MaxNorthSouth", 0); zmax = limits.getInt("Residence.MaxNorthSouth", 0);
minHeight = limits.getInt("plugin.MinHeight", 0); minHeight = limits.getInt("Residence.MinHeight", 0);
maxHeight = limits.getInt("plugin.MaxHeight", 255); maxHeight = limits.getInt("Residence.MaxHeight", 255);
tpaccess = limits.getBoolean("plugin.CanTeleport", false); tpaccess = limits.getBoolean("Residence.CanTeleport", false);
subzonedepth = limits.getInt("plugin.SubzoneDepth", 0); subzonedepth = limits.getInt("Residence.SubzoneDepth", 0);
messageperms = limits.getBoolean("Messaging.CanChange", false); messageperms = limits.getBoolean("Messaging.CanChange", false);
defaultEnterMessage = limits.getString("Messaging.DefaultEnter", null); defaultEnterMessage = limits.getString("Messaging.DefaultEnter", null);
defaultLeaveMessage = limits.getString("Messaging.DefaultLeave", null); defaultLeaveMessage = limits.getString("Messaging.DefaultLeave", null);
@@ -257,10 +257,10 @@ public class PermissionGroup {
canSell = limits.getBoolean("Economy.CanSell", false); canSell = limits.getBoolean("Economy.CanSell", false);
buyIgnoreLimits = limits.getBoolean("Economy.IgnoreLimits", false); buyIgnoreLimits = limits.getBoolean("Economy.IgnoreLimits", false);
costperarea = limits.getDouble("Economy.BuyCost", 0); costperarea = limits.getDouble("Economy.BuyCost", 0);
unstuck = limits.getBoolean("plugin.Unstuck", false); unstuck = limits.getBoolean("Residence.Unstuck", false);
kick = limits.getBoolean("plugin.Kick", false); kick = limits.getBoolean("Residence.Kick", false);
selectCommandAccess = limits.getBoolean("plugin.SelectCommandAccess", true); selectCommandAccess = limits.getBoolean("Residence.SelectCommandAccess", true);
itemListAccess = limits.getBoolean("plugin.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) {