From 815a9dcca22b108c158fcf41035edac2ff4b7178 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Wed, 14 Dec 2011 16:24:47 +0000 Subject: Removed op permissions from admins in the default GloblaGroups.yml. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- EssentialsGroupManager/src/globalgroups.yml | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 47a0f6b79..1f5f0313d 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -85,4 +85,5 @@ v 1.7: - Offline player checks now support partial name matches. - Added custom events so plugins can now be notified of changes within GroupManager. - GM now registers with Bukkits ServicesManager. - - deleting the contents of GlobalGroups.yml will no longer thrown a NullPointerException. \ No newline at end of file + - deleting the contents of GlobalGroups.yml will no longer thrown a NullPointerException. + - Removed op permissions from admins in the default GloblaGroups.yml. \ No newline at end of file diff --git a/EssentialsGroupManager/src/globalgroups.yml b/EssentialsGroupManager/src/globalgroups.yml index 9662baf43..066f4faea 100644 --- a/EssentialsGroupManager/src/globalgroups.yml +++ b/EssentialsGroupManager/src/globalgroups.yml @@ -150,9 +150,9 @@ groups: - bukkit.command.kill - bukkit.command.list - bukkit.command.me - - bukkit.command.op - - bukkit.command.op.give - - bukkit.command.op.take + - -bukkit.command.op + - -bukkit.command.op.give + - -bukkit.command.op.take - bukkit.command.plugins - bukkit.command.reload - bukkit.command.save -- cgit v1.2.3 From ac77bbb0b4f405598b8fc8271d520818d0646da9 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sun, 18 Dec 2011 04:25:54 +0000 Subject: Changed ServicesManager registration to lowest from normal. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GroupManager.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 1f5f0313d..76782e99a 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -86,4 +86,5 @@ v 1.7: - Added custom events so plugins can now be notified of changes within GroupManager. - GM now registers with Bukkits ServicesManager. - deleting the contents of GlobalGroups.yml will no longer thrown a NullPointerException. - - Removed op permissions from admins in the default GloblaGroups.yml. \ No newline at end of file + - Removed op permissions from admins in the default GloblaGroups.yml. + - Changed ServicesManager registration to lowest from normal. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 2d46e74c8..c51efb8be 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -161,7 +161,7 @@ public class GroupManager extends JavaPlugin { System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!"); // Register as a service - this.getServer().getServicesManager().register(AnjoPermissionsHandler.class, this.permissionHandler, this, ServicePriority.Normal); + this.getServer().getServicesManager().register(AnjoPermissionsHandler.class, this.permissionHandler, this, ServicePriority.Lowest); } public static boolean isLoaded() { -- cgit v1.2.3 From de40f7f556513d4997779f0c5cc1d77fe050a02a Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sun, 18 Dec 2011 14:26:00 +0000 Subject: Fixed 'manucheckp' returning a null for the searched node when it's a group/subgroup. --- EssentialsGroupManager/src/Changelog.txt | 4 +++- .../anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java | 3 +++ EssentialsGroupManager/src/plugin.yml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 76782e99a..69f921bb3 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -87,4 +87,6 @@ v 1.7: - GM now registers with Bukkits ServicesManager. - deleting the contents of GlobalGroups.yml will no longer thrown a NullPointerException. - Removed op permissions from admins in the default GloblaGroups.yml. - - Changed ServicesManager registration to lowest from normal. \ No newline at end of file +v 1.8: + - Changed ServicesManager registration to lowest from normal. + - Fixed 'manucheckp' returning a null for the searched node when it's a group/subgroup. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index 6e18bf3f8..9b7253c41 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java @@ -711,12 +711,14 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { PermissionCheckResult resultUser = checkUserOnlyPermission(user, targetPermission); if (resultUser.resultType != PermissionCheckResult.Type.NOTFOUND) { + resultUser.accessLevel = targetPermission; return resultUser; } // IT ONLY CHECKS GROUPS PERMISSIONS IF RESULT FOR USER IS NOT FOUND PermissionCheckResult resultGroup = checkGroupPermissionWithInheritance(user.getGroup(), targetPermission); if (resultGroup.resultType != PermissionCheckResult.Type.NOTFOUND) { + result.accessLevel = targetPermission; return resultGroup; } @@ -724,6 +726,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { for (Group subGroup : user.subGroupListCopy()) { PermissionCheckResult resultSubGroup = checkGroupPermissionWithInheritance(subGroup, targetPermission); if (resultSubGroup.resultType != PermissionCheckResult.Type.NOTFOUND) { + resultSubGroup.accessLevel = targetPermission; return resultSubGroup; } } diff --git a/EssentialsGroupManager/src/plugin.yml b/EssentialsGroupManager/src/plugin.yml index 115e92ba2..da5164ce1 100644 --- a/EssentialsGroupManager/src/plugin.yml +++ b/EssentialsGroupManager/src/plugin.yml @@ -1,5 +1,5 @@ name: GroupManager -version: "1.7 (Phoenix)" +version: "1.8 (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. -- cgit v1.2.3 From 244673e1fb8a8583c95df765e7b64f18c2c631c3 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sun, 18 Dec 2011 14:35:14 +0000 Subject: Fixed manucheckp on group (missed it in last commit) --- .../org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index 9b7253c41..b23fc01d4 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java @@ -718,7 +718,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { // IT ONLY CHECKS GROUPS PERMISSIONS IF RESULT FOR USER IS NOT FOUND PermissionCheckResult resultGroup = checkGroupPermissionWithInheritance(user.getGroup(), targetPermission); if (resultGroup.resultType != PermissionCheckResult.Type.NOTFOUND) { - result.accessLevel = targetPermission; + resultGroup.accessLevel = targetPermission; return resultGroup; } -- cgit v1.2.3 From afe8ecd3dfd26d49c1133e330c942c90e7826e1f Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sun, 18 Dec 2011 15:21:56 +0000 Subject: Fixed a typo --- EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index c51efb8be..062d3df21 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -805,7 +805,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel); } else if (permissionResult.owner instanceof Group) { if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) { - sender.sendMessage(ChatColor.RED + "The user inherits the a negation permission from group: " + permissionResult.owner.getName()); + sender.sendMessage(ChatColor.RED + "The user inherits a negation permission from group: " + permissionResult.owner.getName()); } else { sender.sendMessage(ChatColor.YELLOW + "The user inherits the permission from group: " + permissionResult.owner.getName()); } -- cgit v1.2.3 From 5bb7d82fca1e600107de1b6a588241e600aaf55e Mon Sep 17 00:00:00 2001 From: snowleo Date: Mon, 19 Dec 2011 12:39:23 +0100 Subject: Fix double names in /balancetop and show display name in balancetop --- Essentials/src/com/earth2me/essentials/UserMap.java | 14 +++++++------- .../earth2me/essentials/commands/Commandbalancetop.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/UserMap.java b/Essentials/src/com/earth2me/essentials/UserMap.java index 467c2693b..f6b75c3a5 100644 --- a/Essentials/src/com/earth2me/essentials/UserMap.java +++ b/Essentials/src/com/earth2me/essentials/UserMap.java @@ -47,7 +47,7 @@ public class UserMap extends CacheLoader implements IConf continue; } final String name = string.substring(0, string.length() - 4); - keys.add(name.toLowerCase(Locale.ENGLISH)); + keys.add(Util.sanitizeFileName(name)); } } }); @@ -55,14 +55,14 @@ public class UserMap extends CacheLoader implements IConf public boolean userExists(final String name) { - return keys.contains(name.toLowerCase(Locale.ENGLISH)); + return keys.contains(Util.sanitizeFileName(name)); } public User getUser(final String name) { try { - return users.get(name.toLowerCase(Locale.ENGLISH)); + return users.get(Util.sanitizeFileName(name)); } catch (ExecutionException ex) { @@ -81,14 +81,14 @@ public class UserMap extends CacheLoader implements IConf { if (player.getName().equalsIgnoreCase(name)) { - keys.add(name.toLowerCase(Locale.ENGLISH)); + keys.add(Util.sanitizeFileName(name)); return new User(player, ess); } } final File userFile = getUserFile(name); if (userFile.exists()) { - keys.add(name.toLowerCase(Locale.ENGLISH)); + keys.add(Util.sanitizeFileName(name)); return new User(new OfflinePlayer(name, ess), ess); } throw new Exception("User not found!"); @@ -102,8 +102,8 @@ public class UserMap extends CacheLoader implements IConf public void removeUser(final String name) { - keys.remove(name.toLowerCase(Locale.ENGLISH)); - users.invalidate(name.toLowerCase(Locale.ENGLISH)); + keys.remove(Util.sanitizeFileName(name)); + users.invalidate(Util.sanitizeFileName(name)); } public Set getAllUniqueUsers() diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java index 5f73f84c2..672f1c6ca 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java @@ -112,7 +112,7 @@ public class Commandbalancetop extends EssentialsCommand final User user = ess.getUserMap().getUser(u); if (user != null) { - balances.put(u, user.getMoney()); + balances.put(user.getDisplayName(), user.getMoney()); } } -- cgit v1.2.3 From abd86347c70005c0a4d36400d16472019c3a9d7a Mon Sep 17 00:00:00 2001 From: snowleo Date: Mon, 19 Dec 2011 12:57:09 +0100 Subject: Always return an offlineplayer object with the name, that the user wants. --- Essentials/src/com/earth2me/essentials/Essentials.java | 15 ++++++++++++--- Essentials/src/com/earth2me/essentials/OfflinePlayer.java | 15 +++++++++++---- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 648a99ce3..c8152248e 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -36,7 +36,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; -import java.util.logging.LogRecord; import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -440,7 +439,12 @@ public class Essentials extends JavaPlugin implements IEssentials } if (base instanceof String) { - return userMap.getUser((String)base); + final User user = userMap.getUser((String)base); + if (user != null && user.getBase() instanceof OfflinePlayer) + { + ((OfflinePlayer)user.getBase()).setName((String)base); + } + return user; } return null; } @@ -472,7 +476,12 @@ public class Essentials extends JavaPlugin implements IEssentials @Override public User getOfflineUser(final String name) { - return userMap.getUser(name); + final User user = userMap.getUser(name); + if (user != null && user.getBase() instanceof OfflinePlayer) + { + ((OfflinePlayer)user.getBase()).setName(name); + } + return user; } @Override diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index e05a07576..097c4c883 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -26,11 +26,11 @@ import org.bukkit.util.Vector; public class OfflinePlayer implements Player { private final transient IEssentials ess; - private Location location = new Location(null, 0, 0, 0, 0, 0); - private World world; - private UUID uniqueId = UUID.randomUUID(); + private transient Location location = new Location(null, 0, 0, 0, 0, 0); + private transient World world; + private final transient UUID uniqueId = UUID.randomUUID(); @Delegate(types = org.bukkit.OfflinePlayer.class) - private final org.bukkit.OfflinePlayer base; + private transient org.bukkit.OfflinePlayer base; public OfflinePlayer(final String name, final IEssentials ess) { @@ -822,4 +822,11 @@ public class OfflinePlayer implements Player { throw new UnsupportedOperationException("Not supported yet."); } + + void setName(final String name) + { + if (!this.base.getName().equalsIgnoreCase(name)) { + this.base = ess.getServer().getOfflinePlayer(name); + } + } } -- cgit v1.2.3 From 7c8c40c7903852e3ee2d5740729f2e94b5982240 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Mon, 19 Dec 2011 15:44:27 +0000 Subject: manpromote and mandemote now correctly sent the notification to the console if the command was issued there. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GroupManager.java | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 69f921bb3..4b85fa94f 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -89,4 +89,5 @@ v 1.7: - Removed op permissions from admins in the default GloblaGroups.yml. v 1.8: - Changed ServicesManager registration to lowest from normal. - - Fixed 'manucheckp' returning a null for the searched node when it's a group/subgroup. \ No newline at end of file + - Fixed 'manucheckp' returning a null for the searched node when it's a group/subgroup. + - manpromote and mandemote now correctly send the notification to the console if the command was issued there. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 062d3df21..9762a35a7 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -415,7 +415,7 @@ public class GroupManager extends JavaPlugin { // PARECE OK auxUser.setGroup(auxGroup); - if (!sender.hasPermission("groupmanager.notify.other")) + if (!sender.hasPermission("groupmanager.notify.other") || (isConsole)) sender.sendMessage(ChatColor.YELLOW + "You changed player '" + auxUser.getName() + "' group to '" + auxGroup.getName() + "'."); targetPlayer = this.getServer().getPlayer(auxUser.getName()); @@ -1610,7 +1610,7 @@ public class GroupManager extends JavaPlugin { } // PARECE OK auxUser.setGroup(auxGroup); - if (!sender.hasPermission("groupmanager.notify.other")) + if (!sender.hasPermission("groupmanager.notify.other") || (isConsole)) sender.sendMessage(ChatColor.YELLOW + "You changed " + auxUser.getName() + " group to " + auxGroup.getName() + "."); targetPlayer = this.getServer().getPlayer(auxUser.getName()); @@ -1666,7 +1666,7 @@ public class GroupManager extends JavaPlugin { } // PARECE OK auxUser.setGroup(auxGroup); - if (!sender.hasPermission("groupmanager.notify.other")) + if (!sender.hasPermission("groupmanager.notify.other") || (isConsole)) sender.sendMessage(ChatColor.YELLOW + "You changed " + auxUser.getName() + " group to " + auxGroup.getName() + "."); targetPlayer = this.getServer().getPlayer(auxUser.getName()); -- cgit v1.2.3 From a2202439bb1aeddaaad08c3b6607ce11b98356f3 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Mon, 19 Dec 2011 19:22:04 +0000 Subject: Expanded GlobalGroups.yml and Groups.yml to include Towny permissions. --- EssentialsGroupManager/src/Changelog.txt | 3 +- EssentialsGroupManager/src/globalgroups.yml | 57 +++++++++++++++++++++++++++-- EssentialsGroupManager/src/groups.yml | 3 ++ 3 files changed, 58 insertions(+), 5 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 4b85fa94f..6611c3e1b 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -90,4 +90,5 @@ v 1.7: v 1.8: - Changed ServicesManager registration to lowest from normal. - Fixed 'manucheckp' returning a null for the searched node when it's a group/subgroup. - - manpromote and mandemote now correctly send the notification to the console if the command was issued there. \ No newline at end of file + - manpromote and mandemote now correctly send the notification to the console if the command was issued there. + - Expanded GlobalGroups.yml and Groups.yml to include Towny permissions. \ No newline at end of file diff --git a/EssentialsGroupManager/src/globalgroups.yml b/EssentialsGroupManager/src/globalgroups.yml index 066f4faea..fe7b7df99 100644 --- a/EssentialsGroupManager/src/globalgroups.yml +++ b/EssentialsGroupManager/src/globalgroups.yml @@ -1,9 +1,5 @@ groups: - g:bukkit_default: - permissions: - - bukkit.broadcast.user - g:essentials_default: permissions: - essentials.help @@ -129,6 +125,10 @@ groups: - groupmanager.manucheckp - groupmanager.manulistp + g:bukkit_default: + permissions: + - bukkit.broadcast.user + g:bukkit_moderator: permissions: - bukkit.command.ban @@ -174,3 +174,52 @@ groups: - bukkit.command.whitelist.list - bukkit.command.whitelist.reload - bukkit.command.whitelist.remove + + g:towny_builder: + permissions: + - towny.town.* + - towny.nation.* + - towny.chat.tc + - towny.chat.nc + - towny.wild.block.6.* + - towny.wild.block.14.destroy + - towny.wild.block.15.destroy + - towny.wild.block.16.destroy + - towny.wild.block.17.* + - towny.wild.block.18.destroy + - towny.wild.block.21.destroy + - towny.wild.block.31.destroy + - towny.wild.block.37.destroy + - towny.wild.block.38.destroy + - towny.wild.block.39.destroy + - towny.wild.block.40.destroy + - towny.wild.block.50.destroy + - towny.wild.block.56.destroy + - towny.wild.block.73.destroy + - towny.wild.block.74.destroy + - towny.wild.block.78.destroy + - towny.wild.block.81.destroy + - towny.wild.block.82.destroy + - towny.wild.block.83.destroy + - towny.wild.block.86.destroy + - towny.wild.block.103.destroy + - towny.wild.block.106.destroy + - towny.wild.block.111.destroy + - towny.wild.block.115.destroy + + g:towny_moderator: + permissions: + - towny.chat.mod + - towny.wild.block.64.switch + - towny.wild.block.83.build + - towny.wild.block.86.build + - towny.wild.block.103.build + - towny.wild.block.111.build + - towny.wild.block.115.build + + g:towny_admin: + permissions: + - towny.admin + - -towny.wild.block.119.destroy + - -towny.wild.block.120.destroy + - towny.chat.admin \ No newline at end of file diff --git a/EssentialsGroupManager/src/groups.yml b/EssentialsGroupManager/src/groups.yml index 81fb4f030..e50054c9f 100644 --- a/EssentialsGroupManager/src/groups.yml +++ b/EssentialsGroupManager/src/groups.yml @@ -24,6 +24,7 @@ groups: inheritance: - default - g:essentials_builder + - g:towny_moderator info: prefix: '&2' build: true @@ -35,6 +36,7 @@ groups: - builder - g:essentials_moderator - g:bukkit_moderator + - g:towny_moderator info: prefix: '&5' build: true @@ -46,6 +48,7 @@ groups: - moderator - g:essentials_admin - g:bukkit_admin + - g:towny_admin info: prefix: '&c' build: true -- cgit v1.2.3 From 31e80ba698e29d88be97aeaae87ecbd189cb1ea8 Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 20 Dec 2011 11:57:22 +0100 Subject: Fix sending our player object to other plugins. --- Essentials/src/com/earth2me/essentials/commands/Commandbreak.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java index a1db8e0b2..2691ad4f2 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java @@ -31,7 +31,7 @@ public class Commandbreak extends EssentialsCommand { throw new Exception("You are not allowed to destroy bedrock."); //TODO: Translation } - final BlockBreakEvent event = new BlockBreakEvent(block, user); + final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase()); server.getPluginManager().callEvent(event); if (event.isCancelled()) { -- cgit v1.2.3 From 5d4f22ad84ff075c02dc29384edc030c23f89f7b Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 20 Dec 2011 12:20:12 +0100 Subject: Correctly match release and non release versions of bukkit. --- Essentials/src/com/earth2me/essentials/Essentials.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index c8152248e..a80b3685a 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -123,7 +123,7 @@ public class Essentials extends JavaPlugin implements IEssentials LOGGER.log(Level.WARNING, _("versionMismatch", plugin.getDescription().getName())); } } - final Matcher versionMatch = Pattern.compile("git-Bukkit-([0-9]+).([0-9]+).([0-9]+)-R[0-9]+-b([0-9]+)jnks.*").matcher(getServer().getVersion()); + final Matcher versionMatch = Pattern.compile("git-Bukkit-([0-9]+).([0-9]+).([0-9]+)-R[0-9]+-(?:[0-9]+-g[0-9a-f]+-)?b([0-9]+)jnks.*").matcher(getServer().getVersion()); if (versionMatch.matches()) { final int versionNumber = Integer.parseInt(versionMatch.group(4)); -- cgit v1.2.3 From 791e8f2d14029999028854c8da85bc074e84fe93 Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 20 Dec 2011 12:24:59 +0100 Subject: Only info not a warning if a file is missing --- .../earth2me/essentials/storage/AbstractDelayedYamlFileReader.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java b/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java index 43bfc358d..d48b4a060 100644 --- a/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java +++ b/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java @@ -6,10 +6,8 @@ import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.logging.Level; -import java.util.logging.Logger; import org.bukkit.Bukkit; import org.bukkit.plugin.Plugin; -import org.yaml.snakeyaml.error.YAMLException; public abstract class AbstractDelayedYamlFileReader implements Runnable @@ -56,7 +54,7 @@ public abstract class AbstractDelayedYamlFileReader imp catch (FileNotFoundException ex) { onException(); - Bukkit.getLogger().log(Level.WARNING, "File not found: " + file.toString()); + Bukkit.getLogger().log(Level.INFO, "File not found: " + file.toString()); } catch (ObjectLoadException ex) { -- cgit v1.2.3 From debcf4714a3db9065219e3701137e8dea6439970 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 20 Dec 2011 17:21:55 +0000 Subject: Delayed GroupManager events so Superperms will be fully updated before plugins receive the events. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GroupManager.java | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 6611c3e1b..dc661f7c3 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -91,4 +91,5 @@ v 1.8: - Changed ServicesManager registration to lowest from normal. - Fixed 'manucheckp' returning a null for the searched node when it's a group/subgroup. - manpromote and mandemote now correctly send the notification to the console if the command was issued there. - - Expanded GlobalGroups.yml and Groups.yml to include Towny permissions. \ No newline at end of file + - Expanded GlobalGroups.yml and Groups.yml to include Towny permissions. + - Delayed GroupManager events so Superperms will be fully updated before plugins receive the events. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 9762a35a7..5ced1fb47 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -1840,11 +1840,21 @@ public class GroupManager extends JavaPlugin { /** * Triggers all GroupManager events for other plugins to see. + * Schedules events for 1 tick later to allow GM to finish populating super perms. * * @param event */ - public static void callEvent(GroupManagerEvent event) { - Bukkit.getServer().getPluginManager().callEvent(event); + public static void callEvent(final GroupManagerEvent event) { + + if (Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Bukkit.getPluginManager().getPlugin("GroupManager"), new Runnable() { + + @Override + public void run() { + Bukkit.getServer().getPluginManager().callEvent(event); + } + }) == -1) + GroupManager.logger.warning("Could not schedule GM Event."); + } /** -- cgit v1.2.3 From 69847af08aa1ebc91c7808310bb7c7c1183b137f Mon Sep 17 00:00:00 2001 From: ElgarL Date: Thu, 22 Dec 2011 17:01:10 +0000 Subject: Decreased ranks of default users so idiots who don't remove them can't get 'hacked' when in offline mode. --- EssentialsGroupManager/src/users.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/users.yml b/EssentialsGroupManager/src/users.yml index 28fa79910..72a7b652f 100644 --- a/EssentialsGroupManager/src/users.yml +++ b/EssentialsGroupManager/src/users.yml @@ -3,7 +3,7 @@ users: snowleo: subgroups: [] permissions: [] - group: Admin + group: Builder KHobbits: subgroups: [] permissions: [] @@ -11,5 +11,5 @@ users: ElgarL: subgroups: [] permissions: [] - group: Owner + group: Moderator -- cgit v1.2.3 From 3aba996e97bd5bb90e65ed3166f3666d9122a729 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Thu, 29 Dec 2011 14:52:42 +0000 Subject: Changed the way events are raised to prevent variable corruption. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../org/anjocaido/groupmanager/GroupManager.java | 19 ------------------- .../groupmanager/events/GroupManagerEvent.java | 22 +++++++++++++++++++++- .../events/GroupManagerEventHandler.java | 8 +++----- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index dc661f7c3..3929b9d22 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -92,4 +92,5 @@ v 1.8: - Fixed 'manucheckp' returning a null for the searched node when it's a group/subgroup. - manpromote and mandemote now correctly send the notification to the console if the command was issued there. - Expanded GlobalGroups.yml and Groups.yml to include Towny permissions. - - Delayed GroupManager events so Superperms will be fully updated before plugins receive the events. \ No newline at end of file + - Delayed GroupManager events so Superperms will be fully updated before plugins receive the events. + - Changed the way events are raised to prevent variable corruption. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 5ced1fb47..c0e9ef2f8 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -1837,25 +1837,6 @@ public class GroupManager extends JavaPlugin { return match; } - - /** - * Triggers all GroupManager events for other plugins to see. - * Schedules events for 1 tick later to allow GM to finish populating super perms. - * - * @param event - */ - public static void callEvent(final GroupManagerEvent event) { - - if (Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Bukkit.getPluginManager().getPlugin("GroupManager"), new Runnable() { - - @Override - public void run() { - Bukkit.getServer().getPluginManager().callEvent(event); - } - }) == -1) - GroupManager.logger.warning("Could not schedule GM Event."); - - } /** * @return the config diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GroupManagerEvent.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GroupManagerEvent.java index 856abbc28..0834b3ada 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GroupManagerEvent.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GroupManagerEvent.java @@ -1,6 +1,8 @@ package org.anjocaido.groupmanager.events; +import org.anjocaido.groupmanager.GroupManager; +import org.bukkit.Bukkit; import org.bukkit.event.Event; /** @@ -13,10 +15,28 @@ public abstract class GroupManagerEvent extends Event { * */ private static final long serialVersionUID = 8790362185329926951L; - + protected GroupManagerEvent(String name) { super(name); } + /** + * Triggers all GroupManager events for other plugins to see. + * Schedules events for 1 tick later to allow GM to finish populating super perms. + * + * @param event + */ + public void schedule(final GroupManagerEvent event) { + + if (Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Bukkit.getPluginManager().getPlugin("GroupManager"), new Runnable() { + + @Override + public void run() { + Bukkit.getServer().getPluginManager().callEvent(event); + } + }, 1) == -1) + GroupManager.logger.warning("Could not schedule GM Event."); + } + } \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GroupManagerEventHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GroupManagerEventHandler.java index 83cac393d..3c077b6c6 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GroupManagerEventHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GroupManagerEventHandler.java @@ -1,11 +1,9 @@ package org.anjocaido.groupmanager.events; -import org.anjocaido.groupmanager.GroupManager; import org.anjocaido.groupmanager.data.Group; import org.anjocaido.groupmanager.data.User; - /** * @author ElgarL * @@ -13,13 +11,13 @@ import org.anjocaido.groupmanager.data.User; public class GroupManagerEventHandler { protected static void callEvent(GMGroupEvent event) { - GroupManager.callEvent(event); + event.schedule(event); } protected static void callEvent(GMUserEvent event) { - GroupManager.callEvent(event); + event.schedule(event); } protected static void callEvent(GMSystemEvent event) { - GroupManager.callEvent(event); + event.schedule(event); } public static void callEvent(Group group, GMGroupEvent.Action action) { -- cgit v1.2.3 From 283dc9b3c13b0ccf5f861e8629b2987ced1b9ab8 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 1 Jan 2012 18:18:29 -0600 Subject: No sending to all players, must specify target. --- Essentials/src/com/earth2me/essentials/commands/Commandpay.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpay.java b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java index 53927e012..01e1fcffb 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandpay.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java @@ -21,6 +21,11 @@ public class Commandpay extends EssentialsCommand { throw new NotEnoughArgumentsException(); } + + if (args[0] == "") + { + throw new NotEnoughArgumentsException("You need to specify a player to pay."); + } double amount = Double.parseDouble(args[1].replaceAll("[^0-9\\.]", "")); -- cgit v1.2.3 From 7726fd0081346b59e4c555476f6c62e1aa38b69f Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 3 Jan 2012 02:04:48 +0000 Subject: Reload GlobalGroups when you perform a world load. Changed GlobalGroups to save/load before local groups in the scheduled data saving/loading --- EssentialsGroupManager/src/Changelog.txt | 4 +++- .../src/org/anjocaido/groupmanager/GroupManager.java | 2 ++ .../groupmanager/dataholder/worlds/WorldsHolder.java | 19 ++++++++++--------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 3929b9d22..9b43fddbb 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -93,4 +93,6 @@ v 1.8: - manpromote and mandemote now correctly send the notification to the console if the command was issued there. - Expanded GlobalGroups.yml and Groups.yml to include Towny permissions. - Delayed GroupManager events so Superperms will be fully updated before plugins receive the events. - - Changed the way events are raised to prevent variable corruption. \ No newline at end of file + - Changed the way events are raised to prevent variable corruption. + - Reload GlobalGroups when you perform a world load. + - Changed GlobalGroups to save/load before local groups in the scheduled data saving/loading \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index c0e9ef2f8..16e0222d8 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -1504,7 +1504,9 @@ public class GroupManager extends JavaPlugin { isLoaded = false; // Disable Bukkit Perms update + globalGroups.load(); worldsHolder.loadWorld(auxString); + sender.sendMessage("The request to world '" + auxString + "' was sent."); isLoaded = true; diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java index 25eaf8526..dbdd17f34 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java @@ -176,6 +176,16 @@ public class WorldsHolder { ArrayList alreadyDone = new ArrayList(); Tasks.removeOldFiles(plugin, plugin.getBackupFolder()); + // Write Global Groups + if (GroupManager.getGlobalGroups().haveGroupsChanged()) { + GroupManager.getGlobalGroups().writeGroups(overwrite); + } else { + if (GroupManager.getGlobalGroups().getTimeStampGroups() < GroupManager.getGlobalGroups().getGlobalGroupsFile().lastModified()) { + System.out.print("Newer GlobalGroups file found (Loading changes)!"); + GroupManager.getGlobalGroups().load(); + } + } + for (OverloadedWorldHolder w : worldsData.values()) { if (alreadyDone.contains(w)) { continue; @@ -228,15 +238,6 @@ public class WorldsHolder { } alreadyDone.add(w); } - // Write Global Groups - if (GroupManager.getGlobalGroups().haveGroupsChanged()) { - GroupManager.getGlobalGroups().writeGroups(overwrite); - } else { - if (GroupManager.getGlobalGroups().getTimeStampGroups() < GroupManager.getGlobalGroups().getGlobalGroupsFile().lastModified()) { - System.out.print("Newer GlobalGroups file found (Loading changes)!"); - GroupManager.getGlobalGroups().load(); - } - } } /** -- cgit v1.2.3 From 4c485f31476825993ba8edac00a71080d51d6a2d Mon Sep 17 00:00:00 2001 From: ElgarL Date: Thu, 5 Jan 2012 19:43:30 +0000 Subject: Fix 'manucheckp' to correctly report if a permission is available from GroupManager or Bukkit. --- EssentialsGroupManager/src/Changelog.txt | 3 +- .../org/anjocaido/groupmanager/GroupManager.java | 40 +++++++++++----------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 9b43fddbb..8e4996b01 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -95,4 +95,5 @@ v 1.8: - Delayed GroupManager events so Superperms will be fully updated before plugins receive the events. - Changed the way events are raised to prevent variable corruption. - Reload GlobalGroups when you perform a world load. - - Changed GlobalGroups to save/load before local groups in the scheduled data saving/loading \ No newline at end of file + - Changed GlobalGroups to save/load before local groups in the scheduled data saving/loading + - Fix 'manucheckp' to correctly report if a permission is available from GroupManager or Bukkit. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 16e0222d8..4ba2624bf 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -787,29 +787,29 @@ public class GroupManager extends JavaPlugin { } targetPlayer = this.getServer().getPlayer(auxUser.getName()); // VALIDANDO PERMISSAO - permissionResult = permissionHandler.checkFullUserPermission(auxUser, args[1]); + permissionResult = permissionHandler.checkFullGMPermission(auxUser, args[1], false); + if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) { + //No permissions found in GM so fall through and check Bukkit. sender.sendMessage(ChatColor.RED + "The player doesn't have access to that permission"); - sender.sendMessage(ChatColor.YELLOW + "SuperPerms reports Node: " + targetPlayer.hasPermission(args[1])); - return false; - } - // PARECE OK - // auxString = - // permissionHandler.checkUserOnlyPermission(auxUser, args[1]); - if (permissionResult.owner instanceof User) { - if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) { - sender.sendMessage(ChatColor.RED + "The user has directly a negation node for that permission."); - } else { - sender.sendMessage(ChatColor.YELLOW + "The user has directly this permission."); - } - sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel); - } else if (permissionResult.owner instanceof Group) { - if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) { - sender.sendMessage(ChatColor.RED + "The user inherits a negation permission from group: " + permissionResult.owner.getName()); - } else { - sender.sendMessage(ChatColor.YELLOW + "The user inherits the permission from group: " + permissionResult.owner.getName()); + + } else { + // This permission was found in groupmanager. + if (permissionResult.owner instanceof User) { + if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) { + sender.sendMessage(ChatColor.RED + "The user has directly a negation node for that permission."); + } else { + sender.sendMessage(ChatColor.YELLOW + "The user has directly this permission."); + } + sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel); + } else if (permissionResult.owner instanceof Group) { + if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) { + sender.sendMessage(ChatColor.RED + "The user inherits a negation permission from group: " + permissionResult.owner.getName()); + } else { + sender.sendMessage(ChatColor.YELLOW + "The user inherits the permission from group: " + permissionResult.owner.getName()); + } + sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel); } - sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel); } // superperms -- cgit v1.2.3 From 58057a771d4e8e971d8531e1ad208eb6bbb0df54 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Mon, 9 Jan 2012 02:00:58 +0000 Subject: Changed over to a reflection method for populating superperms as Bukkit lags when you handle permissions one at a time. --- EssentialsGroupManager/src/Changelog.txt | 3 +- EssentialsGroupManager/src/config.yml | 4 +- EssentialsGroupManager/src/globalgroups.yml | 1 + .../groupmanager/Tasks/BukkitPermsUpdateTask.java | 2 +- .../permissions/BukkitPermissions.java | 117 +++++++++++++++------ 5 files changed, 88 insertions(+), 39 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 8e4996b01..6ac58e8ff 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -96,4 +96,5 @@ v 1.8: - Changed the way events are raised to prevent variable corruption. - Reload GlobalGroups when you perform a world load. - Changed GlobalGroups to save/load before local groups in the scheduled data saving/loading - - Fix 'manucheckp' to correctly report if a permission is available from GroupManager or Bukkit. \ No newline at end of file + - Fix 'manucheckp' to correctly report if a permission is available from GroupManager or Bukkit. + - Changed over to a reflection method for populating superperms as Bukkit lags when you handle permissions one at a time. \ No newline at end of file diff --git a/EssentialsGroupManager/src/config.yml b/EssentialsGroupManager/src/config.yml index 2fe5e509c..17ffc5b6e 100644 --- a/EssentialsGroupManager/src/config.yml +++ b/EssentialsGroupManager/src/config.yml @@ -4,9 +4,9 @@ settings: # The user will be able to promote players to the same group or even above. opOverrides: true - # If enabled any plugins bukkit permissions which default to true will be left enabled. + # If enabled any bukkit permissiosn which default to true will be left enabled. # If the player is op any permissions set to Op will follow suit. - bukkit_perms_override: false + bukkit_perms_override: true # Default setting for 'mantoglevalidate' # true will cause GroupManager to attempt name matching by default. diff --git a/EssentialsGroupManager/src/globalgroups.yml b/EssentialsGroupManager/src/globalgroups.yml index fe7b7df99..c9ecc2673 100644 --- a/EssentialsGroupManager/src/globalgroups.yml +++ b/EssentialsGroupManager/src/globalgroups.yml @@ -128,6 +128,7 @@ groups: g:bukkit_default: permissions: - bukkit.broadcast.user + - -bukkit.command.plugins g:bukkit_moderator: permissions: diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/Tasks/BukkitPermsUpdateTask.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/Tasks/BukkitPermsUpdateTask.java index f4b805c35..8788fc83b 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/Tasks/BukkitPermsUpdateTask.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/Tasks/BukkitPermsUpdateTask.java @@ -18,7 +18,7 @@ public class BukkitPermsUpdateTask implements Runnable { public void run() { // Signal loaded and update BukkitPermissions. GroupManager.setLoaded(true); - GroupManager.BukkitPermissions.collectPermissions(); + //GroupManager.BukkitPermissions.collectPermissions(); GroupManager.BukkitPermissions.updateAllPlayers(); GroupManager.logger.info("Bukkit Permissions Updated!"); diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index 202e27e3a..7c157a2f7 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -16,6 +16,7 @@ package org.anjocaido.groupmanager.permissions; +import java.lang.reflect.Field; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; @@ -23,9 +24,9 @@ import java.util.List; import java.util.Map; import org.anjocaido.groupmanager.GroupManager; -import org.anjocaido.groupmanager.data.User; +//import org.anjocaido.groupmanager.data.User; import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; -import org.anjocaido.groupmanager.utils.PermissionCheckResult; +//import org.anjocaido.groupmanager.utils.PermissionCheckResult; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -43,8 +44,7 @@ import org.bukkit.event.server.ServerListener; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionAttachment; import org.bukkit.permissions.PermissionAttachmentInfo; -import org.bukkit.permissions.PermissionDefault; -import org.bukkit.plugin.Plugin; +//import org.bukkit.permissions.PermissionDefault; import org.bukkit.plugin.PluginManager; @@ -52,7 +52,7 @@ import org.bukkit.plugin.PluginManager; * * BukkitPermissions overrides to force GM reponses to Superperms * - * @author ElgarL, based upon PermissionsEX implementation + * @author ElgarL, originally based upon PermissionsEX implementation */ public class BukkitPermissions { @@ -62,13 +62,25 @@ public class BukkitPermissions { protected boolean dumpAllPermissions = true; protected boolean dumpMatchedPermissions = true; public boolean player_join = false; + + private static Field permissions; + + // Setup reflection (Thanks to Codename_B for the reflection source) + static { + try { + permissions = PermissionAttachment.class.getDeclaredField("permissions"); + permissions.setAccessible(true); + } catch (SecurityException e) { + e.printStackTrace(); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } + } public BukkitPermissions(GroupManager plugin) { this.plugin = plugin; - - this.collectPermissions(); + //this.collectPermissions(); this.registerEvents(); - this.updateAllPlayers(); GroupManager.logger.info("Superperms support enabled."); @@ -93,6 +105,7 @@ public class BukkitPermissions { manager.registerEvent(Event.Type.PLUGIN_DISABLE, serverListener, Event.Priority.Normal, plugin); } + /* public void collectPermissions() { registeredPermissions.clear(); for (Plugin bukkitPlugin : Bukkit.getServer().getPluginManager().getPlugins()) { @@ -100,43 +113,56 @@ public class BukkitPermissions { registeredPermissions.push(permission); } } + */ public void updatePermissions(Player player) { this.updatePermissions(player, null); } + + /** + * Push all permissions which are registered with GM for this player, on this world to Bukkit + * and make it update for the child nodes. + * + * @param player + * @param world + */ public void updatePermissions(Player player, String world) { if (player == null || !GroupManager.isLoaded()) { return; } - if (!this.attachments.containsKey(player)) { - this.attachments.put(player, player.addAttachment(plugin)); + PermissionAttachment attachment; + // Find the players current attachment, or add a new one. + if (this.attachments.containsKey(player)) { + attachment = this.attachments.get(player); + } else { + attachment = player.addAttachment(plugin); + this.attachments.put(player, attachment);; } if (world == null) { world = player.getWorld().getName(); } - // All permissions registered with Bukkit for this player - PermissionAttachment attachment = this.attachments.get(player); - OverloadedWorldHolder worldData = plugin.getWorldsHolder().getWorldData(world); + Boolean value = false; + //User user = worldData.getUser(player.getName()); - User user = worldData.getUser(player.getName()); - + /* // clear permissions for (String permission : attachment.getPermissions().keySet()) attachment.unsetPermission(permission); - + */ + /* * find matching permissions * * and base bukkit perms if we are set to allow bukkit permissions to * override. */ - Boolean value = false; - + + /* for (Permission permission : registeredPermissions) { PermissionCheckResult result = worldData.getPermissionsHandler().checkFullGMPermission(user, permission.getName(), false); @@ -163,35 +189,47 @@ public class BukkitPermissions { if ((value == true) || (result.resultType == PermissionCheckResult.Type.NEGATION)) { attachment.setPermission(permission, value); } - /* - if ((value == true) || (result.resultType == PermissionCheckResult.Type.NOTFOUND)) { - // fetch and set all children of this permission node - Map children = permission.getChildren(); - if (children != null) { - for (String child : children.keySet()) { - if (children.get(child)) - attachment.setPermission(child, value); - } - } - }*/ - } + */ - // Add any missing permissions for this player (non bukkit plugins and child nodes) + // Add all permissions for this player (GM only) + // child nodes will be calculated by Bukkit. List playerPermArray = worldData.getPermissionsHandler().getAllPlayersPermissions(player.getName()); - + Map newPerms = new HashMap(); + for (String permission : playerPermArray) { value = true; if (permission.startsWith("-")) { permission = permission.substring(1); // cut off - value = false; } - + /* if (!attachment.getPermissions().containsKey(permission)) { attachment.setPermission(permission, value); } + */ + newPerms.put(permission, value); + } + //player.recalculatePermissions(); + + /** + * This is put in place until such a time as Bukkit pull 466 is implemented + * https://github.com/Bukkit/Bukkit/pull/466 + */ + try { // Codename_B source + @SuppressWarnings("unchecked") + Map orig = (Map) permissions.get(attachment); + // Clear the map (faster than removing the attachment and recalculating) + orig.clear(); + // Then whack our map into there + orig.putAll(newPerms); + // That's all folks! + attachment.getPermissible().recalculatePermissions(); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); } - player.recalculatePermissions(); } /** @@ -245,6 +283,12 @@ public class BukkitPermissions { return null; } + /** + * List all effective permissions for this player. + * + * @param player + * @return + */ public List listPerms(Player player) { List perms = new ArrayList(); @@ -266,6 +310,9 @@ public class BukkitPermissions { return perms; } + /** + * force Bukkit to update every OnlinePlayers permissions. + */ public void updateAllPlayers() { for (Player player : Bukkit.getServer().getOnlinePlayers()) { updatePermissions(player); @@ -326,7 +373,7 @@ public class BukkitPermissions { if (!GroupManager.isLoaded()) return; - collectPermissions(); + //collectPermissions(); updateAllPlayers(); } -- cgit v1.2.3 From 6eea852b1dc862e2167b6096f40bbb40565f642b Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 12 Jan 2012 23:36:45 +0100 Subject: CB#1713 B#1136 --- lib/bukkit.jar | Bin 4405577 -> 4412119 bytes lib/craftbukkit.jar | Bin 9818144 -> 10393769 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/bukkit.jar b/lib/bukkit.jar index 283d2224d..0dbb054f0 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index 28b3e3f7e..7aac44932 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From eb5c88ef08b261d1e4de07b6c1d374edccfc402f Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 12 Jan 2012 23:37:39 +0100 Subject: Netbeans 7.1 stuff --- BuildAll/nbproject/build-impl.xml | 9 +++++++++ BuildAll/nbproject/genfiles.properties | 4 ++-- Essentials/nbproject/build-impl.xml | 9 +++++++++ Essentials/nbproject/genfiles.properties | 4 ++-- EssentialsChat/nbproject/build-impl.xml | 9 +++++++++ EssentialsChat/nbproject/genfiles.properties | 4 ++-- EssentialsGeoIP/nbproject/build-impl.xml | 9 +++++++++ EssentialsGeoIP/nbproject/genfiles.properties | 4 ++-- EssentialsGroupBridge/nbproject/build-impl.xml | 9 +++++++++ EssentialsGroupBridge/nbproject/genfiles.properties | 4 ++-- EssentialsGroupManager/nbproject/build-impl.xml | 9 +++++++++ EssentialsGroupManager/nbproject/genfiles.properties | 4 ++-- EssentialsProtect/nbproject/build-impl.xml | 9 +++++++++ EssentialsProtect/nbproject/genfiles.properties | 4 ++-- EssentialsSpawn/nbproject/build-impl.xml | 9 +++++++++ EssentialsSpawn/nbproject/genfiles.properties | 4 ++-- EssentialsUpdate/nbproject/build-impl.xml | 9 +++++++++ EssentialsUpdate/nbproject/genfiles.properties | 4 ++-- EssentialsXMPP/nbproject/build-impl.xml | 9 +++++++++ EssentialsXMPP/nbproject/genfiles.properties | 4 ++-- 20 files changed, 110 insertions(+), 20 deletions(-) diff --git a/BuildAll/nbproject/build-impl.xml b/BuildAll/nbproject/build-impl.xml index 7c88bb114..1f8bcbaae 100644 --- a/BuildAll/nbproject/build-impl.xml +++ b/BuildAll/nbproject/build-impl.xml @@ -922,6 +922,14 @@ is divided into following sections: --> + + + + + + + + @@ -933,6 +941,7 @@ is divided into following sections: + diff --git a/BuildAll/nbproject/genfiles.properties b/BuildAll/nbproject/genfiles.properties index 64276c0d9..8068c7fc0 100644 --- a/BuildAll/nbproject/genfiles.properties +++ b/BuildAll/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.44.1.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=51b33957 -nbproject/build-impl.xml.script.CRC32=c8376938 -nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46 +nbproject/build-impl.xml.script.CRC32=c5170bed +nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46 diff --git a/Essentials/nbproject/build-impl.xml b/Essentials/nbproject/build-impl.xml index 8ee1561bd..f79ca7e26 100644 --- a/Essentials/nbproject/build-impl.xml +++ b/Essentials/nbproject/build-impl.xml @@ -873,6 +873,14 @@ is divided into following sections: --> + + + + + + + + @@ -884,6 +892,7 @@ is divided into following sections: + diff --git a/Essentials/nbproject/genfiles.properties b/Essentials/nbproject/genfiles.properties index d261d97cb..8d631fddf 100644 --- a/Essentials/nbproject/genfiles.properties +++ b/Essentials/nbproject/genfiles.properties @@ -4,8 +4,8 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=a830bc14 -nbproject/build-impl.xml.script.CRC32=40df7eaf -nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46 +nbproject/build-impl.xml.script.CRC32=a9f8842a +nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46 nbproject/profiler-build-impl.xml.data.CRC32=ab78ce15 nbproject/profiler-build-impl.xml.script.CRC32=abda56ed nbproject/profiler-build-impl.xml.stylesheet.CRC32=f10cf54c@1.11.1 diff --git a/EssentialsChat/nbproject/build-impl.xml b/EssentialsChat/nbproject/build-impl.xml index 520e8a1d5..80a5b5256 100644 --- a/EssentialsChat/nbproject/build-impl.xml +++ b/EssentialsChat/nbproject/build-impl.xml @@ -873,6 +873,14 @@ is divided into following sections: --> + + + + + + + + @@ -884,6 +892,7 @@ is divided into following sections: + diff --git a/EssentialsChat/nbproject/genfiles.properties b/EssentialsChat/nbproject/genfiles.properties index b6146a42a..98d505913 100644 --- a/EssentialsChat/nbproject/genfiles.properties +++ b/EssentialsChat/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=7c7f517b -nbproject/build-impl.xml.script.CRC32=4e36cf00 -nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46 +nbproject/build-impl.xml.script.CRC32=52184b61 +nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46 diff --git a/EssentialsGeoIP/nbproject/build-impl.xml b/EssentialsGeoIP/nbproject/build-impl.xml index 77f4373b4..4b4feb8d8 100644 --- a/EssentialsGeoIP/nbproject/build-impl.xml +++ b/EssentialsGeoIP/nbproject/build-impl.xml @@ -873,6 +873,14 @@ is divided into following sections: --> + + + + + + + + @@ -884,6 +892,7 @@ is divided into following sections: + diff --git a/EssentialsGeoIP/nbproject/genfiles.properties b/EssentialsGeoIP/nbproject/genfiles.properties index 55370a872..59191ffde 100644 --- a/EssentialsGeoIP/nbproject/genfiles.properties +++ b/EssentialsGeoIP/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.44.1.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=cbf94f59 -nbproject/build-impl.xml.script.CRC32=ae9285d7 -nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46 +nbproject/build-impl.xml.script.CRC32=db2bb7a7 +nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46 diff --git a/EssentialsGroupBridge/nbproject/build-impl.xml b/EssentialsGroupBridge/nbproject/build-impl.xml index b6dfa7cef..97400aa02 100644 --- a/EssentialsGroupBridge/nbproject/build-impl.xml +++ b/EssentialsGroupBridge/nbproject/build-impl.xml @@ -848,6 +848,14 @@ is divided into following sections: --> + + + + + + + + @@ -859,6 +867,7 @@ is divided into following sections: + diff --git a/EssentialsGroupBridge/nbproject/genfiles.properties b/EssentialsGroupBridge/nbproject/genfiles.properties index 2a94f2294..d862c9b42 100644 --- a/EssentialsGroupBridge/nbproject/genfiles.properties +++ b/EssentialsGroupBridge/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=475c8f4d -nbproject/build-impl.xml.script.CRC32=aa68bcd9 -nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46 +nbproject/build-impl.xml.script.CRC32=c7581402 +nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46 diff --git a/EssentialsGroupManager/nbproject/build-impl.xml b/EssentialsGroupManager/nbproject/build-impl.xml index 5012acdb9..8939aa2fa 100644 --- a/EssentialsGroupManager/nbproject/build-impl.xml +++ b/EssentialsGroupManager/nbproject/build-impl.xml @@ -841,6 +841,14 @@ is divided into following sections: --> + + + + + + + + @@ -852,6 +860,7 @@ is divided into following sections: + diff --git a/EssentialsGroupManager/nbproject/genfiles.properties b/EssentialsGroupManager/nbproject/genfiles.properties index 48463b7ff..d7341b85d 100644 --- a/EssentialsGroupManager/nbproject/genfiles.properties +++ b/EssentialsGroupManager/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=a6709b83 -nbproject/build-impl.xml.script.CRC32=142d30c4 -nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46 +nbproject/build-impl.xml.script.CRC32=fe0fea25 +nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46 diff --git a/EssentialsProtect/nbproject/build-impl.xml b/EssentialsProtect/nbproject/build-impl.xml index 7931eda6c..8cfd93877 100644 --- a/EssentialsProtect/nbproject/build-impl.xml +++ b/EssentialsProtect/nbproject/build-impl.xml @@ -873,6 +873,14 @@ is divided into following sections: --> + + + + + + + + @@ -884,6 +892,7 @@ is divided into following sections: + diff --git a/EssentialsProtect/nbproject/genfiles.properties b/EssentialsProtect/nbproject/genfiles.properties index a5a167f5e..fe9ffd1a1 100644 --- a/EssentialsProtect/nbproject/genfiles.properties +++ b/EssentialsProtect/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.3.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=40644caa -nbproject/build-impl.xml.script.CRC32=a451c39a -nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46 +nbproject/build-impl.xml.script.CRC32=cdb3fc6f +nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46 diff --git a/EssentialsSpawn/nbproject/build-impl.xml b/EssentialsSpawn/nbproject/build-impl.xml index 84746698d..cf349590c 100644 --- a/EssentialsSpawn/nbproject/build-impl.xml +++ b/EssentialsSpawn/nbproject/build-impl.xml @@ -873,6 +873,14 @@ is divided into following sections: --> + + + + + + + + @@ -884,6 +892,7 @@ is divided into following sections: + diff --git a/EssentialsSpawn/nbproject/genfiles.properties b/EssentialsSpawn/nbproject/genfiles.properties index 531fe7094..15d04622b 100644 --- a/EssentialsSpawn/nbproject/genfiles.properties +++ b/EssentialsSpawn/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=e7b96939 -nbproject/build-impl.xml.script.CRC32=2b257042 -nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46 +nbproject/build-impl.xml.script.CRC32=f45f4172 +nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46 diff --git a/EssentialsUpdate/nbproject/build-impl.xml b/EssentialsUpdate/nbproject/build-impl.xml index 4e62c50ea..2f8555c4c 100644 --- a/EssentialsUpdate/nbproject/build-impl.xml +++ b/EssentialsUpdate/nbproject/build-impl.xml @@ -866,6 +866,14 @@ is divided into following sections: --> + + + + + + + + @@ -877,6 +885,7 @@ is divided into following sections: + diff --git a/EssentialsUpdate/nbproject/genfiles.properties b/EssentialsUpdate/nbproject/genfiles.properties index 0791ac507..6e1d2aeac 100644 --- a/EssentialsUpdate/nbproject/genfiles.properties +++ b/EssentialsUpdate/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.44.1.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=fd4b98a9 -nbproject/build-impl.xml.script.CRC32=6c5a1616 -nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46 +nbproject/build-impl.xml.script.CRC32=94e69885 +nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46 diff --git a/EssentialsXMPP/nbproject/build-impl.xml b/EssentialsXMPP/nbproject/build-impl.xml index c0dfd2504..3293bd709 100644 --- a/EssentialsXMPP/nbproject/build-impl.xml +++ b/EssentialsXMPP/nbproject/build-impl.xml @@ -873,6 +873,14 @@ is divided into following sections: --> + + + + + + + + @@ -884,6 +892,7 @@ is divided into following sections: + diff --git a/EssentialsXMPP/nbproject/genfiles.properties b/EssentialsXMPP/nbproject/genfiles.properties index bb3b3a973..ae2a6f962 100644 --- a/EssentialsXMPP/nbproject/genfiles.properties +++ b/EssentialsXMPP/nbproject/genfiles.properties @@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=28e38971@1.42.1.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=1012a5dd -nbproject/build-impl.xml.script.CRC32=4ece3e29 -nbproject/build-impl.xml.stylesheet.CRC32=c12040a1@1.47.1.46 +nbproject/build-impl.xml.script.CRC32=8cccbe45 +nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46 -- cgit v1.2.3 From fe9d5645f61a1ab8dfb2896db1d0bdcc9358c2f9 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 12 Jan 2012 23:42:04 +0100 Subject: Added the new Enchantments --- Essentials/src/com/earth2me/essentials/Enchantments.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/Enchantments.java b/Essentials/src/com/earth2me/essentials/Enchantments.java index dac789353..3553142fa 100644 --- a/Essentials/src/com/earth2me/essentials/Enchantments.java +++ b/Essentials/src/com/earth2me/essentials/Enchantments.java @@ -54,6 +54,10 @@ public class Enchantments ENCHANTMENTS.put("silktouch", Enchantment.SILK_TOUCH); ENCHANTMENTS.put("waterworker", Enchantment.WATER_WORKER); ENCHANTMENTS.put("aquaaffinity", Enchantment.WATER_WORKER); + ENCHANTMENTS.put("firearrow", Enchantment.ARROW_FIRE); + ENCHANTMENTS.put("arrowdamage", Enchantment.ARROW_DAMAGE); + ENCHANTMENTS.put("arrowknockback", Enchantment.ARROW_KNOCKBACK); + ENCHANTMENTS.put("infinitearrows", Enchantment.ARROW_INFINITE); } public static Enchantment getByName(String name) { -- cgit v1.2.3 From 390b17f0d8a4b07388619ad7a64e411d33c211cf Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 12 Jan 2012 23:43:11 +0100 Subject: Min Bukkit version is 1713 now --- Essentials/src/com/earth2me/essentials/Essentials.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index a80b3685a..fe550279e 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -60,7 +60,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 1597; + public static final int BUKKIT_VERSION = 1713; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); -- cgit v1.2.3 From 3fdde2f7641e681ba9d53f9f161a22214a64ea11 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 12 Jan 2012 23:56:39 +0100 Subject: Add new eggs to items.csv --- Essentials/src/items.csv | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index 95a197aec..98c25c327 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -2429,6 +2429,30 @@ glisteringmelon,382,0 shiningmelon,382,0 gmelon,382,0 smelon,382,0 +creeperegg,383,50 +skeletonegg,383,51 +spideregg,383,52 +giantegg,383,53 +zombieegg,383,54 +slimeegg,383,55 +ghastegg,383,56 +zombiepigmanegg,383,57 +pigmanegg,383,57 +endermanegg,383,58 +cavespideregg,383,59 +silverfishegg,383,60 +blazeegg,383,61 +lavaslimeegg,383,62 +magmacubeegg,383,63 +pigegg,383,90 +sheepegg,383,91 +cowegg,383,92 +chickenegg,383,93 +squidegg,383,94 +wolfegg,383,95 +mooshroomegg,383,96 +mushroomcowegg,383,96 +villageregg,383,120 goldmusicrecord,2256,0 goldmusicdisk,2256,0 goldmusiccd,2256,0 -- cgit v1.2.3 From 256d202d50db621eb9b89fc29291fe9d111072c6 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 13 Jan 2012 22:41:47 +0000 Subject: Adjusting default spawn behavior. Moving option in config file. --- Essentials/src/com/earth2me/essentials/UserData.java | 17 ----------------- Essentials/src/config.yml | 12 ++++++------ .../com/earth2me/essentials/spawn/EssentialsSpawn.java | 2 +- .../spawn/EssentialsSpawnPlayerListener.java | 18 +++++++++++++----- 4 files changed, 20 insertions(+), 29 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 9df1b0342..d08704484 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -53,7 +53,6 @@ public abstract class UserData extends PlayerExtension implements IConf lastLogout = _getLastLogout(); lastLoginAddress = _getLastLoginAddress(); afk = getAfk(); - newplayer = getNew(); geolocation = _getGeoLocation(); isSocialSpyEnabled = _isSocialSpyEnabled(); isNPC = _isNPC(); @@ -736,22 +735,6 @@ public abstract class UserData extends PlayerExtension implements IConf } private boolean newplayer; - private boolean getNew() - { - return config.getBoolean("newplayer", true); - } - - public boolean isNew() - { - return newplayer; - } - - public void setNew(boolean set) - { - newplayer = set; - config.setProperty("newplayer", set); - config.save(); - } private String geolocation; private String _getGeoLocation() diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 2254bdbab..877ff0c42 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -253,10 +253,7 @@ register-back-in-listener: false # +------------------------------------------------------+ # ############################################################ -# When users die, should they respawn at their first home, instead of the spawnpoint or bed? -respawn-at-home: false - -# If no home is set send you to bed or spawn when /home is used +# If no home is set, send players to spawn when /home is used spawn-if-no-home: true # Allows people to set their bed at daytime @@ -532,8 +529,11 @@ newbies: spawnpoint: newbies # Set this to lowest, if you want Multiverse to handle the respawning -# Set this to normal, if you want EssentialsSpawn to handle the respawning +# Set this to high, if you want EssentialsSpawn to handle the respawning # Set this to highest, if you want to force EssentialsSpawn to handle the respawning -respawn-listener-priority: normal +respawn-listener-priority: high + +# When users die, should they respawn at their first home or bed, instead of the spawnpoint? +respawn-at-home: false # End of File <-- No seriously, you're done with configuration. diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java index c4cd7c727..813220a16 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java @@ -39,7 +39,7 @@ public class EssentialsSpawn extends JavaPlugin final EssentialsSpawnPlayerListener playerListener = new EssentialsSpawnPlayerListener(ess, spawns); pluginManager.registerEvent(Type.PLAYER_RESPAWN, playerListener, ess.getSettings().getRespawnPriority(), this); - pluginManager.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Low, this); + pluginManager.registerEvent(Type.PLAYER_JOIN, playerListener, ess.getSettings().getRespawnPriority(), this); LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team")); } diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index 530a00faa..2a9efe4b1 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.User; import java.util.logging.Level; +import java.util.logging.Logger; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.event.player.PlayerJoinEvent; @@ -16,6 +17,7 @@ public class EssentialsSpawnPlayerListener extends PlayerListener { private final transient IEssentials ess; private final transient SpawnStorage spawns; + private static final Logger LOGGER = Bukkit.getLogger(); public EssentialsSpawnPlayerListener(final IEssentials ess, final SpawnStorage spawns) { @@ -26,7 +28,7 @@ public class EssentialsSpawnPlayerListener extends PlayerListener @Override public void onPlayerRespawn(final PlayerRespawnEvent event) - { + { final User user = ess.getUser(event.getPlayer()); if (ess.getSettings().getRespawnAtHome()) @@ -45,8 +47,12 @@ public class EssentialsSpawnPlayerListener extends PlayerListener final Location spawn = spawns.getSpawn(user.getGroup()); if (spawn != null) { + LOGGER.log(Level.INFO, "setting respawn location"); event.setRespawnLocation(spawn); } + else { + LOGGER.log(Level.INFO, "spawn was null"); + } } @Override @@ -54,20 +60,22 @@ public class EssentialsSpawnPlayerListener extends PlayerListener { final User user = ess.getUser(event.getPlayer()); - if (!user.isNew() || user.getBedSpawnLocation() != null) + if (user.hasPlayedBefore()) { + LOGGER.log(Level.FINE, "Old player join"); return; - } - user.setNew(false); + } if (!"none".equalsIgnoreCase(ess.getSettings().getNewbieSpawn())) { - ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user)); + ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user), 1L); } if (ess.getSettings().getAnnounceNewPlayers()) { ess.broadcastMessage(user, ess.getSettings().getAnnounceNewPlayerFormat(user)); } + + LOGGER.log(Level.FINE, "New player join"); } -- cgit v1.2.3 From 43f1c0f89d62cf3b273045d2d3b42b53a950bc56 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 13 Jan 2012 22:50:48 +0000 Subject: Removing debugging messages. --- .../com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index 2a9efe4b1..81e8f6e9e 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -47,12 +47,8 @@ public class EssentialsSpawnPlayerListener extends PlayerListener final Location spawn = spawns.getSpawn(user.getGroup()); if (spawn != null) { - LOGGER.log(Level.INFO, "setting respawn location"); event.setRespawnLocation(spawn); } - else { - LOGGER.log(Level.INFO, "spawn was null"); - } } @Override -- cgit v1.2.3