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/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) { diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 29c46622e..fe550279e 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; @@ -61,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); @@ -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); + } + } } 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/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()); } } 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\\.]", "")); 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/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 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/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 47a0f6b79..6ac58e8ff 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -85,4 +85,16 @@ 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. +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. + - 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 + - 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 9662baf43..c9ecc2673 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,11 @@ groups: - groupmanager.manucheckp - groupmanager.manulistp + g:bukkit_default: + permissions: + - bukkit.broadcast.user + - -bukkit.command.plugins + g:bukkit_moderator: permissions: - bukkit.command.ban @@ -150,9 +151,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 @@ -174,3 +175,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 diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 2d46e74c8..4ba2624bf 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() { @@ -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()); @@ -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."); + + } 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); - } 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()); - } else { - sender.sendMessage(ChatColor.YELLOW + "The user inherits the permission from group: " + permissionResult.owner.getName()); - } - sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel); } // superperms @@ -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; @@ -1610,7 +1612,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 +1668,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()); @@ -1837,15 +1839,6 @@ public class GroupManager extends JavaPlugin { return match; } - - /** - * Triggers all GroupManager events for other plugins to see. - * - * @param event - */ - public static void callEvent(GroupManagerEvent event) { - Bukkit.getServer().getPluginManager().callEvent(event); - } /** * @return the config 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/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(); - } - } } /** 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) { diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index 6e18bf3f8..b23fc01d4 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) { + resultGroup.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/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(); } 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. 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 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/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..81e8f6e9e 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()) @@ -54,20 +56,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"); } 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