summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2011-10-11 22:05:21 +0100
committerElgarL <ElgarL@palmergames.com>2011-10-11 22:05:21 +0100
commit1543bfd5504eeaa83c48b27077bdf7a66f5bc715 (patch)
treec71c87200d52f4de1488289ce4c8744cc373b352 /EssentialsGroupManager/src
parent1bb3eb0d07cd4d39044b3c9b3f8f7fae96d88720 (diff)
downloadEssentials-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')
-rw-r--r--EssentialsGroupManager/src/Changelog.txt5
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java10
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java4
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java2
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java6
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java2
-rw-r--r--EssentialsGroupManager/src/plugin.yml2
7 files changed, 17 insertions, 14 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index fe33a9f15..2fc8cf71c 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -39,4 +39,7 @@ v 1.3:
- Fix for Bukkit passing a null To location on a player Portaling
- Fixed manudelsub not correctly selecting the group to remove.
- Added two new permission nodes - groupmanager.notify.self & groupmanager.notify.other
- These allow players/admins to be notified when players are moved between groups. \ No newline at end of file
+ These allow players/admins to be notified when players are moved between groups.
+v 1.4:
+ - Updated for Bukkits new YamlConfiguration.
+ - Cleared remaining Cast errors cause by object cloning. \ No newline at end of file
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);
}
/**
diff --git a/EssentialsGroupManager/src/plugin.yml b/EssentialsGroupManager/src/plugin.yml
index a247c7ad0..596b4a8d8 100644
--- a/EssentialsGroupManager/src/plugin.yml
+++ b/EssentialsGroupManager/src/plugin.yml
@@ -1,5 +1,5 @@
name: GroupManager
-version: "1.3 (Phoenix)"
+version: "1.4 (Phoenix)"
main: org.anjocaido.groupmanager.GroupManager
website: http://www.anjocaido.info/
description: Provides on-the-fly system for permissions system created by Nijikokun. But all in memory, and with flat-file saving schedule.