summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src/org/anjocaido/groupmanager
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-03-17 18:20:33 +0000
committerKHobbits <rob@khobbits.co.uk>2012-03-17 18:20:33 +0000
commitaf8cf203e2965c33ca7708b0e6ce341b451f8045 (patch)
treea8bcfed7eb292c5fa200f2b0fe11b2e82be8c114 /EssentialsGroupManager/src/org/anjocaido/groupmanager
parent4c7564c936412210a7d3a91418d16c9bc759c603 (diff)
parente036ecf9247218da714dcb616e34269ac6cbbce3 (diff)
downloadEssentials-af8cf203e2965c33ca7708b0e6ce341b451f8045.tar
Essentials-af8cf203e2965c33ca7708b0e6ce341b451f8045.tar.gz
Essentials-af8cf203e2965c33ca7708b0e6ce341b451f8045.tar.lz
Essentials-af8cf203e2965c33ca7708b0e6ce341b451f8045.tar.xz
Essentials-af8cf203e2965c33ca7708b0e6ce341b451f8045.zip
Merge remote branch 'remotes/origin/groupmanager'
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java26
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java12
2 files changed, 3 insertions, 35 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
index e72118468..290a58388 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
@@ -347,32 +347,8 @@ public class WorldsHolder {
String worldNameLowered = worldName.toLowerCase();
// Find this worlds data
- if (worldsData.containsKey(worldNameLowered)) {
-
- String usersMirror = mirrorsUser.get(worldNameLowered);
- String groupsMirror = mirrorsGroup.get(worldNameLowered);
-
- if (usersMirror != null) {
-
- // If both are mirrored
- if (groupsMirror != null) {
-
- // if the data sources are the same, return the parent
- if (usersMirror == groupsMirror)
- return getUpdatedWorldData(usersMirror.toLowerCase());
-
- // Both data sources are mirrors, but they are from different parents
- // so we return the actual data object.
- return getUpdatedWorldData(worldNameLowered);
- }
-
- // Groups isn't a mirror so return this this worlds data source
- return getUpdatedWorldData(worldNameLowered);
- }
-
- // users isn't mirrored so we need to return this worlds data source
+ if (worldsData.containsKey(worldNameLowered))
return getUpdatedWorldData(worldNameLowered);
- }
// Oddly no data source was found for this world so return the default.
GroupManager.logger.finest("Requested world " + worldName + " not found or badly mirrored. Returning default world...");
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
index 0b6148900..dc08168dc 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java
@@ -26,6 +26,7 @@ import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Set;
+import java.util.WeakHashMap;
import org.anjocaido.groupmanager.GroupManager;
@@ -37,7 +38,6 @@ import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChangedWorldEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerKickEvent;
-import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.server.PluginDisableEvent;
import org.bukkit.event.server.PluginEnableEvent;
import org.bukkit.permissions.Permission;
@@ -54,7 +54,7 @@ import org.bukkit.plugin.PluginManager;
*/
public class BukkitPermissions {
- protected Map<Player, PermissionAttachment> attachments = new HashMap<Player, PermissionAttachment>();
+ protected WeakHashMap<Player, PermissionAttachment> attachments = new WeakHashMap<Player, PermissionAttachment>();
protected LinkedHashMap<String, Permission> registeredPermissions = new LinkedHashMap<String, Permission>();
protected GroupManager plugin;
protected boolean dumpAllPermissions = true;
@@ -369,14 +369,6 @@ public class BukkitPermissions {
}
@EventHandler(priority = EventPriority.LOWEST)
- public void onPlayerQuit(PlayerQuitEvent event) {
- if (!GroupManager.isLoaded())
- return;
-
- attachments.remove(event.getPlayer());
- }
-
- @EventHandler(priority = EventPriority.LOWEST)
public void onPlayerKick(PlayerKickEvent event) {
attachments.remove(event.getPlayer());
}