diff options
author | snowleo <schneeleo@gmail.com> | 2011-12-13 23:52:25 +0100 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2011-12-13 23:52:25 +0100 |
commit | 79861b1f10af8e57b3c11d0e5f12895648ebce44 (patch) | |
tree | ba90475ff033b4e5bf3688db5145c72b335ccc4f /EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java | |
parent | 505460349f840cf5a91f9f13f4a2e56537617263 (diff) | |
parent | 559400c606775141397b691fce2385e541bf143b (diff) | |
download | Essentials-79861b1f10af8e57b3c11d0e5f12895648ebce44.tar Essentials-79861b1f10af8e57b3c11d0e5f12895648ebce44.tar.gz Essentials-79861b1f10af8e57b3c11d0e5f12895648ebce44.tar.lz Essentials-79861b1f10af8e57b3c11d0e5f12895648ebce44.tar.xz Essentials-79861b1f10af8e57b3c11d0e5f12895648ebce44.zip |
Merge branch 'refs/heads/groupmanager'
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java index 10757475d..1f2be9875 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java @@ -9,6 +9,9 @@ import java.util.ArrayList; import org.anjocaido.groupmanager.GroupManager; import org.anjocaido.groupmanager.dataholder.WorldDataHolder; +import org.anjocaido.groupmanager.events.GMUserEvent.Action; +import org.anjocaido.groupmanager.events.GroupManagerEventHandler; + import java.util.Map; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -16,7 +19,7 @@ import org.bukkit.entity.Player; /** * - * @author gabrielcouto + * @author gabrielcouto/ElgarL */ public class User extends DataUnit implements Cloneable { @@ -139,6 +142,8 @@ public class User extends DataUnit implements Cloneable { if (notify) GroupManager.notify(this.getName(), String.format(" moved to the group %s.", group.getName())); + + GroupManagerEventHandler.callEvent(this, Action.USER_GROUP_CHANGED); } } @@ -153,9 +158,11 @@ public class User extends DataUnit implements Cloneable { removeSubGroup(subGroup); subGroups.add(subGroup.getName()); flagAsChanged(); - if (GroupManager.isLoaded()) + if (GroupManager.isLoaded()) { if (GroupManager.BukkitPermissions.player_join = false) GroupManager.BukkitPermissions.updateAllPlayers(); + GroupManagerEventHandler.callEvent(this, Action.USER_SUBGROUP_CHANGED); + } } public int subGroupsSize() { @@ -177,6 +184,7 @@ public class User extends DataUnit implements Cloneable { if (GroupManager.isLoaded()) if (GroupManager.BukkitPermissions.player_join = false) GroupManager.BukkitPermissions.updateAllPlayers(); + GroupManagerEventHandler.callEvent(this, Action.USER_SUBGROUP_CHANGED); return true; } } catch (Exception e) { @@ -220,9 +228,11 @@ public class User extends DataUnit implements Cloneable { variables.addVar(key, varList.get(key)); } flagAsChanged(); - if (GroupManager.isLoaded()) + if (GroupManager.isLoaded()) { if (GroupManager.BukkitPermissions.player_join = false) GroupManager.BukkitPermissions.updateAllPlayers(); + GroupManagerEventHandler.callEvent(this, Action.USER_INFO_CHANGED); + } } public User updatePlayer(Player player) { @@ -238,5 +248,4 @@ public class User extends DataUnit implements Cloneable { } return bukkitPlayer; } - } |