diff options
author | ElgarL <ElgarL@palmergames.com> | 2011-10-11 22:05:21 +0100 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2011-10-11 22:05:21 +0100 |
commit | 1543bfd5504eeaa83c48b27077bdf7a66f5bc715 (patch) | |
tree | c71c87200d52f4de1488289ce4c8744cc373b352 /EssentialsGroupManager/src/org | |
parent | 1bb3eb0d07cd4d39044b3c9b3f8f7fae96d88720 (diff) | |
download | Essentials-1543bfd5504eeaa83c48b27077bdf7a66f5bc715.tar Essentials-1543bfd5504eeaa83c48b27077bdf7a66f5bc715.tar.gz Essentials-1543bfd5504eeaa83c48b27077bdf7a66f5bc715.tar.lz Essentials-1543bfd5504eeaa83c48b27077bdf7a66f5bc715.tar.xz Essentials-1543bfd5504eeaa83c48b27077bdf7a66f5bc715.zip |
v 1.4:
- Updated for Bukkits new YamlConfiguration.
- Cleared remaining Cast errors cause by object cloning.
Diffstat (limited to 'EssentialsGroupManager/src/org')
5 files changed, 12 insertions, 12 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java index aa838d9e8..0d9f927d9 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java @@ -10,7 +10,7 @@ import java.util.Map; import java.util.logging.Level; import org.anjocaido.groupmanager.utils.Tasks; -import org.bukkit.util.config.Configuration; +import org.bukkit.configuration.file.YamlConfiguration; /** * @@ -20,7 +20,7 @@ public class GMConfiguration { private GroupManager plugin; private File configFile; - private Configuration GMconfig; + private YamlConfiguration GMconfig; public GMConfiguration(GroupManager plugin) { this.plugin = plugin; @@ -41,10 +41,10 @@ public class GMConfiguration { } } - GMconfig = new Configuration(configFile); + GMconfig = new YamlConfiguration(); try { - GMconfig.load(); + GMconfig.load(configFile); } catch (Exception ex) { throw new IllegalArgumentException("The following file couldn't pass on Parser.\n" + configFile.getPath(), ex); } @@ -57,7 +57,7 @@ public class GMConfiguration { @SuppressWarnings("unchecked") public Map<String, Object> getMirrorsMap() { - return (Map<String, Object>) GMconfig.getProperty("settings.permission.world.mirror"); + return (Map<String, Object>) GMconfig.getList("settings.permission.world.mirror"); } public Integer getSaveInterval() { diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index ac822908f..92d50ca5d 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -1770,10 +1770,10 @@ public class GroupManager extends JavaPlugin { for(Player test: Bukkit.getServer().getOnlinePlayers()) { if (!test.equals(player)){ if (test.hasPermission("groupmanager.notify.other")) - test.sendMessage(ChatColor.YELLOW + name +" was " + msg); + test.sendMessage(ChatColor.YELLOW + name +" was" + msg); } else if ((player != null) && ((player.hasPermission("groupmanager.notify.self")) || (player.hasPermission("groupmanager.notify.other")))) - player.sendMessage(ChatColor.YELLOW + "You we're " + msg); + player.sendMessage(ChatColor.YELLOW + "You we're" + msg); } } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java index f17d8b21e..7b027a94d 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java @@ -102,7 +102,7 @@ public abstract class DataUnit { * @return a copy of the permission list */ public ArrayList<String> getPermissionList() { - return (ArrayList<String>) permissions.clone(); + return new ArrayList<String>(permissions); } public void sortPermissions() { diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java index c881fc95d..84d4fceed 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java @@ -41,7 +41,7 @@ public class Group extends DataUnit implements Cloneable { @Override public Group clone() { Group clone = new Group(getDataSource(), this.getName()); - clone.inherits = ((ArrayList<String>) this.getInherits().clone()); + clone.inherits = new ArrayList<String>(this.getInherits()); for (String perm : this.getPermissionList()) { clone.addPermission(perm); } @@ -60,7 +60,7 @@ public class Group extends DataUnit implements Cloneable { return null; } Group clone = getDataSource().createGroup(this.getName()); - clone.inherits = ((ArrayList<String>) this.getInherits().clone()); + clone.inherits = new ArrayList<String>(this.getInherits()); for (String perm : this.getPermissionList()) { clone.addPermission(perm); } @@ -76,7 +76,7 @@ public class Group extends DataUnit implements Cloneable { * @return the inherits */ public ArrayList<String> getInherits() { - return (ArrayList<String>) inherits.clone(); + return new ArrayList<String>(inherits); } /** diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java index a95018fa9..8a0e6cdbb 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java @@ -183,7 +183,7 @@ public class User extends DataUnit implements Cloneable { } public ArrayList<String> subGroupListStringCopy() { - return (ArrayList<String>) subGroups.clone(); + return new ArrayList<String>(subGroups); } /** |