summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore6
-rw-r--r--BuildAll/nbproject/build-impl.xml17
-rw-r--r--BuildAll/nbproject/genfiles.properties4
-rw-r--r--BuildAll/nbproject/project.properties4
-rw-r--r--Essentials/nbproject/build-impl.xml17
-rw-r--r--Essentials/nbproject/genfiles.properties4
-rw-r--r--Essentials/nbproject/pmd.settings1
-rw-r--r--Essentials/nbproject/project.properties13
-rw-r--r--Essentials/src/com/earth2me/essentials/AlternativeCommandsHandler.java137
-rw-r--r--Essentials/src/com/earth2me/essentials/Backup.java9
-rw-r--r--Essentials/src/com/earth2me/essentials/Console.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/DescParseTickFormat.java14
-rw-r--r--Essentials/src/com/earth2me/essentials/Enchantments.java83
-rw-r--r--Essentials/src/com/earth2me/essentials/Essentials.java444
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java65
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsConf.java67
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java27
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java208
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java181
-rw-r--r--Essentials/src/com/earth2me/essentials/ExecuteTimer.java19
-rw-r--r--Essentials/src/com/earth2me/essentials/I18n.java175
-rw-r--r--Essentials/src/com/earth2me/essentials/IConf.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/IEssentials.java20
-rw-r--r--Essentials/src/com/earth2me/essentials/IEssentialsModule.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/ISettings.java43
-rw-r--r--Essentials/src/com/earth2me/essentials/IUser.java26
-rw-r--r--Essentials/src/com/earth2me/essentials/ItemDb.java28
-rw-r--r--Essentials/src/com/earth2me/essentials/Jail.java97
-rw-r--r--Essentials/src/com/earth2me/essentials/JailPlayerListener.java84
-rw-r--r--Essentials/src/com/earth2me/essentials/Jails.java254
-rw-r--r--Essentials/src/com/earth2me/essentials/Kit.java113
-rw-r--r--Essentials/src/com/earth2me/essentials/ManagedFile.java18
-rw-r--r--Essentials/src/com/earth2me/essentials/Mob.java41
-rw-r--r--Essentials/src/com/earth2me/essentials/OfflinePlayer.java295
-rw-r--r--Essentials/src/com/earth2me/essentials/PlayerExtension.java54
-rw-r--r--Essentials/src/com/earth2me/essentials/Settings.java130
-rw-r--r--Essentials/src/com/earth2me/essentials/Spawn.java102
-rw-r--r--Essentials/src/com/earth2me/essentials/TNTExplodeListener.java52
-rw-r--r--Essentials/src/com/earth2me/essentials/TargetBlock.java527
-rw-r--r--Essentials/src/com/earth2me/essentials/Teleport.java85
-rw-r--r--Essentials/src/com/earth2me/essentials/Trade.java72
-rw-r--r--Essentials/src/com/earth2me/essentials/User.java110
-rw-r--r--Essentials/src/com/earth2me/essentials/UserData.java98
-rw-r--r--Essentials/src/com/earth2me/essentials/UserMap.java86
-rw-r--r--Essentials/src/com/earth2me/essentials/Util.java367
-rw-r--r--Essentials/src/com/earth2me/essentials/Warps.java21
-rw-r--r--Essentials/src/com/earth2me/essentials/Worth.java8
-rw-r--r--Essentials/src/com/earth2me/essentials/api/Economy.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/api/IAlternativeCommandsHandler.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/api/IEssentials.java51
-rw-r--r--Essentials/src/com/earth2me/essentials/api/IEssentialsEconomy.java37
-rw-r--r--Essentials/src/com/earth2me/essentials/api/II18n.java9
-rw-r--r--Essentials/src/com/earth2me/essentials/api/IItemDb.java11
-rw-r--r--Essentials/src/com/earth2me/essentials/api/IJails.java18
-rw-r--r--Essentials/src/com/earth2me/essentials/api/IReload.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/api/ISettings.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/api/ITeleport.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/api/IUser.java43
-rw-r--r--Essentials/src/com/earth2me/essentials/api/IUserMap.java20
-rw-r--r--Essentials/src/com/earth2me/essentials/api/IWarps.java16
-rw-r--r--Essentials/src/com/earth2me/essentials/api/IWorth.java11
-rw-r--r--Essentials/src/com/earth2me/essentials/api/NoLoanPermittedException.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/api/UserDoesNotExistException.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandafk.java14
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandantioch.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandback.java8
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandbackup.java8
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandbalance.java21
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java169
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandban.java34
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandbanip.java17
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java20
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandbreak.java45
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandburn.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java25
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandcompass.java26
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java39
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commanddeljail.java15
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commanddelwarp.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commanddepth.java18
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandeco.java26
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandenchant.java96
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandessentials.java59
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandext.java18
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandfeed.java52
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandfireball.java12
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java57
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandgc.java15
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java48
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandgive.java59
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandgod.java24
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandheal.java22
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandhelp.java220
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java17
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandhome.java47
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandignore.java28
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandinfo.java180
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java20
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commanditem.java61
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java37
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandjails.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandjump.java22
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkick.java32
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkickall.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkill.java12
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkillall.java162
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkit.java134
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandlightning.java40
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandlist.java69
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandmail.java78
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandme.java13
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandmore.java50
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandmotd.java17
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandmsg.java61
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandmute.java31
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandnear.java120
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandnick.java123
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandnuke.java9
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandpay.java18
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandping.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java31
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandpowertooltoggle.java14
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandptime.java34
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandr.java45
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandrealname.java21
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandreloadall.java21
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandremove.java161
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandrepair.java43
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandrules.java15
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandseen.java13
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsell.java38
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsethome.java24
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java14
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java14
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java8
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java8
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandspawner.java32
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java142
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsudo.java42
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtempban.java37
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandthunder.java14
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtime.java44
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java73
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtop.java17
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtp.java49
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpa.java26
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java32
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java37
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java24
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpall.java23
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java16
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtphere.java19
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpo.java21
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java21
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtppos.java31
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtree.java34
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandunban.java12
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java14
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java45
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandwarp.java109
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandweather.java36
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandwhois.java52
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandworld.java27
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandworth.java84
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java31
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/IEssentialsCommand.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/NotEnoughArgumentsException.java15
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java51
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java (renamed from Essentials/src/com/earth2me/essentials/FakeInventory.java)4
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java (renamed from Essentials/src/com/earth2me/essentials/FakeWorld.java)112
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/InventoryWorkaround.java (renamed from Essentials/src/com/earth2me/essentials/InventoryWorkaround.java)63
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/ItemDupeFix.java25
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/OfflineBedLocation.java52
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/SetBed.java25
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java58
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/ShowInventory.java46
-rw-r--r--Essentials/src/com/earth2me/essentials/perm/BPermissionsHandler.java14
-rw-r--r--Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java33
-rw-r--r--Essentials/src/com/earth2me/essentials/perm/PermissionsExHandler.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/register/payment/Method.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/register/payment/Methods.java54
-rw-r--r--Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java40
-rw-r--r--Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java40
-rw-r--r--Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java28
-rw-r--r--Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java328
-rw-r--r--Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java28
-rw-r--r--Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java41
-rw-r--r--Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java28
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/Backup.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/Chat.java9
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/Commands.java11
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/Economy.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/General.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/GroupOptions.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/Groups.java11
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/Jails.java18
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/Location.java28
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/Locations.java22
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/Settings.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/Spawns.java18
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/Worth.java34
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/commands/Afk.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/commands/God.java5
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/commands/Help.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/commands/Home.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/commands/Kit.java18
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/commands/KitObject.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/commands/Lightning.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/settings/commands/Spawnmob.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java71
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignBalance.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java9
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignBuy.java5
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignDisposal.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignEnchant.java121
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignFree.java18
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignGameMode.java37
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignHeal.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignKit.java73
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignMail.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignProtection.java47
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignSell.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignSpawnmob.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignTime.java8
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignTrade.java125
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignWarp.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignWeather.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/Signs.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java69
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileWriter.java55
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/AsyncStorageObjectHolder.java148
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java433
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/Comment.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/EnchantmentLevel.java80
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/IStorageObjectHolder.java17
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/IStorageReader.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/IStorageWriter.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/MapKeyType.java (renamed from Essentials/src/com/earth2me/essentials/storage/MapType.java)2
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/MapValueType.java14
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/ObjectLoadException.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/StorageObject.java246
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/YamlStorageReader.java119
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/YamlStorageWriter.java340
-rw-r--r--Essentials/src/com/earth2me/essentials/textreader/ArrayListInput.java31
-rw-r--r--Essentials/src/com/earth2me/essentials/textreader/HelpInput.java146
-rw-r--r--Essentials/src/com/earth2me/essentials/textreader/IText.java14
-rw-r--r--Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java147
-rw-r--r--Essentials/src/com/earth2me/essentials/textreader/TextInput.java137
-rw-r--r--Essentials/src/com/earth2me/essentials/textreader/TextPager.java182
-rw-r--r--Essentials/src/com/earth2me/essentials/user/Ban.java14
-rw-r--r--Essentials/src/com/earth2me/essentials/user/IOfflinePlayer.java15
-rw-r--r--Essentials/src/com/earth2me/essentials/user/IOfflineUser.java9
-rw-r--r--Essentials/src/com/earth2me/essentials/user/Inventory.java27
-rw-r--r--Essentials/src/com/earth2me/essentials/user/User.java199
-rw-r--r--Essentials/src/com/earth2me/essentials/user/UserBase.java122
-rw-r--r--Essentials/src/com/earth2me/essentials/user/UserData.java56
-rw-r--r--Essentials/src/com/earth2me/essentials/user/UserMap.java128
-rw-r--r--Essentials/src/config.yml146
-rw-r--r--Essentials/src/examples/permissionsbukkit.yml4
-rw-r--r--Essentials/src/info.txt41
-rw-r--r--Essentials/src/items.csv452
-rw-r--r--Essentials/src/messages.properties761
-rw-r--r--Essentials/src/messages_da.properties770
-rw-r--r--Essentials/src/messages_de.properties763
-rw-r--r--Essentials/src/messages_en.properties758
-rw-r--r--Essentials/src/messages_es.properties406
-rw-r--r--Essentials/src/messages_fr.properties768
-rw-r--r--Essentials/src/messages_nl.properties758
-rw-r--r--Essentials/src/motd.txt3
-rw-r--r--Essentials/src/plugin.yml186
-rw-r--r--Essentials/src/rules.txt3
-rw-r--r--Essentials/test/com/earth2me/essentials/FakeServer.java69
-rw-r--r--Essentials/test/com/earth2me/essentials/StorageTest.java170
-rw-r--r--Essentials/test/com/earth2me/essentials/UserTest.java22
-rw-r--r--Essentials/test/com/earth2me/essentials/UtilTest.java18
-rw-r--r--EssentialsChat/nbproject/build-impl.xml17
-rw-r--r--EssentialsChat/nbproject/genfiles.properties4
-rw-r--r--EssentialsChat/nbproject/project.properties9
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java44
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java155
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java146
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerHighest.java53
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java41
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java79
-rw-r--r--EssentialsChat/src/plugin.yml2
-rw-r--r--EssentialsGeoIP/nbproject/build-impl.xml17
-rw-r--r--EssentialsGeoIP/nbproject/genfiles.properties4
-rw-r--r--EssentialsGeoIP/nbproject/project.properties9
-rw-r--r--EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java18
-rw-r--r--EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java27
-rw-r--r--EssentialsGeoIP/src/com/maxmind/geoip/DatabaseInfo.java4
-rw-r--r--EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java4
-rw-r--r--EssentialsGroupBridge/nbproject/build-impl.xml17
-rw-r--r--EssentialsGroupBridge/nbproject/genfiles.properties4
-rw-r--r--EssentialsGroupBridge/nbproject/project.properties4
-rw-r--r--EssentialsGroupManager/.classpath3
-rw-r--r--EssentialsGroupManager/nbproject/build-impl.xml17
-rw-r--r--EssentialsGroupManager/nbproject/genfiles.properties4
-rw-r--r--EssentialsGroupManager/nbproject/project.properties4
-rw-r--r--EssentialsPermissionsCommands/build.xml74
-rw-r--r--EssentialsPermissionsCommands/manifest.mf3
-rw-r--r--EssentialsPermissionsCommands/nbproject/build-impl.xml1081
-rw-r--r--EssentialsPermissionsCommands/nbproject/genfiles.properties8
-rw-r--r--EssentialsPermissionsCommands/nbproject/project.properties125
-rw-r--r--EssentialsPermissionsCommands/nbproject/project.xml28
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangadd.java30
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddi.java31
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddp.java31
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangcheckp.java31
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdel.java30
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdeli.java31
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdelp.java31
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanglistp.java30
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanload.java30
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java32
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddp.java31
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddsub.java31
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanucheckp.java31
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudel.java30
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelp.java31
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelsub.java31
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanulistp.java30
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java57
-rw-r--r--EssentialsPermissionsCommands/src/plugin.yml166
-rw-r--r--EssentialsProtect/MANIFEST.MF1
-rw-r--r--EssentialsProtect/nbproject/build-impl.xml17
-rw-r--r--EssentialsProtect/nbproject/genfiles.properties4
-rw-r--r--EssentialsProtect/nbproject/project.properties11
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyBlockListener.java36
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyEntityListener.java22
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyPlayerListener.java16
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java124
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java134
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java83
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java138
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java23
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/IProtect.java19
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java7
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/data/IProtectedBlock.java11
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/data/OwnedBlock.java4
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java9
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java94
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockSQLite.java54
-rw-r--r--EssentialsProtect/src/plugin.yml4
-rw-r--r--EssentialsSpawn/nbproject/build-impl.xml17
-rw-r--r--EssentialsSpawn/nbproject/genfiles.properties4
-rw-r--r--EssentialsSpawn/nbproject/pmd.settings1
-rw-r--r--EssentialsSpawn/nbproject/project.properties9
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java10
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java45
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java35
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java87
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/SpawnStorage.java90
-rw-r--r--EssentialsSpawn/src/plugin.yml4
-rw-r--r--EssentialsUpdate/nbproject/build-impl.xml17
-rw-r--r--EssentialsUpdate/nbproject/genfiles.properties4
-rw-r--r--EssentialsUpdate/nbproject/project.properties45
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/AbstractWorkListener.java10
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsHelp.java9
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsUpdate.java4
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/GetFile.java6
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/UpdateFile.java4
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java2
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/chat/AbstractFileCommand.java6
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/chat/ConfigCommand.java10
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/states/AbstractState.java5
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java2
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java2
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/states/UpdateOrInstallation.java7
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/tasks/InstallModule.java2
-rw-r--r--EssentialsUpdate/src/com/earth2me/essentials/update/tasks/SelfUpdate.java6
-rwxr-xr-xEssentialsUpdate/src/org/jibble/pircbot/InputThread.java4
-rwxr-xr-xEssentialsUpdate/src/org/jibble/pircbot/OutputThread.java3
-rwxr-xr-xEssentialsUpdate/src/org/jibble/pircbot/PircBot.java15
-rwxr-xr-xEssentialsUpdate/src/org/jibble/pircbot/User.java6
-rw-r--r--EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java1
-rw-r--r--EssentialsXMPP/build.xml2
-rw-r--r--EssentialsXMPP/nbproject/build-impl.xml17
-rw-r--r--EssentialsXMPP/nbproject/genfiles.properties4
-rw-r--r--EssentialsXMPP/nbproject/project.properties13
-rw-r--r--EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandsetxmpp.java2
-rw-r--r--EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java3
-rw-r--r--EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java34
-rw-r--r--EssentialsXMPP/src/com/earth2me/essentials/xmpp/UserManager.java18
-rw-r--r--EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java24
-rw-r--r--README.markdown2
-rw-r--r--WebPush/index.php37
-rw-r--r--WebPush/upload.php47
-rw-r--r--build.xml1
-rw-r--r--lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jarbin17873 -> 22335 bytes
-rw-r--r--lib/EssentialsiConomyBridge.jarbin7469 -> 0 bytes
-rw-r--r--lib/VanishNoPickup.jarbin32894 -> 0 bytes
-rw-r--r--lib/Vault.jarbin0 -> 180183 bytes
-rw-r--r--lib/bukkit-0.0.1-SNAPSHOT.jarbin4382157 -> 0 bytes
-rw-r--r--lib/bukkit.jar (renamed from lib/bukkit-1.0.0-R1-SNAPSHOT.jar)bin4404406 -> 4412119 bytes
-rw-r--r--lib/craftbukkit-0.0.1-SNAPSHOT.jarbin9590762 -> 0 bytes
-rw-r--r--lib/craftbukkit.jar (renamed from lib/craftbukkit-1.0.0-SNAPSHOT.jar)bin9815461 -> 10393769 bytes
-rw-r--r--lib/gson.jarbin164986 -> 0 bytes
-rw-r--r--lib/junit/junit-3.8.2-api.zipbin72555 -> 0 bytes
-rw-r--r--lib/junit/junit-3.8.2.jarbin118932 -> 0 bytes
-rw-r--r--lib/junit_4.10/junit-4.10-src.jarbin0 -> 141185 bytes
-rw-r--r--lib/junit_4.10/junit-4.10.jarbin0 -> 253160 bytes
-rw-r--r--lib/junit_4/junit-4.5-api.zipbin184067 -> 0 bytes
-rw-r--r--lib/junit_4/junit-4.5-src.jarbin109014 -> 0 bytes
-rw-r--r--lib/junit_4/junit-4.5.jarbin196787 -> 0 bytes
-rw-r--r--lib/mysql.jarbin703265 -> 0 bytes
-rw-r--r--lib/nblibraries.properties14
-rw-r--r--lib/smack-3.2.1.jar (renamed from lib/smack-3.2.0.jar)bin306803 -> 307017 bytes
-rw-r--r--lib/sqlite.jarbin1304214 -> 0 bytes
-rw-r--r--settings.zipbin19795 -> 0 bytes
416 files changed, 14312 insertions, 9468 deletions
diff --git a/.gitignore b/.gitignore
index c1c78f213..6c25fbdd7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,6 +35,6 @@
/EssentialsUpdate/dist/
/EssentialsUpdate/build/
/WebPush/apikey.php
-
-/WebPush/apikey.php
-/WebPush/apikey.php \ No newline at end of file
+/WebPush/nbproject/private
+/.idea
+*.iml \ No newline at end of file
diff --git a/BuildAll/nbproject/build-impl.xml b/BuildAll/nbproject/build-impl.xml
index 34bc10d88..1f8bcbaae 100644
--- a/BuildAll/nbproject/build-impl.xml
+++ b/BuildAll/nbproject/build-impl.xml
@@ -20,10 +20,10 @@ is divided into following sections:
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="BuildAll-impl">
- <fail message="Please build using Ant 1.7.1 or higher.">
+ <fail message="Please build using Ant 1.8.0 or higher.">
<condition>
<not>
- <antversion atleast="1.7.1"/>
+ <antversion atleast="1.8.0"/>
</not>
</condition>
</fail>
@@ -223,6 +223,7 @@ is divided into following sections:
<property name="javac.fork" value="${jdkBug6558476}"/>
<property name="jar.index" value="false"/>
<property name="jar.index.metainf" value="${jar.index}"/>
+ <property name="copylibs.rebase" value="true"/>
<available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
</target>
<target name="-post-init">
@@ -409,6 +410,7 @@ is divided into following sections:
<property environment="env"/>
<resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
<java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
@@ -539,7 +541,7 @@ is divided into following sections:
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
- <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+ <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
@@ -920,6 +922,14 @@ is divided into following sections:
-->
<target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
+ <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+ <and>
+ <isset property="endorsed.classpath.cmd.line.arg"/>
+ <not>
+ <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+ </not>
+ </and>
+ </condition>
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
<classpath>
<path path="${javac.classpath}"/>
@@ -931,6 +941,7 @@ is divided into following sections:
<include name="**/*.java"/>
<exclude name="*.java"/>
</fileset>
+ <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
</javadoc>
<copy todir="${dist.javadoc.dir}">
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
diff --git a/BuildAll/nbproject/genfiles.properties b/BuildAll/nbproject/genfiles.properties
index d832e2cec..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=66b89647
-nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
+nbproject/build-impl.xml.script.CRC32=c5170bed
+nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
diff --git a/BuildAll/nbproject/project.properties b/BuildAll/nbproject/project.properties
index dd9ceab91..246ea1240 100644
--- a/BuildAll/nbproject/project.properties
+++ b/BuildAll/nbproject/project.properties
@@ -81,9 +81,7 @@ javac.source=1.6
javac.target=1.6
javac.test.classpath=\
${javac.classpath}:\
- ${build.classes.dir}:\
- ${libs.junit.classpath}:\
- ${libs.junit_4.classpath}
+ ${build.classes.dir}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
diff --git a/Essentials/nbproject/build-impl.xml b/Essentials/nbproject/build-impl.xml
index 0816b04c9..f79ca7e26 100644
--- a/Essentials/nbproject/build-impl.xml
+++ b/Essentials/nbproject/build-impl.xml
@@ -20,10 +20,10 @@ is divided into following sections:
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="Essentials-impl">
- <fail message="Please build using Ant 1.7.1 or higher.">
+ <fail message="Please build using Ant 1.8.0 or higher.">
<condition>
<not>
- <antversion atleast="1.7.1"/>
+ <antversion atleast="1.8.0"/>
</not>
</condition>
</fail>
@@ -223,6 +223,7 @@ is divided into following sections:
<property name="javac.fork" value="${jdkBug6558476}"/>
<property name="jar.index" value="false"/>
<property name="jar.index.metainf" value="${jar.index}"/>
+ <property name="copylibs.rebase" value="true"/>
<available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
</target>
<target name="-post-init">
@@ -409,6 +410,7 @@ is divided into following sections:
<property environment="env"/>
<resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
<java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
@@ -539,7 +541,7 @@ is divided into following sections:
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
- <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+ <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
@@ -871,6 +873,14 @@ is divided into following sections:
-->
<target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
+ <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+ <and>
+ <isset property="endorsed.classpath.cmd.line.arg"/>
+ <not>
+ <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+ </not>
+ </and>
+ </condition>
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
<classpath>
<path path="${javac.classpath}"/>
@@ -882,6 +892,7 @@ is divided into following sections:
<include name="**/*.java"/>
<exclude name="*.java"/>
</fileset>
+ <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
</javadoc>
<copy todir="${dist.javadoc.dir}">
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
diff --git a/Essentials/nbproject/genfiles.properties b/Essentials/nbproject/genfiles.properties
index d39edfe18..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=64a00ba6
-nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
+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/nbproject/pmd.settings b/Essentials/nbproject/pmd.settings
index 824aa3ac9..29baf7ea1 100644
--- a/Essentials/nbproject/pmd.settings
+++ b/Essentials/nbproject/pmd.settings
@@ -1,2 +1,3 @@
DoNotUseThreads
+LongVariable
SignatureDeclareThrowsException
diff --git a/Essentials/nbproject/project.properties b/Essentials/nbproject/project.properties
index 079cf2b0c..0c8b44650 100644
--- a/Essentials/nbproject/project.properties
+++ b/Essentials/nbproject/project.properties
@@ -29,6 +29,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blank
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=*
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE
@@ -37,6 +38,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.place
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
@@ -64,16 +66,17 @@ endorsed.classpath=
excludes=
file.reference.BOSEconomy7.jar=../lib/BOSEconomy7.jar
file.reference.bPermissions.jar=../lib/bPermissions.jar
-file.reference.craftbukkit-0.0.1-SNAPSHOT.jar=..\\lib\\craftbukkit-0.0.1-SNAPSHOT.jar
+file.reference.bukkit.jar=../lib/bukkit.jar
+file.reference.craftbukkit.jar=../lib/craftbukkit.jar
file.reference.iCo4.jar=../lib/iCo4.jar
file.reference.iCo5.jar=../lib/iCo5.jar
file.reference.iCo6.jar=../lib/iCo6.jar
-file.reference.junit-4.5.jar=../lib/junit_4/junit-4.5.jar
file.reference.lombok-0.10.1.jar=../lib/lombok-0.10.1.jar
file.reference.MultiCurrency.jar=../lib/MultiCurrency.jar
file.reference.Permissions3.jar=../lib/Permissions3.jar
file.reference.PermissionsBukkit-1.2.jar=../lib/PermissionsBukkit-1.2.jar
file.reference.PermissionsEx.jar=../lib/PermissionsEx.jar
+file.reference.Vault.jar=../lib/Vault.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=true
@@ -90,7 +93,9 @@ javac.classpath=\
${file.reference.PermissionsBukkit-1.2.jar}:\
${file.reference.lombok-0.10.1.jar}:\
${reference.EssentialsGroupManager.jar}:\
- ${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}
+ ${file.reference.bukkit.jar}:\
+ ${file.reference.craftbukkit.jar}:\
+ ${file.reference.Vault.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
@@ -101,7 +106,7 @@ javac.target=1.6
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
- ${file.reference.junit-4.5.jar}
+ ${libs.junit_4.10.classpath}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
diff --git a/Essentials/src/com/earth2me/essentials/AlternativeCommandsHandler.java b/Essentials/src/com/earth2me/essentials/AlternativeCommandsHandler.java
new file mode 100644
index 000000000..e75644ad5
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/AlternativeCommandsHandler.java
@@ -0,0 +1,137 @@
+package com.earth2me.essentials;
+
+import java.util.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.bukkit.command.Command;
+import org.bukkit.command.PluginCommand;
+import org.bukkit.command.PluginCommandYamlParser;
+import org.bukkit.plugin.Plugin;
+
+
+public class AlternativeCommandsHandler
+{
+ private static final Logger LOGGER = Logger.getLogger("Minecraft");
+ private final transient Map<String, List<PluginCommand>> altcommands = new HashMap<String, List<PluginCommand>>();
+ private final transient Map<String, String> disabledList = new HashMap<String, String>();
+ private final transient IEssentials ess;
+
+ public AlternativeCommandsHandler(final IEssentials ess)
+ {
+ this.ess = ess;
+ for (Plugin plugin : ess.getServer().getPluginManager().getPlugins())
+ {
+ if (plugin.isEnabled())
+ {
+ addPlugin(plugin);
+ }
+ }
+ }
+
+ public final void addPlugin(final Plugin plugin)
+ {
+ if (plugin.getDescription().getMain().contains("com.earth2me.essentials"))
+ {
+ return;
+ }
+ final List<Command> commands = PluginCommandYamlParser.parse(plugin);
+ final String pluginName = plugin.getDescription().getName().toLowerCase(Locale.ENGLISH);
+
+ for (Command command : commands)
+ {
+ final PluginCommand pc = (PluginCommand)command;
+ final List<String> labels = new ArrayList<String>(pc.getAliases());
+ labels.add(pc.getName());
+
+ PluginCommand reg = ess.getServer().getPluginCommand(pluginName + ":" + pc.getName().toLowerCase(Locale.ENGLISH));
+ if (reg == null)
+ {
+ reg = ess.getServer().getPluginCommand(pc.getName().toLowerCase(Locale.ENGLISH));
+ }
+ if (reg == null || !reg.getPlugin().equals(plugin))
+ {
+ continue;
+ }
+ for (String label : labels)
+ {
+ List<PluginCommand> plugincommands = altcommands.get(label.toLowerCase(Locale.ENGLISH));
+ if (plugincommands == null)
+ {
+ plugincommands = new ArrayList<PluginCommand>();
+ altcommands.put(label.toLowerCase(Locale.ENGLISH), plugincommands);
+ }
+ boolean found = false;
+ for (PluginCommand pc2 : plugincommands)
+ {
+ if (pc2.getPlugin().equals(plugin))
+ {
+ found = true;
+ }
+ }
+ if (!found)
+ {
+ plugincommands.add(reg);
+ }
+ }
+ }
+ }
+
+ public void removePlugin(final Plugin plugin)
+ {
+ final Iterator<Map.Entry<String, List<PluginCommand>>> iterator = altcommands.entrySet().iterator();
+ while (iterator.hasNext())
+ {
+ final Map.Entry<String, List<PluginCommand>> entry = iterator.next();
+ final Iterator<PluginCommand> pcIterator = entry.getValue().iterator();
+ while (pcIterator.hasNext())
+ {
+ final PluginCommand pc = pcIterator.next();
+ if (pc.getPlugin() == null || pc.getPlugin().equals(plugin))
+ {
+ pcIterator.remove();
+ }
+ }
+ if (entry.getValue().isEmpty())
+ {
+ iterator.remove();
+ }
+ }
+ }
+
+ public PluginCommand getAlternative(final String label)
+ {
+ final List<PluginCommand> commands = altcommands.get(label);
+ if (commands == null || commands.isEmpty())
+ {
+ return null;
+ }
+ if (commands.size() == 1)
+ {
+ return commands.get(0);
+ }
+ // return the first command that is not an alias
+ for (PluginCommand command : commands)
+ {
+ if (command.getName().equalsIgnoreCase(label))
+ {
+ return command;
+ }
+ }
+ // return the first alias
+ return commands.get(0);
+ }
+
+ public void executed(final String label, final String otherLabel)
+ {
+ if (ess.getSettings().isDebug())
+ {
+ LOGGER.log(Level.INFO, "Essentials: Alternative command " + label + " found, using " + otherLabel);
+ }
+ disabledList.put(label, otherLabel);
+ }
+
+ public Map<String, String> disabledCommands()
+ {
+ return disabledList;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/Backup.java b/Essentials/src/com/earth2me/essentials/Backup.java
index 02a3d54ba..ada36c9d7 100644
--- a/Essentials/src/com/earth2me/essentials/Backup.java
+++ b/Essentials/src/com/earth2me/essentials/Backup.java
@@ -1,5 +1,6 @@
package com.earth2me.essentials;
+import static com.earth2me.essentials.I18n._;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@@ -7,7 +8,6 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import org.bukkit.craftbukkit.CraftServer;
public class Backup implements Runnable
@@ -48,6 +48,7 @@ public class Backup implements Runnable
}
}
+ @Override
public void run()
{
if (active)
@@ -60,7 +61,7 @@ public class Backup implements Runnable
{
return;
}
- LOGGER.log(Level.INFO, Util.i18n("backupStarted"));
+ LOGGER.log(Level.INFO, _("backupStarted"));
final CommandSender cs = server.getConsoleSender();
server.dispatchCommand(cs, "save-all");
server.dispatchCommand(cs, "save-off");
@@ -68,6 +69,7 @@ public class Backup implements Runnable
ess.scheduleAsyncDelayedTask(
new Runnable()
{
+ @Override
public void run()
{
try
@@ -109,6 +111,7 @@ public class Backup implements Runnable
ess.scheduleSyncDelayedTask(
new Runnable()
{
+ @Override
public void run()
{
server.dispatchCommand(cs, "save-on");
@@ -121,7 +124,7 @@ public class Backup implements Runnable
}
}
active = false;
- LOGGER.log(Level.INFO, Util.i18n("backupFinished"));
+ LOGGER.log(Level.INFO, _("backupFinished"));
}
});
}
diff --git a/Essentials/src/com/earth2me/essentials/Console.java b/Essentials/src/com/earth2me/essentials/Console.java
index dcdb65a0d..d07171c63 100644
--- a/Essentials/src/com/earth2me/essentials/Console.java
+++ b/Essentials/src/com/earth2me/essentials/Console.java
@@ -19,11 +19,13 @@ public final class Console implements IReplyTo
return server.getConsoleSender();
}
+ @Override
public void setReplyTo(CommandSender user)
{
replyTo = user;
}
+ @Override
public CommandSender getReplyTo()
{
return replyTo;
diff --git a/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java b/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java
index 0fd2e9047..bf3037e59 100644
--- a/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java
+++ b/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials;
-import com.earth2me.essentials.commands.Commandtime;
+import static com.earth2me.essentials.I18n._;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -72,7 +72,7 @@ public final class DescParseTickFormat
public static long parse(String desc) throws NumberFormatException
{
// Only look at alphanumeric and lowercase and : for 24:00
- desc = desc.toLowerCase().replaceAll("[^A-Za-z0-9:]", "");
+ desc = desc.toLowerCase(Locale.ENGLISH).replaceAll("[^A-Za-z0-9:]", "");
// Detect ticks format
try
@@ -133,7 +133,7 @@ public final class DescParseTickFormat
throw new NumberFormatException();
}
- desc = desc.toLowerCase().replaceAll("[^0-9]", "");
+ desc = desc.toLowerCase(Locale.ENGLISH).replaceAll("[^0-9]", "");
if (desc.length() != 4)
{
@@ -156,7 +156,7 @@ public final class DescParseTickFormat
int hours = 0;
int minutes = 0;
- desc = desc.toLowerCase().replaceAll("[^0-9]", "");
+ desc = desc.toLowerCase(Locale.ENGLISH).replaceAll("[^0-9]", "");
if (desc.length() > 4)
{
@@ -185,12 +185,12 @@ public final class DescParseTickFormat
{
throw new NumberFormatException();
}
-
+
if (desc.endsWith("pm") && hours != 12)
{
hours += 12;
}
-
+
if (desc.endsWith("am") && hours == 12)
{
hours -= 12;
@@ -231,7 +231,7 @@ public final class DescParseTickFormat
// --------------------------------------------
public static String format(final long ticks)
{
- return Util.format("timeFormat", format24(ticks), format12(ticks), formatTicks(ticks));
+ return _("timeFormat", format24(ticks), format12(ticks), formatTicks(ticks));
}
public static String formatTicks(final long ticks)
diff --git a/Essentials/src/com/earth2me/essentials/Enchantments.java b/Essentials/src/com/earth2me/essentials/Enchantments.java
new file mode 100644
index 000000000..5ce10d75d
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/Enchantments.java
@@ -0,0 +1,83 @@
+package com.earth2me.essentials;
+
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.regex.Pattern;
+import org.bukkit.enchantments.Enchantment;
+
+
+public class Enchantments
+{
+ private static final transient Pattern NUMPATTERN = Pattern.compile("\\d+");
+ private static final Map<String, Enchantment> ENCHANTMENTS = new HashMap<String, Enchantment>();
+
+ static
+ {
+ ENCHANTMENTS.put("alldamage", Enchantment.DAMAGE_ALL);
+ ENCHANTMENTS.put("alldmg", Enchantment.DAMAGE_ALL);
+ ENCHANTMENTS.put("sharpness", Enchantment.DAMAGE_ALL);
+ ENCHANTMENTS.put("arthropodsdamage", Enchantment.DAMAGE_ARTHROPODS);
+ ENCHANTMENTS.put("ardmg", Enchantment.DAMAGE_ARTHROPODS);
+ ENCHANTMENTS.put("baneofarthropods", Enchantment.DAMAGE_ARTHROPODS);
+ ENCHANTMENTS.put("undeaddamage", Enchantment.DAMAGE_UNDEAD);
+ ENCHANTMENTS.put("smite", Enchantment.DAMAGE_UNDEAD);
+ ENCHANTMENTS.put("digspeed", Enchantment.DIG_SPEED);
+ ENCHANTMENTS.put("efficiency", Enchantment.DIG_SPEED);
+ ENCHANTMENTS.put("durability", Enchantment.DURABILITY);
+ ENCHANTMENTS.put("dura", Enchantment.DURABILITY);
+ ENCHANTMENTS.put("unbreaking", Enchantment.DURABILITY);
+ ENCHANTMENTS.put("fireaspect", Enchantment.FIRE_ASPECT);
+ ENCHANTMENTS.put("fire", Enchantment.FIRE_ASPECT);
+ ENCHANTMENTS.put("knockback", Enchantment.KNOCKBACK);
+ ENCHANTMENTS.put("blockslootbonus", Enchantment.LOOT_BONUS_BLOCKS);
+ ENCHANTMENTS.put("fortune", Enchantment.LOOT_BONUS_BLOCKS);
+ ENCHANTMENTS.put("mobslootbonus", Enchantment.LOOT_BONUS_MOBS);
+ ENCHANTMENTS.put("mobloot", Enchantment.LOOT_BONUS_MOBS);
+ ENCHANTMENTS.put("looting", Enchantment.LOOT_BONUS_MOBS);
+ ENCHANTMENTS.put("oxygen", Enchantment.OXYGEN);
+ ENCHANTMENTS.put("respiration", Enchantment.OXYGEN);
+ ENCHANTMENTS.put("protection", Enchantment.PROTECTION_ENVIRONMENTAL);
+ ENCHANTMENTS.put("prot", Enchantment.PROTECTION_ENVIRONMENTAL);
+ ENCHANTMENTS.put("explosionsprotection", Enchantment.PROTECTION_EXPLOSIONS);
+ ENCHANTMENTS.put("expprot", Enchantment.PROTECTION_EXPLOSIONS);
+ ENCHANTMENTS.put("blastprotection", Enchantment.PROTECTION_EXPLOSIONS);
+ ENCHANTMENTS.put("fallprotection", Enchantment.PROTECTION_FALL);
+ ENCHANTMENTS.put("fallprot", Enchantment.PROTECTION_FALL);
+ ENCHANTMENTS.put("featherfalling", Enchantment.PROTECTION_FALL);
+ ENCHANTMENTS.put("fireprotection", Enchantment.PROTECTION_FIRE);
+ ENCHANTMENTS.put("fireprot", Enchantment.PROTECTION_FIRE);
+ ENCHANTMENTS.put("projectileprotection", Enchantment.PROTECTION_PROJECTILE);
+ ENCHANTMENTS.put("projprot", Enchantment.PROTECTION_PROJECTILE);
+ 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("arrowkb", Enchantment.ARROW_KNOCKBACK);
+ ENCHANTMENTS.put("infinitearrows", Enchantment.ARROW_INFINITE);
+ ENCHANTMENTS.put("infarrows", Enchantment.ARROW_INFINITE);
+ }
+
+ public static Enchantment getByName(String name) {
+ Enchantment enchantment;
+ if (NUMPATTERN.matcher(name).matches()) {
+ enchantment = Enchantment.getById(Integer.parseInt(name));
+ } else {
+ enchantment = Enchantment.getByName(name.toUpperCase(Locale.ENGLISH));
+ }
+ if (enchantment == null)
+ {
+ enchantment = ENCHANTMENTS.get(name.toLowerCase(Locale.ENGLISH));
+ }
+ return enchantment;
+ }
+
+ public static Set<Entry<String, Enchantment>> entrySet()
+ {
+ return ENCHANTMENTS.entrySet();
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java
index a571483f6..5287e299b 100644
--- a/Essentials/src/com/earth2me/essentials/Essentials.java
+++ b/Essentials/src/com/earth2me/essentials/Essentials.java
@@ -1,57 +1,73 @@
/*
* Essentials - a bukkit plugin
* Copyright (C) 2011 Essentials Team
- *
+ *
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.earth2me.essentials;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.api.Economy;
+import com.earth2me.essentials.api.IJails;
import com.earth2me.essentials.commands.EssentialsCommand;
-import java.io.*;
-import java.util.*;
-import java.util.logging.*;
-import org.bukkit.*;
-import org.bukkit.command.Command;
-import org.bukkit.command.CommandSender;
import com.earth2me.essentials.commands.IEssentialsCommand;
import com.earth2me.essentials.commands.NoChargeException;
import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import com.earth2me.essentials.craftbukkit.ItemDupeFix;
import com.earth2me.essentials.perm.PermissionsHandler;
import com.earth2me.essentials.register.payment.Methods;
import com.earth2me.essentials.signs.SignBlockListener;
import com.earth2me.essentials.signs.SignEntityListener;
import com.earth2me.essentials.signs.SignPlayerListener;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.bukkit.Server;
+import org.bukkit.World;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Player;
import org.bukkit.event.Event.Priority;
import org.bukkit.event.Event.Type;
-import org.bukkit.plugin.*;
-import org.bukkit.plugin.java.*;
+import org.bukkit.event.player.PlayerJoinEvent;
+import org.bukkit.event.player.PlayerListener;
+import org.bukkit.event.world.WorldListener;
+import org.bukkit.event.world.WorldLoadEvent;
+import org.bukkit.event.world.WorldUnloadEvent;
+import org.bukkit.plugin.InvalidDescriptionException;
+import org.bukkit.plugin.Plugin;
+import org.bukkit.plugin.PluginDescriptionFile;
+import org.bukkit.plugin.PluginManager;
+import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitScheduler;
+import org.yaml.snakeyaml.error.YAMLException;
public class Essentials extends JavaPlugin implements IEssentials
{
- public static final int BUKKIT_VERSION = 1060;
+ 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);
- private transient Spawn spawn;
- private transient Jail jail;
+ private transient Jails jails;
private transient Warps warps;
private transient Worth worth;
private transient List<IConf> confList;
@@ -59,8 +75,10 @@ public class Essentials extends JavaPlugin implements IEssentials
private transient ItemDb itemDb;
private transient final Methods paymentMethod = new Methods();
private transient PermissionsHandler permissionsHandler;
+ private transient AlternativeCommandsHandler alternativeCommandsHandler;
private transient UserMap userMap;
private transient ExecuteTimer execTimer;
+ private transient I18n i18n;
@Override
public ISettings getSettings()
@@ -79,10 +97,13 @@ public class Essentials extends JavaPlugin implements IEssentials
{
throw new IOException();
}
- LOGGER.log(Level.INFO, Util.i18n("usingTempFolderForTesting"));
+ i18n = new I18n(this);
+ i18n.onEnable();
+ LOGGER.log(Level.INFO, _("usingTempFolderForTesting"));
LOGGER.log(Level.INFO, dataFolder.toString());
this.initialize(null, server, new PluginDescriptionFile(new FileReader(new File("src" + File.separator + "plugin.yml"))), dataFolder, null, null);
settings = new Settings(this);
+ i18n.updateLocale("en");
userMap = new UserMap(this);
permissionsHandler = new PermissionsHandler(this, false);
Economy.setEss(this);
@@ -93,61 +114,91 @@ public class Essentials extends JavaPlugin implements IEssentials
{
execTimer = new ExecuteTimer();
execTimer.start();
- final String[] javaversion = System.getProperty("java.version").split("\\.", 3);
- if (javaversion == null || javaversion.length < 2 || Integer.parseInt(javaversion[1]) < 6)
- {
- LOGGER.log(Level.SEVERE, "Java version not supported! Please install Java 1.6. You have " + System.getProperty("java.version"));
- }
- final EssentialsUpgrade upgrade = new EssentialsUpgrade(this);
- upgrade.beforeSettings();
- execTimer.mark("Upgrade");
- confList = new ArrayList<IConf>();
- settings = new Settings(this);
- confList.add(settings);
- execTimer.mark("Settings");
- upgrade.afterSettings();
- execTimer.mark("Upgrade2");
- Util.updateLocale(settings.getLocale(), this);
- userMap = new UserMap(this);
- confList.add(userMap);
- execTimer.mark("Init(Usermap)");
- spawn = new Spawn(getServer(), this.getDataFolder());
- confList.add(spawn);
- warps = new Warps(getServer(), this.getDataFolder());
- confList.add(warps);
- execTimer.mark("Init(Spawn/Warp)");
- worth = new Worth(this.getDataFolder());
- confList.add(worth);
- itemDb = new ItemDb(this);
- confList.add(itemDb);
- execTimer.mark("Init(Worth/ItemDB)");
- reload();
- backup = new Backup(this);
-
+ i18n = new I18n(this);
+ i18n.onEnable();
+ execTimer.mark("I18n1");
final PluginManager pm = getServer().getPluginManager();
for (Plugin plugin : pm.getPlugins())
{
if (plugin.getDescription().getName().startsWith("Essentials")
&& !plugin.getDescription().getVersion().equals(this.getDescription().getVersion()))
{
- LOGGER.log(Level.WARNING, Util.format("versionMismatch", plugin.getDescription().getName()));
+ LOGGER.log(Level.WARNING, _("versionMismatch", plugin.getDescription().getName()));
}
}
- final Matcher versionMatch = Pattern.compile("git-Bukkit-([0-9]+).([0-9]+).([0-9]+)-[0-9]+-[0-9a-z]+-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));
if (versionNumber < BUKKIT_VERSION)
{
- LOGGER.log(Level.WARNING, Util.i18n("notRecommendedBukkit"));
+ LOGGER.log(Level.SEVERE, _("notRecommendedBukkit"));
+ LOGGER.log(Level.SEVERE, _("requiredBukkit", Integer.toString(BUKKIT_VERSION)));
+ this.setEnabled(false);
+ return;
}
}
else
{
- LOGGER.log(Level.INFO, Util.i18n("bukkitFormatChanged"));
+ LOGGER.log(Level.INFO, _("bukkitFormatChanged"));
+ LOGGER.log(Level.INFO, getServer().getVersion());
+ LOGGER.log(Level.INFO, getServer().getBukkitVersion());
}
-
+ execTimer.mark("BukkitCheck");
+ try
+ {
+ final EssentialsUpgrade upgrade = new EssentialsUpgrade(this);
+ upgrade.beforeSettings();
+ execTimer.mark("Upgrade");
+ confList = new ArrayList<IConf>();
+ settings = new Settings(this);
+ confList.add(settings);
+ execTimer.mark("Settings");
+ upgrade.afterSettings();
+ execTimer.mark("Upgrade2");
+ i18n.updateLocale(settings.getLocale());
+ userMap = new UserMap(this);
+ confList.add(userMap);
+ execTimer.mark("Init(Usermap)");
+ warps = new Warps(getServer(), this.getDataFolder());
+ confList.add(warps);
+ execTimer.mark("Init(Spawn/Warp)");
+ worth = new Worth(this.getDataFolder());
+ confList.add(worth);
+ itemDb = new ItemDb(this);
+ confList.add(itemDb);
+ execTimer.mark("Init(Worth/ItemDB)");
+ reload();
+ }
+ catch (YAMLException exception)
+ {
+ if (pm.getPlugin("EssentialsUpdate") != null)
+ {
+ LOGGER.log(Level.SEVERE, _("essentialsHelp2"));
+ }
+ else
+ {
+ LOGGER.log(Level.SEVERE, _("essentialsHelp1"));
+ }
+ LOGGER.log(Level.SEVERE, exception.toString());
+ pm.registerEvent(Type.PLAYER_JOIN, new PlayerListener()
+ {
+ @Override
+ public void onPlayerJoin(PlayerJoinEvent event)
+ {
+ event.getPlayer().sendMessage("Essentials failed to load, read the log file.");
+ }
+ }, Priority.Low, this);
+ for (Player player : getServer().getOnlinePlayers())
+ {
+ player.sendMessage("Essentials failed to load, read the log file.");
+ }
+ this.setEnabled(false);
+ return;
+ }
+ backup = new Backup(this);
permissionsHandler = new PermissionsHandler(this, settings.useBukkitPermissions());
+ alternativeCommandsHandler = new AlternativeCommandsHandler(this);
final EssentialsPluginListener serverListener = new EssentialsPluginListener(this);
pm.registerEvent(Type.PLUGIN_ENABLE, serverListener, Priority.Low, this);
pm.registerEvent(Type.PLUGIN_DISABLE, serverListener, Priority.Low, this);
@@ -161,10 +212,13 @@ public class Essentials extends JavaPlugin implements IEssentials
pm.registerEvent(Type.PLAYER_MOVE, playerListener, Priority.High, this);
pm.registerEvent(Type.PLAYER_LOGIN, playerListener, Priority.High, this);
pm.registerEvent(Type.PLAYER_TELEPORT, playerListener, Priority.High, this);
- pm.registerEvent(Type.PLAYER_INTERACT, playerListener, Priority.High, this);
pm.registerEvent(Type.PLAYER_EGG_THROW, playerListener, Priority.High, this);
pm.registerEvent(Type.PLAYER_BUCKET_EMPTY, playerListener, Priority.High, this);
pm.registerEvent(Type.PLAYER_ANIMATION, playerListener, Priority.High, this);
+ pm.registerEvent(Type.PLAYER_CHANGED_WORLD, playerListener, Priority.Normal, this);
+ pm.registerEvent(Type.PLAYER_INTERACT, playerListener, Priority.Monitor, this);
+ pm.registerEvent(Type.PLAYER_PICKUP_ITEM, playerListener, Priority.Low, this);
+ pm.registerEvent(Type.PLAYER_TELEPORT, new ItemDupeFix(), Priority.Monitor, this);
final EssentialsBlockListener blockListener = new EssentialsBlockListener(this);
pm.registerEvent(Type.BLOCK_PLACE, blockListener, Priority.Lowest, this);
@@ -191,18 +245,14 @@ public class Essentials extends JavaPlugin implements IEssentials
pm.registerEvent(Type.ENTITY_DEATH, entityListener, Priority.Lowest, this);
pm.registerEvent(Type.ENTITY_REGAIN_HEALTH, entityListener, Priority.Lowest, this);
pm.registerEvent(Type.FOOD_LEVEL_CHANGE, entityListener, Priority.Lowest, this);
+
+ final EssentialsWorldListener worldListener = new EssentialsWorldListener(this);
+ pm.registerEvent(Type.WORLD_LOAD, worldListener, Priority.Monitor, this);
+ pm.registerEvent(Type.WORLD_UNLOAD, worldListener, Priority.Monitor, this);
//TODO: Check if this should be here, and not above before reload()
- jail = new Jail(this);
- final JailPlayerListener jailPlayerListener = new JailPlayerListener(this);
- confList.add(jail);
- pm.registerEvent(Type.BLOCK_BREAK, jail, Priority.Low, this);
- pm.registerEvent(Type.BLOCK_DAMAGE, jail, Priority.Low, this);
- pm.registerEvent(Type.BLOCK_PLACE, jail, Priority.Low, this);
- pm.registerEvent(Type.PLAYER_INTERACT, jailPlayerListener, Priority.Low, this);
- pm.registerEvent(Type.PLAYER_RESPAWN, jailPlayerListener, Priority.High, this);
- pm.registerEvent(Type.PLAYER_TELEPORT, jailPlayerListener, Priority.High, this);
- pm.registerEvent(Type.PLAYER_JOIN, jailPlayerListener, Priority.High, this);
+ jails = new Jails(this);
+ confList.add(jails);
pm.registerEvent(Type.ENTITY_EXPLODE, tntListener, Priority.High, this);
@@ -210,7 +260,7 @@ public class Essentials extends JavaPlugin implements IEssentials
getScheduler().scheduleSyncRepeatingTask(this, timer, 1, 100);
Economy.setEss(this);
execTimer.mark("RegListeners");
- LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), Util.joinList(this.getDescription().getAuthors())));
+ LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), Util.joinList(this.getDescription().getAuthors())));
final String timeroutput = execTimer.end();
if (getSettings().isDebug())
{
@@ -221,6 +271,8 @@ public class Essentials extends JavaPlugin implements IEssentials
@Override
public void onDisable()
{
+ i18n.onDisable();
+ Economy.setEss(null);
Trade.closeLog();
}
@@ -235,158 +287,26 @@ public class Essentials extends JavaPlugin implements IEssentials
execTimer.mark("Reload(" + iConf.getClass().getSimpleName() + ")");
}
- Util.updateLocale(settings.getLocale(), this);
-
- // for motd
- getConfiguration().load();
- }
-
- @Override
- public String[] getMotd(final CommandSender sender, final String def)
- {
- return getLines(sender, "motd", def);
- }
-
- @Override
- public String[] getLines(final CommandSender sender, final String node, final String def)
- {
- List<String> lines = (List<String>)getConfiguration().getProperty(node);
- if (lines == null)
- {
- return new String[0];
- }
- String[] retval = new String[lines.size()];
-
- if (lines.isEmpty() || lines.get(0) == null)
- {
- try
- {
- lines = new ArrayList<String>();
- // "[]" in YaML indicates empty array, so respect that
- if (!getConfiguration().getString(node, def).equals("[]"))
- {
- lines.add(getConfiguration().getString(node, def));
- retval = new String[lines.size()];
- }
- }
- catch (Throwable ex2)
- {
- LOGGER.log(Level.WARNING, Util.format("corruptNodeInConfig", node));
- return new String[0];
- }
- }
-
- // if still empty, call it a day
- if (lines == null || lines.isEmpty() || lines.get(0) == null)
- {
- return new String[0];
- }
-
- for (int i = 0; i < lines.size(); i++)
- {
- String m = lines.get(i);
- if (m == null)
- {
- continue;
- }
- m = m.replace('&', '§').replace("§§", "&");
-
- if (sender instanceof User || sender instanceof Player)
- {
- User user = getUser(sender);
- m = m.replace("{PLAYER}", user.getDisplayName());
- m = m.replace("{IP}", user.getAddress().toString());
- m = m.replace("{BALANCE}", Double.toString(user.getMoney()));
- m = m.replace("{MAILS}", Integer.toString(user.getMails().size()));
- m = m.replace("{WORLD}", user.getLocation().getWorld().getName());
- }
- int playerHidden = 0;
- for (Player p : getServer().getOnlinePlayers())
- {
- if (getUser(p).isHidden())
- {
- playerHidden++;
- }
- }
- m = m.replace("{ONLINE}", Integer.toString(getServer().getOnlinePlayers().length - playerHidden));
- m = m.replace("{UNIQUE}", Integer.toString(userMap.getUniqueUsers()));
-
- if (m.matches(".*\\{PLAYERLIST\\}.*"))
- {
- StringBuilder online = new StringBuilder();
- for (Player p : getServer().getOnlinePlayers())
- {
- if (getUser(p).isHidden())
- {
- continue;
- }
- if (online.length() > 0)
- {
- online.append(", ");
- }
- online.append(p.getDisplayName());
- }
- m = m.replace("{PLAYERLIST}", online.toString());
- }
-
- if (sender instanceof Player)
- {
- try
- {
- Class User = getClassLoader().loadClass("bukkit.Vandolis.User");
- Object vuser = User.getConstructor(User.class).newInstance((Player)sender);
- m = m.replace("{RED:BALANCE}", User.getMethod("getMoney").invoke(vuser).toString());
- m = m.replace("{RED:BUYS}", User.getMethod("getNumTransactionsBuy").invoke(vuser).toString());
- m = m.replace("{RED:SELLS}", User.getMethod("getNumTransactionsSell").invoke(vuser).toString());
- }
- catch (Throwable ex)
- {
- m = m.replace("{RED:BALANCE}", "N/A");
- m = m.replace("{RED:BUYS}", "N/A");
- m = m.replace("{RED:SELLS}", "N/A");
- }
- }
-
- retval[i] = m + " ";
- }
- return retval;
+ i18n.updateLocale(settings.getLocale());
}
@Override
public boolean onCommand(final CommandSender sender, final Command command, final String commandLabel, final String[] args)
{
- return onCommandEssentials(sender, command, commandLabel, args, Essentials.class.getClassLoader(), "com.earth2me.essentials.commands.Command", "essentials.");
+ return onCommandEssentials(sender, command, commandLabel, args, Essentials.class.getClassLoader(), "com.earth2me.essentials.commands.Command", "essentials.", null);
}
@Override
- public boolean onCommandEssentials(final CommandSender sender, final Command command, final String commandLabel, final String[] args, final ClassLoader classLoader, final String commandPath, final String permissionPrefix)
+ public boolean onCommandEssentials(final CommandSender sender, final Command command, final String commandLabel, final String[] args, final ClassLoader classLoader, final String commandPath, final String permissionPrefix, final IEssentialsModule module)
{
// Allow plugins to override the command via onCommand
- if (!getSettings().isCommandOverridden(command.getName()) && !commandLabel.startsWith("e"))
+ if (!getSettings().isCommandOverridden(command.getName()) && (!commandLabel.startsWith("e") || commandLabel.equalsIgnoreCase(command.getName())))
{
- for (Plugin p : getServer().getPluginManager().getPlugins())
+ final PluginCommand pc = alternativeCommandsHandler.getAlternative(commandLabel);
+ if (pc != null)
{
- if (p.getDescription().getMain().contains("com.earth2me.essentials"))
- {
- continue;
- }
-
- final PluginDescriptionFile desc = p.getDescription();
- if (desc == null)
- {
- continue;
- }
-
- if (desc.getName() == null)
- {
- continue;
- }
-
- final PluginCommand pc = getServer().getPluginCommand(desc.getName() + ":" + commandLabel);
- if (pc != null)
- {
- return pc.execute(sender, commandLabel, args);
- }
+ alternativeCommandsHandler.executed(commandLabel, pc.getLabel());
+ return pc.execute(sender, commandLabel, args);
}
}
@@ -405,7 +325,7 @@ public class Essentials extends JavaPlugin implements IEssentials
final List<String> mail = user.getMails();
if (mail != null && !mail.isEmpty())
{
- user.sendMessage(Util.format("youHaveNewMail", mail.size()));
+ user.sendMessage(_("youHaveNewMail", mail.size()));
}
}
@@ -420,19 +340,20 @@ public class Essentials extends JavaPlugin implements IEssentials
{
cmd = (IEssentialsCommand)classLoader.loadClass(commandPath + command.getName()).newInstance();
cmd.setEssentials(this);
+ cmd.setEssentialsModule(module);
}
catch (Exception ex)
{
- sender.sendMessage(Util.format("commandNotLoaded", commandLabel));
- LOGGER.log(Level.SEVERE, Util.format("commandNotLoaded", commandLabel), ex);
+ sender.sendMessage(_("commandNotLoaded", commandLabel));
+ LOGGER.log(Level.SEVERE, _("commandNotLoaded", commandLabel), ex);
return true;
}
// Check authorization
if (user != null && !user.isAuthorized(cmd, permissionPrefix))
{
- LOGGER.log(Level.WARNING, Util.format("deniedAccessCommand", user.getName()));
- user.sendMessage(Util.i18n("noAccessCommand"));
+ LOGGER.log(Level.WARNING, _("deniedAccessCommand", user.getName()));
+ user.sendMessage(_("noAccessCommand"));
return true;
}
@@ -457,6 +378,10 @@ public class Essentials extends JavaPlugin implements IEssentials
{
sender.sendMessage(command.getDescription());
sender.sendMessage(command.getUsage().replaceAll("<command>", commandLabel));
+ if (!ex.getMessage().isEmpty())
+ {
+ sender.sendMessage(ex.getMessage());
+ }
return true;
}
catch (Throwable ex)
@@ -467,7 +392,7 @@ public class Essentials extends JavaPlugin implements IEssentials
}
catch (Throwable ex)
{
- LOGGER.log(Level.SEVERE, Util.format("commandFailed", commandLabel), ex);
+ LOGGER.log(Level.SEVERE, _("commandFailed", commandLabel), ex);
return true;
}
}
@@ -475,12 +400,10 @@ public class Essentials extends JavaPlugin implements IEssentials
@Override
public void showError(final CommandSender sender, final Throwable exception, final String commandLabel)
{
- sender.sendMessage(Util.format("errorWithMessage", exception.getMessage()));
- final LogRecord logRecord = new LogRecord(Level.WARNING, Util.format("errorCallingCommand", commandLabel));
- logRecord.setThrown(exception);
+ sender.sendMessage(_("errorWithMessage", exception.getMessage()));
if (getSettings().isDebug())
{
- LOGGER.log(logRecord);
+ LOGGER.log(Level.WARNING, _("errorCallingCommand", commandLabel), exception);
}
}
@@ -491,9 +414,9 @@ public class Essentials extends JavaPlugin implements IEssentials
}
@Override
- public Jail getJail()
+ public IJails getJails()
{
- return jail;
+ return jails;
}
@Override
@@ -515,12 +438,6 @@ public class Essentials extends JavaPlugin implements IEssentials
}
@Override
- public Spawn getSpawn()
- {
- return spawn;
- }
-
- @Override
public User getUser(final Object base)
{
if (base instanceof Player)
@@ -529,14 +446,12 @@ public class Essentials extends JavaPlugin implements IEssentials
}
if (base instanceof String)
{
- try
+ final User user = userMap.getUser((String)base);
+ if (user != null && user.getBase() instanceof OfflinePlayer)
{
- return userMap.getUser((String)base);
- }
- catch (NullPointerException ex)
- {
- return null;
+ ((OfflinePlayer)user.getBase()).setName((String)base);
}
+ return user;
}
return null;
}
@@ -552,27 +467,28 @@ public class Essentials extends JavaPlugin implements IEssentials
{
return (User)base;
}
- try
+ User user = userMap.getUser(base.getName());
+
+ if (user == null)
{
- return userMap.getUser(base.getName()).update(base);
+ user = new User(base, this);
}
- catch (NullPointerException ex)
+ else
{
- return new User(base, this);
+ user.update(base);
}
+ return user;
}
@Override
public User getOfflineUser(final String name)
{
- try
- {
- return userMap.getUser(name);
- }
- catch (NullPointerException ex)
+ final User user = userMap.getUser(name);
+ if (user != null && user.getBase() instanceof OfflinePlayer)
{
- return null;
+ ((OfflinePlayer)user.getBase()).setName(name);
}
+ return user;
}
@Override
@@ -663,6 +579,12 @@ public class Essentials extends JavaPlugin implements IEssentials
}
@Override
+ public AlternativeCommandsHandler getAlternativeCommandsHandler()
+ {
+ return alternativeCommandsHandler;
+ }
+
+ @Override
public ItemDb getItemDb()
{
return itemDb;
@@ -673,4 +595,52 @@ public class Essentials extends JavaPlugin implements IEssentials
{
return userMap;
}
+
+ @Override
+ public I18n getI18n()
+ {
+ return i18n;
+ }
+
+ private static class EssentialsWorldListener extends WorldListener implements Runnable {
+ private transient final IEssentials ess;
+
+ public EssentialsWorldListener(IEssentials ess)
+ {
+ this.ess = ess;
+ }
+
+
+ @Override
+ public void onWorldLoad(WorldLoadEvent event)
+ {
+ ess.getJails().onReload();
+ ess.getWarps().reloadConfig();
+ for (IConf iConf : ((Essentials)ess).confList)
+ {
+ if (iConf instanceof IEssentialsModule) {
+ iConf.reloadConfig();
+ }
+ }
+ }
+
+ @Override
+ public void onWorldUnload(WorldUnloadEvent event)
+ {
+ ess.getJails().onReload();
+ ess.getWarps().reloadConfig();
+ for (IConf iConf : ((Essentials)ess).confList)
+ {
+ if (iConf instanceof IEssentialsModule) {
+ iConf.reloadConfig();
+ }
+ }
+ }
+
+ @Override
+ public void run()
+ {
+ ess.reload();
+ }
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java
index 72c308655..ceda6a60c 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java
@@ -28,69 +28,9 @@ public class EssentialsBlockListener extends BlockListener
final User user = ess.getUser(event.getPlayer());
// Do not rely on getItemInHand();
// http://leaky.bukkit.org/issues/663
- final ItemStack is = new ItemStack(event.getBlockPlaced().getType(), 1, (short)0, event.getBlockPlaced().getData());
- switch (is.getType())
+ final ItemStack is = Util.convertBlockToItem(event.getBlockPlaced());
+ if (is == null)
{
- case WOODEN_DOOR:
- is.setType(Material.WOOD_DOOR);
- is.setDurability((short)0);
- break;
- case IRON_DOOR_BLOCK:
- is.setType(Material.IRON_DOOR);
- is.setDurability((short)0);
- break;
- case SIGN_POST:
- case WALL_SIGN:
- is.setType(Material.SIGN);
- is.setDurability((short)0);
- break;
- case CROPS:
- is.setType(Material.SEEDS);
- is.setDurability((short)0);
- break;
- case CAKE_BLOCK:
- is.setType(Material.CAKE);
- is.setDurability((short)0);
- break;
- case BED_BLOCK:
- is.setType(Material.BED);
- is.setDurability((short)0);
- break;
- case REDSTONE_WIRE:
- is.setType(Material.REDSTONE);
- is.setDurability((short)0);
- break;
- case REDSTONE_TORCH_OFF:
- case REDSTONE_TORCH_ON:
- is.setType(Material.REDSTONE_TORCH_ON);
- is.setDurability((short)0);
- break;
- case DIODE_BLOCK_OFF:
- case DIODE_BLOCK_ON:
- is.setType(Material.DIODE);
- is.setDurability((short)0);
- break;
- case DOUBLE_STEP:
- is.setType(Material.STEP);
- break;
- case TORCH:
- case RAILS:
- case LADDER:
- case WOOD_STAIRS:
- case COBBLESTONE_STAIRS:
- case LEVER:
- case STONE_BUTTON:
- case FURNACE:
- case DISPENSER:
- case PUMPKIN:
- case JACK_O_LANTERN:
- case WOOD_PLATE:
- case STONE_PLATE:
- case PISTON_STICKY_BASE:
- case PISTON_BASE:
- is.setDurability((short)0);
- break;
- case FIRE:
return;
}
boolean unlimitedForUser = user.hasUnlimited(is);
@@ -99,6 +39,7 @@ public class EssentialsBlockListener extends BlockListener
ess.scheduleSyncDelayedTask(
new Runnable()
{
+ @Override
public void run()
{
user.getInventory().addItem(is);
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsConf.java b/Essentials/src/com/earth2me/essentials/EssentialsConf.java
index c48f9f987..35252532f 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsConf.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsConf.java
@@ -1,13 +1,10 @@
package com.earth2me.essentials;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import static com.earth2me.essentials.I18n._;
+import java.io.*;
import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -15,6 +12,7 @@ import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.World;
+import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.config.Configuration;
@@ -44,7 +42,7 @@ public class EssentialsConf extends Configuration
{
if (!configFile.getParentFile().mkdirs())
{
- LOGGER.log(Level.SEVERE, Util.format("failedToCreateConfig", configFile.toString()));
+ LOGGER.log(Level.SEVERE, _("failedToCreateConfig", configFile.toString()));
}
}
// This will delete files where the first character is 0. In most cases they are broken.
@@ -87,22 +85,22 @@ public class EssentialsConf extends Configuration
{
if (templateName != null)
{
- LOGGER.log(Level.INFO, Util.format("creatingConfigFromTemplate", configFile.toString()));
+ LOGGER.log(Level.INFO, _("creatingConfigFromTemplate", configFile.toString()));
createFromTemplate();
}
else
{
try
{
- LOGGER.log(Level.INFO, Util.format("creatingEmptyConfig", configFile.toString()));
+ LOGGER.log(Level.INFO, _("creatingEmptyConfig", configFile.toString()));
if (!configFile.createNewFile())
{
- LOGGER.log(Level.SEVERE, Util.format("failedToCreateConfig", configFile.toString()));
+ LOGGER.log(Level.SEVERE, _("failedToCreateConfig", configFile.toString()));
}
}
catch (IOException ex)
{
- LOGGER.log(Level.SEVERE, Util.format("failedToCreateConfig", configFile.toString()), ex);
+ LOGGER.log(Level.SEVERE, _("failedToCreateConfig", configFile.toString()), ex);
}
}
}
@@ -113,7 +111,7 @@ public class EssentialsConf extends Configuration
}
catch (RuntimeException e)
{
- LOGGER.log(Level.INFO, "File: " + configFile.toString());
+ LOGGER.log(Level.SEVERE, "File broken: " + configFile.toString());
throw e;
}
@@ -132,7 +130,7 @@ public class EssentialsConf extends Configuration
istr = resourceClass.getResourceAsStream(templateName);
if (istr == null)
{
- LOGGER.log(Level.SEVERE, Util.format("couldNotFindTemplate", templateName));
+ LOGGER.log(Level.SEVERE, _("couldNotFindTemplate", templateName));
return;
}
ostr = new FileOutputStream(configFile);
@@ -147,8 +145,7 @@ public class EssentialsConf extends Configuration
}
catch (IOException ex)
{
- LOGGER.log(Level.SEVERE, Util.format("failedToWriteConfig", configFile.toString()), ex);
- return;
+ LOGGER.log(Level.SEVERE, _("failedToWriteConfig", configFile.toString()), ex);
}
finally
{
@@ -172,7 +169,7 @@ public class EssentialsConf extends Configuration
}
catch (IOException ex)
{
- LOGGER.log(Level.SEVERE, Util.format("failedToCloseConfig", configFile.toString()), ex);
+ LOGGER.log(Level.SEVERE, _("failedToCloseConfig", configFile.toString()), ex);
}
}
}
@@ -208,7 +205,7 @@ public class EssentialsConf extends Configuration
final World world = server.getWorld(worldName);
if (world == null)
{
- throw new Exception(Util.i18n("invalidWorld"));
+ throw new Exception(_("invalidWorld"));
}
return new Location(world,
getDouble((path == null ? "" : path + ".") + "x", 0),
@@ -230,11 +227,29 @@ public class EssentialsConf extends Configuration
public ItemStack getItemStack(final String path)
{
- return new ItemStack(
+ final ItemStack stack = new ItemStack(
Material.valueOf(getString(path + ".type", "AIR")),
getInt(path + ".amount", 1),
- (short)getInt(path + ".damage", 0)/*,
- (byte)getInt(path + ".data", 0)*/);
+ (short)getInt(path + ".damage", 0));
+ final List<String> enchants = getKeys(path + ".enchant");
+ if (enchants != null)
+ {
+ for (String enchant : enchants)
+ {
+ final Enchantment enchantment = Enchantment.getByName(enchant.toUpperCase(Locale.ENGLISH));
+ if (enchantment == null)
+ {
+ continue;
+ }
+ final int level = getInt(path + ".enchant." + enchant, enchantment.getStartLevel());
+ stack.addUnsafeEnchantment(enchantment, level);
+ }
+ }
+ return stack;
+ /*
+ * ,
+ * (byte)getInt(path + ".data", 0)
+ */
}
public void setProperty(final String path, final ItemStack stack)
@@ -243,6 +258,16 @@ public class EssentialsConf extends Configuration
map.put("type", stack.getType().toString());
map.put("amount", stack.getAmount());
map.put("damage", stack.getDurability());
+ Map<Enchantment, Integer> enchantments = stack.getEnchantments();
+ if (!enchantments.isEmpty())
+ {
+ Map<String, Integer> enchant = new HashMap<String, Integer>();
+ for (Map.Entry<Enchantment, Integer> entry : enchantments.entrySet())
+ {
+ enchant.put(entry.getKey().getName().toLowerCase(Locale.ENGLISH), entry.getValue());
+ }
+ map.put("enchant", enchant);
+ }
// getData().getData() is broken
//map.put("data", stack.getDurability());
setProperty(path, map);
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
index fed7a2956..214fc8c01 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
@@ -1,19 +1,14 @@
package com.earth2me.essentials;
+import static com.earth2me.essentials.I18n._;
import java.util.List;
-import java.util.logging.Level;
import java.util.logging.Logger;
+import org.bukkit.Material;
+import org.bukkit.entity.Animals;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
-import org.bukkit.event.entity.EntityCombustEvent;
-import org.bukkit.event.entity.EntityDamageByEntityEvent;
-import org.bukkit.event.entity.EntityDamageEvent;
-import org.bukkit.event.entity.EntityDeathEvent;
-import org.bukkit.event.entity.EntityListener;
-import org.bukkit.event.entity.EntityRegainHealthEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
-import org.bukkit.event.entity.FoodLevelChangeEvent;
-import org.bukkit.event.entity.PlayerDeathEvent;
+import org.bukkit.event.entity.*;
import org.bukkit.inventory.ItemStack;
@@ -56,6 +51,18 @@ public class EssentialsEntityListener extends EntityListener
}
}
}
+ if (eDefend instanceof Animals && eAttack instanceof Player)
+ {
+ User player = ess.getUser(eAttack);
+ ItemStack hand = player.getItemInHand();
+ if (hand != null && hand.getType() == Material.MILK_BUCKET) {
+ ((Animals)eDefend).setAge(-24000);
+ hand.setType(Material.BUCKET);
+ player.setItemInHand(hand);
+ player.updateInventory();
+ event.setCancelled(true);
+ }
+ }
}
if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled())
{
@@ -85,7 +92,7 @@ public class EssentialsEntityListener extends EntityListener
if (user.isAuthorized("essentials.back.ondeath") && !ess.getSettings().isCommandDisabled("back"))
{
user.setLastLocation();
- user.sendMessage(Util.i18n("backAfterDeath"));
+ user.sendMessage(_("backAfterDeath"));
}
if (!ess.getSettings().areDeathMessagesEnabled())
{
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
index 3205d4d91..b6cb728d2 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
@@ -1,33 +1,27 @@
package com.earth2me.essentials;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.craftbukkit.SetBed;
+import com.earth2me.essentials.textreader.IText;
+import com.earth2me.essentials.textreader.KeywordReplacer;
+import com.earth2me.essentials.textreader.TextInput;
+import com.earth2me.essentials.textreader.TextPager;
+import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Server;
-import org.bukkit.World;
-import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.block.Action;
-import org.bukkit.event.player.PlayerAnimationEvent;
-import org.bukkit.event.player.PlayerAnimationType;
-import org.bukkit.event.player.PlayerBedEnterEvent;
-import org.bukkit.event.player.PlayerBucketEmptyEvent;
-import org.bukkit.event.player.PlayerChatEvent;
-import org.bukkit.event.player.PlayerCommandPreprocessEvent;
-import org.bukkit.event.player.PlayerEggThrowEvent;
-import org.bukkit.event.player.PlayerInteractEvent;
-import org.bukkit.event.player.PlayerJoinEvent;
-import org.bukkit.event.player.PlayerListener;
-import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerLoginEvent.Result;
-import org.bukkit.event.player.PlayerMoveEvent;
-import org.bukkit.event.player.PlayerQuitEvent;
-import org.bukkit.event.player.PlayerRespawnEvent;
+import org.bukkit.event.player.*;
import org.bukkit.event.player.PlayerTeleportEvent;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.inventory.ItemStack;
@@ -47,11 +41,10 @@ public class EssentialsPlayerListener extends PlayerListener
public void onPlayerRespawn(final PlayerRespawnEvent event)
{
final User user = ess.getUser(event.getPlayer());
- user.setDisplayNick(user.getNick());
updateCompass(user);
if (ess.getSettings().changeDisplayName())
{
- user.setDisplayNick(user.getNick());
+ user.setDisplayNick();
}
}
@@ -62,8 +55,8 @@ public class EssentialsPlayerListener extends PlayerListener
if (user.isMuted())
{
event.setCancelled(true);
- user.sendMessage(Util.i18n("playerMuted"));
- LOGGER.info(Util.format("mutedUserSpeaks", user.getName()));
+ user.sendMessage(_("playerMuted"));
+ LOGGER.info(_("mutedUserSpeaks", user.getName()));
}
final Iterator<Player> it = event.getRecipients().iterator();
while (it.hasNext())
@@ -77,7 +70,7 @@ public class EssentialsPlayerListener extends PlayerListener
user.updateActivity(true);
if (ess.getSettings().changeDisplayName())
{
- user.setDisplayNick(user.getNick());
+ user.setDisplayNick();
}
}
@@ -130,33 +123,6 @@ public class EssentialsPlayerListener extends PlayerListener
}
user.updateActivity(false);
user.dispose();
- if (!ess.getSettings().getReclaimSetting())
- {
- return;
- }
- final Thread thread = new Thread(new Runnable()
- {
- public void run()
- {
- try
- {
- Thread.sleep(1000);
- Runtime rt = Runtime.getRuntime();
- double mem = rt.freeMemory();
- rt.runFinalization();
- rt.gc();
- mem = rt.freeMemory() - mem;
- mem /= 1024 * 1024;
- LOGGER.log(Level.INFO, Util.format("freedMemory", mem));
- }
- catch (InterruptedException ex)
- {
- return;
- }
- }
- });
- thread.setPriority(Thread.MIN_PRIORITY);
- thread.start();
}
@Override
@@ -167,8 +133,9 @@ public class EssentialsPlayerListener extends PlayerListener
if (ess.getSettings().changeDisplayName())
{
- user.setDisplayNick(user.getNick());
+ user.setDisplayNick();
}
+ user.setLastLoginAddress(user.getAddress().getAddress().getHostAddress());
user.updateActivity(false);
if (user.isAuthorized("essentials.sleepingignored"))
{
@@ -177,13 +144,23 @@ public class EssentialsPlayerListener extends PlayerListener
if (!ess.getSettings().isCommandDisabled("motd") && user.isAuthorized("essentials.motd"))
{
- for (String m : ess.getMotd(user, null))
+ try
{
- if (m == null)
+ final IText input = new TextInput(user, "motd", true, ess);
+ final IText output = new KeywordReplacer(input, user, ess);
+ final TextPager pager = new TextPager(output, true);
+ pager.showPage("1", null, "motd", user);
+ }
+ catch (IOException ex)
+ {
+ if (ess.getSettings().isDebug())
{
- continue;
+ LOGGER.log(Level.WARNING, ex.getMessage(), ex);
+ }
+ else
+ {
+ LOGGER.log(Level.WARNING, ex.getMessage());
}
- user.sendMessage(m);
}
}
@@ -192,11 +169,11 @@ public class EssentialsPlayerListener extends PlayerListener
final List<String> mail = user.getMails();
if (mail.isEmpty())
{
- user.sendMessage(Util.i18n("noNewMail"));
+ user.sendMessage(_("noNewMail"));
}
else
{
- user.sendMessage(Util.format("youHaveNewMail", mail.size()));
+ user.sendMessage(_("youHaveNewMail", mail.size()));
}
}
}
@@ -206,27 +183,26 @@ public class EssentialsPlayerListener extends PlayerListener
{
if (event.getResult() != Result.ALLOWED && event.getResult() != Result.KICK_FULL && event.getResult() != Result.KICK_BANNED)
{
- LOGGER.log(Level.INFO, "Disconnecting user " + event.getPlayer().toString() + " due to " + event.getResult().toString());
return;
}
User user = ess.getUser(event.getPlayer());
user.setNPC(false);
final long currentTime = System.currentTimeMillis();
- boolean banExpired = user.checkBanTimeout(currentTime);
+ final boolean banExpired = user.checkBanTimeout(currentTime);
user.checkMuteTimeout(currentTime);
user.checkJailTimeout(currentTime);
if (banExpired == false && (user.isBanned() || event.getResult() == Result.KICK_BANNED))
{
final String banReason = user.getBanReason();
- event.disallow(Result.KICK_BANNED, banReason != null && !banReason.isEmpty() && !banReason.equalsIgnoreCase("ban") ? banReason : Util.i18n("defaultBanReason"));
+ event.disallow(Result.KICK_BANNED, banReason != null && !banReason.isEmpty() && !banReason.equalsIgnoreCase("ban") ? banReason : _("defaultBanReason"));
return;
}
if (server.getOnlinePlayers().length >= server.getMaxPlayers() && !user.isAuthorized("essentials.joinfullserver"))
{
- event.disallow(Result.KICK_FULL, Util.i18n("serverFull"));
+ event.disallow(Result.KICK_FULL, _("serverFull"));
return;
}
event.allow();
@@ -237,12 +213,14 @@ public class EssentialsPlayerListener extends PlayerListener
private void updateCompass(final User user)
{
- try
+ Location loc = user.getHome(user.getLocation());
+ if (loc == null)
{
- user.setCompassTarget(user.getHome(user.getLocation()));
+ loc = user.getBedSpawnLocation();
}
- catch (Exception ex)
+ if (loc != null)
{
+ user.setCompassTarget(loc);
}
}
@@ -253,38 +231,19 @@ public class EssentialsPlayerListener extends PlayerListener
{
return;
}
- final User user = ess.getUser(event.getPlayer());
- if (ess.getSettings().changeDisplayName())
- {
- user.setDisplayNick(user.getNick());
- }
- updateCompass(user);
- }
- @Override
- public void onPlayerInteract(final PlayerInteractEvent event)
- {
- if (event.isCancelled())
- {
- return;
- }
- if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
+ final User user = ess.getUser(event.getPlayer());
+ //There is TeleportCause.COMMMAND but plugins have to actively pass the cause in on their teleports.
+ if ((event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND) && ess.getSettings().registerBackInListener())
{
- return;
+ user.setLastLocation();
}
- if (ess.getSettings().getBedSetsHome() && event.getClickedBlock().getType() == Material.BED_BLOCK)
+ if (ess.getSettings().changeDisplayName())
{
- try
- {
- final User user = ess.getUser(event.getPlayer());
- user.setHome();
- user.sendMessage(Util.i18n("homeSetToBed"));
- }
- catch (Throwable ex)
- {
- }
+ user.setDisplayNick();
}
+ updateCompass(user);
}
@Override
@@ -308,6 +267,7 @@ public class EssentialsPlayerListener extends PlayerListener
event.getItemStack().setType(event.getBucket());
ess.scheduleSyncDelayedTask(new Runnable()
{
+ @Override
public void run()
{
user.updateInventory();
@@ -321,22 +281,22 @@ public class EssentialsPlayerListener extends PlayerListener
{
final User user = ess.getUser(event.getPlayer());
user.updateActivity(true);
- usePowertools(event);
+ if (event.getAnimationType() == PlayerAnimationType.ARM_SWING
+ && user.hasPowerTools() && user.arePowerToolsEnabled())
+ {
+ usePowertools(user);
+ }
}
- private void usePowertools(final PlayerAnimationEvent event)
+ private void usePowertools(final User user)
{
- if (event.getAnimationType() != PlayerAnimationType.ARM_SWING)
- {
- return;
- }
- final User user = ess.getUser(event.getPlayer());
final ItemStack is = user.getItemInHand();
- if (is == null || is.getType() == Material.AIR || !user.arePowerToolsEnabled())
+ int id;
+ if (is == null || (id = is.getTypeId()) == 0)
{
return;
}
- final List<String> commandList = user.getPowertool(is);
+ final List<String> commandList = user.getPowertool(id);
if (commandList == null || commandList.isEmpty())
{
return;
@@ -352,14 +312,11 @@ public class EssentialsPlayerListener extends PlayerListener
}
else if (command.startsWith("c:"))
{
- for (Player p : server.getOnlinePlayers())
- {
- p.sendMessage(user.getDisplayName() + ":" + command.substring(2));
- }
+ user.chat(command.substring(2));
}
else
{
- user.getServer().dispatchCommand(event.getPlayer(), command);
+ user.getServer().dispatchCommand(user.getBase(), command);
}
}
}
@@ -372,7 +329,7 @@ public class EssentialsPlayerListener extends PlayerListener
return;
}
final User user = ess.getUser(event.getPlayer());
- final String cmd = event.getMessage().toLowerCase().split(" ")[0].replace("/", "").toLowerCase();
+ final String cmd = event.getMessage().toLowerCase(Locale.ENGLISH).split(" ")[0].replace("/", "").toLowerCase(Locale.ENGLISH);
final List<String> commands = Arrays.asList("msg", "r", "mail", "m", "t", "emsg", "tell", "er", "reply", "ereply", "email");
if (commands.contains(cmd))
{
@@ -390,4 +347,49 @@ public class EssentialsPlayerListener extends PlayerListener
user.updateActivity(true);
}
}
+
+ @Override
+ public void onPlayerChangedWorld(final PlayerChangedWorldEvent event)
+ {
+ if (ess.getSettings().getNoGodWorlds().contains(event.getPlayer().getLocation().getWorld().getName()))
+ {
+ User user = ess.getUser(event.getPlayer());
+ if (user.isGodModeEnabledRaw())
+ {
+ user.sendMessage(_("noGodWorldWarning"));
+ }
+ }
+ }
+
+ @Override
+ public void onPlayerInteract(final PlayerInteractEvent event)
+ {
+ if (event.isCancelled())
+ {
+ return;
+ }
+ if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
+ {
+ return;
+ }
+
+ if (ess.getSettings().getUpdateBedAtDaytime() && event.getClickedBlock().getType() == Material.BED_BLOCK)
+ {
+ SetBed.setBed(event.getPlayer(), event.getClickedBlock());
+ }
+ }
+
+ @Override
+ public void onPlayerPickupItem(PlayerPickupItemEvent event)
+ {
+ if (event.isCancelled() || !ess.getSettings().getDisableItemPickupWhileAfk())
+ {
+ return;
+ }
+ final User user = ess.getUser(event.getPlayer());
+ if (user.isAfk())
+ {
+ event.setCancelled(true);
+ }
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java
index 6b92d7aa2..b0ee0b543 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java
@@ -21,6 +21,7 @@ public class EssentialsPluginListener extends ServerListener implements IConf
public void onPluginEnable(final PluginEnableEvent event)
{
ess.getPermissionsHandler().checkPermissions();
+ ess.getAlternativeCommandsHandler().addPlugin(event.getPlugin());
if (!ess.getPaymentMethod().hasMethod() && ess.getPaymentMethod().setMethod(ess.getServer().getPluginManager()))
{
LOGGER.log(Level.INFO, "[Essentials] Payment method found (" + ess.getPaymentMethod().getMethod().getName() + " version: " + ess.getPaymentMethod().getMethod().getVersion() + ")");
@@ -31,6 +32,7 @@ public class EssentialsPluginListener extends ServerListener implements IConf
public void onPluginDisable(final PluginDisableEvent event)
{
ess.getPermissionsHandler().checkPermissions();
+ ess.getAlternativeCommandsHandler().removePlugin(event.getPlugin());
// Check to see if the plugin thats being disabled is the one we are using
if (ess.getPaymentMethod() != null && ess.getPaymentMethod().hasMethod() && ess.getPaymentMethod().checkDisabled(event.getPlugin()))
{
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java
index 409250a00..ae444af2e 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java
@@ -1,21 +1,14 @@
package com.earth2me.essentials;
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
+import com.earth2me.essentials.craftbukkit.FakeWorld;
+import com.earth2me.essentials.settings.Spawns;
+import com.earth2me.essentials.storage.YamlStorageWriter;
+import static com.earth2me.essentials.I18n._;
+import java.io.*;
import java.math.BigInteger;
import java.security.DigestInputStream;
import java.security.MessageDigest;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
@@ -78,7 +71,51 @@ public class EssentialsUpgrade
}
catch (Throwable e)
{
- LOGGER.log(Level.SEVERE, Util.i18n("upgradingFilesError"), e);
+ LOGGER.log(Level.SEVERE, _("upgradingFilesError"), e);
+ }
+ }
+
+ private void moveMotdRulesToFile(String name)
+ {
+ if (doneFile.getBoolean("move" + name + "ToFile", false))
+ {
+ return;
+ }
+ try
+ {
+ final File file = new File(ess.getDataFolder(), name + ".txt");
+ if (file.exists())
+ {
+ return;
+ }
+ final File configFile = new File(ess.getDataFolder(), "config.yml");
+ if (!configFile.exists())
+ {
+ return;
+ }
+ final EssentialsConf conf = new EssentialsConf(configFile);
+ conf.load();
+ List<String> lines = conf.getStringList(name, null);
+ if (lines != null && !lines.isEmpty())
+ {
+ if (!file.createNewFile())
+ {
+ throw new IOException("Failed to create file " + file);
+ }
+ PrintWriter writer = new PrintWriter(file);
+
+ for (String line : lines)
+ {
+ writer.println(line);
+ }
+ writer.close();
+ }
+ doneFile.setProperty("move" + name + "ToFile", true);
+ doneFile.save();
+ }
+ catch (Throwable e)
+ {
+ LOGGER.log(Level.SEVERE, _("upgradingFilesError"), e);
}
}
@@ -128,11 +165,11 @@ public class EssentialsUpgrade
{
if (!file.renameTo(new File(file.getParentFile(), file.getName().concat("." + System.currentTimeMillis() + ".upgradebackup"))))
{
- throw new Exception(Util.i18n("configFileMoveError"));
+ throw new Exception(_("configFileMoveError"));
}
if (!tempFile.renameTo(file))
{
- throw new Exception(Util.i18n("configFileRenameError"));
+ throw new Exception(_("configFileRenameError"));
}
}
else
@@ -187,7 +224,7 @@ public class EssentialsUpgrade
((Number)vals.get(3)).floatValue(),
((Number)vals.get(4)).floatValue());
- final String worldName = world.getName().toLowerCase();
+ final String worldName = world.getName().toLowerCase(Locale.ENGLISH);
if (worldName != null && !worldName.isEmpty())
{
config.removeProperty("home");
@@ -314,7 +351,7 @@ public class EssentialsUpgrade
{
continue;
}
- worldName = loc.getWorld().getName().toLowerCase();
+ worldName = loc.getWorld().getName().toLowerCase(Locale.ENGLISH);
if (worldName != null && !worldName.isEmpty())
{
config.setProperty("homes." + worldName, loc);
@@ -460,7 +497,7 @@ public class EssentialsUpgrade
ess.getWarps().setWarp(filename.substring(0, filename.length() - 4), loc);
if (!listOfFiles[i].renameTo(new File(warpsFolder, filename + ".old")))
{
- throw new Exception(Util.format("fileRenameError", filename));
+ throw new Exception(_("fileRenameError", filename));
}
}
catch (Exception ex)
@@ -508,7 +545,7 @@ public class EssentialsUpgrade
ess.getWarps().setWarp(name, loc);
if (!warpFile.renameTo(new File(ess.getDataFolder(), "warps.txt.old")))
{
- throw new Exception(Util.format("fileRenameError", "warps.txt"));
+ throw new Exception(_("fileRenameError", "warps.txt"));
}
}
}
@@ -552,17 +589,17 @@ public class EssentialsUpgrade
final File newFile = new File(listOfFiles[i].getParentFile(), sanitizedFilename);
if (!listOfFiles[i].renameTo(tmpFile))
{
- LOGGER.log(Level.WARNING, Util.format("userdataMoveError", filename, sanitizedFilename));
+ LOGGER.log(Level.WARNING, _("userdataMoveError", filename, sanitizedFilename));
continue;
}
if (newFile.exists())
{
- LOGGER.log(Level.WARNING, Util.format("duplicatedUserdata", filename, sanitizedFilename));
+ LOGGER.log(Level.WARNING, _("duplicatedUserdata", filename, sanitizedFilename));
continue;
}
if (!tmpFile.renameTo(newFile))
{
- LOGGER.log(Level.WARNING, Util.format("userdataMoveBackError", sanitizedFilename, sanitizedFilename));
+ LOGGER.log(Level.WARNING, _("userdataMoveBackError", sanitizedFilename, sanitizedFilename));
}
}
doneFile.setProperty("sanitizeAllUserFilenames", true);
@@ -647,6 +684,100 @@ public class EssentialsUpgrade
}
}
+ private void updateSpawnsToNewSpawnsConfig()
+ {
+ if (doneFile.getBoolean("updateSpawnsToNewSpawnsConfig", false))
+ {
+ return;
+ }
+ final File configFile = new File(ess.getDataFolder(), "spawn.yml");
+ if (configFile.exists())
+ {
+
+ final EssentialsConf config = new EssentialsConf(configFile);
+ try
+ {
+ config.load();
+ if (!config.hasProperty("spawns"))
+ {
+ final Spawns spawns = new Spawns();
+ List<String> keys = config.getKeys();
+ for (String group : keys)
+ {
+ Location loc = getFakeLocation(config, group);
+ spawns.getSpawns().put(group.toLowerCase(Locale.ENGLISH), loc);
+ }
+ if (!configFile.renameTo(new File(ess.getDataFolder(), "spawn.yml.old")))
+ {
+ throw new Exception(_("fileRenameError", "spawn.yml"));
+ }
+ PrintWriter writer = new PrintWriter(configFile);
+ try
+ {
+ new YamlStorageWriter(writer).save(spawns);
+ }
+ finally
+ {
+ writer.close();
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
+ }
+ }
+ doneFile.setProperty("updateSpawnsToNewSpawnsConfig", true);
+ doneFile.save();
+ }
+
+ private void updateJailsToNewJailsConfig()
+ {
+ if (doneFile.getBoolean("updateJailsToNewJailsConfig", false))
+ {
+ return;
+ }
+ final File configFile = new File(ess.getDataFolder(), "jail.yml");
+ if (configFile.exists())
+ {
+
+ final EssentialsConf config = new EssentialsConf(configFile);
+ try
+ {
+ config.load();
+ if (!config.hasProperty("jails"))
+ {
+ final com.earth2me.essentials.settings.Jails jails = new com.earth2me.essentials.settings.Jails();
+ List<String> keys = config.getKeys();
+ for (String jailName : keys)
+ {
+ Location loc = getFakeLocation(config, jailName);
+ jails.getJails().put(jailName.toLowerCase(Locale.ENGLISH), loc);
+ }
+ if (!configFile.renameTo(new File(ess.getDataFolder(), "jail.yml.old")))
+ {
+ throw new Exception(_("fileRenameError", "jail.yml"));
+ }
+ PrintWriter writer = new PrintWriter(configFile);
+ try
+ {
+ new YamlStorageWriter(writer).save(jails);
+ }
+ finally
+ {
+ writer.close();
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
+ }
+ }
+ doneFile.setProperty("updateJailsToNewJailsConfig", true);
+ doneFile.save();
+ }
+
public void beforeSettings()
{
if (!ess.getDataFolder().exists())
@@ -654,6 +785,8 @@ public class EssentialsUpgrade
ess.getDataFolder().mkdirs();
}
moveWorthValuesToWorthYml();
+ moveMotdRulesToFile("motd");
+ moveMotdRulesToFile("rules");
}
public void afterSettings()
@@ -665,5 +798,7 @@ public class EssentialsUpgrade
updateUsersPowerToolsFormat();
updateUsersHomesFormat();
deleteOldItemsCsv();
+ updateSpawnsToNewSpawnsConfig();
+ updateJailsToNewJailsConfig();
}
}
diff --git a/Essentials/src/com/earth2me/essentials/ExecuteTimer.java b/Essentials/src/com/earth2me/essentials/ExecuteTimer.java
index 7a88018c2..301669428 100644
--- a/Essentials/src/com/earth2me/essentials/ExecuteTimer.java
+++ b/Essentials/src/com/earth2me/essentials/ExecuteTimer.java
@@ -1,12 +1,17 @@
package com.earth2me.essentials;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
public class ExecuteTimer
{
- private final List<ExecuteRecord> times;
+ private final transient List<ExecuteRecord> times;
+ private final transient DecimalFormat decimalFormat = new DecimalFormat("#0.000", DecimalFormatSymbols.getInstance(Locale.US));
+
public ExecuteTimer()
{
@@ -24,7 +29,7 @@ public class ExecuteTimer
{
if (!times.isEmpty() || "start".equals(label))
{
- times.add(new ExecuteRecord(label, System.currentTimeMillis()));
+ times.add(new ExecuteRecord(label, System.nanoTime()));
}
}
@@ -36,7 +41,7 @@ public class ExecuteTimer
long time0 = 0;
long time1 = 0;
long time2 = 0;
- long duration;
+ double duration;
for (ExecuteRecord pair : times)
{
@@ -44,8 +49,8 @@ public class ExecuteTimer
time2 = (Long)pair.getTime();
if (time1 > 0)
{
- duration = time2 - time1;
- output.append(mark).append(": ").append(duration).append("ms - ");
+ duration = (time2 - time1)/1000000.0;
+ output.append(mark).append(": ").append(decimalFormat.format(duration)).append("ms - ");
}
else
{
@@ -53,8 +58,8 @@ public class ExecuteTimer
}
time1 = time2;
}
- duration = time1 - time0;
- output.append("Total: ").append(duration).append("ms");
+ duration = (time1 - time0)/1000000.0;
+ output.append("Total: ").append(decimalFormat.format(duration)).append("ms");
times.clear();
return output.toString();
}
diff --git a/Essentials/src/com/earth2me/essentials/I18n.java b/Essentials/src/com/earth2me/essentials/I18n.java
new file mode 100644
index 000000000..63fdcc065
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/I18n.java
@@ -0,0 +1,175 @@
+package com.earth2me.essentials;
+
+import com.earth2me.essentials.api.II18n;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.text.MessageFormat;
+import java.util.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+
+public class I18n implements II18n
+{
+ private static I18n instance;
+ private static final String MESSAGES = "messages";
+ private final transient Locale defaultLocale = Locale.getDefault();
+ private transient Locale currentLocale = defaultLocale;
+ private transient ResourceBundle customBundle;
+ private transient ResourceBundle localeBundle;
+ private final transient ResourceBundle defaultBundle;
+ private final transient Map<String, MessageFormat> messageFormatCache = new HashMap<String, MessageFormat>();
+ private final transient IEssentials ess;
+
+ public I18n(final IEssentials ess)
+ {
+ this.ess = ess;
+ customBundle = ResourceBundle.getBundle(MESSAGES, defaultLocale, new FileResClassLoader(I18n.class.getClassLoader(), ess));
+ localeBundle = ResourceBundle.getBundle(MESSAGES, defaultLocale);
+ defaultBundle = ResourceBundle.getBundle(MESSAGES, Locale.ENGLISH);
+ }
+
+ public void onEnable()
+ {
+ instance = this;
+ }
+
+ public void onDisable()
+ {
+ instance = null;
+ }
+
+ public Locale getCurrentLocale()
+ {
+ return currentLocale;
+ }
+
+ public String translate(final String string)
+ {
+ try
+ {
+ try
+ {
+ return customBundle.getString(string);
+ }
+ catch (MissingResourceException ex)
+ {
+ return localeBundle.getString(string);
+ }
+ }
+ catch (MissingResourceException ex)
+ {
+ Logger.getLogger("Minecraft").log(Level.WARNING, String.format("Missing translation key \"%s\" in translation file %s", ex.getKey(), localeBundle.getLocale().toString()), ex);
+ return defaultBundle.getString(string);
+ }
+ }
+
+ public static String _(final String string, final Object... objects)
+ {
+ if (instance == null) {
+ return "";
+ }
+ if (objects.length == 0)
+ {
+ return instance.translate(string);
+ }
+ else
+ {
+ return instance.format(string, objects);
+ }
+ }
+
+ public String format(final String string, final Object... objects)
+ {
+ final String format = translate(string);
+ MessageFormat messageFormat = messageFormatCache.get(format);
+ if (messageFormat == null)
+ {
+ messageFormat = new MessageFormat(format);
+ messageFormatCache.put(format, messageFormat);
+ }
+ return messageFormat.format(objects);
+ }
+
+ public void updateLocale(final String loc)
+ {
+ if (loc == null || loc.isEmpty())
+ {
+ return;
+ }
+ final String[] parts = loc.split("[_\\.]");
+ if (parts.length == 1)
+ {
+ currentLocale = new Locale(parts[0]);
+ }
+ if (parts.length == 2)
+ {
+ currentLocale = new Locale(parts[0], parts[1]);
+ }
+ if (parts.length == 3)
+ {
+ currentLocale = new Locale(parts[0], parts[1], parts[2]);
+ }
+ Logger.getLogger("Minecraft").log(Level.INFO, String.format("Using locale %s", currentLocale.toString()));
+ customBundle = ResourceBundle.getBundle(MESSAGES, currentLocale, new FileResClassLoader(I18n.class.getClassLoader(), ess));
+ localeBundle = ResourceBundle.getBundle(MESSAGES, currentLocale);
+ }
+
+ public static String capitalCase(final String input)
+ {
+ return input == null || input.length() == 0
+ ? input
+ : input.toUpperCase(Locale.ENGLISH).charAt(0)
+ + input.toLowerCase(Locale.ENGLISH).substring(1);
+ }
+
+
+ private static class FileResClassLoader extends ClassLoader
+ {
+ private final transient File dataFolder;
+
+ public FileResClassLoader(final ClassLoader classLoader, final IEssentials ess)
+ {
+ super(classLoader);
+ this.dataFolder = ess.getDataFolder();
+ }
+
+ @Override
+ public URL getResource(final String string)
+ {
+ final File file = new File(dataFolder, string);
+ if (file.exists())
+ {
+ try
+ {
+ return file.toURI().toURL();
+ }
+ catch (MalformedURLException ex)
+ {
+ }
+ }
+ return super.getResource(string);
+ }
+
+ @Override
+ public InputStream getResourceAsStream(final String string)
+ {
+ final File file = new File(dataFolder, string);
+ if (file.exists())
+ {
+ try
+ {
+ return new FileInputStream(file);
+ }
+ catch (FileNotFoundException ex)
+ {
+ }
+ }
+ return super.getResourceAsStream(string);
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/IConf.java b/Essentials/src/com/earth2me/essentials/IConf.java
index a523f8638..580e6232f 100644
--- a/Essentials/src/com/earth2me/essentials/IConf.java
+++ b/Essentials/src/com/earth2me/essentials/IConf.java
@@ -1,5 +1,9 @@
package com.earth2me.essentials;
+/**
+ * @deprecated New interface will be IReload in api package
+ */
+@Deprecated
public interface IConf {
public void reloadConfig();
}
diff --git a/Essentials/src/com/earth2me/essentials/IEssentials.java b/Essentials/src/com/earth2me/essentials/IEssentials.java
index 9dca96e81..20c6c300e 100644
--- a/Essentials/src/com/earth2me/essentials/IEssentials.java
+++ b/Essentials/src/com/earth2me/essentials/IEssentials.java
@@ -1,5 +1,6 @@
package com.earth2me.essentials;
+import com.earth2me.essentials.api.IJails;
import com.earth2me.essentials.perm.PermissionsHandler;
import com.earth2me.essentials.register.payment.Methods;
import org.bukkit.World;
@@ -8,17 +9,22 @@ import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitScheduler;
-
+/**
+ * @deprecated This will be moved to the api package soon
+ */
+@Deprecated
public interface IEssentials extends Plugin
{
void addReloadListener(IConf listener);
void reload();
- boolean onCommandEssentials(CommandSender sender, Command command, String commandLabel, String[] args, ClassLoader classLoader, String commandPath, String permissionPrefix);
+ boolean onCommandEssentials(CommandSender sender, Command command, String commandLabel, String[] args, ClassLoader classLoader, String commandPath, String permissionPrefix, IEssentialsModule module);
User getUser(Object base);
+ I18n getI18n();
+
User getOfflineUser(String name);
World getWorld(String name);
@@ -29,11 +35,7 @@ public interface IEssentials extends Plugin
BukkitScheduler getScheduler();
- String[] getMotd(CommandSender sender, String def);
-
- String[] getLines(CommandSender sender, String node, String def);
-
- Jail getJail();
+ IJails getJails();
Warps getWarps();
@@ -41,8 +43,6 @@ public interface IEssentials extends Plugin
Backup getBackup();
- Spawn getSpawn();
-
Methods getPaymentMethod();
int scheduleAsyncDelayedTask(Runnable run);
@@ -57,6 +57,8 @@ public interface IEssentials extends Plugin
PermissionsHandler getPermissionsHandler();
+ AlternativeCommandsHandler getAlternativeCommandsHandler();
+
void showError(final CommandSender sender, final Throwable exception, final String commandLabel);
ItemDb getItemDb();
diff --git a/Essentials/src/com/earth2me/essentials/IEssentialsModule.java b/Essentials/src/com/earth2me/essentials/IEssentialsModule.java
new file mode 100644
index 000000000..69a1a494c
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/IEssentialsModule.java
@@ -0,0 +1,6 @@
+package com.earth2me.essentials;
+
+
+public interface IEssentialsModule
+{
+}
diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java
index 7ffa0c138..5c53a6790 100644
--- a/Essentials/src/com/earth2me/essentials/ISettings.java
+++ b/Essentials/src/com/earth2me/essentials/ISettings.java
@@ -3,12 +3,13 @@ package com.earth2me.essentials;
import com.earth2me.essentials.commands.IEssentialsCommand;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.bukkit.ChatColor;
+import org.bukkit.event.Event.Priority;
public interface ISettings extends IConf
{
-
boolean areSignsDisabled();
String format(String format, IUser user);
@@ -21,8 +22,6 @@ public interface ISettings extends IConf
long getBackupInterval();
- boolean getBedSetsHome();
-
String getChatFormat(String group);
int getChatRadius();
@@ -33,6 +32,8 @@ public interface ISettings extends IConf
String getCurrencySymbol();
+ int getOversizedStackSize();
+
int getDefaultStackSize();
double getHealCooldown();
@@ -61,14 +62,12 @@ public interface ISettings extends IConf
String getProtectString(final String configName);
- boolean getReclaimSetting();
-
boolean getRespawnAtHome();
-
+
List getMultipleHomes();
-
+
int getHomeLimit(String set);
-
+
int getHomeLimit(User user);
boolean getSortListByGroups();
@@ -110,11 +109,11 @@ public interface ISettings extends IConf
boolean warnOnBuildDisallow();
boolean warnOnSmite();
-
+
double getMaxMoney();
boolean isEcoLogEnabled();
-
+
boolean removeGodOnDisconnect();
boolean changeDisplayName();
@@ -124,9 +123,9 @@ public interface ISettings extends IConf
boolean useBukkitPermissions();
boolean addPrefixSuffix();
-
+
boolean disablePrefix();
-
+
boolean disableSuffix();
long getAutoAfk();
@@ -134,6 +133,24 @@ public interface ISettings extends IConf
long getAutoAfkKick();
boolean getFreezeAfkPlayers();
-
+
boolean areDeathMessagesEnabled();
+
+ public void setDebug(boolean debug);
+
+ Set<String> getNoGodWorlds();
+
+ boolean getUpdateBedAtDaytime();
+
+ boolean getRepairEnchanted();
+
+ boolean getIsWorldTeleportPermissions();
+
+ boolean registerBackInListener();
+
+ public boolean getDisableItemPickupWhileAfk();
+
+ public Priority getRespawnPriority();
+
+ long getTpaAcceptCancellation();
}
diff --git a/Essentials/src/com/earth2me/essentials/IUser.java b/Essentials/src/com/earth2me/essentials/IUser.java
index 27f95430c..bff556ab4 100644
--- a/Essentials/src/com/earth2me/essentials/IUser.java
+++ b/Essentials/src/com/earth2me/essentials/IUser.java
@@ -7,16 +7,12 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.PlayerInventory;
-public interface IUser
+/**
+ * @deprecated This will be moved to the api package soon
+ */
+@Deprecated
+public interface IUser extends Player
{
- int getHealth();
-
- Location getLocation();
-
- boolean isOnline();
-
- void sendMessage(String string);
-
long getLastTeleportTimestamp();
boolean isAuthorized(String node);
@@ -37,10 +33,6 @@ public interface IUser
void giveMoney(double value);
- PlayerInventory getInventory();
-
- void updateInventory();
-
String getGroup();
void setLastLocation();
@@ -49,11 +41,9 @@ public interface IUser
Location getHome(Location loc) throws Exception;
- String getName();
-
- InetSocketAddress getAddress();
+ boolean isHidden();
- String getDisplayName();
+ Teleport getTeleport();
- boolean isHidden();
+ void setJail(String jail);
}
diff --git a/Essentials/src/com/earth2me/essentials/ItemDb.java b/Essentials/src/com/earth2me/essentials/ItemDb.java
index e978a312d..e3df50bab 100644
--- a/Essentials/src/com/earth2me/essentials/ItemDb.java
+++ b/Essentials/src/com/earth2me/essentials/ItemDb.java
@@ -1,13 +1,16 @@
package com.earth2me.essentials;
+import com.earth2me.essentials.api.IItemDb;
+import static com.earth2me.essentials.I18n._;
import java.util.HashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
-public class ItemDb implements IConf
+public class ItemDb implements IConf, IItemDb
{
private final transient IEssentials ess;
@@ -24,8 +27,9 @@ public class ItemDb implements IConf
public void reloadConfig()
{
final List<String> lines = file.getLines();
-
- if (lines.isEmpty()) {
+
+ if (lines.isEmpty())
+ {
return;
}
@@ -34,7 +38,7 @@ public class ItemDb implements IConf
for (String line : lines)
{
- line = line.trim().toLowerCase();
+ line = line.trim().toLowerCase(Locale.ENGLISH);
if (line.length() > 0 && line.charAt(0) == '#')
{
continue;
@@ -48,14 +52,14 @@ public class ItemDb implements IConf
final int numeric = Integer.parseInt(parts[1]);
- durabilities.put(parts[0].toLowerCase(), parts.length > 2 && !parts[2].equals("0") ? Short.parseShort(parts[2]) : 0);
- items.put(parts[0].toLowerCase(), numeric);
+ durabilities.put(parts[0].toLowerCase(Locale.ENGLISH), parts.length > 2 && !parts[2].equals("0") ? Short.parseShort(parts[2]) : 0);
+ items.put(parts[0].toLowerCase(Locale.ENGLISH), numeric);
}
}
public ItemStack get(final String id, final int quantity) throws Exception
{
- final ItemStack retval = get(id.toLowerCase());
+ final ItemStack retval = get(id.toLowerCase(Locale.ENGLISH));
retval.setAmount(quantity);
return retval;
}
@@ -76,12 +80,12 @@ public class ItemDb implements IConf
}
else if (id.matches("^[^:+',;.]+[:+',;.]\\d+$"))
{
- itemname = id.split("[:+',;.]")[0].toLowerCase();
+ itemname = id.split("[:+',;.]")[0].toLowerCase(Locale.ENGLISH);
metaData = Short.parseShort(id.split("[:+',;.]")[1]);
}
else
{
- itemname = id.toLowerCase();
+ itemname = id.toLowerCase(Locale.ENGLISH);
}
if (itemname != null)
@@ -101,17 +105,17 @@ public class ItemDb implements IConf
}
else
{
- throw new Exception(Util.format("unknownItemName", id));
+ throw new Exception(_("unknownItemName", id));
}
}
final Material mat = Material.getMaterial(itemid);
if (mat == null)
{
- throw new Exception(Util.format("unknownItemId", itemid));
+ throw new Exception(_("unknownItemId", itemid));
}
final ItemStack retval = new ItemStack(mat);
- retval.setAmount(ess.getSettings().getDefaultStackSize());
+ retval.setAmount(mat.getMaxStackSize());
retval.setDurability(metaData);
return retval;
}
diff --git a/Essentials/src/com/earth2me/essentials/Jail.java b/Essentials/src/com/earth2me/essentials/Jail.java
deleted file mode 100644
index ff3bec2f7..000000000
--- a/Essentials/src/com/earth2me/essentials/Jail.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.earth2me.essentials;
-
-import java.io.File;
-import java.util.List;
-import java.util.logging.Logger;
-import org.bukkit.Location;
-import org.bukkit.event.block.BlockBreakEvent;
-import org.bukkit.event.block.BlockDamageEvent;
-import org.bukkit.event.block.BlockListener;
-import org.bukkit.event.block.BlockPlaceEvent;
-
-
-public class Jail extends BlockListener implements IConf
-{
- private static final Logger logger = Logger.getLogger("Minecraft");
- private final EssentialsConf config;
- private final IEssentials ess;
-
- public Jail(IEssentials ess)
- {
- this.ess = ess;
- config = new EssentialsConf(new File(ess.getDataFolder(), "jail.yml"));
- config.load();
- }
-
- public void setJail(Location loc, String jailName) throws Exception
- {
- config.setProperty(jailName.toLowerCase(), loc);
- config.save();
- }
-
- public Location getJail(String jailName) throws Exception
- {
- if (jailName == null || config.getProperty(jailName.toLowerCase()) == null)
- {
- throw new Exception(Util.i18n("jailNotExist"));
- }
-
- Location loc = config.getLocation(jailName.toLowerCase(), ess.getServer());
- return loc;
- }
-
- public void sendToJail(User user, String jail) throws Exception
- {
- if (!(user.getBase() instanceof OfflinePlayer))
- {
- user.getTeleport().now(getJail(jail));
- }
- user.setJail(jail);
- }
-
- public void delJail(String jail) throws Exception
- {
- config.removeProperty(jail.toLowerCase());
- config.save();
- }
-
- public List<String> getJails() throws Exception
- {
- return config.getKeys(null);
- }
-
- public void reloadConfig()
- {
- config.load();
- }
-
- @Override
- public void onBlockBreak(BlockBreakEvent event)
- {
- User user = ess.getUser(event.getPlayer());
- if (user.isJailed())
- {
- event.setCancelled(true);
- }
- }
-
- @Override
- public void onBlockPlace(BlockPlaceEvent event)
- {
- User user = ess.getUser(event.getPlayer());
- if (user.isJailed())
- {
- event.setCancelled(true);
- }
- }
-
- @Override
- public void onBlockDamage(BlockDamageEvent event)
- {
- User user = ess.getUser(event.getPlayer());
- if (user.isJailed())
- {
- event.setCancelled(true);
- }
- }
-}
diff --git a/Essentials/src/com/earth2me/essentials/JailPlayerListener.java b/Essentials/src/com/earth2me/essentials/JailPlayerListener.java
deleted file mode 100644
index da8c165cb..000000000
--- a/Essentials/src/com/earth2me/essentials/JailPlayerListener.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.earth2me.essentials;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.bukkit.event.player.PlayerInteractEvent;
-import org.bukkit.event.player.PlayerJoinEvent;
-import org.bukkit.event.player.PlayerListener;
-import org.bukkit.event.player.PlayerRespawnEvent;
-import org.bukkit.event.player.PlayerTeleportEvent;
-
-
-public class JailPlayerListener extends PlayerListener
-{
- private static final Logger LOGGER = Logger.getLogger("Minecraft");
- private final IEssentials ess;
-
- public JailPlayerListener(IEssentials parent)
- {
- this.ess = parent;
- }
-
- @Override
- public void onPlayerInteract(PlayerInteractEvent event)
- {
- final User user = ess.getUser(event.getPlayer());
- if (user.isJailed())
- {
- event.setCancelled(true);
- }
- }
-
- @Override
- public void onPlayerRespawn(PlayerRespawnEvent event)
- {
- final User user = ess.getUser(event.getPlayer());
- if (user.isJailed() && user.getJail() != null && !user.getJail().isEmpty())
- {
- try
- {
- event.setRespawnLocation(ess.getJail().getJail(user.getJail()));
- }
- catch (Exception ex)
- {
- }
- }
- }
-
- @Override
- public void onPlayerTeleport(PlayerTeleportEvent event)
- {
- final User user = ess.getUser(event.getPlayer());
- if (!user.isJailed() || user.getJail() == null || user.getJail().isEmpty())
- {
- return;
- }
- try
- {
- event.setTo(ess.getJail().getJail(user.getJail()));
- }
- catch (Exception ex)
- {
- LOGGER.log(Level.WARNING, Util.i18n("returnPlayerToJailError"), ex);
- }
- user.sendMessage(Util.i18n("jailMessage"));
- }
-
- @Override
- public void onPlayerJoin(final PlayerJoinEvent event)
- {
- User u = ess.getUser(event.getPlayer());
- if (u.isJailed())
- {
- try
- {
- ess.getJail().sendToJail(u, u.getJail());
- }
- catch (Exception ex)
- {
- LOGGER.log(Level.WARNING, Util.i18n("returnPlayerToJailError"), ex);
- }
- u.sendMessage(Util.i18n("jailMessage"));
- }
- }
-}
diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java
new file mode 100644
index 000000000..f8ab2d02e
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/Jails.java
@@ -0,0 +1,254 @@
+package com.earth2me.essentials;
+
+import com.earth2me.essentials.api.IJails;
+import com.earth2me.essentials.storage.AsyncStorageObjectHolder;
+import static com.earth2me.essentials.I18n._;
+import java.io.File;
+import java.util.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.event.Event.Priority;
+import org.bukkit.event.Event.Type;
+import org.bukkit.event.block.*;
+import org.bukkit.event.player.*;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
+import org.bukkit.plugin.PluginManager;
+
+
+public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.settings.Jails> implements IJails
+{
+ private static final transient Logger LOGGER = Bukkit.getLogger();
+
+ public Jails(final IEssentials ess)
+ {
+ super(ess, com.earth2me.essentials.settings.Jails.class);
+ reloadConfig();
+ registerListeners();
+ }
+
+ private void registerListeners()
+ {
+ final PluginManager pluginManager = ess.getServer().getPluginManager();
+ final JailBlockListener blockListener = new JailBlockListener();
+ final JailPlayerListener playerListener = new JailPlayerListener();
+ pluginManager.registerEvent(Type.BLOCK_BREAK, blockListener, Priority.Low, ess);
+ pluginManager.registerEvent(Type.BLOCK_DAMAGE, blockListener, Priority.Low, ess);
+ pluginManager.registerEvent(Type.BLOCK_PLACE, blockListener, Priority.Low, ess);
+ pluginManager.registerEvent(Type.PLAYER_INTERACT, playerListener, Priority.Low, ess);
+ pluginManager.registerEvent(Type.PLAYER_RESPAWN, playerListener, Priority.High, ess);
+ pluginManager.registerEvent(Type.PLAYER_TELEPORT, playerListener, Priority.High, ess);
+ pluginManager.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.High, ess);
+ }
+
+ @Override
+ public File getStorageFile()
+ {
+ return new File(ess.getDataFolder(), "jail.yml");
+ }
+
+ @Override
+ public Location getJail(final String jailName) throws Exception
+ {
+ acquireReadLock();
+ try
+ {
+ if (getData().getJails() == null || jailName == null
+ || !getData().getJails().containsKey(jailName.toLowerCase(Locale.ENGLISH)))
+ {
+ throw new Exception(_("jailNotExist"));
+ }
+ Location loc = getData().getJails().get(jailName.toLowerCase(Locale.ENGLISH));
+ if (loc == null || loc.getWorld() == null)
+ {
+ throw new Exception(_("jailNotExist"));
+ }
+ return loc;
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ @Override
+ public Collection<String> getList() throws Exception
+ {
+ acquireReadLock();
+ try
+ {
+ if (getData().getJails() == null)
+ {
+ return Collections.emptyList();
+ }
+ return new ArrayList<String>(getData().getJails().keySet());
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ @Override
+ public void removeJail(final String jail) throws Exception
+ {
+ acquireWriteLock();
+ try
+ {
+ if (getData().getJails() == null)
+ {
+ return;
+ }
+ getData().getJails().remove(jail.toLowerCase(Locale.ENGLISH));
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ @Override
+ public void sendToJail(final IUser user, final String jail) throws Exception
+ {
+ acquireReadLock();
+ try
+ {
+ if (!(user.getBase() instanceof OfflinePlayer))
+ {
+ Location loc = getJail(jail);
+ user.getTeleport().now(loc, false, TeleportCause.COMMAND);
+ }
+ user.setJail(jail);
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ @Override
+ public void setJail(final String jailName, final Location loc) throws Exception
+ {
+ acquireWriteLock();
+ try
+ {
+ if (getData().getJails() == null)
+ {
+ getData().setJails(new HashMap<String, Location>());
+ }
+ getData().getJails().put(jailName.toLowerCase(Locale.ENGLISH), loc);
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+
+ private class JailBlockListener extends BlockListener
+ {
+ @Override
+ public void onBlockBreak(final BlockBreakEvent event)
+ {
+ final User user = ess.getUser(event.getPlayer());
+ if (user.isJailed())
+ {
+ event.setCancelled(true);
+ }
+ }
+
+ @Override
+ public void onBlockPlace(final BlockPlaceEvent event)
+ {
+ final User user = ess.getUser(event.getPlayer());
+ if (user.isJailed())
+ {
+ event.setCancelled(true);
+ }
+ }
+
+ @Override
+ public void onBlockDamage(final BlockDamageEvent event)
+ {
+ final User user = ess.getUser(event.getPlayer());
+ if (user.isJailed())
+ {
+ event.setCancelled(true);
+ }
+ }
+ }
+
+
+ private class JailPlayerListener extends PlayerListener
+ {
+ @Override
+ public void onPlayerInteract(final PlayerInteractEvent event)
+ {
+ final User user = ess.getUser(event.getPlayer());
+ if (user.isJailed())
+ {
+ event.setCancelled(true);
+ }
+ }
+
+ @Override
+ public void onPlayerRespawn(final PlayerRespawnEvent event)
+ {
+ final User user = ess.getUser(event.getPlayer());
+ if (!user.isJailed() || user.getJail() == null || user.getJail().isEmpty())
+ {
+ return;
+ }
+
+ try
+ {
+ event.setRespawnLocation(getJail(user.getJail()));
+ }
+ catch (Exception ex)
+ {
+ LOGGER.log(Level.WARNING, _("returnPlayerToJailError"), ex);
+ }
+ }
+
+ @Override
+ public void onPlayerTeleport(final PlayerTeleportEvent event)
+ {
+ final User user = ess.getUser(event.getPlayer());
+ if (!user.isJailed() || user.getJail() == null || user.getJail().isEmpty())
+ {
+ return;
+ }
+
+ try
+ {
+ event.setTo(getJail(user.getJail()));
+ }
+ catch (Exception ex)
+ {
+ LOGGER.log(Level.WARNING, _("returnPlayerToJailError"), ex);
+ }
+ user.sendMessage(_("jailMessage"));
+ }
+
+ @Override
+ public void onPlayerJoin(final PlayerJoinEvent event)
+ {
+ final User user = ess.getUser(event.getPlayer());
+ if (!user.isJailed() || user.getJail() == null || user.getJail().isEmpty())
+ {
+ return;
+ }
+
+ try
+ {
+ sendToJail(user, user.getJail());
+ }
+ catch (Exception ex)
+ {
+ LOGGER.log(Level.WARNING, _("returnPlayerToJailError"), ex);
+ }
+ user.sendMessage(_("jailMessage"));
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java
new file mode 100644
index 000000000..53d2e8784
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/Kit.java
@@ -0,0 +1,113 @@
+package com.earth2me.essentials;
+
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.commands.NoChargeException;
+import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
+import java.util.*;
+import org.bukkit.Material;
+import org.bukkit.inventory.ItemStack;
+
+
+public class Kit
+{
+ //TODO: Convert this to use one of the new text classes?
+ public static String listKits(final IEssentials ess, final User user) throws Exception
+ {
+ try
+ {
+ final Map<String, Object> kits = ess.getSettings().getKits();
+ final StringBuilder list = new StringBuilder();
+ for (String kiteItem : kits.keySet())
+ {
+ if (user.isAuthorized("essentials.kit." + kiteItem.toLowerCase(Locale.ENGLISH)))
+ {
+ list.append(" ").append(kiteItem);
+ }
+ }
+ return list.toString();
+ }
+ catch (Exception ex)
+ {
+ throw new Exception(_("kitError"));
+ }
+
+ }
+
+ public static void checkTime(final User user, final String kitName, final Map<String, Object> els) throws NoChargeException
+ {
+ final double delay = els.containsKey("delay") ? ((Number)els.get("delay")).doubleValue() : 0L;
+ final Calendar c = new GregorianCalendar();
+ c.add(Calendar.SECOND, -(int)delay);
+ c.add(Calendar.MILLISECOND, -(int)((delay * 1000.0) % 1000.0));
+
+ final long mintime = c.getTimeInMillis();
+
+ final Long lastTime = user.getKitTimestamp(kitName);
+ if (lastTime == null || lastTime < mintime)
+ {
+ final Calendar now = new GregorianCalendar();
+ user.setKitTimestamp(kitName, now.getTimeInMillis());
+ }
+ else
+ {
+ final Calendar future = new GregorianCalendar();
+ future.setTimeInMillis(lastTime);
+ future.add(Calendar.SECOND, (int)delay);
+ future.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0));
+ user.sendMessage(_("kitTimed", Util.formatDateDiff(future.getTimeInMillis())));
+ throw new NoChargeException();
+ }
+ }
+
+ public static List<String> getItems(final User user, final Map<String, Object> els) throws Exception
+ {
+ try
+ {
+ return (List<String>)els.get("items");
+ }
+ catch (Exception e)
+ {
+ user.sendMessage(_("kitError2"));
+ throw new Exception(_("kitErrorHelp"));
+ }
+ }
+
+ public static void expandItems(final IEssentials ess, final User user, final List<String> items) throws Exception
+ {
+ try
+ {
+ boolean spew = false;
+ for (String d : items)
+ {
+ final String[] parts = d.split("[^0-9]+", 3);
+ final int id = Material.getMaterial(Integer.parseInt(parts[0])).getId();
+ final int amount = parts.length > 1 ? Integer.parseInt(parts[parts.length > 2 ? 2 : 1]) : 1;
+ final short data = parts.length > 2 ? Short.parseShort(parts[1]) : 0;
+ final Map<Integer, ItemStack> overfilled;
+ if (user.isAuthorized("essentials.oversizedstacks"))
+ {
+ overfilled = InventoryWorkaround.addItem(user.getInventory(), true, ess.getSettings().getOversizedStackSize(), new ItemStack(id, amount, data));
+ }
+ else
+ {
+ overfilled = InventoryWorkaround.addItem(user.getInventory(), true, new ItemStack(id, amount, data));
+ }
+ for (ItemStack itemStack : overfilled.values())
+ {
+ user.getWorld().dropItemNaturally(user.getLocation(), itemStack);
+ spew = true;
+ }
+ }
+ user.updateInventory();
+ if (spew)
+ {
+ user.sendMessage(_("kitInvFull"));
+ }
+ }
+ catch (Exception e)
+ {
+ user.updateInventory();
+ throw new Exception(_("kitError2"));
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/ManagedFile.java b/Essentials/src/com/earth2me/essentials/ManagedFile.java
index 759261e02..a1918fa20 100644
--- a/Essentials/src/com/earth2me/essentials/ManagedFile.java
+++ b/Essentials/src/com/earth2me/essentials/ManagedFile.java
@@ -1,15 +1,7 @@
package com.earth2me.essentials;
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
+import static com.earth2me.essentials.I18n._;
+import java.io.*;
import java.math.BigInteger;
import java.security.DigestInputStream;
import java.security.DigestOutputStream;
@@ -54,7 +46,7 @@ public class ManagedFile
}
catch (IOException ex)
{
- Bukkit.getLogger().log(Level.SEVERE, Util.i18n("itemsCsvNotLoaded"), ex);
+ Bukkit.getLogger().log(Level.SEVERE, _("itemsCsvNotLoaded"), ex);
}
}
}
@@ -138,12 +130,12 @@ public class ManagedFile
try
{
String hash = reader.readLine();
- if (hash.matches("#[a-f0-9]{32}"))
+ if (hash != null && hash.matches("#[a-f0-9]{32}"))
{
hash = hash.substring(1);
bais.reset();
final String versionline = reader.readLine();
- if (versionline.matches("#version: .+"))
+ if (versionline != null && versionline.matches("#version: .+"))
{
final String versioncheck = versionline.substring(10);
if (!versioncheck.equalsIgnoreCase(version))
diff --git a/Essentials/src/com/earth2me/essentials/Mob.java b/Essentials/src/com/earth2me/essentials/Mob.java
index d937ba0fb..049f7b8a3 100644
--- a/Essentials/src/com/earth2me/essentials/Mob.java
+++ b/Essentials/src/com/earth2me/essentials/Mob.java
@@ -1,7 +1,10 @@
package com.earth2me.essentials;
+import static com.earth2me.essentials.I18n._;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
+import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Location;
@@ -29,8 +32,14 @@ public enum Mob
WOLF("Wolf", Enemies.NEUTRAL, CreatureType.WOLF),
CAVESPIDER("CaveSpider", Enemies.ENEMY, CreatureType.CAVE_SPIDER),
ENDERMAN("Enderman", Enemies.ENEMY, "", CreatureType.ENDERMAN),
- SILVERFISH("Silverfish", Enemies.ENEMY, "", CreatureType.SILVERFISH);
-
+ SILVERFISH("Silverfish", Enemies.ENEMY, "", CreatureType.SILVERFISH),
+ ENDERDRAGON("EnderDragon", Enemies.ENEMY, CreatureType.ENDER_DRAGON),
+ VILLAGER("Villager", Enemies.FRIENDLY, CreatureType.VILLAGER),
+ BLAZE("Blaze", Enemies.ENEMY, CreatureType.BLAZE),
+ MUSHROOMCOW("MushroomCow", Enemies.FRIENDLY, CreatureType.MUSHROOM_COW),
+ MAGMACUBE("MagmaCube", Enemies.ENEMY, CreatureType.MAGMA_CUBE),
+ SNOWMAN("Snowman", Enemies.FRIENDLY, "", CreatureType.SNOWMAN);
+
public static final Logger logger = Logger.getLogger("Minecraft");
private Mob(String n, Enemies en, String s, CreatureType type)
@@ -47,7 +56,6 @@ public enum Mob
this.type = en;
this.bukkitType = type;
}
-
public String suffix = "s";
final public String name;
final public Enemies type;
@@ -58,17 +66,20 @@ public enum Mob
{
for (Mob mob : Mob.values())
{
- hashMap.put(mob.name, mob);
+ hashMap.put(mob.name.toLowerCase(Locale.ENGLISH), mob);
}
}
+
+ public static Set<String> getMobList() {
+ return hashMap.keySet();
+ }
public LivingEntity spawn(final Player player, final Server server, final Location loc) throws MobException
{
-
- final LivingEntity entity = player.getWorld().spawnCreature(loc, this.bukkitType);
+ final LivingEntity entity = player.getWorld().spawn(loc, (Class<? extends LivingEntity>)this.bukkitType.getEntityClass());
if (entity == null)
{
- logger.log(Level.WARNING, Util.i18n("unableToSpawnMob"));
+ logger.log(Level.WARNING, _("unableToSpawnMob"));
throw new MobException();
}
return entity;
@@ -81,24 +92,26 @@ public enum Mob
NEUTRAL("neutral"),
ENEMY("enemy");
- private Enemies(final String t)
+ private Enemies(final String type)
{
- this.type = t;
+ this.type = type;
}
final protected String type;
}
- public CreatureType getType () {
+ public CreatureType getType()
+ {
return bukkitType;
}
- public static class MobException extends Exception
+ public static Mob fromName(final String name)
{
- private static final long serialVersionUID = 1L;
+ return hashMap.get(name.toLowerCase(Locale.ENGLISH));
}
- public static Mob fromName(String n)
+
+ public static class MobException extends Exception
{
- return hashMap.get(n);
+ private static final long serialVersionUID = 1L;
}
}
diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java
index 8e50aa1bd..097c4c883 100644
--- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java
+++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java
@@ -1,29 +1,18 @@
package com.earth2me.essentials;
+import com.earth2me.essentials.craftbukkit.OfflineBedLocation;
+import static com.earth2me.essentials.I18n._;
import java.net.InetSocketAddress;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import lombok.Delegate;
-import org.bukkit.Achievement;
-import org.bukkit.Effect;
-import org.bukkit.GameMode;
-import org.bukkit.Instrument;
-import org.bukkit.Location;
-import org.bukkit.Material;
-import org.bukkit.Note;
-import org.bukkit.Server;
-import org.bukkit.Statistic;
-import org.bukkit.World;
+import org.bukkit.*;
import org.bukkit.block.Block;
-import org.bukkit.entity.Arrow;
-import org.bukkit.entity.Egg;
-import org.bukkit.entity.Entity;
-import org.bukkit.entity.Player;
-import org.bukkit.entity.Snowball;
-import org.bukkit.entity.Vehicle;
+import org.bukkit.entity.*;
import org.bukkit.event.entity.EntityDamageEvent;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.map.MapView;
@@ -37,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();
- @Delegate(types=org.bukkit.OfflinePlayer.class)
- private final org.bukkit.OfflinePlayer base;
+ 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 transient org.bukkit.OfflinePlayer base;
public OfflinePlayer(final String name, final IEssentials ess)
{
@@ -66,77 +55,93 @@ public class OfflinePlayer implements Player
{
}
+ @Override
public void setCompassTarget(Location lctn)
{
}
+ @Override
public InetSocketAddress getAddress()
{
return null;
}
+ @Override
public void kickPlayer(String string)
{
}
+ @Override
public PlayerInventory getInventory()
{
return null;
}
+ @Override
public ItemStack getItemInHand()
{
return null;
}
+ @Override
public void setItemInHand(ItemStack is)
{
}
+ @Override
public int getHealth()
{
return 0;
}
+ @Override
public void setHealth(int i)
{
}
+ @Override
public Egg throwEgg()
{
return null;
}
+ @Override
public Snowball throwSnowball()
{
return null;
}
+ @Override
public Arrow shootArrow()
{
return null;
}
+ @Override
public boolean isInsideVehicle()
{
return false;
}
+ @Override
public boolean leaveVehicle()
{
return false;
}
+ @Override
public Vehicle getVehicle()
{
return null;
}
+ @Override
public Location getLocation()
{
return location;
}
+ @Override
public World getWorld()
{
return world;
@@ -156,11 +161,13 @@ public class OfflinePlayer implements Player
{
}
+ @Override
public int getEntityId()
{
return -1;
}
+ @Override
public boolean performCommand(String string)
{
return false;
@@ -171,91 +178,109 @@ public class OfflinePlayer implements Player
return false;
}
+ @Override
public int getRemainingAir()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void setRemainingAir(int i)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public int getMaximumAir()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void setMaximumAir(int i)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public boolean isSneaking()
{
return false;
}
+ @Override
public void setSneaking(boolean bln)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void updateInventory()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void chat(String string)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public double getEyeHeight()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public double getEyeHeight(boolean bln)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public List<Block> getLineOfSight(HashSet<Byte> hs, int i)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public Block getTargetBlock(HashSet<Byte> hs, int i)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public List<Block> getLastTwoTargetBlocks(HashSet<Byte> hs, int i)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public int getFireTicks()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public int getMaxFireTicks()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void setFireTicks(int i)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void remove()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public Server getServer()
{
return ess == null ? null : ess.getServer();
@@ -263,308 +288,367 @@ public class OfflinePlayer implements Player
public Vector getMomentum()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
public void setMomentum(Vector vector)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void setVelocity(Vector vector)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public Vector getVelocity()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void damage(int i)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void damage(int i, Entity entity)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public Location getEyeLocation()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void sendRawMessage(String string)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public Location getCompassTarget()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public int getMaximumNoDamageTicks()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void setMaximumNoDamageTicks(int i)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public int getLastDamage()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void setLastDamage(int i)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public int getNoDamageTicks()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void setNoDamageTicks(int i)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public boolean teleport(Location lctn)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public boolean teleport(Entity entity)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public Entity getPassenger()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public boolean setPassenger(Entity entity)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public boolean isEmpty()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public boolean eject()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void saveData()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void loadData()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public boolean isSleeping()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public int getSleepTicks()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public List<Entity> getNearbyEntities(double d, double d1, double d2)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public boolean isDead()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public float getFallDistance()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void setFallDistance(float f)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void setSleepingIgnored(boolean bln)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public boolean isSleepingIgnored()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void awardAchievement(Achievement a)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void incrementStatistic(Statistic ststc)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void incrementStatistic(Statistic ststc, int i)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void incrementStatistic(Statistic ststc, Material mtrl)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void incrementStatistic(Statistic ststc, Material mtrl, int i)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void playNote(Location lctn, byte b, byte b1)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void sendBlockChange(Location lctn, Material mtrl, byte b)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void sendBlockChange(Location lctn, int i, byte b)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void setLastDamageCause(EntityDamageEvent ede)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public EntityDamageEvent getLastDamageCause()
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public void playEffect(Location lctn, Effect effect, int i)
{
- throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
+ throw new UnsupportedOperationException(_("notSupportedYet"));
}
+ @Override
public boolean sendChunkChange(Location lctn, int i, int i1, int i2, byte[] bytes)
{
return true;
}
+ @Override
public UUID getUniqueId()
{
return uniqueId;
}
+ @Override
public void playNote(Location lctn, Instrument i, Note note)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void setPlayerTime(long l, boolean bln)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public long getPlayerTime()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public long getPlayerTimeOffset()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean isPlayerTimeRelative()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void resetPlayerTime()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean isPermissionSet(String string)
{
return false;
}
+ @Override
public boolean isPermissionSet(Permission prmsn)
{
return false;
}
+ @Override
public boolean hasPermission(String string)
{
return false;
}
+ @Override
public boolean hasPermission(Permission prmsn)
{
return false;
}
+ @Override
public PermissionAttachment addAttachment(Plugin plugin, String string, boolean bln)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public PermissionAttachment addAttachment(Plugin plugin)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public PermissionAttachment addAttachment(Plugin plugin, String string, boolean bln, int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public PermissionAttachment addAttachment(Plugin plugin, int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void removeAttachment(PermissionAttachment pa)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void recalculatePermissions()
{
}
+ @Override
public Set<PermissionAttachmentInfo> getEffectivePermissions()
{
throw new UnsupportedOperationException("Not supported yet.");
}
-
+
@Override
public void sendMap(MapView mv)
{
@@ -658,7 +742,7 @@ public class OfflinePlayer implements Player
@Override
public Location getBedSpawnLocation()
{
- throw new UnsupportedOperationException("Not supported yet.");
+ return OfflineBedLocation.getBedLocation(base.getName(), ess);
}
@Override
@@ -696,4 +780,53 @@ public class OfflinePlayer implements Player
{
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ @Override
+ public int getMaxHealth()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void giveExp(int i)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public float getExp()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setExp(float f)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean teleport(Location lctn, TeleportCause tc)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean teleport(Entity entity, TeleportCause tc)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Player getKiller()
+ {
+ 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/PlayerExtension.java b/Essentials/src/com/earth2me/essentials/PlayerExtension.java
index 11c17761c..7c52e40d1 100644
--- a/Essentials/src/com/earth2me/essentials/PlayerExtension.java
+++ b/Essentials/src/com/earth2me/essentials/PlayerExtension.java
@@ -1,12 +1,8 @@
package com.earth2me.essentials;
import lombok.Delegate;
-import org.bukkit.craftbukkit.entity.CraftPlayer;
-import net.minecraft.server.EntityPlayer;
-import net.minecraft.server.IInventory;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
-import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
import org.bukkit.entity.Entity;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.LivingEntity;
@@ -17,21 +13,19 @@ import org.bukkit.permissions.ServerOperator;
public class PlayerExtension implements Player
{
- protected final transient IEssentials ess;
@Delegate(types =
{
- Player.class, Entity.class, CommandSender.class, ServerOperator.class,
+ Player.class, Entity.class, CommandSender.class, ServerOperator.class,
HumanEntity.class, ConfigurationSerializable.class, LivingEntity.class,
Permissible.class
})
protected Player base;
-
- public PlayerExtension(final Player base, final IEssentials ess)
+
+ public PlayerExtension(final Player base)
{
this.base = base;
- this.ess = ess;
}
-
+
public final Player getBase()
{
return base;
@@ -41,44 +35,4 @@ public class PlayerExtension implements Player
{
return this.base = base;
}
-
- public void showInventory(final IInventory inventory)
- {
- getHandle().a(inventory);
- }
-
- public void showInventory(final CraftInventoryPlayer inventory)
- {
- showInventory((IInventory)inventory.getInventory());
- }
-
- public TargetBlock getTarget()
- {
- return new TargetBlock(getBase());
- }
-
- public String getGroup()
- {
- return ess.getPermissionsHandler().getGroup(base);
- }
-
- public boolean inGroup(final String group)
- {
- return ess.getPermissionsHandler().inGroup(base, group);
- }
-
- public boolean canBuild()
- {
- return ess.getPermissionsHandler().canBuild(base, getGroup());
- }
-
- public EntityPlayer getHandle()
- {
- return getCraftPlayer().getHandle();
- }
-
- public CraftPlayer getCraftPlayer()
- {
- return (CraftPlayer)base;
- }
}
diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java
index ca076c272..682eedaf9 100644
--- a/Essentials/src/com/earth2me/essentials/Settings.java
+++ b/Essentials/src/com/earth2me/essentials/Settings.java
@@ -1,13 +1,13 @@
package com.earth2me.essentials;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.commands.IEssentialsCommand;
+import java.io.File;
+import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.ChatColor;
-import com.earth2me.essentials.commands.IEssentialsCommand;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import org.bukkit.event.Event.Priority;
import org.bukkit.inventory.ItemStack;
@@ -32,9 +32,9 @@ public class Settings implements ISettings
}
@Override
- public boolean getBedSetsHome()
+ public boolean getUpdateBedAtDaytime()
{
- return config.getBoolean("bed-sethome", false);
+ return config.getBoolean("update-bed-at-daytime", true);
}
@Override
@@ -83,9 +83,15 @@ public class Settings implements ISettings
}
@Override
+ public int getOversizedStackSize()
+ {
+ return config.getInt("oversized-stacksize", 64);
+ }
+
+ @Override
public int getDefaultStackSize()
{
- return config.getInt("default-stack-size", 64);
+ return config.getInt("default-stack-size", -1);
}
@Override
@@ -111,7 +117,7 @@ public class Settings implements ISettings
}
return true;
}
- return config.getBoolean("disable-" + label.toLowerCase(), false);
+ return config.getBoolean("disable-" + label.toLowerCase(Locale.ENGLISH), false);
}
@Override
@@ -131,7 +137,7 @@ public class Settings implements ISettings
}
return true;
}
- return config.getBoolean("restrict-" + label.toLowerCase(), false);
+ return config.getBoolean("restrict-" + label.toLowerCase(Locale.ENGLISH), false);
}
@Override
@@ -161,7 +167,7 @@ public class Settings implements ISettings
}
return true;
}
- return config.getBoolean("override-" + name.toLowerCase(), false);
+ return config.getBoolean("override-" + name.toLowerCase(Locale.ENGLISH), false);
}
@Override
@@ -190,13 +196,13 @@ public class Settings implements ISettings
@Override
public double getTeleportCooldown()
{
- return config.getDouble("teleport-cooldown", 60);
+ return config.getDouble("teleport-cooldown", 0);
}
@Override
public double getHealCooldown()
{
- return config.getDouble("heal-cooldown", 60);
+ return config.getDouble("heal-cooldown", 0);
}
@Override
@@ -235,7 +241,7 @@ public class Settings implements ISettings
try
{
- return ChatColor.valueOf(colorName.toUpperCase());
+ return ChatColor.valueOf(colorName.toUpperCase(Locale.ENGLISH));
}
catch (IllegalArgumentException ex)
{
@@ -245,12 +251,6 @@ public class Settings implements ISettings
}
@Override
- public boolean getReclaimSetting()
- {
- return config.getBoolean("reclaim-onlogout", true);
- }
-
- @Override
public int getSpawnMobLimit()
{
return config.getInt("spawnmob-limit", 10);
@@ -339,6 +339,7 @@ public class Settings implements ISettings
public void reloadConfig()
{
config.load();
+ noGodWorlds = new HashSet<String>(config.getStringList("no-god-in-worlds", Collections.<String>emptyList()));
}
@Override
@@ -360,7 +361,7 @@ public class Settings implements ISettings
}
catch (Exception ex)
{
- logger.log(Level.SEVERE, Util.format("unknownItemInList", itemName, "item-spawn-blacklist"));
+ logger.log(Level.SEVERE, _("unknownItemInList", itemName, "item-spawn-blacklist"));
}
}
return epItemSpwn;
@@ -377,11 +378,12 @@ public class Settings implements ISettings
{
return config.getBoolean("protect.disable.warn-on-build-disallow", false);
}
+ private boolean debug = false;
@Override
public boolean isDebug()
{
- return config.getBoolean("debug", false);
+ return debug || config.getBoolean("debug", false);
}
@Override
@@ -445,7 +447,7 @@ public class Settings implements ISettings
}
catch (Exception ex)
{
- logger.log(Level.SEVERE, Util.format("unknownItemInList", itemName, configName));
+ logger.log(Level.SEVERE, _("unknownItemInList", itemName, configName));
}
}
return list;
@@ -464,6 +466,7 @@ public class Settings implements ISettings
}
private final static double MAXMONEY = 10000000000000.0;
+ @Override
public double getMaxMoney()
{
double max = config.getDouble("max-money", MAXMONEY);
@@ -474,36 +477,43 @@ public class Settings implements ISettings
return max;
}
+ @Override
public boolean isEcoLogEnabled()
{
return config.getBoolean("economy-log-enabled", false);
}
+ @Override
public boolean removeGodOnDisconnect()
{
return config.getBoolean("remove-god-on-disconnect", false);
}
+ @Override
public boolean changeDisplayName()
{
return config.getBoolean("change-displayname", true);
}
+ @Override
public boolean useBukkitPermissions()
{
return config.getBoolean("use-bukkit-permissions", false);
}
+ @Override
public boolean addPrefixSuffix()
{
return config.getBoolean("add-prefix-suffix", ess.getServer().getPluginManager().isPluginEnabled("EssentialsChat"));
}
-
+
+ @Override
public boolean disablePrefix()
{
return config.getBoolean("disablePrefix", false);
}
-
+
+ @Override
public boolean disableSuffix()
{
return config.getBoolean("disableSuffix", false);
@@ -532,4 +542,74 @@ public class Settings implements ISettings
{
return config.getBoolean("death-messages", true);
}
+ Set<String> noGodWorlds = new HashSet<String>();
+
+ @Override
+ public Set<String> getNoGodWorlds()
+ {
+ return noGodWorlds;
+ }
+
+ @Override
+ public void setDebug(final boolean debug)
+ {
+ this.debug = debug;
+ }
+
+ @Override
+ public boolean getRepairEnchanted()
+ {
+ return config.getBoolean("repair-enchanted", true);
+ }
+
+ @Override
+ public boolean getIsWorldTeleportPermissions()
+ {
+ return config.getBoolean("world-teleport-permissions", false);
+ }
+
+ @Override
+ public boolean registerBackInListener()
+ {
+ return config.getBoolean("register-back-in-listener", false);
+ }
+
+ @Override
+ public boolean getDisableItemPickupWhileAfk()
+ {
+ return config.getBoolean("disable-item-pickup-while-afk", true);
+ }
+
+ @Override
+ public Priority getRespawnPriority()
+ {
+ String priority = config.getString("respawn-listener-priority", "normal").toLowerCase(Locale.ENGLISH);
+ if ("lowest".equals(priority))
+ {
+ return Priority.Lowest;
+ }
+ if ("low".equals(priority))
+ {
+ return Priority.Low;
+ }
+ if ("normal".equals(priority))
+ {
+ return Priority.Normal;
+ }
+ if ("high".equals(priority))
+ {
+ return Priority.High;
+ }
+ if ("highest".equals(priority))
+ {
+ return Priority.Highest;
+ }
+ return Priority.Normal;
+ }
+
+ @Override
+ public long getTpaAcceptCancellation()
+ {
+ return config.getLong("tpa-accept-cancellation", 0);
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/Spawn.java b/Essentials/src/com/earth2me/essentials/Spawn.java
deleted file mode 100644
index b1e06d50c..000000000
--- a/Essentials/src/com/earth2me/essentials/Spawn.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package com.earth2me.essentials;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Logger;
-import org.bukkit.Location;
-import org.bukkit.Server;
-import org.bukkit.World;
-import org.bukkit.World.Environment;
-
-
-public class Spawn implements IConf
-{
- private static final Logger logger = Logger.getLogger("Minecraft");
- private final EssentialsConf config;
- private final Server server;
-
- public Spawn(Server server, File dataFolder)
- {
- File configFile = new File(dataFolder, "spawn.yml");
- this.server = server;
- config = new EssentialsConf(configFile);
- config.load();
- }
-
- public void setSpawn(Location loc, String group)
- {
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("world", loc.getWorld().getName());
- map.put("x", loc.getX());
- map.put("y", loc.getY());
- map.put("z", loc.getZ());
- map.put("yaw", loc.getYaw());
- map.put("pitch", loc.getPitch());
- config.setProperty(group, map);
- config.save();
-
- if ("default".equals(group))
- {
- loc.getWorld().setSpawnLocation(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
- }
- }
-
- public Location getSpawn(String group)
- {
- if (config.getProperty(group) == null)
- {
- group = "default";
- }
- if (config.getProperty(group) == null)
- {
- for (World w : server.getWorlds())
- {
- if (w.getEnvironment() != Environment.NORMAL)
- {
- continue;
- }
- return w.getSpawnLocation();
- }
- }
- String worldId = config.getString(group + ".world", "");
- World world = server.getWorlds().get(server.getWorlds().size() > 1 ? 1 : 0);
- for (World w : server.getWorlds())
- {
- if (w.getEnvironment() != Environment.NORMAL)
- {
- continue;
- }
- world = w;
- break;
- }
- for (World w : server.getWorlds())
- {
- if (!w.getName().equals(worldId))
- {
- continue;
- }
- world = w;
- break;
- }
-
- double x = config.getDouble(group + ".x", config.getDouble("default.x", 0));
- double y = config.getDouble(group + ".y", config.getDouble("default.y", 0));
- double z = config.getDouble(group + ".z", config.getDouble("default.z", 0));
- float yaw = (float)config.getDouble(group + ".yaw", config.getDouble("default.yaw", 0));
- float pitch = (float)config.getDouble(group + ".pitch", config.getDouble("default.pitch", 0));
- Location retval = new Location(world, x, y, z, yaw, pitch);
-
- if (y < 1)
- {
- retval.setY(world.getHighestBlockYAt(retval));
- }
-
- return retval;
- }
-
- public void reloadConfig()
- {
- config.load();
- }
-}
diff --git a/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java b/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java
index 0f3ca01cc..4ae259a32 100644
--- a/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java
+++ b/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java
@@ -1,31 +1,20 @@
package com.earth2me.essentials;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import net.minecraft.server.ChunkPosition;
-import net.minecraft.server.Packet60Explosion;
-import org.bukkit.Location;
-import org.bukkit.block.Block;
-import org.bukkit.craftbukkit.CraftServer;
-import org.bukkit.craftbukkit.CraftWorld;
+import com.earth2me.essentials.craftbukkit.FakeExplosion;
import org.bukkit.entity.LivingEntity;
-import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityListener;
public class TNTExplodeListener extends EntityListener implements Runnable
{
- private final IEssentials ess;
- private boolean enabled = false;
- private int timer = -1;
+ private final transient IEssentials ess;
+ private transient boolean enabled = false;
+ private transient int timer = -1;
- public TNTExplodeListener(IEssentials ess)
+ public TNTExplodeListener(final IEssentials ess)
{
+ super();
this.ess = ess;
}
@@ -55,36 +44,11 @@ public class TNTExplodeListener extends EntityListener implements Runnable
{
return;
}
- try
- {
- final Set<ChunkPosition> set = new HashSet<ChunkPosition>(event.blockList().size());
- final Player[] players = ess.getServer().getOnlinePlayers();
- final List<ChunkPosition> blocksUnderPlayers = new ArrayList<ChunkPosition>(players.length);
- final Location loc = event.getLocation();
- for (Player player : players)
- {
- if (player.getWorld().equals(loc.getWorld()))
- {
- blocksUnderPlayers.add(new ChunkPosition(player.getLocation().getBlockX(), player.getLocation().getBlockY() - 1, player.getLocation().getBlockZ()));
- }
- }
- for (Block block : event.blockList())
- {
- final ChunkPosition cp = new ChunkPosition(block.getX(), block.getY(), block.getZ());
- if (!blocksUnderPlayers.contains(cp))
- {
- set.add(cp);
- }
- }
- ((CraftServer)ess.getServer()).getHandle().sendPacketNearby(loc.getX(), loc.getY(), loc.getZ(), 64.0, ((CraftWorld)loc.getWorld()).getHandle().worldProvider.dimension, new Packet60Explosion(loc.getX(), loc.getY(), loc.getZ(), 3.0F, set));
- }
- catch (Throwable ex)
- {
- Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
- }
+ FakeExplosion.createExplosion(event, ess.getServer(), ess.getServer().getOnlinePlayers());
event.setCancelled(true);
}
+ @Override
public void run()
{
enabled = false;
diff --git a/Essentials/src/com/earth2me/essentials/TargetBlock.java b/Essentials/src/com/earth2me/essentials/TargetBlock.java
deleted file mode 100644
index 3d45afc55..000000000
--- a/Essentials/src/com/earth2me/essentials/TargetBlock.java
+++ /dev/null
@@ -1,527 +0,0 @@
-package com.earth2me.essentials;
-
-import java.util.List;
-import org.bukkit.block.Block;
-import org.bukkit.Location;
-import org.bukkit.Material;
-import org.bukkit.entity.Player;
-
-
-/**
- * Original authors: toi & Raphfrk
- */
-@Deprecated
-public class TargetBlock
-{
- private transient final Location location;
- private transient final double viewHeight;
- private transient final int maxDistance;
- private transient final int[] blockToIgnore;
- private transient final double checkDistance;
- private transient double curDistance;
- private transient double targetPositionX;
- private transient double targetPositionY;
- private transient double targetPositionZ;
- private transient int itargetPositionX;
- private transient int itargetPositionY;
- private transient int itargetPositionZ;
- private transient int prevPositionX;
- private transient int prevPositionY;
- private transient int prevPositionZ;
- private transient final double offsetX;
- private transient final double offsetY;
- private transient final double offsetZ;
-
- /**
- * Constructor requiring a player, uses default values
- *
- * @param player Player to work with
- */
- public TargetBlock(final Player player)
- {
- this(player.getLocation(), 300, 1.65, 0.2, null);
- }
-
- /**
- * Constructor requiring a location, uses default values
- *
- * @param loc Location to work with
- */
- public TargetBlock(final Location loc)
- {
- this(loc, 300, 0, 0.2, null);
- }
-
- /**
- * Constructor requiring a player, max distance and a checking distance
- *
- * @param player Player to work with
- * @param maxDistance How far it checks for blocks
- * @param checkDistance How often to check for blocks, the smaller the more precise
- */
- public TargetBlock(final Player player, final int maxDistance, final double checkDistance)
- {
- this(player.getLocation(), maxDistance, 1.65, checkDistance, null);
- }
-
- /**
- * Constructor requiring a location, max distance and a checking distance
- *
- * @param loc What location to work with
- * @param maxDistance How far it checks for blocks
- * @param checkDistance How often to check for blocks, the smaller the more precise
- */
- public TargetBlock(final Location loc, final int maxDistance, final double checkDistance)
- {
- this(loc, maxDistance, 0, checkDistance, null);
- }
-
- /**
- * Constructor requiring a player, max distance, checking distance and an array of blocks to ignore
- *
- * @param player What player to work with
- * @param maxDistance How far it checks for blocks
- * @param checkDistance How often to check for blocks, the smaller the more precise
- * @param blocksToIgnore Integer array of what block ids to ignore while checking for viable targets
- */
- public TargetBlock(final Player player, final int maxDistance, final double checkDistance, final int[] blocksToIgnore)
- {
- this(player.getLocation(), maxDistance, 1.65, checkDistance, blocksToIgnore);
- }
-
- /**
- * Constructor requiring a location, max distance, checking distance and an array of blocks to ignore
- *
- * @param loc What location to work with
- * @param maxDistance How far it checks for blocks
- * @param checkDistance How often to check for blocks, the smaller the more precise
- * @param blocksToIgnore Array of what block ids to ignore while checking for viable targets
- */
- public TargetBlock(final Location loc, final int maxDistance, final double checkDistance, final int[] blocksToIgnore)
- {
- this(loc, maxDistance, 0, checkDistance, blocksToIgnore);
- }
-
- /**
- * Constructor requiring a player, max distance, checking distance and an array of blocks to ignore
- *
- * @param player What player to work with
- * @param maxDistance How far it checks for blocks
- * @param checkDistance How often to check for blocks, the smaller the more precise
- * @param blocksToIgnore String ArrayList of what block ids to ignore while checking for viable targets
- */
- public TargetBlock(final Player player, final int maxDistance, final double checkDistance, final List<String> blocksToIgnore)
- {
- this(player.getLocation(), maxDistance, 1.65, checkDistance, TargetBlock.convertStringArraytoIntArray(blocksToIgnore));
- }
-
- /**
- * Constructor requiring a location, max distance, checking distance and an array of blocks to ignore
- *
- * @param loc What location to work with
- * @param maxDistance How far it checks for blocks
- * @param checkDistance How often to check for blocks, the smaller the more precise
- * @param blocksToIgnore String ArrayList of what block ids to ignore while checking for viable targets
- */
- public TargetBlock(final Location loc, final int maxDistance, final double checkDistance, final List<String> blocksToIgnore)
- {
- this(loc, maxDistance, 0, checkDistance, TargetBlock.convertStringArraytoIntArray(blocksToIgnore));
- }
-
- /**
- * Set the values, all constructors uses this function
- *
- * @param loc Location of the view
- * @param maxDistance How far it checks for blocks
- * @param viewPos Where the view is positioned in y-axis
- * @param checkDistance How often to check for blocks, the smaller the more precise
- * @param blocksToIgnore Ids of blocks to ignore while checking for viable targets
- */
- private TargetBlock(final Location loc, final int maxDistance, final double viewHeight, final double checkDistance, final int[] blocksToIgnore)
- {
- this.location = loc;
- this.maxDistance = maxDistance;
- this.viewHeight = viewHeight;
- this.checkDistance = checkDistance;
- if (blocksToIgnore == null || blocksToIgnore.length == 0)
- {
- this.blockToIgnore = new int[0];
- }
- else
- {
- this.blockToIgnore = new int[blocksToIgnore.length];
- System.arraycopy(blocksToIgnore, 0, this.blockToIgnore, 0, this.blockToIgnore.length);
- }
-
- final double xRotation = (loc.getYaw() + 90) % 360;
- final double yRotation = loc.getPitch() * -1;
-
- final double hypotenuse = (checkDistance * Math.cos(Math.toRadians(yRotation)));
- offsetX = hypotenuse * Math.cos(Math.toRadians(xRotation));
- offsetY = checkDistance * Math.sin(Math.toRadians(yRotation));
- offsetZ = hypotenuse * Math.sin(Math.toRadians(xRotation));
-
- reset();
- }
-
- /**
- * Call this to reset checking position to allow you to check for a new target with the same TargetBlock instance.
- */
- public final void reset()
- {
- targetPositionX = location.getX();
- targetPositionY = location.getY() + viewHeight;
- targetPositionZ = location.getZ();
- itargetPositionX = (int)Math.floor(targetPositionX);
- itargetPositionY = (int)Math.floor(targetPositionY);
- itargetPositionZ = (int)Math.floor(targetPositionZ);
- prevPositionX = itargetPositionX;
- prevPositionY = itargetPositionY;
- prevPositionZ = itargetPositionZ;
- this.curDistance = 0;
- }
-
- /**
- * Gets the distance to a block. Measures from the block underneath the player to the targetblock
- * Should only be used when passing player as an constructor parameter
- *
- * @return double
- */
- public double getDistanceToBlock()
- {
- final double blockUnderPlayerX = Math.floor(location.getX() + 0.5);
- final double blockUnderPlayerY = Math.floor(location.getY() - 0.5);
- final double blockUnderPlayerZ = Math.floor(location.getZ() + 0.5);
-
- final Block block = getTargetBlock();
- final double distX = block.getX() - blockUnderPlayerX;
- final double distY = block.getY() - blockUnderPlayerY;
- final double distZ = block.getZ() - blockUnderPlayerZ;
-
- return Math.sqrt(distX*distX + distY*distY + distZ*distZ);
- }
-
- /**
- * Gets the rounded distance to a block. Measures from the block underneath the player to the targetblock
- * Should only be used when passing player as an constructor parameter
- *
- * @return int
- */
- public int getDistanceToBlockRounded()
- {
- return (int)Math.round(getDistanceToBlock());
- }
-
- /**
- * Gets the floored x distance to a block.
- *
- * @return int
- */
- public int getXDistanceToBlock()
- {
- return (int)Math.floor(getTargetBlock().getX() - location.getBlockX() + 0.5);
- }
-
- /**
- * Gets the floored y distance to a block
- *
- * @return int
- */
- public int getYDistanceToBlock()
- {
- return (int)Math.floor(getTargetBlock().getY() - location.getBlockY() + viewHeight);
- }
-
- /**
- * Gets the floored z distance to a block
- *
- * @return int
- */
- public int getZDistanceToBlock()
- {
- return (int)Math.floor(getTargetBlock().getZ() - location.getBlockZ() + 0.5);
- }
-
- /**
- * Returns the block at the sight. Returns null if out of range or if no viable target was found
- *
- * @return Block
- */
- public Block getTargetBlock()
- {
- this.reset();
- Block block;
- do
- {
- block = getNextBlock();
- }
- while (block != null && ((block.getTypeId() == 0) || this.blockIsIgnored(block.getTypeId())));
-
- return block;
- }
-
- /**
- * Sets the type of the block at the sight. Returns false if the block wasn't set.
- *
- * @param typeID ID of type to set the block to
- * @return boolean
- */
- public boolean setTargetBlock(final int typeID)
- {
- return setTargetBlock(Material.getMaterial(typeID));
- }
-
- /**
- * Sets the type of the block at the sight. Returns false if the block wasn't set.
- *
- * @param type Material to set the block to
- * @return boolean
- */
- @SuppressWarnings("empty-statement")
- public boolean setTargetBlock(final Material type)
- {
- if (type == null)
- {
- return false;
- }
- final Block block = getTargetBlock();
- if (block != null)
- {
- block.setType(type);
- return true;
- }
- return false;
- }
-
- /**
- * Sets the type of the block at the sight. Returns false if the block wasn't set.
- * Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
- *
- * @param type Name of type to set the block to
- * @return boolean
- */
- public boolean setTargetBlock(final String type)
- {
- return setTargetBlock(Material.valueOf(type));
- }
-
- /**
- * Returns the block attached to the face at the sight. Returns null if out of range or if no viable target was found
- *
- * @return Block
- */
- public Block getFaceBlock()
- {
- final Block block = getTargetBlock();
- if (block == null)
- {
- return null;
- }
- return getPreviousBlock();
- }
-
- /**
- * Sets the type of the block attached to the face at the sight. Returns false if the block wasn't set.
- *
- * @param typeID
- * @return boolean
- */
- public boolean setFaceBlock(final int typeID)
- {
- return setFaceBlock(Material.getMaterial(typeID));
- }
-
- /**
- * Sets the type of the block attached to the face at the sight. Returns false if the block wasn't set.
- *
- * @param type
- * @return boolean
- */
- public boolean setFaceBlock(final Material type)
- {
- if (type == null)
- {
- return false;
- }
- if (getCurrentBlock() != null)
- {
- final Block blk = location.getWorld().getBlockAt(prevPositionX, prevPositionY, prevPositionZ);
- blk.setType(type);
- return true;
- }
- return false;
- }
-
- /**
- * Sets the type of the block attached to the face at the sight. Returns false if the block wasn't set.
- * Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
- *
- * @param type
- * @return boolean
- */
- public boolean setFaceBlock(final String type)
- {
- return setFaceBlock(Material.valueOf(type));
- }
-
- /**
- * Get next block
- *
- * @return Block
- */
- public Block getNextBlock()
- {
- prevPositionX = itargetPositionX;
- prevPositionY = itargetPositionY;
- prevPositionZ = itargetPositionZ;
- do
- {
- curDistance += checkDistance;
-
- targetPositionX += offsetX;
- targetPositionY += offsetY;
- targetPositionZ += offsetZ;
- itargetPositionX = (int)Math.floor(targetPositionX);
- itargetPositionY = (int)Math.floor(targetPositionY);
- itargetPositionZ = (int)Math.floor(targetPositionZ);
- }
- while (curDistance <= maxDistance && itargetPositionX == prevPositionX && itargetPositionY == prevPositionY && itargetPositionZ == prevPositionZ);
- if (curDistance > maxDistance)
- {
- return null;
- }
-
- return this.location.getWorld().getBlockAt(itargetPositionX, itargetPositionY, itargetPositionZ);
- }
-
- /**
- * Returns the current block along the line of vision
- *
- * @return Block
- */
- public Block getCurrentBlock()
- {
- Block block;
- if (curDistance <= maxDistance)
- {
- block = this.location.getWorld().getBlockAt(itargetPositionX, itargetPositionY, itargetPositionZ);
- }
- else
- {
- block = null;
- }
- return block;
- }
-
- /**
- * Sets current block type. Returns false if the block wasn't set.
- *
- * @param typeID
- */
- public boolean setCurrentBlock(final int typeID)
- {
- return setCurrentBlock(Material.getMaterial(typeID));
- }
-
- /**
- * Sets current block type. Returns false if the block wasn't set.
- *
- * @param type
- */
- public boolean setCurrentBlock(final Material type)
- {
- final Block blk = getCurrentBlock();
- if (blk != null && type != null)
- {
- blk.setType(type);
- return true;
- }
- return false;
- }
-
- /**
- * Sets current block type. Returns false if the block wasn't set.
- * Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
- *
- * @param type
- */
- public boolean setCurrentBlock(final String type)
- {
- return setCurrentBlock(Material.valueOf(type));
- }
-
- /**
- * Returns the previous block in the aimed path
- *
- * @return Block
- */
- public Block getPreviousBlock()
- {
- return this.location.getWorld().getBlockAt(prevPositionX, prevPositionY, prevPositionZ);
- }
-
- /**
- * Sets previous block type id. Returns false if the block wasn't set.
- *
- * @param typeID
- */
- public boolean setPreviousBlock(final int typeID)
- {
- return setPreviousBlock(Material.getMaterial(typeID));
- }
-
- /**
- * Sets previous block type id. Returns false if the block wasn't set.
- *
- * @param type
- */
- public boolean setPreviousBlock(final Material type)
- {
- final Block blk = getPreviousBlock();
- if (blk != null && type != null)
- {
- blk.setType(type);
- return true;
- }
- return false;
- }
-
- /**
- * Sets previous block type id. Returns false if the block wasn't set.
- * Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
- *
- * @param type
- */
- public boolean setPreviousBlock(final String type)
- {
- return setPreviousBlock(Material.valueOf(type));
- }
-
- private static int[] convertStringArraytoIntArray(final List<String> array)
- {
- final int intarray[] = new int[array == null ? 0 : array.size()];
- for (int i = 0; i < intarray.length; i++)
- {
- try
- {
- intarray[i] = Integer.parseInt(array.get(i));
- }
- catch (NumberFormatException nfe)
- {
- }
- }
- return intarray;
- }
-
- private boolean blockIsIgnored(final int value)
- {
- for (int i : this.blockToIgnore)
- {
- if (i == value)
- {
- return true;
- }
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java
index 845f9c3a3..9c21ffc6d 100644
--- a/Essentials/src/com/earth2me/essentials/Teleport.java
+++ b/Essentials/src/com/earth2me/essentials/Teleport.java
@@ -1,14 +1,19 @@
package com.earth2me.essentials;
+import com.earth2me.essentials.api.ITeleport;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.commands.NotEnoughArgumentsException;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
+import org.bukkit.entity.Player;
+import org.bukkit.event.player.PlayerRespawnEvent;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
-public class Teleport implements Runnable
+public class Teleport implements Runnable, ITeleport
{
private static final double MOVE_CONSTANT = 0.3;
@@ -54,8 +59,9 @@ public class Teleport implements Runnable
private Trade chargeFor;
private final IEssentials ess;
private static final Logger logger = Logger.getLogger("Minecraft");
+ private TeleportCause cause;
- private void initTimer(long delay, Target target, Trade chargeFor)
+ private void initTimer(long delay, Target target, Trade chargeFor, TeleportCause cause)
{
this.started = System.currentTimeMillis();
this.delay = delay;
@@ -65,8 +71,10 @@ public class Teleport implements Runnable
this.initZ = Math.round(user.getLocation().getZ() * MOVE_CONSTANT);
this.teleportTarget = target;
this.chargeFor = chargeFor;
+ this.cause = cause;
}
+ @Override
public void run()
{
@@ -92,11 +100,11 @@ public class Teleport implements Runnable
try
{
cooldown(false);
- user.sendMessage(Util.i18n("teleportationCommencing"));
+ user.sendMessage(_("teleportationCommencing"));
try
{
- now(teleportTarget);
+ now(teleportTarget, cause);
if (chargeFor != null)
{
chargeFor.charge(user);
@@ -106,11 +114,10 @@ public class Teleport implements Runnable
{
ess.showError(user.getBase(), ex, "teleport");
}
- return;
}
catch (Exception ex)
{
- user.sendMessage(Util.format("cooldownWithMessage", ex.getMessage()));
+ user.sendMessage(_("cooldownWithMessage", ex.getMessage()));
}
}
}
@@ -121,16 +128,20 @@ public class Teleport implements Runnable
this.ess = ess;
}
- public void respawn(Spawn spawn, Trade chargeFor) throws Exception
+ public void respawn(final Trade chargeFor, TeleportCause cause) throws Exception
{
- teleport(new Target(spawn.getSpawn(user.getGroup())), chargeFor);
+ final Player player = user.getBase();
+ final Location bed = player.getBedSpawnLocation();
+ final PlayerRespawnEvent pre = new PlayerRespawnEvent(player, bed == null ? player.getWorld().getSpawnLocation() : bed, bed != null);
+ ess.getServer().getPluginManager().callEvent(pre);
+ teleport(new Target(pre.getRespawnLocation()), chargeFor, cause);
}
- public void warp(String warp, Trade chargeFor) throws Exception
+ public void warp(String warp, Trade chargeFor, TeleportCause cause) throws Exception
{
Location loc = ess.getWarps().getWarp(warp);
- teleport(new Target(loc), chargeFor);
- user.sendMessage(Util.format("warpingTo", warp));
+ teleport(new Target(loc), chargeFor, cause);
+ user.sendMessage(_("warpingTo", warp));
}
public void cooldown(boolean check) throws Exception
@@ -145,7 +156,7 @@ public class Teleport implements Runnable
cooldownTime.add(Calendar.MILLISECOND, (int)((cooldown * 1000.0) % 1000.0));
if (cooldownTime.after(now) && !user.isAuthorized("essentials.teleport.cooldown.bypass"))
{
- throw new Exception(Util.format("timeBeforeTeleport", Util.formatDateDiff(cooldownTime.getTimeInMillis())));
+ throw new Exception(_("timeBeforeTeleport", Util.formatDateDiff(cooldownTime.getTimeInMillis())));
}
}
// if justCheck is set, don't update lastTeleport; we're just checking
@@ -166,7 +177,7 @@ public class Teleport implements Runnable
ess.getServer().getScheduler().cancelTask(teleTimer);
if (notifyUser)
{
- user.sendMessage(Util.i18n("pendingTeleportCancelled"));
+ user.sendMessage(_("pendingTeleportCancelled"));
}
}
finally
@@ -179,18 +190,23 @@ public class Teleport implements Runnable
{
cancel(false);
}
-
+
public void teleport(Location loc, Trade chargeFor) throws Exception
{
- teleport(new Target(loc), chargeFor);
+ teleport(new Target(loc), chargeFor, TeleportCause.PLUGIN);
}
- public void teleport(Entity entity, Trade chargeFor) throws Exception
+ public void teleport(Location loc, Trade chargeFor, TeleportCause cause) throws Exception
{
- teleport(new Target(entity), chargeFor);
+ teleport(new Target(loc), chargeFor, cause);
}
- private void teleport(Target target, Trade chargeFor) throws Exception
+ public void teleport(Entity entity, Trade chargeFor, TeleportCause cause) throws Exception
+ {
+ teleport(new Target(entity), chargeFor, cause);
+ }
+
+ private void teleport(Target target, Trade chargeFor, TeleportCause cause) throws Exception
{
double delay = ess.getSettings().getTeleportDelay();
@@ -202,7 +218,7 @@ public class Teleport implements Runnable
if (delay <= 0 || user.isAuthorized("essentials.teleport.timer.bypass"))
{
cooldown(false);
- now(target);
+ now(target, cause);
if (chargeFor != null)
{
chargeFor.charge(user);
@@ -214,49 +230,52 @@ public class Teleport implements Runnable
Calendar c = new GregorianCalendar();
c.add(Calendar.SECOND, (int)delay);
c.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0));
- user.sendMessage(Util.format("dontMoveMessage", Util.formatDateDiff(c.getTimeInMillis())));
- initTimer((long)(delay * 1000.0), target, chargeFor);
+ user.sendMessage(_("dontMoveMessage", Util.formatDateDiff(c.getTimeInMillis())));
+ initTimer((long)(delay * 1000.0), target, chargeFor, cause);
teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
}
- private void now(Target target) throws Exception
+ private void now(Target target, TeleportCause cause) throws Exception
{
cancel();
user.setLastLocation();
- user.getBase().teleport(Util.getSafeDestination(target.getLocation()));
+ user.getBase().teleport(Util.getSafeDestination(target.getLocation()), cause);
}
- public void now(Location loc) throws Exception
+ public void now(Location loc, boolean cooldown, TeleportCause cause) throws Exception
{
- cooldown(false);
- now(new Target(loc));
+ if (cooldown)
+ {
+ cooldown(false);
+ }
+ now(new Target(loc), cause);
}
- public void now(Location loc, Trade chargeFor) throws Exception
+ public void now(Location loc, Trade chargeFor, TeleportCause cause) throws Exception
{
cooldown(false);
chargeFor.charge(user);
- now(new Target(loc));
+ now(new Target(loc), cause);
}
- public void now(Entity entity, boolean cooldown) throws Exception
+ public void now(Entity entity, boolean cooldown, TeleportCause cause) throws Exception
{
if (cooldown)
{
cooldown(false);
}
- now(new Target(entity));
+ now(new Target(entity), cause);
}
public void back(Trade chargeFor) throws Exception
{
- teleport(new Target(user.getLastLocation()), chargeFor);
+ teleport(new Target(user.getLastLocation()), chargeFor, TeleportCause.COMMAND);
}
public void back() throws Exception
{
- now(new Target(user.getLastLocation()));
+ now(new Target(user.getLastLocation()), TeleportCause.COMMAND);
}
public void home(IUser user, String home, Trade chargeFor) throws Exception
@@ -266,6 +285,6 @@ public class Teleport implements Runnable
{
throw new NotEnoughArgumentsException();
}
- teleport(new Target(loc), chargeFor);
+ teleport(new Target(loc), chargeFor, TeleportCause.COMMAND);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java
index 69f6478f7..6cd9ce93a 100644
--- a/Essentials/src/com/earth2me/essentials/Trade.java
+++ b/Essentials/src/com/earth2me/essentials/Trade.java
@@ -1,10 +1,14 @@
package com.earth2me.essentials;
+import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
+import com.earth2me.essentials.craftbukkit.SetExpFix;
+import static com.earth2me.essentials.I18n._;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DateFormat;
import java.util.Date;
+import java.util.Locale;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -17,28 +21,35 @@ public class Trade
private final transient String command;
private final transient Double money;
private final transient ItemStack itemStack;
+ private final transient Integer exp;
private final transient IEssentials ess;
public Trade(final String command, final IEssentials ess)
{
- this(command, null, null, ess);
+ this(command, null, null, null, ess);
}
public Trade(final double money, final IEssentials ess)
{
- this(null, money, null, ess);
+ this(null, money, null, null, ess);
}
public Trade(final ItemStack items, final IEssentials ess)
{
- this(null, null, items, ess);
+ this(null, null, items, null, ess);
+ }
+
+ public Trade(final int exp, final IEssentials ess)
+ {
+ this(null, null, null, exp, ess);
}
- private Trade(final String command, final Double money, final ItemStack item, final IEssentials ess)
+ private Trade(final String command, final Double money, final ItemStack item, final Integer exp, final IEssentials ess)
{
this.command = command;
this.money = money;
this.itemStack = item;
+ this.exp = exp;
this.ess = ess;
}
@@ -50,13 +61,13 @@ public class Trade
&& getMoney() > 0
&& !user.isAuthorized("essentials.eco.loan"))
{
- throw new ChargeException(Util.i18n("notEnoughMoney"));
+ throw new ChargeException(_("notEnoughMoney"));
}
if (getItemStack() != null
- && !InventoryWorkaround.containsItem(user.getInventory(), true, itemStack))
+ && !InventoryWorkaround.containsItem(user.getInventory(), true, true, itemStack))
{
- throw new ChargeException(Util.format("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase().replace("_", " ")));
+ throw new ChargeException(_("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " ")));
}
if (command != null && !command.isEmpty()
@@ -66,7 +77,12 @@ public class Trade
&& 0 < ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command)
&& !user.isAuthorized("essentials.eco.loan"))
{
- throw new ChargeException(Util.i18n("notEnoughMoney"));
+ throw new ChargeException(_("notEnoughMoney"));
+ }
+
+ if (exp != null && exp > 0
+ && SetExpFix.getTotalExperience(user) < exp) {
+ throw new ChargeException(_("notEnoughExperience"));
}
}
@@ -98,6 +114,10 @@ public class Trade
}
user.updateInventory();
}
+ if (getExperience() != null)
+ {
+ SetExpFix.setTotalExperience(user, SetExpFix.getTotalExperience(user) + getExperience());
+ }
return success;
}
@@ -108,17 +128,17 @@ public class Trade
final double mon = user.getMoney();
if (mon < getMoney() && getMoney() > 0 && !user.isAuthorized("essentials.eco.loan"))
{
- throw new ChargeException(Util.i18n("notEnoughMoney"));
+ throw new ChargeException(_("notEnoughMoney"));
}
user.takeMoney(getMoney());
}
if (getItemStack() != null)
{
- if (!InventoryWorkaround.containsItem(user.getInventory(), true, itemStack))
+ if (!InventoryWorkaround.containsItem(user.getInventory(), true, true, itemStack))
{
- throw new ChargeException(Util.format("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase().replace("_", " ")));
+ throw new ChargeException(_("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " ")));
}
- InventoryWorkaround.removeItem(user.getInventory(), true, getItemStack());
+ InventoryWorkaround.removeItem(user.getInventory(), true, true, getItemStack());
user.updateInventory();
}
if (command != null && !command.isEmpty()
@@ -129,10 +149,19 @@ public class Trade
final double cost = ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command);
if (mon < cost && cost > 0 && !user.isAuthorized("essentials.eco.loan"))
{
- throw new ChargeException(Util.i18n("notEnoughMoney"));
+ throw new ChargeException(_("notEnoughMoney"));
}
user.takeMoney(cost);
}
+ if (getExperience() != null)
+ {
+ final int experience = SetExpFix.getTotalExperience(user);
+ if (experience < getExperience() && getExperience() > 0)
+ {
+ throw new ChargeException(_("notEnoughExperience"));
+ }
+ SetExpFix.setTotalExperience(user, experience - getExperience());
+ }
}
public Double getMoney()
@@ -144,6 +173,11 @@ public class Trade
{
return itemStack;
}
+
+ public Integer getExperience()
+ {
+ return exp;
+ }
private static FileWriter fw = null;
public static void log(String type, String subtype, String event, String sender, Trade charge, String receiver, Trade pay, Location loc, IEssentials ess)
@@ -190,6 +224,12 @@ public class Trade
sb.append("money").append(",");
sb.append(ess.getSettings().getCurrencySymbol());
}
+ if (charge.getExperience() != null)
+ {
+ sb.append(charge.getExperience()).append(",");
+ sb.append("exp").append(",");
+ sb.append("\"\"");
+ }
}
sb.append(",\"");
if (receiver != null)
@@ -215,6 +255,12 @@ public class Trade
sb.append("money").append(",");
sb.append(ess.getSettings().getCurrencySymbol());
}
+ if (pay.getExperience() != null)
+ {
+ sb.append(pay.getExperience()).append(",");
+ sb.append("exp").append(",");
+ sb.append("\"\"");
+ }
}
if (loc == null)
{
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java
index f0754cdb4..e23fe1de0 100644
--- a/Essentials/src/com/earth2me/essentials/User.java
+++ b/Essentials/src/com/earth2me/essentials/User.java
@@ -1,9 +1,12 @@
package com.earth2me.essentials;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.commands.IEssentialsCommand;
import com.earth2me.essentials.register.payment.Method;
import java.util.Calendar;
import java.util.GregorianCalendar;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
@@ -16,16 +19,21 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
private transient User teleportRequester;
private transient boolean teleportRequestHere;
private transient final Teleport teleport;
+ private transient long teleportRequestTime;
private transient long lastOnlineActivity;
private transient long lastActivity = System.currentTimeMillis();
private boolean hidden = false;
- private transient Location afkPosition;
+ private transient Location afkPosition = null;
+ private static final Logger logger = Logger.getLogger("Minecraft");
User(final Player base, final IEssentials ess)
{
super(base, ess);
teleport = new Teleport(this, ess);
- afkPosition = getLocation();
+ if (isAfk())
+ {
+ afkPosition = getLocation();
+ }
}
User update(final Player base)
@@ -79,7 +87,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
cooldownTime.add(Calendar.MILLISECOND, (int)((cooldown * 1000.0) % 1000.0));
if (cooldownTime.after(now) && !isAuthorized("essentials.heal.cooldown.bypass"))
{
- throw new Exception(Util.format("timeBeforeHeal", Util.formatDateDiff(cooldownTime.getTimeInMillis())));
+ throw new Exception(_("timeBeforeHeal", Util.formatDateDiff(cooldownTime.getTimeInMillis())));
}
}
setLastHealTimestamp(now.getTimeInMillis());
@@ -98,10 +106,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
return;
}
setMoney(getMoney() + value);
- sendMessage(Util.format("addedToAccount", Util.formatCurrency(value, ess)));
+ sendMessage(_("addedToAccount", Util.formatCurrency(value, ess)));
if (initiator != null)
{
- initiator.sendMessage(Util.format("addedToOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName()));
+ initiator.sendMessage(_("addedToOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName()));
}
}
@@ -115,12 +123,12 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
{
setMoney(getMoney() - value);
reciever.setMoney(reciever.getMoney() + value);
- sendMessage(Util.format("moneySentTo", Util.formatCurrency(value, ess), reciever.getDisplayName()));
- reciever.sendMessage(Util.format("moneyRecievedFrom", Util.formatCurrency(value, ess), getDisplayName()));
+ sendMessage(_("moneySentTo", Util.formatCurrency(value, ess), reciever.getDisplayName()));
+ reciever.sendMessage(_("moneyRecievedFrom", Util.formatCurrency(value, ess), getDisplayName()));
}
else
{
- throw new Exception(Util.i18n("notEnoughMoney"));
+ throw new Exception(_("notEnoughMoney"));
}
}
@@ -137,10 +145,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
return;
}
setMoney(getMoney() - value);
- sendMessage(Util.format("takenFromAccount", Util.formatCurrency(value, ess)));
+ sendMessage(_("takenFromAccount", Util.formatCurrency(value, ess)));
if (initiator != null)
{
- initiator.sendMessage(Util.format("takenFromOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName()));
+ initiator.sendMessage(_("takenFromOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName()));
}
}
@@ -170,7 +178,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
@Override
public int compareTo(final User other)
{
- return ChatColor.stripColor(this.getDisplayName()).compareToIgnoreCase(ChatColor.stripColor(other.getDisplayName()));
+ return Util.stripColor(this.getDisplayName()).compareToIgnoreCase(Util.stripColor(other.getDisplayName()));
}
@Override
@@ -180,14 +188,14 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
{
return false;
}
- return ChatColor.stripColor(this.getDisplayName()).equalsIgnoreCase(ChatColor.stripColor(((User)object).getDisplayName()));
+ return this.getName().equalsIgnoreCase(((User)object).getName());
}
@Override
public int hashCode()
{
- return ChatColor.stripColor(this.getDisplayName()).hashCode();
+ return this.getName().hashCode();
}
public Boolean canSpawnItem(final int itemId)
@@ -218,6 +226,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
public void requestTeleport(final User player, final boolean here)
{
+ teleportRequestTime = System.currentTimeMillis();
teleportRequester = player;
teleportRequestHere = here;
}
@@ -232,7 +241,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
return teleportRequestHere;
}
- public String getNick()
+ public String getNick(boolean addprefixsuffix)
{
final StringBuilder nickname = new StringBuilder();
final String nick = getNickname();
@@ -256,9 +265,8 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
}
}
- if (ess.getSettings().addPrefixSuffix())
+ if (addprefixsuffix && ess.getSettings().addPrefixSuffix())
{
-
if (!ess.getSettings().disablePrefix())
{
final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
@@ -282,19 +290,35 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
return nickname.toString();
}
- public void setDisplayNick(String name)
+ public void setDisplayNick()
{
+ String name = getNick(true);
setDisplayName(name);
- //TODO: Maybe we need to limit nick length, or try use a string trim.
- if (name.length() <= 16)
+ if (name.length() > 16)
+ {
+ name = getNick(false);
+ }
+ if (name.length() > 16)
+ {
+ name = name.substring(0, name.charAt(15) == '§' ? 15 : 16);
+ }
+ try
{
setPlayerListName(name);
}
+ catch (IllegalArgumentException e)
+ {
+ logger.log(Level.INFO, "Playerlist for " + name + " was not updated. Use a shorter displayname prefix.");
+ }
}
@Override
public String getDisplayName()
{
+ if (!(base instanceof OfflinePlayer) && ess.getSettings().changeDisplayName())
+ {
+ setDisplayNick();
+ }
return super.getDisplayName() == null ? super.getName() : super.getDisplayName();
}
@@ -365,6 +389,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
{
afkPosition = getLocation();
}
+ else if (!set && isAfk())
+ {
+ afkPosition = null;
+ }
super.setAfk(set);
}
@@ -376,6 +404,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
return now;
}
+ @Override
public boolean isHidden()
{
return hidden;
@@ -393,7 +422,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
{
setJailTimeout(0);
setJailed(false);
- sendMessage(Util.i18n("haveBeenReleased"));
+ sendMessage(_("haveBeenReleased"));
setJail(null);
try
{
@@ -413,7 +442,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
if (getMuteTimeout() > 0 && getMuteTimeout() < currentTime && isMuted())
{
setMuteTimeout(0);
- sendMessage(Util.i18n("canTalkAgain"));
+ sendMessage(_("canTalkAgain"));
setMuted(false);
return true;
}
@@ -439,7 +468,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
setAfk(false);
if (broadcast && !isHidden())
{
- ess.broadcastMessage(this, Util.format("userIsNotAway", getDisplayName()));
+ ess.broadcastMessage(this, _("userIsNotAway", getDisplayName()));
}
}
lastActivity = System.currentTimeMillis();
@@ -448,10 +477,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
public void checkActivity()
{
final long autoafkkick = ess.getSettings().getAutoAfkKick();
- if (autoafkkick > 0 && lastActivity + autoafkkick * 1000 < System.currentTimeMillis()
+ if (autoafkkick > 0 && lastActivity > 0 && (lastActivity + (autoafkkick * 1000)) < System.currentTimeMillis()
&& !isHidden() && !isAuthorized("essentials.kick.exempt") && !isAuthorized("essentials.afk.kickexempt"))
{
- final String kickReason = Util.format("autoAfkKickReason", autoafkkick / 60.0);
+ final String kickReason = _("autoAfkKickReason", autoafkkick / 60.0);
+ lastActivity = 0;
kickPlayer(kickReason);
@@ -460,7 +490,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
final User user = ess.getUser(player);
if (user.isAuthorized("essentials.kick.notify"))
{
- player.sendMessage(Util.format("playerKicked", Console.NAME, getName(), kickReason));
+ player.sendMessage(_("playerKicked", Console.NAME, getName(), kickReason));
}
}
}
@@ -470,7 +500,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
setAfk(true);
if (!isHidden())
{
- ess.broadcastMessage(this, Util.format("userIsAway", getDisplayName()));
+ ess.broadcastMessage(this, _("userIsAway", getDisplayName()));
}
}
}
@@ -493,6 +523,32 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
@Override
public boolean isGodModeEnabled()
{
- return super.isGodModeEnabled() || (isAfk() && ess.getSettings().getFreezeAfkPlayers());
+ return (super.isGodModeEnabled() && !ess.getSettings().getNoGodWorlds().contains(getLocation().getWorld().getName()))
+ || (isAfk() && ess.getSettings().getFreezeAfkPlayers());
+ }
+
+ public boolean isGodModeEnabledRaw()
+ {
+ return super.isGodModeEnabled();
+ }
+
+ public String getGroup()
+ {
+ return ess.getPermissionsHandler().getGroup(base);
+ }
+
+ public boolean inGroup(final String group)
+ {
+ return ess.getPermissionsHandler().inGroup(base, group);
+ }
+
+ public boolean canBuild()
+ {
+ return ess.getPermissionsHandler().canBuild(base, getGroup());
+ }
+
+ public long getTeleportRequestTime()
+ {
+ return teleportRequestTime;
}
}
diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java
index f0a461b70..e2a365ad2 100644
--- a/Essentials/src/com/earth2me/essentials/UserData.java
+++ b/Essentials/src/com/earth2me/essentials/UserData.java
@@ -1,11 +1,7 @@
package com.earth2me.essentials;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.Material;
@@ -15,12 +11,14 @@ import org.bukkit.inventory.ItemStack;
public abstract class UserData extends PlayerExtension implements IConf
{
+ protected final transient IEssentials ess;
private final EssentialsConf config;
private static final Logger logger = Logger.getLogger("Minecraft");
protected UserData(Player base, IEssentials ess)
{
- super(base, ess);
+ super(base);
+ this.ess = ess;
File folder = new File(ess.getDataFolder(), "userdata");
if (!folder.exists())
{
@@ -30,6 +28,7 @@ public abstract class UserData extends PlayerExtension implements IConf
reloadConfig();
}
+ @Override
public final void reloadConfig()
{
config.load();
@@ -52,8 +51,8 @@ public abstract class UserData extends PlayerExtension implements IConf
jailTimeout = _getJailTimeout();
lastLogin = _getLastLogin();
lastLogout = _getLastLogout();
+ lastLoginAddress = _getLastLoginAddress();
afk = getAfk();
- newplayer = getNew();
geolocation = _getGeoLocation();
isSocialSpyEnabled = _isSocialSpyEnabled();
isNPC = _isNPC();
@@ -130,27 +129,32 @@ public abstract class UserData extends PlayerExtension implements IConf
return loc;
}
- public Location getHome(Location world) throws Exception
+ public Location getHome(final Location world)
{
- Location loc;
- for (String home : getHomes())
+ try
{
- loc = config.getLocation("homes." + home, getServer());
- if (world.getWorld() == loc.getWorld())
+ Location loc;
+ for (String home : getHomes())
{
- return loc;
- }
+ loc = config.getLocation("homes." + home, getServer());
+ if (world.getWorld() == loc.getWorld())
+ {
+ return loc;
+ }
+ }
+ loc = config.getLocation("homes." + getHomes().get(0), getServer());
+ return loc;
+ }
+ catch (Exception ex)
+ {
+ return null;
}
- loc = config.getLocation("homes." + getHomes().get(0), getServer());
- return loc;
}
public List<String> getHomes()
{
- List<String> list = new ArrayList(homes.keySet());
- return list;
-
+ return new ArrayList(homes.keySet());
}
public void setHome(String name, Location loc)
@@ -260,6 +264,11 @@ public abstract class UserData extends PlayerExtension implements IConf
{
return (List<String>)powertools.get(stack.getTypeId());
}
+
+ public List<String> getPowertool(int id)
+ {
+ return (List<String>)powertools.get(id);
+ }
public void setPowertool(ItemStack stack, List<String> commandList)
{
@@ -277,7 +286,7 @@ public abstract class UserData extends PlayerExtension implements IConf
public boolean hasPowerTools()
{
- return powertools.size() > 0;
+ return !powertools.isEmpty();
}
private Location lastLocation;
@@ -502,18 +511,18 @@ public abstract class UserData extends PlayerExtension implements IConf
public boolean isIgnoredPlayer(String name)
{
- return ignoredPlayers.contains(name.toLowerCase());
+ return ignoredPlayers.contains(name.toLowerCase(Locale.ENGLISH));
}
public void setIgnoredPlayer(String name, boolean set)
{
if (set)
{
- ignoredPlayers.add(name.toLowerCase());
+ ignoredPlayers.add(name.toLowerCase(Locale.ENGLISH));
}
else
{
- ignoredPlayers.remove(name.toLowerCase());
+ ignoredPlayers.remove(name.toLowerCase(Locale.ENGLISH));
}
setIgnoredPlayers(ignoredPlayers);
}
@@ -686,6 +695,24 @@ public abstract class UserData extends PlayerExtension implements IConf
config.setProperty("timestamps.logout", time);
config.save();
}
+ private String lastLoginAddress;
+
+ private String _getLastLoginAddress()
+ {
+ return config.getString("ipAddress", "");
+ }
+
+ public String getLastLoginAddress()
+ {
+ return lastLoginAddress;
+ }
+
+ public void setLastLoginAddress(String address)
+ {
+ lastLoginAddress = address;
+ config.setProperty("ipAddress", address);
+ config.save();
+ }
private boolean afk;
private boolean getAfk()
@@ -713,22 +740,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()
@@ -834,14 +845,19 @@ public abstract class UserData extends PlayerExtension implements IConf
public Long getKitTimestamp(final String name)
{
- final Number num = (Number)kitTimestamps.get(name.toLowerCase());
+ final Number num = (Number)kitTimestamps.get(name.toLowerCase(Locale.ENGLISH));
return num == null ? null : num.longValue();
}
public void setKitTimestamp(final String name, final long time)
{
- kitTimestamps.put(name.toLowerCase(), time);
+ kitTimestamps.put(name.toLowerCase(Locale.ENGLISH), time);
config.setProperty("timestamps.kits", kitTimestamps);
config.save();
}
+
+ public void save()
+ {
+ config.save();
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/UserMap.java b/Essentials/src/com/earth2me/essentials/UserMap.java
index 580b2aaf9..d15438c7d 100644
--- a/Essentials/src/com/earth2me/essentials/UserMap.java
+++ b/Essentials/src/com/earth2me/essentials/UserMap.java
@@ -1,24 +1,26 @@
package com.earth2me.essentials;
-import com.google.common.base.Function;
-import com.google.common.collect.ComputationException;
-import com.google.common.collect.MapMaker;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.util.concurrent.UncheckedExecutionException;
import java.io.File;
-import java.util.HashSet;
+import java.util.Collections;
import java.util.Set;
-import java.util.concurrent.ConcurrentMap;
-import java.util.logging.Level;
-import org.bukkit.Bukkit;
+import java.util.concurrent.ConcurrentSkipListSet;
+import java.util.concurrent.ExecutionException;
import org.bukkit.entity.Player;
-public class UserMap implements Function<String, User>, IConf
+public class UserMap extends CacheLoader<String, User> implements IConf
{
private final transient IEssentials ess;
- private final transient ConcurrentMap<String, User> users = new MapMaker().softValues().makeComputingMap(this);
+ private final transient Cache<String, User> users = CacheBuilder.newBuilder().softValues().build(this);
+ private final transient ConcurrentSkipListSet<String> keys = new ConcurrentSkipListSet<String>();
public UserMap(final IEssentials ess)
{
+ super();
this.ess = ess;
loadAllUsersAsync(ess);
}
@@ -35,6 +37,8 @@ public class UserMap implements Function<String, User>, IConf
{
return;
}
+ keys.clear();
+ users.invalidateAll();
for (String string : userdir.list())
{
if (!string.endsWith(".yml"))
@@ -42,18 +46,7 @@ public class UserMap implements Function<String, User>, IConf
continue;
}
final String name = string.substring(0, string.length() - 4);
- try
- {
- users.get(name.toLowerCase());
- }
- catch (NullPointerException ex)
- {
- // Ignore these
- }
- catch (ComputationException ex)
- {
- Bukkit.getLogger().log(Level.INFO, "Failed to preload user " + name, ex);
- }
+ keys.add(Util.sanitizeFileName(name));
}
}
});
@@ -61,59 +54,70 @@ public class UserMap implements Function<String, User>, IConf
public boolean userExists(final String name)
{
- return users.containsKey(name.toLowerCase());
+ return keys.contains(Util.sanitizeFileName(name));
}
- public User getUser(final String name) throws NullPointerException
+ public User getUser(final String name)
{
- return users.get(name.toLowerCase());
+ try
+ {
+ return users.get(Util.sanitizeFileName(name));
+ }
+ catch (ExecutionException ex)
+ {
+ return null;
+ }
+ catch (UncheckedExecutionException ex)
+ {
+ return null;
+ }
}
@Override
- public User apply(final String name)
+ public User load(final String name) throws Exception
{
for (Player player : ess.getServer().getOnlinePlayers())
{
if (player.getName().equalsIgnoreCase(name))
{
+ keys.add(Util.sanitizeFileName(name));
return new User(player, ess);
}
}
- final File userFolder = new File(ess.getDataFolder(), "userdata");
- final File userFile = new File(userFolder, Util.sanitizeFileName(name) + ".yml");
+ final File userFile = getUserFile(name);
if (userFile.exists())
{
+ keys.add(Util.sanitizeFileName(name));
return new User(new OfflinePlayer(name, ess), ess);
}
- return null;
+ throw new Exception("User not found!");
}
@Override
public void reloadConfig()
{
- for (User user : users.values())
- {
- user.reloadConfig();
- }
+ loadAllUsersAsync(ess);
}
public void removeUser(final String name)
{
- users.remove(name.toLowerCase());
+ keys.remove(Util.sanitizeFileName(name));
+ users.invalidate(Util.sanitizeFileName(name));
}
- public Set<User> getAllUsers()
+ public Set<String> getAllUniqueUsers()
{
- final Set<User> userSet = new HashSet<User>();
- for (String name : users.keySet())
- {
- userSet.add(users.get(name));
- }
- return userSet;
+ return Collections.unmodifiableSet(keys);
}
public int getUniqueUsers()
{
- return users.size();
+ return keys.size();
+ }
+
+ public File getUserFile(final String name)
+ {
+ final File userFolder = new File(ess.getDataFolder(), "userdata");
+ return new File(userFolder, Util.sanitizeFileName(name) + ".yml");
}
}
diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java
index c1b0ed7bf..eeb2dd6d6 100644
--- a/Essentials/src/com/earth2me/essentials/Util.java
+++ b/Essentials/src/com/earth2me/essentials/Util.java
@@ -1,26 +1,9 @@
package com.earth2me.essentials;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
+import static com.earth2me.essentials.I18n._;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
-import java.text.MessageFormat;
-import java.util.Calendar;
-import java.util.Enumeration;
-import java.util.GregorianCalendar;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.Set;
-import java.util.logging.Level;
+import java.util.*;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -28,6 +11,8 @@ import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.inventory.ItemStack;
public class Util
@@ -36,10 +21,11 @@ public class Util
{
}
private final static Logger logger = Logger.getLogger("Minecraft");
+ private final static Pattern INVALIDCHARS = Pattern.compile("[^a-z0-9]");
- public static String sanitizeFileName(String name)
+ public static String sanitizeFileName(final String name)
{
- return name.toLowerCase().replaceAll("[^a-z0-9]", "_");
+ return INVALIDCHARS.matcher(name.toLowerCase(Locale.ENGLISH)).replaceAll("_");
}
public static String formatDateDiff(long date)
@@ -55,7 +41,7 @@ public class Util
boolean future = false;
if (toDate.equals(fromDate))
{
- return Util.i18n("now");
+ return _("now");
}
if (toDate.after(fromDate))
{
@@ -74,18 +60,18 @@ public class Util
};
String[] names = new String[]
{
- Util.i18n("year"),
- Util.i18n("years"),
- Util.i18n("month"),
- Util.i18n("months"),
- Util.i18n("day"),
- Util.i18n("days"),
- Util.i18n("hour"),
- Util.i18n("hours"),
- Util.i18n("minute"),
- Util.i18n("minutes"),
- Util.i18n("second"),
- Util.i18n("seconds")
+ _("year"),
+ _("years"),
+ _("month"),
+ _("months"),
+ _("day"),
+ _("days"),
+ _("hour"),
+ _("hours"),
+ _("minute"),
+ _("minutes"),
+ _("second"),
+ _("seconds")
};
for (int i = 0; i < types.length; i++)
{
@@ -185,7 +171,7 @@ public class Util
}
if (!found)
{
- throw new Exception(Util.i18n("illegalDate"));
+ throw new Exception(_("illegalDate"));
}
Calendar c = new GregorianCalendar();
if (years > 0)
@@ -218,11 +204,12 @@ public class Util
}
return c.getTimeInMillis();
}
-
// The player can stand inside these materials
private static final Set<Integer> AIR_MATERIALS = new HashSet<Integer>();
-
- static {
+ private static final HashSet<Byte> AIR_MATERIALS_TARGET = new HashSet<Byte>();
+
+ static
+ {
AIR_MATERIALS.add(Material.AIR.getId());
AIR_MATERIALS.add(Material.SAPLING.getId());
AIR_MATERIALS.add(Material.POWERED_RAIL.getId());
@@ -232,7 +219,7 @@ public class Util
AIR_MATERIALS.add(Material.YELLOW_FLOWER.getId());
AIR_MATERIALS.add(Material.RED_ROSE.getId());
AIR_MATERIALS.add(Material.BROWN_MUSHROOM.getId());
- AIR_MATERIALS.add(Material.RED_MUSHROOM.getId());
+ AIR_MATERIALS.add(Material.RED_MUSHROOM.getId());
AIR_MATERIALS.add(Material.TORCH.getId());
AIR_MATERIALS.add(Material.REDSTONE_WIRE.getId());
AIR_MATERIALS.add(Material.SEEDS.getId());
@@ -244,32 +231,49 @@ public class Util
AIR_MATERIALS.add(Material.LEVER.getId());
AIR_MATERIALS.add(Material.STONE_PLATE.getId());
AIR_MATERIALS.add(Material.IRON_DOOR_BLOCK.getId());
- AIR_MATERIALS.add(Material.WOOD_PLATE.getId());
+ AIR_MATERIALS.add(Material.WOOD_PLATE.getId());
AIR_MATERIALS.add(Material.REDSTONE_TORCH_OFF.getId());
AIR_MATERIALS.add(Material.REDSTONE_TORCH_ON.getId());
AIR_MATERIALS.add(Material.STONE_BUTTON.getId());
- AIR_MATERIALS.add(Material.SUGAR_CANE_BLOCK.getId());
+ AIR_MATERIALS.add(Material.SUGAR_CANE_BLOCK.getId());
AIR_MATERIALS.add(Material.DIODE_BLOCK_OFF.getId());
- AIR_MATERIALS.add(Material.DIODE_BLOCK_ON.getId());
+ AIR_MATERIALS.add(Material.DIODE_BLOCK_ON.getId());
AIR_MATERIALS.add(Material.TRAP_DOOR.getId());
AIR_MATERIALS.add(Material.PUMPKIN_STEM.getId());
AIR_MATERIALS.add(Material.MELON_STEM.getId());
AIR_MATERIALS.add(Material.VINE.getId());
- //TODO: Add 1.9 materials
-
+ AIR_MATERIALS.add(Material.NETHER_WARTS.getId());
+ AIR_MATERIALS.add(Material.WATER_LILY.getId());
+
+ for (Integer integer : AIR_MATERIALS)
+ {
+ AIR_MATERIALS_TARGET.add(integer.byteValue());
+ }
+ AIR_MATERIALS_TARGET.add((byte)Material.WATER.getId());
+ AIR_MATERIALS_TARGET.add((byte)Material.STATIONARY_WATER.getId());
}
-
+
+ public static Location getTarget(final LivingEntity entity) throws Exception
+ {
+ final Block block = entity.getTargetBlock(AIR_MATERIALS_TARGET, 300);
+ if (block == null)
+ {
+ throw new Exception("Not targeting a block");
+ }
+ return block.getLocation();
+ }
+
public static Location getSafeDestination(final Location loc) throws Exception
{
if (loc == null || loc.getWorld() == null)
{
- throw new Exception(Util.i18n("destinationNotSet"));
+ throw new Exception(_("destinationNotSet"));
}
final World world = loc.getWorld();
int x = loc.getBlockX();
int y = (int)Math.round(loc.getY());
int z = loc.getBlockZ();
-
+
while (isBlockAboveAir(world, x, y, z))
{
y -= 1;
@@ -297,7 +301,7 @@ public class Util
x += 1;
if (x - 32 > loc.getBlockX())
{
- throw new Exception(Util.i18n("holeInFloor"));
+ throw new Exception(_("holeInFloor"));
}
}
}
@@ -329,6 +333,88 @@ public class Util
}
return isBlockAboveAir(world, x, y, z);
}
+
+ public static ItemStack convertBlockToItem(final Block block)
+ {
+ final ItemStack is = new ItemStack(block.getType(), 1, (short)0, block.getData());
+ switch (is.getType())
+ {
+ case WOODEN_DOOR:
+ is.setType(Material.WOOD_DOOR);
+ is.setDurability((short)0);
+ break;
+ case IRON_DOOR_BLOCK:
+ is.setType(Material.IRON_DOOR);
+ is.setDurability((short)0);
+ break;
+ case SIGN_POST:
+ case WALL_SIGN:
+ is.setType(Material.SIGN);
+ is.setDurability((short)0);
+ break;
+ case CROPS:
+ is.setType(Material.SEEDS);
+ is.setDurability((short)0);
+ break;
+ case CAKE_BLOCK:
+ is.setType(Material.CAKE);
+ is.setDurability((short)0);
+ break;
+ case BED_BLOCK:
+ is.setType(Material.BED);
+ is.setDurability((short)0);
+ break;
+ case REDSTONE_WIRE:
+ is.setType(Material.REDSTONE);
+ is.setDurability((short)0);
+ break;
+ case REDSTONE_TORCH_OFF:
+ case REDSTONE_TORCH_ON:
+ is.setType(Material.REDSTONE_TORCH_ON);
+ is.setDurability((short)0);
+ break;
+ case DIODE_BLOCK_OFF:
+ case DIODE_BLOCK_ON:
+ is.setType(Material.DIODE);
+ is.setDurability((short)0);
+ break;
+ case DOUBLE_STEP:
+ is.setType(Material.STEP);
+ break;
+ case TORCH:
+ case RAILS:
+ case LADDER:
+ case WOOD_STAIRS:
+ case COBBLESTONE_STAIRS:
+ case LEVER:
+ case STONE_BUTTON:
+ case FURNACE:
+ case DISPENSER:
+ case PUMPKIN:
+ case JACK_O_LANTERN:
+ case WOOD_PLATE:
+ case STONE_PLATE:
+ case PISTON_STICKY_BASE:
+ case PISTON_BASE:
+ case IRON_FENCE:
+ case THIN_GLASS:
+ case TRAP_DOOR:
+ case FENCE:
+ case FENCE_GATE:
+ case NETHER_FENCE:
+ is.setDurability((short)0);
+ break;
+ case FIRE:
+ return null;
+ case PUMPKIN_STEM:
+ is.setType(Material.PUMPKIN_SEEDS);
+ break;
+ case MELON_STEM:
+ is.setType(Material.MELON_SEEDS);
+ break;
+ }
+ return is;
+ }
private static DecimalFormat df = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.US));
public static String formatCurrency(final double value, final IEssentials ess)
@@ -346,175 +432,24 @@ public class Util
return Math.round(d * 100.0) / 100.0;
}
- public static Locale getCurrentLocale()
- {
- return currentLocale;
- }
-
-
- private static class ConfigClassLoader extends ClassLoader
- {
- private final transient File dataFolder;
- private final transient ClassLoader cl;
- private final transient IEssentials ess;
-
- public ConfigClassLoader(final ClassLoader cl, final IEssentials ess)
- {
- this.ess = ess;
- this.dataFolder = ess.getDataFolder();
- this.cl = cl;
- }
-
- @Override
- public URL getResource(final String string)
- {
- final File file = new File(dataFolder, string);
- if (file.exists())
- {
- try
- {
- return file.toURI().toURL();
- }
- catch (MalformedURLException ex)
- {
- return cl.getResource(string);
- }
- }
- return cl.getResource(string);
- }
-
- @Override
- public synchronized void clearAssertionStatus()
- {
- cl.clearAssertionStatus();
- }
-
- @Override
- public InputStream getResourceAsStream(final String string)
- {
- final File file = new File(dataFolder, string);
- if (file.exists())
- {
- BufferedReader br = null;
- try
- {
- br = new BufferedReader(new FileReader(file));
- final String version = br.readLine();
-
- if (version == null || !version.equals("#version: " + ess.getDescription().getVersion()))
- {
- logger.log(Level.WARNING, String.format("Translation file %s is not updated for Essentials version. Will use default.", file));
- return cl.getResourceAsStream(string);
- }
- return new FileInputStream(file);
- }
- catch (IOException ex)
- {
- return cl.getResourceAsStream(string);
- }
- finally
- {
- if (br != null)
- {
- try
- {
- br.close();
- }
- catch (IOException ex)
- {
- }
- }
- }
- }
- return cl.getResourceAsStream(string);
- }
-
- @Override
- public Enumeration<URL> getResources(final String string) throws IOException
- {
- return cl.getResources(string);
- }
-
- @Override
- public Class<?> loadClass(final String string) throws ClassNotFoundException
- {
- return cl.loadClass(string);
- }
-
- @Override
- public synchronized void setClassAssertionStatus(final String string, final boolean bln)
- {
- cl.setClassAssertionStatus(string, bln);
- }
-
- @Override
- public synchronized void setDefaultAssertionStatus(final boolean bln)
- {
- cl.setDefaultAssertionStatus(bln);
- }
-
- @Override
- public synchronized void setPackageAssertionStatus(final String string, final boolean bln)
- {
- cl.setPackageAssertionStatus(string, bln);
- }
- }
- private static final Locale defaultLocale = Locale.getDefault();
- private static Locale currentLocale = defaultLocale;
- private static ResourceBundle bundle = ResourceBundle.getBundle("messages", defaultLocale);
- private static ResourceBundle defaultBundle = ResourceBundle.getBundle("messages", Locale.US);
-
- public static String i18n(String string)
+ public static boolean isInt(final String sInt)
{
try
{
- return bundle.getString(string);
+ Integer.parseInt(sInt);
}
- catch (MissingResourceException ex)
+ catch (NumberFormatException e)
{
- logger.log(Level.WARNING, String.format("Missing translation key \"%s\" in translation file %s", ex.getKey(), bundle.getLocale().toString()), ex);
- return defaultBundle.getString(string);
- }
- }
-
- public static String format(String string, Object... objects)
- {
- MessageFormat mf = new MessageFormat(i18n(string));
- return mf.format(objects);
- }
-
- public static void updateLocale(String loc, IEssentials ess)
- {
- if (loc == null || loc.isEmpty())
- {
- return;
- }
- String[] parts = loc.split("[_\\.]");
- if (parts.length == 1)
- {
- currentLocale = new Locale(parts[0]);
- }
- if (parts.length == 2)
- {
- currentLocale = new Locale(parts[0], parts[1]);
- }
- if (parts.length == 3)
- {
- currentLocale = new Locale(parts[0], parts[1], parts[2]);
- }
- logger.log(Level.INFO, String.format("Using locale %s", currentLocale.toString()));
- bundle = ResourceBundle.getBundle("messages", currentLocale, new ConfigClassLoader(Util.class.getClassLoader(), ess));
- if (!bundle.keySet().containsAll(defaultBundle.keySet()))
- {
- logger.log(Level.WARNING, String.format("Translation file %s does not contain all translation keys.", currentLocale.toString()));
+ return false;
}
+ return true;
}
public static String joinList(Object... list)
{
return joinList(", ", list);
}
-
+
public static String joinList(String seperator, Object... list)
{
StringBuilder buf = new StringBuilder();
@@ -524,14 +459,14 @@ public class Util
{
buf.append(seperator);
}
-
- if(each instanceof List)
+
+ if (each instanceof Collection)
{
- buf.append(joinList(seperator, ((List)each).toArray()));
+ buf.append(joinList(seperator, ((Collection)each).toArray()));
}
else
{
- try
+ try
{
buf.append(each.toString());
}
@@ -543,9 +478,15 @@ public class Util
}
return buf.toString();
}
-
- public static String capitalCase(String s)
+ private static transient final Pattern COLOR_PATTERN = Pattern.compile("\u00A7+[0-9A-FKa-fk]");
+
+ public static String stripColor(final String input)
{
- return s.toUpperCase().charAt(0) + s.toLowerCase().substring(1);
- }
+ if (input == null)
+ {
+ return null;
+ }
+
+ return COLOR_PATTERN.matcher(input).replaceAll("");
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/Warps.java b/Essentials/src/com/earth2me/essentials/Warps.java
index adf665f2a..57326b54a 100644
--- a/Essentials/src/com/earth2me/essentials/Warps.java
+++ b/Essentials/src/com/earth2me/essentials/Warps.java
@@ -1,12 +1,8 @@
package com.earth2me.essentials;
+import static com.earth2me.essentials.I18n._;
import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Location;
@@ -52,7 +48,7 @@ public class Warps implements IConf
EssentialsConf conf = warpPoints.get(new StringIgnoreCase(warp));
if (conf == null)
{
- throw new Exception(Util.i18n("warpNotExist"));
+ throw new Exception(_("warpNotExist"));
}
return conf.getLocation(null, server);
}
@@ -66,7 +62,7 @@ public class Warps implements IConf
File confFile = new File(warpsFolder, filename + ".yml");
if (confFile.exists())
{
- throw new Exception(Util.i18n("similarWarpExist"));
+ throw new Exception(_("similarWarpExist"));
}
conf = new EssentialsConf(confFile);
warpPoints.put(new StringIgnoreCase(name), conf);
@@ -81,15 +77,16 @@ public class Warps implements IConf
EssentialsConf conf = warpPoints.get(new StringIgnoreCase(name));
if (conf == null)
{
- throw new Exception(Util.i18n("warpNotExist"));
+ throw new Exception(_("warpNotExist"));
}
if (!conf.getFile().delete())
{
- throw new Exception(Util.i18n("warpDeleteError"));
+ throw new Exception(_("warpDeleteError"));
}
warpPoints.remove(new StringIgnoreCase(name));
}
+ @Override
public final void reloadConfig()
{
warpPoints.clear();
@@ -113,7 +110,7 @@ public class Warps implements IConf
}
catch (Exception ex)
{
- logger.log(Level.WARNING, Util.format("loadWarpError", filename), ex);
+ logger.log(Level.WARNING, _("loadWarpError", filename), ex);
}
}
}
@@ -133,7 +130,7 @@ public class Warps implements IConf
@Override
public int hashCode()
{
- return getString().toLowerCase().hashCode();
+ return getString().toLowerCase(Locale.ENGLISH).hashCode();
}
@Override
diff --git a/Essentials/src/com/earth2me/essentials/Worth.java b/Essentials/src/com/earth2me/essentials/Worth.java
index fd1426f10..b597bd3e8 100644
--- a/Essentials/src/com/earth2me/essentials/Worth.java
+++ b/Essentials/src/com/earth2me/essentials/Worth.java
@@ -1,6 +1,7 @@
package com.earth2me.essentials;
import java.io.File;
+import java.util.Locale;
import java.util.logging.Logger;
import org.bukkit.inventory.ItemStack;
@@ -19,7 +20,7 @@ public class Worth implements IConf
public double getPrice(ItemStack itemStack)
{
- String itemname = itemStack.getType().toString().toLowerCase().replace("_", "");
+ String itemname = itemStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
double result;
result = config.getDouble("worth." + itemname + "." + itemStack.getDurability(), Double.NaN);
if (Double.isNaN(result))
@@ -41,17 +42,18 @@ public class Worth implements IConf
{
if (itemStack.getType().getData() == null)
{
- config.setProperty("worth." + itemStack.getType().toString().toLowerCase().replace("_", ""), price);
+ config.setProperty("worth." + itemStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""), price);
}
else
{
// Bukkit-bug: getDurability still contains the correct value, while getData().getData() is 0.
- config.setProperty("worth." + itemStack.getType().toString().toLowerCase().replace("_", "") + "." + itemStack.getDurability(), price);
+ config.setProperty("worth." + itemStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "") + "." + itemStack.getDurability(), price);
}
config.removeProperty("worth-" + itemStack.getTypeId());
config.save();
}
+ @Override
public void reloadConfig()
{
config.load();
diff --git a/Essentials/src/com/earth2me/essentials/api/Economy.java b/Essentials/src/com/earth2me/essentials/api/Economy.java
index b0a267345..1d45c8df9 100644
--- a/Essentials/src/com/earth2me/essentials/api/Economy.java
+++ b/Essentials/src/com/earth2me/essentials/api/Economy.java
@@ -1,6 +1,7 @@
package com.earth2me.essentials.api;
import com.earth2me.essentials.EssentialsConf;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
@@ -59,7 +60,7 @@ public final class Economy
{
if (!config.delete())
{
- logger.log(Level.WARNING, Util.format("deleteFileError", config));
+ logger.log(Level.WARNING, _("deleteFileError", config));
}
ess.getUserMap().removeUser(name);
}
diff --git a/Essentials/src/com/earth2me/essentials/api/IAlternativeCommandsHandler.java b/Essentials/src/com/earth2me/essentials/api/IAlternativeCommandsHandler.java
new file mode 100644
index 000000000..11619bca4
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/api/IAlternativeCommandsHandler.java
@@ -0,0 +1,10 @@
+package com.earth2me.essentials.api;
+
+import java.util.Map;
+import org.bukkit.command.PluginCommand;
+
+
+public interface IAlternativeCommandsHandler
+{
+ Map<String, String> disabledCommands();
+}
diff --git a/Essentials/src/com/earth2me/essentials/api/IEssentials.java b/Essentials/src/com/earth2me/essentials/api/IEssentials.java
new file mode 100644
index 000000000..c04bed0bd
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/api/IEssentials.java
@@ -0,0 +1,51 @@
+package com.earth2me.essentials.api;
+
+import com.earth2me.essentials.perm.IPermissionsHandler;
+import com.earth2me.essentials.register.payment.Methods;
+import org.bukkit.World;
+import org.bukkit.command.CommandSender;
+import org.bukkit.plugin.Plugin;
+
+
+public interface IEssentials extends Plugin, IReload
+{
+ void addReloadListener(IReload listener);
+
+ IUser getUser(Object base);
+
+ int broadcastMessage(IUser sender, String message);
+
+ II18n getI18n();
+
+ ISettings getSettings();
+
+ IJails getJail();
+
+ IWarps getWarps();
+
+ IWorth getWorth();
+
+ IItemDb getItemDb();
+
+ IUserMap getUserMap();
+
+ IEssentialsEconomy getEconomy();
+
+ World getWorld(String name);
+
+ Methods getPaymentMethod();
+
+ int scheduleAsyncDelayedTask(Runnable run);
+
+ int scheduleSyncDelayedTask(Runnable run);
+
+ int scheduleSyncDelayedTask(Runnable run, long delay);
+
+ int scheduleSyncRepeatingTask(Runnable run, long delay, long period);
+
+ IPermissionsHandler getPermissionsHandler();
+
+ IAlternativeCommandsHandler getAlternativeCommandsHandler();
+
+ void showCommandError(CommandSender sender, String commandLabel, Throwable exception);
+}
diff --git a/Essentials/src/com/earth2me/essentials/api/IEssentialsEconomy.java b/Essentials/src/com/earth2me/essentials/api/IEssentialsEconomy.java
new file mode 100644
index 000000000..72fb89d26
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/api/IEssentialsEconomy.java
@@ -0,0 +1,37 @@
+package com.earth2me.essentials.api;
+
+
+public interface IEssentialsEconomy
+{
+ double getMoney(String name) throws UserDoesNotExistException;
+
+ void setMoney(String name, double balance) throws UserDoesNotExistException, NoLoanPermittedException;
+
+ void add(String name, double amount) throws UserDoesNotExistException, NoLoanPermittedException;
+
+ void subtract(String name, double amount) throws UserDoesNotExistException, NoLoanPermittedException;
+
+ void divide(String name, double value) throws UserDoesNotExistException, NoLoanPermittedException;
+
+ void multiply(String name, double value) throws UserDoesNotExistException, NoLoanPermittedException;
+
+ void resetBalance(String name) throws UserDoesNotExistException, NoLoanPermittedException;
+
+ boolean hasEnough(String name, double amount) throws UserDoesNotExistException;
+
+ boolean hasMore(String name, double amount) throws UserDoesNotExistException;
+
+ boolean hasLess(String name, double amount) throws UserDoesNotExistException;
+
+ boolean isNegative(String name) throws UserDoesNotExistException;
+
+ String format(double amount);
+
+ boolean playerExists(String name);
+
+ boolean isNPC(String name) throws UserDoesNotExistException;
+
+ boolean createNPC(String name);
+
+ void removeNPC(String name) throws UserDoesNotExistException;
+}
diff --git a/Essentials/src/com/earth2me/essentials/api/II18n.java b/Essentials/src/com/earth2me/essentials/api/II18n.java
new file mode 100644
index 000000000..567d4e59e
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/api/II18n.java
@@ -0,0 +1,9 @@
+package com.earth2me.essentials.api;
+
+import java.util.Locale;
+
+
+public interface II18n
+{
+ Locale getCurrentLocale();
+}
diff --git a/Essentials/src/com/earth2me/essentials/api/IItemDb.java b/Essentials/src/com/earth2me/essentials/api/IItemDb.java
new file mode 100644
index 000000000..ee4819215
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/api/IItemDb.java
@@ -0,0 +1,11 @@
+package com.earth2me.essentials.api;
+
+import org.bukkit.inventory.ItemStack;
+
+
+public interface IItemDb
+{
+ ItemStack get(final String name, final int quantity) throws Exception;
+
+ ItemStack get(final String name) throws Exception;
+}
diff --git a/Essentials/src/com/earth2me/essentials/api/IJails.java b/Essentials/src/com/earth2me/essentials/api/IJails.java
new file mode 100644
index 000000000..18866d8e5
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/api/IJails.java
@@ -0,0 +1,18 @@
+package com.earth2me.essentials.api;
+
+import java.util.Collection;
+import org.bukkit.Location;
+
+
+public interface IJails extends IReload
+{
+ Location getJail(String jailName) throws Exception;
+
+ Collection<String> getList() throws Exception;
+
+ void removeJail(String jail) throws Exception;
+
+ void sendToJail(com.earth2me.essentials.IUser user, String jail) throws Exception;
+
+ void setJail(String jailName, Location loc) throws Exception;
+}
diff --git a/Essentials/src/com/earth2me/essentials/api/IReload.java b/Essentials/src/com/earth2me/essentials/api/IReload.java
new file mode 100644
index 000000000..75403b55c
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/api/IReload.java
@@ -0,0 +1,7 @@
+package com.earth2me.essentials.api;
+
+
+public interface IReload
+{
+ void onReload();
+}
diff --git a/Essentials/src/com/earth2me/essentials/api/ISettings.java b/Essentials/src/com/earth2me/essentials/api/ISettings.java
new file mode 100644
index 000000000..eff65ad87
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/api/ISettings.java
@@ -0,0 +1,10 @@
+package com.earth2me.essentials.api;
+
+import com.earth2me.essentials.settings.Settings;
+import com.earth2me.essentials.storage.IStorageObjectHolder;
+
+
+public interface ISettings extends IStorageObjectHolder<Settings>
+{
+
+}
diff --git a/Essentials/src/com/earth2me/essentials/api/ITeleport.java b/Essentials/src/com/earth2me/essentials/api/ITeleport.java
new file mode 100644
index 000000000..5b9a19757
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/api/ITeleport.java
@@ -0,0 +1,10 @@
+package com.earth2me.essentials.api;
+
+import org.bukkit.Location;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
+
+
+public interface ITeleport
+{
+ void now(Location loc, boolean cooldown, TeleportCause cause) throws Exception;
+}
diff --git a/Essentials/src/com/earth2me/essentials/api/IUser.java b/Essentials/src/com/earth2me/essentials/api/IUser.java
new file mode 100644
index 000000000..5d2f9d4b8
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/api/IUser.java
@@ -0,0 +1,43 @@
+package com.earth2me.essentials.api;
+
+import com.earth2me.essentials.commands.IEssentialsCommand;
+import org.bukkit.Location;
+import org.bukkit.entity.Player;
+
+
+public interface IUser extends Player, IReload
+{
+ long getLastTeleportTimestamp();
+
+ boolean isAuthorized(String node);
+
+ boolean isAuthorized(IEssentialsCommand cmd);
+
+ boolean isAuthorized(IEssentialsCommand cmd, String permissionPrefix);
+
+ void setLastTeleportTimestamp(long time);
+
+ Location getLastLocation();
+
+ Player getBase();
+
+ double getMoney();
+
+ void takeMoney(double value);
+
+ void giveMoney(double value);
+
+ String getGroup();
+
+ void setLastLocation();
+
+ Location getHome(String name) throws Exception;
+
+ Location getHome(Location loc) throws Exception;
+
+ boolean isHidden();
+
+ ITeleport getTeleport();
+
+ void setJail(String jail);
+}
diff --git a/Essentials/src/com/earth2me/essentials/api/IUserMap.java b/Essentials/src/com/earth2me/essentials/api/IUserMap.java
new file mode 100644
index 000000000..9e609ab37
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/api/IUserMap.java
@@ -0,0 +1,20 @@
+package com.earth2me.essentials.api;
+
+import java.io.File;
+import java.util.Set;
+
+
+public interface IUserMap
+{
+ boolean userExists(final String name);
+
+ IUser getUser(final String name);
+
+ void removeUser(final String name);
+
+ Set<String> getAllUniqueUsers();
+
+ int getUniqueUsers();
+
+ File getUserFile(final String name);
+}
diff --git a/Essentials/src/com/earth2me/essentials/api/IWarps.java b/Essentials/src/com/earth2me/essentials/api/IWarps.java
new file mode 100644
index 000000000..14779e327
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/api/IWarps.java
@@ -0,0 +1,16 @@
+package com.earth2me.essentials.api;
+
+import java.util.Collection;
+import org.bukkit.Location;
+
+
+public interface IWarps extends IReload
+{
+ Location getWarp(String warp) throws Exception;
+
+ Collection<String> getWarps();
+
+ void removeWarp(String name) throws Exception;
+
+ void setWarp(String name, Location loc) throws Exception;
+}
diff --git a/Essentials/src/com/earth2me/essentials/api/IWorth.java b/Essentials/src/com/earth2me/essentials/api/IWorth.java
new file mode 100644
index 000000000..4add98771
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/api/IWorth.java
@@ -0,0 +1,11 @@
+package com.earth2me.essentials.api;
+
+import org.bukkit.inventory.ItemStack;
+
+
+public interface IWorth extends IReload
+{
+ double getPrice(ItemStack itemStack);
+
+ void setPrice(ItemStack itemStack, double price);
+}
diff --git a/Essentials/src/com/earth2me/essentials/api/NoLoanPermittedException.java b/Essentials/src/com/earth2me/essentials/api/NoLoanPermittedException.java
index 8bead2076..f21bf98cc 100644
--- a/Essentials/src/com/earth2me/essentials/api/NoLoanPermittedException.java
+++ b/Essentials/src/com/earth2me/essentials/api/NoLoanPermittedException.java
@@ -1,13 +1,12 @@
package com.earth2me.essentials.api;
-import com.earth2me.essentials.Util;
+import static com.earth2me.essentials.I18n._;
+
public class NoLoanPermittedException extends Exception
{
-
public NoLoanPermittedException()
{
- super(Util.i18n("negativeBalanceError"));
+ super(_("negativeBalanceError"));
}
-
}
diff --git a/Essentials/src/com/earth2me/essentials/api/UserDoesNotExistException.java b/Essentials/src/com/earth2me/essentials/api/UserDoesNotExistException.java
index f48bd0856..531d9ead6 100644
--- a/Essentials/src/com/earth2me/essentials/api/UserDoesNotExistException.java
+++ b/Essentials/src/com/earth2me/essentials/api/UserDoesNotExistException.java
@@ -1,13 +1,12 @@
package com.earth2me.essentials.api;
-import com.earth2me.essentials.Util;
+import static com.earth2me.essentials.I18n._;
+
public class UserDoesNotExistException extends Exception
{
-
public UserDoesNotExistException(String name)
{
- super(Util.format("userDoesNotExist", name));
+ super(_("userDoesNotExist", name));
}
-
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java
index 8bf70873d..a1c83606c 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
public class Commandafk extends EssentialsCommand
@@ -29,23 +29,23 @@ public class Commandafk extends EssentialsCommand
}
}
- private final void toggleAfk(User user)
+ private void toggleAfk(User user)
{
if (!user.toggleAfk())
{
- //user.sendMessage(Util.i18n("markedAsNotAway"));
+ //user.sendMessage(_("markedAsNotAway"));
if (!user.isHidden())
{
- ess.broadcastMessage(user, Util.format("userIsNotAway", user.getDisplayName()));
+ ess.broadcastMessage(user, _("userIsNotAway", user.getDisplayName()));
}
user.updateActivity(false);
}
else
{
- //user.sendMessage(Util.i18n("markedAsAway"));
+ //user.sendMessage(_("markedAsAway"));
if (!user.isHidden())
{
- ess.broadcastMessage(user, Util.format("userIsAway", user.getDisplayName()));
+ ess.broadcastMessage(user, _("userIsAway", user.getDisplayName()));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java b/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java
index 5bfdd3835..54277d466 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java
@@ -1,9 +1,9 @@
package com.earth2me.essentials.commands;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
import org.bukkit.Location;
import org.bukkit.Server;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.TargetBlock;
import org.bukkit.entity.TNTPrimed;
@@ -20,7 +20,7 @@ public class Commandantioch extends EssentialsCommand
ess.broadcastMessage(user, "...lobbest thou thy Holy Hand Grenade of Antioch towards thy foe,");
ess.broadcastMessage(user, "who being naughty in My sight, shall snuff it.");
- final Location loc = new TargetBlock(user).getTargetBlock().getLocation();
+ final Location loc = Util.getTarget(user);
loc.getWorld().spawn(loc, TNTPrimed.class);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandback.java b/Essentials/src/com/earth2me/essentials/commands/Commandback.java
index 26456a5d7..67698598a 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandback.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandback.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import org.bukkit.Server;
@@ -14,11 +14,11 @@ public class Commandback extends EssentialsCommand
}
@Override
- protected void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- Trade charge = new Trade(this.getName(), ess);
+ final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
- user.sendMessage(Util.i18n("backUsageMsg"));
+ user.sendMessage(_("backUsageMsg"));
user.getTeleport().back(charge);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java
index 6bbf8361c..32c8c9e80 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.Backup;
-import com.earth2me.essentials.Util;
+import static com.earth2me.essentials.I18n._;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -14,14 +14,14 @@ public class Commandbackup extends EssentialsCommand
}
@Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- Backup backup = ess.getBackup();
+ final Backup backup = ess.getBackup();
if (backup == null)
{
throw new Exception();
}
backup.run();
- sender.sendMessage(Util.i18n("backupStarted"));
+ sender.sendMessage(_("backupStarted"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java
index d26df68cb..58f164ad6 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java
@@ -1,8 +1,9 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -14,23 +15,23 @@ public class Commandbalance extends EssentialsCommand
}
@Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- sender.sendMessage(Util.format("balance", Util.formatCurrency(getPlayer(server, args, 0, true).getMoney(), ess)));
+ sender.sendMessage(_("balance", Util.formatCurrency(getPlayer(server, args, 0, true).getMoney(), ess)));
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- double bal = (args.length < 1
- || !(user.isAuthorized("essentials.balance.others")
- || user.isAuthorized("essentials.balance.other"))
- ? user
- : getPlayer(server, args, 0, true)).getMoney();
- user.sendMessage(Util.format("balance", Util.formatCurrency(bal, ess)));
+ final double bal = (args.length < 1
+ || !(user.isAuthorized("essentials.balance.others")
+ || user.isAuthorized("essentials.balance.other"))
+ ? user
+ : getPlayer(server, args, 0, true)).getMoney();
+ user.sendMessage(_("balance", Util.formatCurrency(bal, ess)));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java
index a162ea73f..672f1c6ca 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java
@@ -1,15 +1,15 @@
package com.earth2me.essentials.commands;
-import java.util.Map.Entry;
-import org.bukkit.Server;
import com.earth2me.essentials.User;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Util;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import com.earth2me.essentials.textreader.ArrayListInput;
+import com.earth2me.essentials.textreader.TextPager;
+import java.text.DateFormat;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -19,49 +19,160 @@ public class Commandbalancetop extends EssentialsCommand
{
super("balancetop");
}
+ private static final int CACHETIME = 2 * 60 * 1000;
+ public static final int MINUSERS = 50;
+ private static ArrayListInput cache = new ArrayListInput();
+ private static long cacheage = 0;
+ private static ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
@Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- int max = 10;
+ int page = 0;
+ boolean force = false;
if (args.length > 0)
{
try
{
- if (Integer.parseInt(args[0]) < 10)
+ page = Integer.parseInt(args[0]);
+ }
+ catch (NumberFormatException ex)
+ {
+ if (args[0].equalsIgnoreCase("force") && sender.isOp())
{
- max = Integer.parseInt(args[0]);
+ force = true;
}
}
- catch (NumberFormatException ex)
+ }
+
+ if (!force && lock.readLock().tryLock())
+ {
+ try
+ {
+ if (cacheage > System.currentTimeMillis() - CACHETIME)
+ {
+ outputCache(sender, page);
+ return;
+ }
+ if (ess.getUserMap().getUniqueUsers() > MINUSERS)
+ {
+ sender.sendMessage(_("orderBalances", ess.getUserMap().getUniqueUsers()));
+ }
+ }
+ finally
{
- //catch it because they tried to enter a string not number.
+ lock.readLock().unlock();
}
+ ess.scheduleAsyncDelayedTask(new Viewer(sender, page, force));
}
- final Map<User, Double> balances = new HashMap<User, Double>();
- for (User u : ess.getUserMap().getAllUsers())
+ else
{
- balances.put(u, u.getMoney());
+ if (ess.getUserMap().getUniqueUsers() > MINUSERS)
+ {
+ sender.sendMessage(_("orderBalances", ess.getUserMap().getUniqueUsers()));
+ }
+ ess.scheduleAsyncDelayedTask(new Viewer(sender, page, force));
}
- final List<Map.Entry<User, Double>> sortedEntries = new ArrayList<Map.Entry<User, Double>>(balances.entrySet());
- Collections.sort(sortedEntries, new Comparator<Map.Entry<User, Double>>()
+ }
+
+ private static void outputCache(final CommandSender sender, int page)
+ {
+ final Calendar cal = Calendar.getInstance();
+ cal.setTimeInMillis(cacheage);
+ final DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
+ sender.sendMessage(_("balanceTop", format.format(cal.getTime())));
+ new TextPager(cache).showPage(Integer.toString(page), "", "balancetop", sender);
+ }
+
+
+ private class Calculator implements Runnable
+ {
+ private final transient Viewer viewer;
+ private final boolean force;
+
+ public Calculator(final Viewer viewer, final boolean force)
{
- public int compare(final Entry<User, Double> entry1, final Entry<User, Double> entry2)
+ this.viewer = viewer;
+ this.force = force;
+ }
+
+ @Override
+ public void run()
+ {
+ lock.writeLock().lock();
+ try
{
- return -entry1.getValue().compareTo(entry2.getValue());
+ if (force || cacheage <= System.currentTimeMillis() - CACHETIME)
+ {
+ cache.getLines().clear();
+ final Map<String, Double> balances = new HashMap<String, Double>();
+ for (String u : ess.getUserMap().getAllUniqueUsers())
+ {
+ final User user = ess.getUserMap().getUser(u);
+ if (user != null)
+ {
+ balances.put(user.getDisplayName(), user.getMoney());
+ }
+ }
+
+ final List<Map.Entry<String, Double>> sortedEntries = new ArrayList<Map.Entry<String, Double>>(balances.entrySet());
+ Collections.sort(sortedEntries, new Comparator<Map.Entry<String, Double>>()
+ {
+ @Override
+ public int compare(final Entry<String, Double> entry1, final Entry<String, Double> entry2)
+ {
+ return -entry1.getValue().compareTo(entry2.getValue());
+ }
+ });
+ int pos = 1;
+ for (Map.Entry<String, Double> entry : sortedEntries)
+ {
+ cache.getLines().add(pos + ". " + entry.getKey() + ", " + Util.formatCurrency(entry.getValue(), ess));
+ pos++;
+ }
+ cacheage = System.currentTimeMillis();
+ }
+ }
+ finally
+ {
+ lock.writeLock().unlock();
}
- });
- int count = 0;
- sender.sendMessage(Util.format("balanceTop", max));
- for (Map.Entry<User, Double> entry : sortedEntries)
+ ess.scheduleAsyncDelayedTask(viewer);
+ }
+ }
+
+
+ private class Viewer implements Runnable
+ {
+ private final transient CommandSender sender;
+ private final transient int page;
+ private final transient boolean force;
+
+ public Viewer(final CommandSender sender, final int page, final boolean force)
+ {
+ this.sender = sender;
+ this.page = page;
+ this.force = force;
+ }
+
+ @Override
+ public void run()
{
- if (count == max)
+ lock.readLock().lock();
+ try
+ {
+ if (!force && cacheage > System.currentTimeMillis() - CACHETIME)
+ {
+ outputCache(sender, page);
+ return;
+ }
+ }
+ finally
{
- break;
+ lock.readLock().unlock();
}
- sender.sendMessage(entry.getKey().getDisplayName() + ", " + Util.formatCurrency(entry.getValue(), ess));
- count++;
+ ess.scheduleAsyncDelayedTask(new Calculator(new Viewer(sender, page, force), force));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java
index a4a5e2839..d39419686 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java
@@ -1,11 +1,11 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.Console;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.OfflinePlayer;
+import com.earth2me.essentials.User;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import org.bukkit.entity.Player;
@@ -23,21 +23,21 @@ public class Commandban extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
- final User player = getPlayer(server, args, 0, true);
- if (player.getBase() instanceof OfflinePlayer)
+ final User user = getPlayer(server, args, 0, true);
+ if (user.getBase() instanceof OfflinePlayer)
{
if (sender instanceof Player
&& !ess.getUser(sender).isAuthorized("essentials.ban.offline"))
{
- sender.sendMessage(Util.i18n("banExempt"));
+ sender.sendMessage(_("banExempt"));
return;
}
}
else
{
- if (player.isAuthorized("essentials.ban.exempt"))
+ if (user.isAuthorized("essentials.ban.exempt"))
{
- sender.sendMessage(Util.i18n("banExempt"));
+ sender.sendMessage(_("banExempt"));
return;
}
}
@@ -46,22 +46,22 @@ public class Commandban extends EssentialsCommand
if (args.length > 1)
{
banReason = getFinalArg(args, 1);
- player.setBanReason(banReason);
+ user.setBanReason(banReason);
}
else
{
- banReason = Util.i18n("defaultBanReason");
+ banReason = _("defaultBanReason");
}
- player.setBanned(true);
- player.kickPlayer(banReason);
- String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
-
- for(Player p : server.getOnlinePlayers())
+ user.setBanned(true);
+ user.kickPlayer(banReason);
+ final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
+
+ for (Player onlinePlayer : server.getOnlinePlayers())
{
- User u = ess.getUser(p);
- if(u.isAuthorized("essentials.ban.notify"))
+ final User player = ess.getUser(onlinePlayer);
+ if (player.isAuthorized("essentials.ban.notify"))
{
- p.sendMessage(Util.format("playerBanned", senderName, player.getName(), banReason));
+ onlinePlayer.sendMessage(_("playerBanned", senderName, user.getName(), banReason));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
index 591542bcb..5459bd8fc 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -21,17 +21,22 @@ public class Commandbanip extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- final User u = ess.getUser(args[0]);
+ final User player = ess.getUser(args[0]);
- if (u == null)
+ if (player == null)
{
ess.getServer().banIP(args[0]);
- sender.sendMessage(Util.i18n("banIpAddress"));
+ sender.sendMessage(_("banIpAddress"));
}
else
{
- ess.getServer().banIP(u.getAddress().getAddress().getHostAddress());
- sender.sendMessage(Util.i18n("banIpAddress"));
+ final String ipAddress = player.getLastLoginAddress();
+ if (ipAddress.length() == 0)
+ {
+ throw new Exception(_("playerNotFound"));
+ }
+ ess.getServer().banIP(player.getLastLoginAddress());
+ sender.sendMessage(_("banIpAddress"));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java b/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java
index ded3ffdaf..78d557934 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java
@@ -1,11 +1,11 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.TargetBlock;
-import org.bukkit.Server;
-import org.bukkit.TreeType;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.Location;
+import org.bukkit.Server;
+import org.bukkit.TreeType;
public class Commandbigtree extends EssentialsCommand
@@ -16,7 +16,7 @@ public class Commandbigtree extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
TreeType tree;
if (args.length > 0 && args[0].equalsIgnoreCase("redwood"))
@@ -32,20 +32,16 @@ public class Commandbigtree extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- final int[] ignore =
- {
- 8, 9
- };
- final Location loc = (new TargetBlock(user, 300, 0.2, ignore)).getTargetBlock().getLocation();
+ final Location loc = Util.getTarget(user);
final Location safeLocation = Util.getSafeDestination(loc);
- final boolean success = user.getWorld().generateTree(safeLocation, (TreeType)tree);
+ final boolean success = user.getWorld().generateTree(safeLocation, tree);
if (success)
{
- user.sendMessage(Util.i18n("bigTreeSuccess"));
+ user.sendMessage(_("bigTreeSuccess"));
}
else
{
- throw new Exception(Util.i18n("bigTreeFailure"));
+ throw new Exception(_("bigTreeFailure"));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java
new file mode 100644
index 000000000..2691ad4f2
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java
@@ -0,0 +1,45 @@
+package com.earth2me.essentials.commands;
+
+import com.earth2me.essentials.User;
+import org.bukkit.Material;
+import org.bukkit.Server;
+import org.bukkit.block.Block;
+import org.bukkit.event.block.BlockBreakEvent;
+
+
+public class Commandbreak extends EssentialsCommand
+{
+ public Commandbreak()
+ {
+ super("break");
+ }
+
+ //TODO: Switch to use util class
+ @Override
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
+ {
+ final Block block = user.getTargetBlock(null, 20);
+ if (block == null)
+ {
+ throw new NoChargeException();
+ }
+ if (block.getType() == Material.AIR)
+ {
+ throw new NoChargeException();
+ }
+ if (block.getType() == Material.BEDROCK && !user.isAuthorized("essentials.break.bedrock"))
+ {
+ throw new Exception("You are not allowed to destroy bedrock."); //TODO: Translation
+ }
+ final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase());
+ server.getPluginManager().callEvent(event);
+ if (event.isCancelled())
+ {
+ throw new NoChargeException();
+ }
+ else
+ {
+ block.setType(Material.AIR);
+ }
+ }
+} \ No newline at end of file
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java b/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java
index 9b92434a4..95bb967c6 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java
@@ -1,9 +1,8 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Util;
+import static com.earth2me.essentials.I18n._;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import org.bukkit.entity.Player;
public class Commandbroadcast extends EssentialsCommand
@@ -21,7 +20,6 @@ public class Commandbroadcast extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- ess.broadcastMessage(null,
- Util.format("broadcast", getFinalArg(args, 0)));
+ ess.broadcastMessage(null, _("broadcast", getFinalArg(args, 0)));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandburn.java b/Essentials/src/com/earth2me/essentials/commands/Commandburn.java
index 5df3cb5d8..5d8d38ce7 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandburn.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandburn.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Util;
+import static com.earth2me.essentials.I18n._;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -14,7 +14,7 @@ public class Commandburn extends EssentialsCommand
}
@Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 2)
{
@@ -24,7 +24,7 @@ public class Commandburn extends EssentialsCommand
for (Player p : server.matchPlayer(args[0]))
{
p.setFireTicks(Integer.parseInt(args[1]) * 20);
- sender.sendMessage(Util.format("burnMsg", p.getDisplayName(), Integer.parseInt(args[1])));
+ sender.sendMessage(_("burnMsg", p.getDisplayName(), Integer.parseInt(args[1])));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java b/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java
index 447689691..ef2502b9b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java
@@ -1,11 +1,11 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import java.util.List;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
-import java.util.List;
public class Commandclearinventory extends EssentialsCommand
@@ -15,6 +15,7 @@ public class Commandclearinventory extends EssentialsCommand
super("clearinventory");
}
+ //TODO: Cleanup
@Override
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
{
@@ -30,11 +31,11 @@ public class Commandclearinventory extends EssentialsCommand
for (Player p : online)
{
p.getInventory().clear();
- user.sendMessage(Util.format("inventoryClearedOthers", p.getDisplayName()));
+ user.sendMessage(_("inventoryClearedOthers", p.getDisplayName()));
}
return;
}
- throw new Exception(Util.i18n("playerNotFound"));
+ throw new Exception(_("playerNotFound"));
}
else
{
@@ -42,18 +43,18 @@ public class Commandclearinventory extends EssentialsCommand
if (p != null)
{
p.getInventory().clear();
- user.sendMessage(Util.format("inventoryClearedOthers", p.getDisplayName()));
+ user.sendMessage(_("inventoryClearedOthers", p.getDisplayName()));
}
else
{
- throw new Exception(Util.i18n("playerNotFound"));
+ throw new Exception(_("playerNotFound"));
}
}
}
else
{
user.getInventory().clear();
- user.sendMessage(Util.i18n("inventoryCleared"));
+ user.sendMessage(_("inventoryCleared"));
}
}
@@ -74,11 +75,11 @@ public class Commandclearinventory extends EssentialsCommand
for (Player p : online)
{
p.getInventory().clear();
- sender.sendMessage(Util.format("inventoryClearedOthers", p.getDisplayName()));
+ sender.sendMessage(_("inventoryClearedOthers", p.getDisplayName()));
}
return;
}
- throw new Exception(Util.i18n("playerNotFound"));
+ throw new Exception(_("playerNotFound"));
}
else
{
@@ -86,11 +87,11 @@ public class Commandclearinventory extends EssentialsCommand
if (u != null)
{
u.getInventory().clear();
- sender.sendMessage(Util.format("inventoryClearedOthers", u.getDisplayName()));
+ sender.sendMessage(_("inventoryClearedOthers", u.getDisplayName()));
}
else
{
- throw new Exception(Util.i18n("playerNotFound"));
+ throw new Exception(_("playerNotFound"));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandcompass.java b/Essentials/src/com/earth2me/essentials/commands/Commandcompass.java
index eae10f0a5..25f8c34f6 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandcompass.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandcompass.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
public class Commandcompass extends EssentialsCommand
@@ -13,39 +13,39 @@ public class Commandcompass extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- int r = (int)(user.getLocation().getYaw() + 180 + 360) % 360;
+ final int bearing = (int)(user.getLocation().getYaw() + 180 + 360) % 360;
String dir;
- if (r < 23)
+ if (bearing < 23)
{
dir = "N";
}
- else if (r < 68)
+ else if (bearing < 68)
{
dir = "NE";
}
- else if (r < 113)
+ else if (bearing < 113)
{
dir = "E";
}
- else if (r < 158)
+ else if (bearing < 158)
{
dir = "SE";
}
- else if (r < 203)
+ else if (bearing < 203)
{
dir = "S";
}
- else if (r < 248)
+ else if (bearing < 248)
{
dir = "SW";
}
- else if (r < 293)
+ else if (bearing < 293)
{
dir = "W";
}
- else if (r < 338)
+ else if (bearing < 338)
{
dir = "NW";
}
@@ -53,6 +53,6 @@ public class Commandcompass extends EssentialsCommand
{
dir = "N";
}
- user.sendMessage(Util.format("compassBearing", dir, r));
+ user.sendMessage(_("compassBearing", dir, bearing));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java b/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java
index 1d80b6a17..ce891985e 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java
@@ -1,9 +1,10 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
+import java.util.Locale;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import com.earth2me.essentials.Util;
public class Commanddelhome extends EssentialsCommand
@@ -14,35 +15,37 @@ public class Commanddelhome extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- //Allowing both formats /delhome khobbits house | /delhome khobbits:house
- final String[] nameParts = args[0].split(":");
- if (nameParts[0].length() != args[0].length())
+ if (args.length < 1)
{
- args = nameParts;
+ throw new NotEnoughArgumentsException();
}
User user = ess.getUser(sender);
String name;
- if (args.length < 1)
+ final String[] expandedArg = args[0].split(":");
+
+ if (expandedArg.length > 1 && (user == null || user.isAuthorized("essentials.delhome.others")))
{
- throw new NotEnoughArgumentsException();
+ user = getPlayer(server, expandedArg, 0, true);
+ name = expandedArg[1];
}
- else if (args.length > 1 && (user == null || user.isAuthorized("essentials.delhome.others")))
+ else if (user == null)
{
- user = getPlayer(server, args, 0, true);
- name = args[1];
+ throw new NotEnoughArgumentsException();
}
else
{
- if (user == null)
- {
- throw new NotEnoughArgumentsException();
- }
- name = args[0];
+ name = expandedArg[0];
}
- user.delHome(name.toLowerCase());
- sender.sendMessage(Util.format("deleteHome", name));
+ //TODO: Think up a nice error message
+ /*
+ * if (name.equalsIgnoreCase("bed")) {
+ * throw new Exception("You cannot remove the vanilla home point");
+ * }
+ */
+ user.delHome(name.toLowerCase(Locale.ENGLISH));
+ sender.sendMessage(_("deleteHome", name));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddeljail.java b/Essentials/src/com/earth2me/essentials/commands/Commanddeljail.java
index 23ec04c4e..5c2c957e4 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commanddeljail.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commanddeljail.java
@@ -1,22 +1,25 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Util;
+import static com.earth2me.essentials.I18n._;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-public class Commanddeljail extends EssentialsCommand {
- public Commanddeljail() {
+public class Commanddeljail extends EssentialsCommand
+{
+ public Commanddeljail()
+ {
super("deljail");
}
@Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception {
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- ess.getJail().delJail(args[0]);
- sender.sendMessage(Util.format("deleteJail", args[0]));
+ ess.getJails().removeJail(args[0]);
+ sender.sendMessage(_("deleteJail", args[0]));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddelwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commanddelwarp.java
index 7c2795dda..5eab72b33 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commanddelwarp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commanddelwarp.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import com.earth2me.essentials.Util;
public class Commanddelwarp extends EssentialsCommand
@@ -13,13 +13,13 @@ public class Commanddelwarp extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
ess.getWarps().delWarp(args[0]);
- sender.sendMessage(Util.format("deleteWarp", args[0]));
+ sender.sendMessage(_("deleteWarp", args[0]));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddepth.java b/Essentials/src/com/earth2me/essentials/commands/Commanddepth.java
index 5ceb62591..6c4fa2647 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commanddepth.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commanddepth.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
public class Commanddepth extends EssentialsCommand
@@ -13,20 +13,20 @@ public class Commanddepth extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- int y = user.getLocation().getBlockY() - 63;
- if (y > 0)
+ final int depth = user.getLocation().getBlockY() - 63;
+ if (depth > 0)
{
- user.sendMessage(Util.format("depthAboveSea", y));
+ user.sendMessage(_("depthAboveSea", depth));
}
- else if (y < 0)
+ else if (depth < 0)
{
- user.sendMessage(Util.format("depthBelowSea", (-y)));
+ user.sendMessage(_("depthBelowSea", (-depth)));
}
else
{
- user.sendMessage(Util.i18n("depth"));
+ user.sendMessage(_("depth"));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java
index 2aa883bbf..8f432ca6e 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java
@@ -1,9 +1,10 @@
package com.earth2me.essentials.commands;
+import com.earth2me.essentials.User;
+import java.util.Locale;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
-import com.earth2me.essentials.User;
public class Commandeco extends EssentialsCommand
@@ -14,7 +15,7 @@ public class Commandeco extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 2)
{
@@ -24,7 +25,7 @@ public class Commandeco extends EssentialsCommand
double amount;
try
{
- cmd = EcoCommands.valueOf(args[0].toUpperCase());
+ cmd = EcoCommands.valueOf(args[0].toUpperCase(Locale.ENGLISH));
amount = Double.parseDouble(args[2].replaceAll("[^0-9\\.]", ""));
}
catch (Exception ex)
@@ -34,45 +35,46 @@ public class Commandeco extends EssentialsCommand
if (args[1].contentEquals("*"))
{
- for (Player p : server.getOnlinePlayers())
+ for (Player onlinePlayer : server.getOnlinePlayers())
{
- User u = ess.getUser(p);
+ final User player = ess.getUser(onlinePlayer);
switch (cmd)
{
case GIVE:
- u.giveMoney(amount);
+ player.giveMoney(amount);
break;
case TAKE:
- u.takeMoney(amount);
+ player.takeMoney(amount);
break;
case RESET:
- u.setMoney(amount == 0 ? ess.getSettings().getStartingBalance() : amount);
+ player.setMoney(amount == 0 ? ess.getSettings().getStartingBalance() : amount);
break;
}
}
}
else
{
- User u = getPlayer(server, args, 1, true);
+ final User player = getPlayer(server, args, 1, true);
switch (cmd)
{
case GIVE:
- u.giveMoney(amount, sender);
+ player.giveMoney(amount, sender);
break;
case TAKE:
- u.takeMoney(amount, sender);
+ player.takeMoney(amount, sender);
break;
case RESET:
- u.setMoney(amount == 0 ? ess.getSettings().getStartingBalance() : amount);
+ player.setMoney(amount == 0 ? ess.getSettings().getStartingBalance() : amount);
break;
}
}
}
+
private enum EcoCommands
{
GIVE, TAKE, RESET
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java b/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java
new file mode 100644
index 000000000..51a909d29
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java
@@ -0,0 +1,96 @@
+package com.earth2me.essentials.commands;
+
+import com.earth2me.essentials.Enchantments;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import java.util.*;
+import org.bukkit.Server;
+import org.bukkit.enchantments.Enchantment;
+import org.bukkit.inventory.ItemStack;
+
+
+public class Commandenchant extends EssentialsCommand
+{
+ public Commandenchant()
+ {
+ super("enchant");
+ }
+
+ //TODO: Implement charge costs: final Trade charge = new Trade("enchant-" + enchantmentName, ess);
+ @Override
+ protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
+ {
+ final ItemStack stack = user.getItemInHand();
+ if (stack == null)
+ {
+ throw new Exception(_("nothingInHand"));
+ }
+ if (args.length == 0)
+ {
+ final Set<String> enchantmentslist = new TreeSet<String>();
+ for (Map.Entry<String, Enchantment> entry : Enchantments.entrySet())
+ {
+ final String enchantmentName = entry.getValue().getName().toLowerCase(Locale.ENGLISH);
+ if (enchantmentslist.contains(enchantmentName) || user.isAuthorized("essentials.enchant." + enchantmentName))
+ {
+ enchantmentslist.add(entry.getKey());
+ //enchantmentslist.add(enchantmentName);
+ }
+ }
+ throw new NotEnoughArgumentsException(_("enchantments", Util.joinList(enchantmentslist.toArray())));
+ }
+ int level = -1;
+ if (args.length > 1)
+ {
+ try
+ {
+ level = Integer.parseInt(args[1]);
+ }
+ catch (NumberFormatException ex)
+ {
+ level = -1;
+ }
+ }
+ final Enchantment enchantment = getEnchantment(args[0], user);
+ if (level < 0 || level > enchantment.getMaxLevel())
+ {
+ level = enchantment.getMaxLevel();
+ }
+ if (level == 0)
+ {
+ stack.removeEnchantment(enchantment);
+ }
+ else
+ {
+ stack.addEnchantment(enchantment, level);
+ }
+ user.getInventory().setItemInHand(stack);
+ user.updateInventory();
+ final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH);
+ if (level == 0)
+ {
+ user.sendMessage(_("enchantmentRemoved", enchantmentName.replace('_', ' ')));
+ }
+ else
+ {
+ user.sendMessage(_("enchantmentApplied", enchantmentName.replace('_', ' ')));
+ }
+ }
+
+ public static Enchantment getEnchantment(final String name, final User user) throws Exception
+ {
+
+ final Enchantment enchantment = Enchantments.getByName(name);
+ if (enchantment == null)
+ {
+ throw new Exception(_("enchantmentNotFound"));
+ }
+ final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH);
+ if (user != null && !user.isAuthorized("essentials.enchant." + enchantmentName))
+ {
+ throw new Exception(_("enchantmentPerm", enchantmentName));
+ }
+ return enchantment;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
index 328a4a8b5..14bbf5e02 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
@@ -1,5 +1,6 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Util;
import java.util.HashMap;
import java.util.Map;
@@ -23,6 +24,52 @@ public class Commandessentials extends EssentialsCommand
@Override
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
+ if (args.length == 0) {
+ run_disabled(server, sender, commandLabel, args);
+ }
+ else if (args[0].equalsIgnoreCase("debug"))
+ {
+ run_debug(server, sender, commandLabel, args);
+ }
+ else if (args[0].equalsIgnoreCase("nya"))
+ {
+ run_nya(server, sender, commandLabel, args);
+ }
+ else {
+ run_reload(server, sender, commandLabel, args);
+ }
+ }
+
+ private void run_disabled(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
+ sender.sendMessage("Essentials " + ess.getDescription().getVersion());
+ sender.sendMessage("/<command> <reload/debug>");
+ sender.sendMessage(_("blockList"));
+ final StringBuilder disabledCommands = new StringBuilder();
+ for (Map.Entry<String, String> entry : ess.getAlternativeCommandsHandler().disabledCommands().entrySet())
+ {
+ if (disabledCommands.length() > 0) {
+ disabledCommands.append(", ");
+ }
+ disabledCommands.append(entry.getKey()).append(" => ").append(entry.getValue());
+ }
+ sender.sendMessage(disabledCommands.toString());
+ }
+
+ private void run_debug(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
+ ess.getSettings().setDebug(!ess.getSettings().isDebug());
+ sender.sendMessage("Essentials " + ess.getDescription().getVersion() + " debug mode " + (ess.getSettings().isDebug() ? "enabled" : "disabled"));
+ }
+
+ private void run_reload(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
+ ess.reload();
+ sender.sendMessage(_("essentialsReload", ess.getDescription().getVersion()));
+ }
+
+ private void run_nya(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
final Map<String, Byte> noteMap = new HashMap<String, Byte>();
noteMap.put("1F#", (byte)0x0);
noteMap.put("1G", (byte)0x1);
@@ -48,8 +95,6 @@ public class Commandessentials extends EssentialsCommand
noteMap.put("2D#", (byte)(0x9 + 0xC));
noteMap.put("2E", (byte)(0xA + 0xC));
noteMap.put("2F", (byte)(0xB + 0xC));
- if (args.length > 0 && args[0].equalsIgnoreCase("nya"))
- {
if (!noteBlocks.isEmpty())
{
return;
@@ -74,6 +119,7 @@ public class Commandessentials extends EssentialsCommand
{
int i = 0;
+ @Override
public void run()
{
final String note = tune[i];
@@ -87,21 +133,18 @@ public class Commandessentials extends EssentialsCommand
return;
}
Map<Player, Block> noteBlocks = Commandessentials.this.noteBlocks;
- for (Player player : server.getOnlinePlayers())
+ for (Player onlinePlayer : server.getOnlinePlayers())
{
- Block block = noteBlocks.get(player);
+ final Block block = noteBlocks.get(onlinePlayer);
if (block == null || block.getType() != Material.NOTE_BLOCK)
{
continue;
}
- player.playNote(block.getLocation(), (byte)0, noteMap.get(note));
+ onlinePlayer.playNote(block.getLocation(), (byte)0, noteMap.get(note));
}
}
}, 20, 2);
return;
- }
- ess.reload();
- sender.sendMessage(Util.format("essentialsReload", ess.getDescription().getVersion()));
}
private void stopTune()
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandext.java b/Essentials/src/com/earth2me/essentials/commands/Commandext.java
index afb9fa3a6..3855e7b68 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandext.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandext.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -15,7 +15,7 @@ public class Commandext extends EssentialsCommand
}
@Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
@@ -26,24 +26,24 @@ public class Commandext extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
user.setFireTicks(0);
- user.sendMessage(Util.i18n("extinguish"));
+ user.sendMessage(_("extinguish"));
return;
}
extinguishPlayers(server, user, commandLabel);
}
- private void extinguishPlayers(Server server, CommandSender sender, String name) throws Exception
+ private void extinguishPlayers(final Server server, final CommandSender sender, final String name) throws Exception
{
- for (Player p : server.matchPlayer(name))
+ for (Player matchPlayer : server.matchPlayer(name))
{
- p.setFireTicks(0);
- sender.sendMessage(Util.format("extinguishOthers", p.getDisplayName()));
+ matchPlayer.setFireTicks(0);
+ sender.sendMessage(_("extinguishOthers", matchPlayer.getDisplayName()));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfeed.java b/Essentials/src/com/earth2me/essentials/commands/Commandfeed.java
new file mode 100644
index 000000000..0c1579835
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandfeed.java
@@ -0,0 +1,52 @@
+package com.earth2me.essentials.commands;
+
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import java.util.List;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+
+public class Commandfeed extends EssentialsCommand
+{
+ public Commandfeed()
+ {
+ super("feed");
+ }
+
+ @Override
+ protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
+ {
+ if (args.length > 0 && user.isAuthorized("essentials.feed.others"))
+ {
+ feedOtherPlayers(server,user,args[0]);
+ }
+ else
+ {
+ user.setFoodLevel(20);
+ user.setSaturation(10);
+ user.sendMessage(_("feed"));
+ }
+ }
+
+ private void feedOtherPlayers(final Server server, final CommandSender sender, final String name)
+ {
+ final List<Player> players = server.matchPlayer(name);
+ if (players.isEmpty())
+ {
+ sender.sendMessage(_("playerNotFound"));
+ return;
+ }
+ for (Player player : players)
+ {
+ if (ess.getUser(player).isHidden())
+ {
+ continue;
+ }
+ player.setFoodLevel(20);
+ player.setSaturation(10);
+ sender.sendMessage(_("feedOther", player.getDisplayName()));
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java b/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java
index 19e7eddf1..671d0f72b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java
@@ -3,12 +3,12 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.User;
import org.bukkit.Server;
import org.bukkit.entity.Fireball;
+import org.bukkit.entity.SmallFireball;
import org.bukkit.util.Vector;
public class Commandfireball extends EssentialsCommand
{
-
public Commandfireball()
{
super("fireball");
@@ -17,7 +17,13 @@ public class Commandfireball extends EssentialsCommand
@Override
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- final Vector direction = user.getEyeLocation().getDirection().multiply(2);
- user.getWorld().spawn(user.getEyeLocation().add(direction.getX(), direction.getY(), direction.getZ()), Fireball.class);
+ boolean small = false;
+ if (args.length > 0 && args[0].equalsIgnoreCase("small"))
+ {
+ small = true;
+ }
+ final Vector direction = user.getEyeLocation().getDirection().multiply(2);
+ Fireball fireball = user.getWorld().spawn(user.getEyeLocation().add(direction.getX(), direction.getY(), direction.getZ()), small ? SmallFireball.class : Fireball.class);
+ fireball.setShooter(user.getBase());
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java
new file mode 100644
index 000000000..62ace9357
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java
@@ -0,0 +1,57 @@
+package com.earth2me.essentials.commands;
+
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import java.util.Locale;
+import org.bukkit.GameMode;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+
+public class Commandgamemode extends EssentialsCommand
+{
+ public Commandgamemode()
+ {
+ super("gamemode");
+ }
+
+ @Override
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
+ if (args.length < 1)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+
+ gamemodeOtherPlayers(server, sender, args[0]);
+ }
+
+ @Override
+ protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
+ {
+ if (args.length > 0 && !args[0].trim().isEmpty() && user.isAuthorized("essentials.gamemode.others"))
+ {
+ gamemodeOtherPlayers(server, user, args[0]);
+ return;
+ }
+
+ user.setGameMode(user.getGameMode() == GameMode.SURVIVAL ? GameMode.CREATIVE : GameMode.SURVIVAL);
+ user.sendMessage(_("gameMode", _(user.getGameMode().toString().toLowerCase(Locale.ENGLISH)), user.getDisplayName()));
+ }
+
+ private void gamemodeOtherPlayers(final Server server, final CommandSender sender, final String name)
+ {
+ for (Player matchPlayer : server.matchPlayer(name))
+ {
+ final User player = ess.getUser(matchPlayer);
+ if (player.isHidden())
+ {
+ continue;
+ }
+
+ player.setGameMode(player.getGameMode() == GameMode.SURVIVAL ? GameMode.CREATIVE : GameMode.SURVIVAL);
+ sender.sendMessage(_("gameMode", _(player.getGameMode().toString().toLowerCase(Locale.ENGLISH)), player.getDisplayName()));
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
index 28164bd78..9429bc5a8 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Util;
+import static com.earth2me.essentials.I18n._;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
@@ -14,17 +14,18 @@ public class Commandgc extends EssentialsCommand
}
@Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- sender.sendMessage(Util.format("gcmax", (Runtime.getRuntime().maxMemory() / 1024 / 1024)));
- sender.sendMessage(Util.format("gcfree", (Runtime.getRuntime().freeMemory() / 1024 / 1024)));
- sender.sendMessage(Util.format("gctotal", (Runtime.getRuntime().totalMemory() / 1024 / 1024)));
+ sender.sendMessage(_("gcmax", (Runtime.getRuntime().maxMemory() / 1024 / 1024)));
+ sender.sendMessage(_("gctotal", (Runtime.getRuntime().totalMemory() / 1024 / 1024)));
+ sender.sendMessage(_("gcfree", (Runtime.getRuntime().freeMemory() / 1024 / 1024)));
+
for (World w : server.getWorlds())
{
sender.sendMessage(
(w.getEnvironment() == World.Environment.NETHER ? "Nether" : "World") + " \"" + w.getName() + "\": "
- + w.getLoadedChunks().length + Util.i18n("gcchunks")
- + w.getEntities().size() + Util.i18n("gcentities"));
+ + w.getLoadedChunks().length + _("gcchunks")
+ + w.getEntities().size() + _("gcentities"));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java b/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java
index 6f1fd7d6c..c61702e59 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java
@@ -1,8 +1,9 @@
package com.earth2me.essentials.commands;
+import com.earth2me.essentials.User;
import org.bukkit.Location;
import org.bukkit.Server;
-import com.earth2me.essentials.User;
+import org.bukkit.command.CommandSender;
public class Commandgetpos extends EssentialsCommand
@@ -11,15 +12,44 @@ public class Commandgetpos extends EssentialsCommand
{
super("getpos");
}
-
+
+ @Override
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
+ {
+ if (args.length > 0 && user.isAuthorized("essentials.getpos.others"))
+ {
+ final User otherUser = getPlayer(server, args, 0);
+ outputPosition(user, otherUser.getLocation(), user.getLocation());
+ }
+ else
+ {
+ outputPosition(user, user.getLocation(), null);
+ }
+ }
+
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
+ if (args.length < 1)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final User user = getPlayer(server, args, 0);
+ outputPosition(sender, user.getLocation(), null);
+ }
+
+ //TODO: Translate
+ private void outputPosition(final CommandSender sender, final Location coords, final Location distance)
{
- Location coords = user.getLocation();
- user.sendMessage("§7X: " + coords.getBlockX() + " (+East <-> -West)");
- user.sendMessage("§7Y: " + coords.getBlockY() + " (+Up <-> -Down)");
- user.sendMessage("§7Z: " + coords.getBlockZ() + " (+South <-> -North)");
- user.sendMessage("§7Yaw: " + (coords.getYaw() + 180 + 360) % 360 + " (Rotation)");
- user.sendMessage("§7Pitch: " + coords.getPitch() + " (Head angle)");
+ sender.sendMessage("§7World: " + coords.getWorld().getName());
+ sender.sendMessage("§7X: " + coords.getBlockX() + " (+East <-> -West)");
+ sender.sendMessage("§7Y: " + coords.getBlockY() + " (+Up <-> -Down)");
+ sender.sendMessage("§7Z: " + coords.getBlockZ() + " (+South <-> -North)");
+ sender.sendMessage("§7Yaw: " + (coords.getYaw() + 180 + 360) % 360 + " (Rotation)");
+ sender.sendMessage("§7Pitch: " + coords.getPitch() + " (Head angle)");
+ if (distance != null && coords.getWorld().equals(distance.getWorld()))
+ {
+ sender.sendMessage("§7Distance: " + coords.distance(distance));
+ }
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
index 065b76d03..d6e3d8f98 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
@@ -1,10 +1,13 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
+import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
import com.earth2me.essentials.User;
+import java.util.Locale;
import org.bukkit.ChatColor;
import org.bukkit.Material;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@@ -18,16 +21,16 @@ public class Commandgive extends EssentialsCommand
//TODO: move these messages to message file
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 2)
{
throw new NotEnoughArgumentsException();
}
- ItemStack stack = ess.getItemDb().get(args[1]);
+ final ItemStack stack = ess.getItemDb().get(args[1]);
- String itemname = stack.getType().toString().toLowerCase().replace("_", "");
+ final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
if (sender instanceof Player
&& (ess.getSettings().permissionBasedItemSpawn()
? (!ess.getUser(sender).isAuthorized("essentials.give.item-all")
@@ -38,20 +41,60 @@ public class Commandgive extends EssentialsCommand
{
throw new Exception(ChatColor.RED + "You are not allowed to spawn the item " + itemname);
}
+
+ final User giveTo = getPlayer(server, args, 0);
+
if (args.length > 2 && Integer.parseInt(args[2]) > 0)
{
stack.setAmount(Integer.parseInt(args[2]));
}
+ else if (ess.getSettings().getDefaultStackSize() > 0)
+ {
+ stack.setAmount(ess.getSettings().getDefaultStackSize());
+ }
+ else if (ess.getSettings().getOversizedStackSize() > 0 && giveTo.isAuthorized("essentials.oversizedstacks"))
+ {
+ stack.setAmount(ess.getSettings().getOversizedStackSize());
+ }
+
+ if (args.length > 3)
+ {
+ for (int i = 3; i < args.length; i++)
+ {
+ final String[] split = args[i].split("[:+',;.]", 2);
+ if (split.length < 1)
+ {
+ continue;
+ }
+ final Enchantment enchantment = Commandenchant.getEnchantment(split[0], sender instanceof Player ? ess.getUser(sender) : null);
+ int level;
+ if (split.length > 1)
+ {
+ level = Integer.parseInt(split[1]);
+ }
+ else
+ {
+ level = enchantment.getMaxLevel();
+ }
+ stack.addEnchantment(enchantment, level);
+ }
+ }
if (stack.getType() == Material.AIR)
{
throw new Exception(ChatColor.RED + "You can't give air.");
}
- User giveTo = getPlayer(server, args, 0);
- String itemName = stack.getType().toString().toLowerCase().replace('_', ' ');
+ final String itemName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' ');
sender.sendMessage(ChatColor.BLUE + "Giving " + stack.getAmount() + " of " + itemName + " to " + giveTo.getDisplayName() + ".");
- giveTo.getInventory().addItem(stack);
+ if (giveTo.isAuthorized("essentials.oversizedstacks"))
+ {
+ InventoryWorkaround.addItem(giveTo.getInventory(), true, ess.getSettings().getOversizedStackSize(), stack);
+ }
+ else
+ {
+ InventoryWorkaround.addItem(giveTo.getInventory(), true, stack);
+ }
giveTo.updateInventory();
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgod.java b/Essentials/src/com/earth2me/essentials/commands/Commandgod.java
index d4c35e113..4d5bd424b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandgod.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgod.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -15,7 +15,7 @@ public class Commandgod extends EssentialsCommand
}
@Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
@@ -26,29 +26,29 @@ public class Commandgod extends EssentialsCommand
}
@Override
- protected void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- if (args.length > 0 && user.isAuthorized("essentials.god.others"))
+ if (args.length > 0 && !args[0].trim().isEmpty() && user.isAuthorized("essentials.god.others"))
{
godOtherPlayers(server, user, args[0]);
return;
}
- user.sendMessage(Util.format("godMode", (user.toggleGodModeEnabled()? Util.i18n("enabled") : Util.i18n("disabled"))));
+ user.sendMessage(_("godMode", (user.toggleGodModeEnabled() ? _("enabled") : _("disabled"))));
}
- private void godOtherPlayers(Server server, CommandSender sender, String name)
+ private void godOtherPlayers(final Server server, final CommandSender sender, final String name)
{
- for (Player p : server.matchPlayer(name))
+ for (Player matchPlayer : server.matchPlayer(name))
{
- User u = ess.getUser(p);
- if (u.isHidden())
+ final User player = ess.getUser(matchPlayer);
+ if (player.isHidden())
{
continue;
}
- boolean enabled = u.toggleGodModeEnabled();
- u.sendMessage(Util.format("godMode", (enabled ? Util.i18n("enabled") : Util.i18n("disabled"))));
- sender.sendMessage(Util.format("godMode",Util.format(enabled ? "godEnabledFor": "godDisabledFor", p.getDisplayName())));
+ final boolean enabled = player.toggleGodModeEnabled();
+ player.sendMessage(_("godMode", (enabled ? _("enabled") : _("disabled"))));
+ sender.sendMessage(_("godMode", _(enabled ? "godEnabledFor" : "godDisabledFor", matchPlayer.getDisplayName())));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandheal.java b/Essentials/src/com/earth2me/essentials/commands/Commandheal.java
index 68de488af..82678c96e 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandheal.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandheal.java
@@ -1,11 +1,11 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import java.util.List;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
-import java.util.List;
public class Commandheal extends EssentialsCommand
@@ -16,7 +16,7 @@ public class Commandheal extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length > 0 && user.isAuthorized("essentials.heal.others"))
@@ -35,11 +35,11 @@ public class Commandheal extends EssentialsCommand
}
user.setHealth(20);
user.setFoodLevel(20);
- user.sendMessage(Util.i18n("heal"));
+ user.sendMessage(_("heal"));
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
@@ -49,12 +49,12 @@ public class Commandheal extends EssentialsCommand
healOtherPlayers(server, sender, args[0]);
}
- private void healOtherPlayers(Server server, CommandSender sender, String name)
+ private void healOtherPlayers(final Server server, final CommandSender sender, final String name)
{
- List<Player> players = server.matchPlayer(name);
+ final List<Player> players = server.matchPlayer(name);
if (players.isEmpty())
{
- sender.sendMessage(Util.i18n("playerNotFound"));
+ sender.sendMessage(_("playerNotFound"));
return;
}
for (Player p : players)
@@ -64,7 +64,9 @@ public class Commandheal extends EssentialsCommand
continue;
}
p.setHealth(20);
- sender.sendMessage(Util.format("healOther", p.getDisplayName()));
+ p.setFoodLevel(20);
+ p.sendMessage(_("heal"));
+ sender.sendMessage(_("healOther", p.getDisplayName()));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java
index 8e99dc1ed..769aac483 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java
@@ -1,30 +1,15 @@
package com.earth2me.essentials.commands;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-import org.bukkit.plugin.Plugin;
-import org.bukkit.plugin.PluginDescriptionFile;
-import org.yaml.snakeyaml.Yaml;
-import org.yaml.snakeyaml.constructor.SafeConstructor;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
-import java.util.Map.Entry;
-import java.util.logging.Level;
+import com.earth2me.essentials.textreader.*;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
public class Commandhelp extends EssentialsCommand
{
- private static final String DESCRIPTION = "description";
- private static final String PERMISSION = "permission";
- private static final String PERMISSIONS = "permissions";
- public final Yaml yaml = new Yaml(new SafeConstructor());
-
public Commandhelp()
{
super("help");
@@ -33,198 +18,35 @@ public class Commandhelp extends EssentialsCommand
@Override
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- int page = 1;
- String match = "";
- try
+ IText output;
+ String pageStr = args.length > 0 ? args[0] : null;
+ String chapterPageStr = args.length > 1 ? args[1] : null;
+ final IText input = new TextInput(user, "help", false, ess);
+
+ if (input.getLines().isEmpty())
{
- if (args.length > 0)
+ if (Util.isInt(pageStr) || pageStr == null)
{
- match = args[0].toLowerCase();
- page = Integer.parseInt(args[args.length - 1]);
- if (args.length == 1)
- {
- match = "";
- }
+ output = new HelpInput(user, "", ess);
}
-
- }
- catch (Exception ex)
- {
- if (args.length == 1)
+ else
{
- match = args[0].toLowerCase();
+ output = new HelpInput(user, pageStr, ess);
+ pageStr = chapterPageStr;
}
+ chapterPageStr = null;
}
-
- final List<String> lines = getHelpLines(user, match);
- if (lines.isEmpty())
+ else
{
- throw new Exception(Util.i18n("noHelpFound"));
- }
-
- final int start = (page - 1) * 9;
- final int pages = lines.size() / 9 + (lines.size() % 9 > 0 ? 1 : 0);
-
- user.sendMessage(Util.format("helpPages", page, pages));
- for (int i = start; i < lines.size() && i < start + 9; i++)
- {
- user.sendMessage(lines.get(i));
+ output = new KeywordReplacer(input, user, ess);
}
+ final TextPager pager = new TextPager(output);
+ pager.showPage(pageStr, chapterPageStr, commandLabel, user);
}
@Override
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- sender.sendMessage(Util.i18n("helpConsole"));
- }
-
- @SuppressWarnings("CallToThreadDumpStack")
- private List<String> getHelpLines(final User user, final String match) throws Exception
- {
- final List<String> retval = new ArrayList<String>();
- File helpFile = new File(ess.getDataFolder(), "help_" + Util.sanitizeFileName(user.getName()) + ".txt");
- if (!helpFile.exists())
- {
- helpFile = new File(ess.getDataFolder(), "help_" + Util.sanitizeFileName(user.getGroup()) + ".txt");
- }
- if (!helpFile.exists())
- {
- helpFile = new File(ess.getDataFolder(), "help.txt");
- }
- if (helpFile.exists())
- {
- final BufferedReader bufferedReader = new BufferedReader(new FileReader(helpFile));
- try
- {
-
- while (bufferedReader.ready())
- {
- final String line = bufferedReader.readLine();
- retval.add(line.replace('&', '§'));
- }
- }
- finally
- {
- bufferedReader.close();
- }
- return retval;
- }
-
- boolean reported = false;
- String pluginName = "";
- for (Plugin p : ess.getServer().getPluginManager().getPlugins())
- {
- try
- {
- final PluginDescriptionFile desc = p.getDescription();
- final HashMap<String, HashMap<String, Object>> cmds = (HashMap<String, HashMap<String, Object>>)desc.getCommands();
- pluginName = p.getDescription().getName().toLowerCase();
- for (Entry<String, HashMap<String, Object>> k : cmds.entrySet())
- {
- try
- {
- if ((!match.equalsIgnoreCase(""))
- && (!k.getKey().toLowerCase().contains(match))
- && (!(k.getValue().get(DESCRIPTION) instanceof String
- && ((String)k.getValue().get(DESCRIPTION)).toLowerCase().contains(match)))
- && (!pluginName.contains(match)))
- {
- continue;
- }
-
- if (pluginName.contains("essentials"))
- {
- final String node = "essentials." + k.getKey();
- if (!ess.getSettings().isCommandDisabled(k.getKey()) && user.isAuthorized(node))
- {
- retval.add("§c" + k.getKey() + "§7: " + k.getValue().get(DESCRIPTION));
- }
- }
- else
- {
- if (ess.getSettings().showNonEssCommandsInHelp())
- {
- final HashMap<String, Object> value = k.getValue();
- if (value.containsKey(PERMISSION) && value.get(PERMISSION) instanceof String && !(value.get(PERMISSION).equals("")))
- {
- if (user.isAuthorized((String)value.get(PERMISSION)))
- {
- retval.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION));
- }
- }
- else if (value.containsKey(PERMISSION) && value.get(PERMISSION) instanceof List && !((List<Object>)value.get(PERMISSION)).isEmpty())
- {
- boolean enabled = false;
- for (Object o : (List<Object>)value.get(PERMISSION))
- {
- if (o instanceof String && user.isAuthorized((String)o))
- {
- enabled = true;
- break;
- }
- }
- if (enabled)
- {
- retval.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION));
- }
- }
- else if (value.containsKey(PERMISSIONS) && value.get(PERMISSIONS) instanceof String && !(value.get(PERMISSIONS).equals("")))
- {
- if (user.isAuthorized((String)value.get(PERMISSIONS)))
- {
- retval.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION));
- }
- }
- else if (value.containsKey(PERMISSIONS) && value.get(PERMISSIONS) instanceof List && !((List<Object>)value.get(PERMISSIONS)).isEmpty())
- {
- boolean enabled = false;
- for (Object o : (List<Object>)value.get(PERMISSIONS))
- {
- if (o instanceof String && user.isAuthorized((String)o))
- {
- enabled = true;
- break;
- }
- }
- if (enabled)
- {
- retval.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION));
- }
- }
- else if (user.isAuthorized("essentials.help." + pluginName))
- {
- retval.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION));
- }
- else
- {
- if (!ess.getSettings().hidePermissionlessHelp())
- {
- retval.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION));
- }
- }
- }
- }
- }
- catch (NullPointerException ex)
- {
- continue;
- }
- }
- }
- catch (NullPointerException ex)
- {
- continue;
- }
- catch (Exception ex)
- {
- if (!reported)
- {
- logger.log(Level.WARNING, Util.format("commandHelpFailedForPlugin", pluginName), ex);
- }
- reported = true;
- continue;
- }
- }
- return retval;
+ sender.sendMessage(_("helpConsole"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java b/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java
index 158b0d40b..20cd5cdd3 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java
@@ -1,10 +1,11 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
-import org.bukkit.entity.Player;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.logging.Level;
+import org.bukkit.Server;
+import org.bukkit.entity.Player;
public class Commandhelpop extends EssentialsCommand
@@ -15,23 +16,23 @@ public class Commandhelpop extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- final String message = Util.format("helpOp", user.getDisplayName(), getFinalArg(args, 0));
+ final String message = _("helpOp", user.getDisplayName(), Util.stripColor(getFinalArg(args, 0)));
logger.log(Level.INFO, message);
- for (Player p : server.getOnlinePlayers())
+ for (Player onlinePlayer : server.getOnlinePlayers())
{
- User u = ess.getUser(p);
- if (!u.isAuthorized("essentials.helpop.receive"))
+ final User player = ess.getUser(onlinePlayer);
+ if (!player.isAuthorized("essentials.helpop.receive"))
{
continue;
}
- u.sendMessage(message);
+ player.sendMessage(message);
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
index 16b9fca2a..55bd75d0c 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
@@ -1,10 +1,14 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Trade;
-import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.List;
+import java.util.Locale;
+import org.bukkit.Location;
+import org.bukkit.Server;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Commandhome extends EssentialsCommand
@@ -15,11 +19,11 @@ public class Commandhome extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- Trade charge = new Trade(this.getName(), ess);
+ final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
- User u = user;
+ User player = user;
String homeName = "";
String[] nameParts;
if (args.length > 0)
@@ -31,7 +35,7 @@ public class Commandhome extends EssentialsCommand
}
else
{
- u = getPlayer(server, nameParts[0].split(" "), 0, true);
+ player = getPlayer(server, nameParts, 0, true);
if (nameParts.length > 1)
{
homeName = nameParts[1];
@@ -40,26 +44,43 @@ public class Commandhome extends EssentialsCommand
}
try
{
- user.getTeleport().home(u, homeName.toLowerCase(), charge);
+ if ("bed".equalsIgnoreCase(homeName))
+ {
+ final Location bed = player.getBedSpawnLocation();
+ if (bed != null)
+ {
+ user.getTeleport().teleport(bed, charge, TeleportCause.COMMAND);
+ throw new NoChargeException();
+ }
+ }
+ user.getTeleport().home(player, homeName.toLowerCase(Locale.ENGLISH), charge);
}
catch (NotEnoughArgumentsException e)
{
- List<String> homes = u.getHomes();
- if (homes.isEmpty() && u.equals(user) && ess.getSettings().spawnIfNoHome())
+ final List<String> homes = player.getHomes();
+ if (homes.isEmpty() && player.equals(user))
{
- user.getTeleport().respawn(ess.getSpawn(), charge);
+ final Location bed = player.getBedSpawnLocation();
+ if (bed != null)
+ {
+ user.getTeleport().teleport(bed, charge, TeleportCause.COMMAND);
+ throw new NoChargeException();
+ }
+ user.getTeleport().respawn(charge, TeleportCause.COMMAND);
+
}
else if (homes.isEmpty())
{
- throw new Exception(u == user ? Util.i18n("noHomeSet") : Util.i18n("noHomeSetPlayer"));
+ throw new Exception(player == user ? _("noHomeSet") : _("noHomeSetPlayer"));
}
- else if (homes.size() == 1 && u.equals(user))
+ else if (homes.size() == 1 && player.equals(user))
{
- user.getTeleport().home(u, homes.get(0), charge);
+ user.getTeleport().home(player, homes.get(0), charge);
}
else
{
- user.sendMessage(Util.format("homes", Util.joinList(homes)));
+ homes.add("bed");
+ user.sendMessage(_("homes", Util.joinList(homes)));
}
}
throw new NoChargeException();
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandignore.java b/Essentials/src/com/earth2me/essentials/commands/Commandignore.java
index 953bf742c..93dd029a8 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandignore.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandignore.java
@@ -1,49 +1,47 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import org.bukkit.Server;
public class Commandignore extends EssentialsCommand
{
-
public Commandignore()
{
super("ignore");
}
@Override
- protected void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- User u;
+ User player;
try
{
- u = getPlayer(server, args, 0);
+ player = getPlayer(server, args, 0);
}
- catch(NoSuchFieldException ex)
+ catch (NoSuchFieldException ex)
{
- u = ess.getOfflineUser(args[0]);
+ player = ess.getOfflineUser(args[0]);
}
- if (u == null)
+ if (player == null)
{
- throw new Exception(Util.i18n("playerNotFound"));
+ throw new Exception(_("playerNotFound"));
}
- String name = u.getName();
- if (user.isIgnoredPlayer(name)) {
+ final String name = player.getName();
+ if (user.isIgnoredPlayer(name))
+ {
user.setIgnoredPlayer(name, false);
- user.sendMessage(Util.format("unignorePlayer", u.getName()));
+ user.sendMessage(_("unignorePlayer", player.getName()));
}
else
{
user.setIgnoredPlayer(name, true);
- user.sendMessage(Util.format("ignorePlayer", u.getName()));
+ user.sendMessage(_("ignorePlayer", player.getName()));
}
}
-
-
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandinfo.java b/Essentials/src/com/earth2me/essentials/commands/Commandinfo.java
index 97dd71d35..afe1add72 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandinfo.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandinfo.java
@@ -1,17 +1,11 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import com.earth2me.essentials.textreader.IText;
+import com.earth2me.essentials.textreader.KeywordReplacer;
+import com.earth2me.essentials.textreader.TextInput;
+import com.earth2me.essentials.textreader.TextPager;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import org.bukkit.entity.Player;
public class Commandinfo extends EssentialsCommand
@@ -22,167 +16,11 @@ public class Commandinfo extends EssentialsCommand
}
@Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- String pageStr = args.length > 0 ? args[0].trim() : null;
-
- List<String> lines = new ArrayList<String>();
- List<String> chapters = new ArrayList<String>();
- Map<String, Integer> bookmarks = new HashMap<String, Integer>();
- File file = null;
- if (sender instanceof Player)
- {
- User user = ess.getUser(sender);
- file = new File(ess.getDataFolder(), "info_"+Util.sanitizeFileName(user.getName()) +".txt");
- if (!file.exists())
- {
- file = new File(ess.getDataFolder(), "info_"+Util.sanitizeFileName(user.getGroup()) +".txt");
- }
- }
- if (file == null || !file.exists())
- {
- file = new File(ess.getDataFolder(), "info.txt");
- }
- if (file.exists())
- {
- final BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
- try
- {
- int lineNumber = 0;
- while (bufferedReader.ready())
- {
- final String line = bufferedReader.readLine();
- if (line.length() > 0 && line.charAt(0) == '#')
- {
- bookmarks.put(line.substring(1).toLowerCase().replaceAll("&[0-9a-f]", ""), lineNumber);
- chapters.add(line.substring(1).replace('&', '§'));
- }
- lines.add(line.replace('&', '§'));
- lineNumber++;
- }
- }
- finally
- {
- bufferedReader.close();
- }
- }
- else
- {
- file.createNewFile();
- throw new Exception(Util.i18n("infoFileDoesNotExist"));
- }
-
- if (bookmarks.isEmpty())
- {
- int page = 1;
- try
- {
- page = Integer.parseInt(pageStr);
- }
- catch (Exception ex)
- {
- page = 1;
- }
-
- int start = (page - 1) * 9;
- int pages = lines.size() / 9 + (lines.size() % 9 > 0 ? 1 : 0);
-
- sender.sendMessage(Util.format("infoPages", page, pages ));
- for (int i = start; i < lines.size() && i < start + 9; i++)
- {
- sender.sendMessage(lines.get(i));
- }
- return;
- }
-
- if (pageStr == null || pageStr.isEmpty() || pageStr.matches("[0-9]+"))
- {
- if (lines.get(0).startsWith("#"))
- {
- sender.sendMessage(Util.i18n("infoChapter"));
- StringBuilder sb = new StringBuilder();
- boolean first = true;
- for (String string : chapters)
- {
- if (!first)
- {
- sb.append(", ");
- }
- first = false;
- sb.append(string);
- }
- sender.sendMessage(sb.toString());
- return;
- }
- else
- {
- int page = 1;
- try
- {
- page = Integer.parseInt(pageStr);
- }
- catch (Exception ex)
- {
- page = 1;
- }
-
- int start = (page - 1) * 9;
- int end;
- for (end = 0; end < lines.size(); end++)
- {
- String line = lines.get(end);
- if (line.startsWith("#"))
- {
- break;
- }
- }
- int pages = end / 9 + (end % 9 > 0 ? 1 : 0);
-
- sender.sendMessage(Util.format("infoPages", page, pages ));
- for (int i = start; i < end && i < start + 9; i++)
- {
- sender.sendMessage(lines.get(i));
- }
- return;
- }
- }
-
- int chapterpage = 0;
- if (args.length >= 2)
- {
- try
- {
- chapterpage = Integer.parseInt(args[1]) - 1;
- }
- catch (Exception ex)
- {
- chapterpage = 0;
- }
- }
-
- if (!bookmarks.containsKey(pageStr.toLowerCase()))
- {
- sender.sendMessage(Util.i18n("infoUnknownChapter"));
- return;
- }
- int chapterstart = bookmarks.get(pageStr.toLowerCase()) + 1;
- int chapterend;
- for (chapterend = chapterstart; chapterend < lines.size(); chapterend++)
- {
- String line = lines.get(chapterend);
- if (line.startsWith("#"))
- {
- break;
- }
- }
- int start = chapterstart + chapterpage * 9;
- int page = chapterpage + 1;
- int pages = (chapterend - chapterstart) / 9 + ((chapterend - chapterstart) % 9 > 0 ? 1 : 0);
-
- sender.sendMessage(Util.format("infoChapterPages", pageStr, page , pages));
- for (int i = start; i < chapterend && i < start + 9; i++)
- {
- sender.sendMessage(lines.get(i));
- }
+ final IText input = new TextInput(sender, "info", true, ess);
+ final IText output = new KeywordReplacer(input, sender, ess);
+ final TextPager pager = new TextPager(output);
+ pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, commandLabel, sender);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java b/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java
index 2a730b533..1f5c32faa 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import java.util.Arrays;
import org.bukkit.Server;
import org.bukkit.inventory.ItemStack;
@@ -15,7 +15,7 @@ public class Commandinvsee extends EssentialsCommand
}
@Override
- protected void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1 && user.getSavedInventory() == null)
@@ -31,7 +31,7 @@ public class Commandinvsee extends EssentialsCommand
{
invUser.getInventory().setContents(user.getSavedInventory());
user.setSavedInventory(null);
- user.sendMessage(Util.i18n("invRestored"));
+ user.sendMessage(_("invRestored"));
throw new NoChargeException();
}
@@ -40,16 +40,18 @@ public class Commandinvsee extends EssentialsCommand
user.setSavedInventory(user.getInventory().getContents());
}
ItemStack[] invUserStack = invUser.getInventory().getContents();
- int userStackLength = user.getInventory().getContents().length;
- if (invUserStack.length < userStackLength) {
+ final int userStackLength = user.getInventory().getContents().length;
+ if (invUserStack.length < userStackLength)
+ {
invUserStack = Arrays.copyOf(invUserStack, userStackLength);
}
- if (invUserStack.length > userStackLength) {
- throw new Exception(Util.i18n("invBigger"));
+ if (invUserStack.length > userStackLength)
+ {
+ throw new Exception(_("invBigger"));
}
user.getInventory().setContents(invUserStack);
- user.sendMessage(Util.format("invSee", invUser.getDisplayName()));
- user.sendMessage(Util.i18n("invSeeHelp"));
+ user.sendMessage(_("invSee", invUser.getDisplayName()));
+ user.sendMessage(_("invSeeHelp"));
throw new NoChargeException();
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java
index 352ce18eb..405b8b799 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java
@@ -1,9 +1,12 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import java.util.Locale;
import org.bukkit.Material;
+import org.bukkit.Server;
+import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
@@ -15,15 +18,15 @@ public class Commanditem extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- ItemStack stack = ess.getItemDb().get(args[0]);
+ final ItemStack stack = ess.getItemDb().get(args[0]);
- String itemname = stack.getType().toString().toLowerCase().replace("_", "");
+ final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
if (ess.getSettings().permissionBasedItemSpawn()
? (!user.isAuthorized("essentials.itemspawn.item-all")
&& !user.isAuthorized("essentials.itemspawn.item-" + itemname)
@@ -31,22 +34,60 @@ public class Commanditem extends EssentialsCommand
: (!user.isAuthorized("essentials.itemspawn.exempt")
&& !user.canSpawnItem(stack.getTypeId())))
{
- throw new Exception(Util.format("cantSpawnItem", itemname));
+ throw new Exception(_("cantSpawnItem", itemname));
}
if (args.length > 1 && Integer.parseInt(args[1]) > 0)
{
stack.setAmount(Integer.parseInt(args[1]));
}
+ else if (ess.getSettings().getDefaultStackSize() > 0)
+ {
+ stack.setAmount(ess.getSettings().getDefaultStackSize());
+ }
+ else if (ess.getSettings().getOversizedStackSize() > 0 && user.isAuthorized("essentials.oversizedstacks"))
+ {
+ stack.setAmount(ess.getSettings().getOversizedStackSize());
+ }
+
+ if (args.length > 2)
+ {
+ for (int i = 2; i < args.length; i++)
+ {
+ final String[] split = args[i].split("[:+',;.]", 2);
+ if (split.length < 1)
+ {
+ continue;
+ }
+ final Enchantment enchantment = Commandenchant.getEnchantment(split[0], user);
+ int level;
+ if (split.length > 1)
+ {
+ level = Integer.parseInt(split[1]);
+ }
+ else
+ {
+ level = enchantment.getMaxLevel();
+ }
+ stack.addEnchantment(enchantment, level);
+ }
+ }
if (stack.getType() == Material.AIR)
{
- throw new Exception(Util.format("cantSpawnItem", "Air"));
+ throw new Exception(_("cantSpawnItem", "Air"));
}
- String itemName = stack.getType().toString().toLowerCase().replace('_', ' ');
- user.sendMessage(Util.format("itemSpawn", stack.getAmount(), itemName));
- user.getInventory().addItem(stack);
+ final String displayName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' ');
+ user.sendMessage(_("itemSpawn", stack.getAmount(), displayName));
+ if (user.isAuthorized("essentials.oversizedstacks"))
+ {
+ InventoryWorkaround.addItem(user.getInventory(), true, ess.getSettings().getOversizedStackSize(), stack);
+ }
+ else
+ {
+ InventoryWorkaround.addItem(user.getInventory(), true, stack);
+ }
user.updateInventory();
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java b/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java
new file mode 100644
index 000000000..c35656c72
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java
@@ -0,0 +1,37 @@
+package com.earth2me.essentials.commands;
+
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+import org.bukkit.inventory.ItemStack;
+
+
+public class Commanditemdb extends EssentialsCommand
+{
+ public Commanditemdb()
+ {
+ super("itemdb");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ ItemStack itemStack = null;
+ if (args.length < 1)
+ {
+ if (sender instanceof Player)
+ {
+ itemStack = ((Player)sender).getItemInHand();
+ }
+ if (itemStack == null)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ }
+ else
+ {
+ itemStack = ess.getItemDb().get(args[0]);
+ }
+ sender.sendMessage(itemStack.getType().toString() + "- " + itemStack.getTypeId() + ":" + Integer.toString(itemStack.getData().getData()));
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandjails.java b/Essentials/src/com/earth2me/essentials/commands/Commandjails.java
index 36eb633fc..051bcf710 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandjails.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandjails.java
@@ -13,8 +13,8 @@ public class Commandjails extends EssentialsCommand
}
@Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- sender.sendMessage("§7" + Util.joinList(" ", ess.getJail().getJails()));
+ sender.sendMessage("§7" + Util.joinList(" ", ess.getJails().getList()));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandjump.java b/Essentials/src/com/earth2me/essentials/commands/Commandjump.java
index 5cdcbb2f2..39ca305e3 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandjump.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandjump.java
@@ -1,11 +1,12 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Trade;
-import org.bukkit.Location;
-import org.bukkit.Server;
-import com.earth2me.essentials.TargetBlock;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import org.bukkit.Location;
+import org.bukkit.Server;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Commandjump extends EssentialsCommand
@@ -16,28 +17,25 @@ public class Commandjump extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
Location loc;
- Location cloc = user.getLocation();
+ final Location cloc = user.getLocation();
try
{
- loc = new TargetBlock(user, 100, 2.65).getTargetBlock().getLocation();
- loc.setYaw(cloc.getYaw());
- loc.setPitch(cloc.getPitch());
- loc = new TargetBlock(loc).getPreviousBlock().getLocation();
+ loc = Util.getTarget(user);
loc.setYaw(cloc.getYaw());
loc.setPitch(cloc.getPitch());
loc.setY(loc.getY() + 1);
}
catch (NullPointerException ex)
{
- throw new Exception(Util.i18n("jumpError"), ex);
+ throw new Exception(_("jumpError"), ex);
}
- Trade charge = new Trade(this.getName(), ess);
+ final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
- user.getTeleport().teleport(loc, charge);
+ user.getTeleport().teleport(loc, charge, TeleportCause.COMMAND);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java
index fd0d4a8e0..ae5db48fb 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java
@@ -1,10 +1,10 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.Console;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import org.bukkit.entity.Player;
@@ -14,30 +14,30 @@ public class Commandkick extends EssentialsCommand
{
super("kick");
}
-
+
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
-
- User player = getPlayer(server, args, 0);
- if (player.isAuthorized("essentials.kick.exempt"))
+
+ final User user = getPlayer(server, args, 0);
+ if (user.isAuthorized("essentials.kick.exempt"))
{
- throw new Exception(Util.i18n("kickExempt"));
+ throw new Exception(_("kickExempt"));
}
- final String kickReason = args.length > 1 ? getFinalArg(args, 1) : Util.i18n("kickDefault");
- player.kickPlayer(kickReason);
- String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
-
- for(Player p : server.getOnlinePlayers())
+ final String kickReason = args.length > 1 ? getFinalArg(args, 1) : _("kickDefault");
+ user.kickPlayer(kickReason);
+ final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
+
+ for (Player onlinePlayer : server.getOnlinePlayers())
{
- User u = ess.getUser(p);
- if(u.isAuthorized("essentials.kick.notify"))
+ User player = ess.getUser(onlinePlayer);
+ if (player.isAuthorized("essentials.kick.notify"))
{
- p.sendMessage(Util.format("playerKicked", senderName, player.getName(), kickReason));
+ onlinePlayer.sendMessage(_("playerKicked", senderName, user.getName(), kickReason));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java
index 8d36f50d5..6d97b6af9 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Util;
+import static com.earth2me.essentials.I18n._;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -14,17 +14,17 @@ public class Commandkickall extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- for (Player p : server.getOnlinePlayers())
+ for (Player onlinePlayer : server.getOnlinePlayers())
{
- if (sender instanceof Player && p.getName().equalsIgnoreCase(((Player)sender).getName()))
+ if (sender instanceof Player && onlinePlayer.getName().equalsIgnoreCase(((Player)sender).getName()))
{
continue;
}
else
{
- p.kickPlayer(args.length > 0 ? getFinalArg(args, 0) : Util.i18n("kickDefault"));
+ onlinePlayer.kickPlayer(args.length > 0 ? getFinalArg(args, 0) : _("kickDefault"));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkill.java b/Essentials/src/com/earth2me/essentials/commands/Commandkill.java
index e976faa42..e56f9d67b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkill.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkill.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Util;
+import static com.earth2me.essentials.I18n._;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -15,24 +15,24 @@ public class Commandkill extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- for (Player p : server.matchPlayer(args[0]))
+ for (Player matchPlayer : server.matchPlayer(args[0]))
{
- final EntityDamageEvent ede = new EntityDamageEvent(p, sender instanceof Player && ((Player)sender).getName().equals(p.getName()) ? EntityDamageEvent.DamageCause.SUICIDE : EntityDamageEvent.DamageCause.CUSTOM, 1000);
+ final EntityDamageEvent ede = new EntityDamageEvent(matchPlayer, sender instanceof Player && ((Player)sender).getName().equals(matchPlayer.getName()) ? EntityDamageEvent.DamageCause.SUICIDE : EntityDamageEvent.DamageCause.CUSTOM, 1000);
server.getPluginManager().callEvent(ede);
if (ede.isCancelled() && !sender.hasPermission("essentials.kill.force"))
{
continue;
}
- p.setHealth(0);
- sender.sendMessage(Util.format("kill", p.getDisplayName()));
+ matchPlayer.setHealth(0);
+ sender.sendMessage(_("kill", matchPlayer.getDisplayName()));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java
new file mode 100644
index 000000000..b9679e8b9
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java
@@ -0,0 +1,162 @@
+package com.earth2me.essentials.commands;
+
+import com.earth2me.essentials.Mob;
+import static com.earth2me.essentials.I18n._;
+import java.util.Collections;
+import java.util.Locale;
+import org.bukkit.Chunk;
+import org.bukkit.Server;
+import org.bukkit.World;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Animals;
+import org.bukkit.entity.ComplexLivingEntity;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.Flying;
+import org.bukkit.entity.HumanEntity;
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.entity.Monster;
+import org.bukkit.entity.NPC;
+import org.bukkit.entity.Player;
+import org.bukkit.entity.Slime;
+import org.bukkit.entity.Snowman;
+import org.bukkit.entity.WaterMob;
+import org.bukkit.entity.Wolf;
+import org.bukkit.event.entity.EntityDeathEvent;
+
+
+public class Commandkillall extends EssentialsCommand
+{
+ public Commandkillall()
+ {
+ super("killall");
+ }
+
+ //TODO: Tidy - missed this during command cleanup
+ @Override
+ public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ String type = "all";
+ int radius = -1;
+ World world;
+ if (sender instanceof Player)
+ {
+ world = ((Player)sender).getWorld();
+ if (args.length == 1)
+ {
+ try
+ {
+ radius = Integer.parseInt(args[0]);
+ }
+ catch (NumberFormatException e1)
+ {
+ type = args[0];
+ }
+ }
+ else if (args.length > 1)
+ {
+ type = args[0];
+ try
+ {
+ radius = Integer.parseInt(args[1]);
+ }
+ catch (NumberFormatException e)
+ {
+ throw new Exception(_("numberRequired"));
+ }
+ }
+ }
+ else
+ {
+ if (args.length == 0)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ else if (args.length == 1)
+ {
+ world = ess.getWorld(args[0]);
+ }
+ else
+ {
+ type = args[0];
+ world = ess.getWorld(args[1]);
+ }
+ }
+ if (radius >= 0)
+ {
+ radius *= radius;
+ }
+ String killType = type.toLowerCase(Locale.ENGLISH);
+ boolean animals = killType.startsWith("animal");
+ boolean monster = killType.startsWith("monster") || killType.startsWith("mob");
+ boolean all = killType.equals("all");
+ Class<? extends Entity> entityClass = null;
+ if (!animals && !monster && !all)
+ {
+ if (Mob.fromName(killType) == null)
+ {
+ throw new Exception(_("invalidMob"));
+ }
+ entityClass = Mob.fromName(killType).getType().getEntityClass();
+ }
+ int numKills = 0;
+ for (Chunk chunk : world.getLoadedChunks())
+ {
+ for (Entity entity : chunk.getEntities())
+ {
+ if (sender instanceof Player)
+ {
+ if (radius >= 0 && ((Player)sender).getLocation().distanceSquared(entity.getLocation()) > radius)
+ {
+ continue;
+ }
+ }
+ if (entity instanceof LivingEntity == false || entity instanceof HumanEntity)
+ {
+ continue;
+ }
+ if (entity instanceof Wolf)
+ {
+ if (((Wolf)entity).isTamed())
+ {
+ continue;
+ }
+ }
+ if (animals)
+ {
+ if (entity instanceof Animals || entity instanceof NPC || entity instanceof Snowman || entity instanceof WaterMob)
+ {
+ EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST);
+ ess.getServer().getPluginManager().callEvent(event);
+ entity.remove();
+ numKills++;
+ }
+ }
+ else if (monster)
+ {
+ if (entity instanceof Monster || entity instanceof ComplexLivingEntity || entity instanceof Flying || entity instanceof Slime)
+ {
+ EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST);
+ ess.getServer().getPluginManager().callEvent(event);
+ entity.remove();
+ numKills++;
+ }
+ }
+ else if (all)
+ {
+ EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST);
+ ess.getServer().getPluginManager().callEvent(event);
+ entity.remove();
+ numKills++;
+ }
+ else if (entityClass != null && entityClass.isAssignableFrom(entity.getClass()))
+ {
+ EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST);
+ ess.getServer().getPluginManager().callEvent(event);
+ entity.remove();
+ numKills++;
+ }
+ }
+ }
+ sender.sendMessage(_("kill", numKills));
+ }
+} \ No newline at end of file
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
index ae7963c5e..c003d28ac 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
@@ -1,16 +1,9 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Trade;
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import com.earth2me.essentials.*;
+import static com.earth2me.essentials.I18n._;
+import java.util.*;
import org.bukkit.Server;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
-import java.util.GregorianCalendar;
-import org.bukkit.Material;
-import org.bukkit.inventory.ItemStack;
public class Commandkit extends EssentialsCommand
@@ -25,120 +18,39 @@ public class Commandkit extends EssentialsCommand
{
if (args.length < 1)
{
- try
+ final String kitList = Kit.listKits(ess, user);
+ if (kitList.length() > 0)
{
- final Map<String, Object> kits = ess.getSettings().getKits();
- final StringBuilder list = new StringBuilder();
- for (String k : kits.keySet())
- {
- if (user.isAuthorized("essentials.kit." + k.toLowerCase()))
- {
- list.append(" ").append(k);
- }
- }
- if (list.length() > 0)
- {
- user.sendMessage(Util.format("kits", list.toString()));
- }
- else
- {
- user.sendMessage(Util.i18n("noKits"));
- }
+ user.sendMessage(_("kits", kitList));
}
- catch (Exception ex)
+ else
{
- user.sendMessage(Util.i18n("kitError"));
+ user.sendMessage(_("noKits"));
}
+ throw new NoChargeException();
}
else
{
- try
+ final String kitName = args[0].toLowerCase(Locale.ENGLISH);
+ final Object kit = ess.getSettings().getKit(kitName);
+
+ if (!user.isAuthorized("essentials.kit." + kitName))
{
- final String kitName = args[0].toLowerCase();
- final Object kit = ess.getSettings().getKit(kitName);
- List<String> items;
+ throw new Exception(_("noKitPermission", "essentials.kit." + kitName));
+ }
+ final Map<String, Object> els = (Map<String, Object>)kit;
+ final List<String> items = Kit.getItems(user, els);
- if (!user.isAuthorized("essentials.kit." + kitName))
- {
- user.sendMessage(Util.format("noKitPermission", "essentials.kit." + kitName));
- return;
- }
+ Kit.checkTime(user, kitName, els);
- try
- {
+ final Trade charge = new Trade("kit-" + kitName, ess);
+ charge.isAffordableFor(user);
- //System.out.println("Kit is timed");
- final Map<String, Object> els = (Map<String, Object>)kit;
- items = (List<String>)els.get("items");
- final double delay = els.containsKey("delay") ? ((Number)els.get("delay")).doubleValue() : 0L;
- final Calendar c = new GregorianCalendar();
- c.add(Calendar.SECOND, -(int)delay);
- c.add(Calendar.MILLISECOND, -(int)((delay*1000.0)%1000.0));
+ Kit.expandItems(ess, user, items);
- final long mintime = c.getTimeInMillis();
-
- final Long lastTime = user.getKitTimestamp(kitName);
- if (lastTime == null || lastTime < mintime) {
- final Calendar now = new GregorianCalendar();
- user.setKitTimestamp(kitName, now.getTimeInMillis());
- } else {
- final Calendar future = new GregorianCalendar();
- future.setTimeInMillis(lastTime);
- future.add(Calendar.SECOND, (int)delay);
- future.add(Calendar.MILLISECOND, (int)((delay*1000.0)%1000.0));
- user.sendMessage(Util.format("kitTimed", Util.formatDateDiff(future.getTimeInMillis())));
- return;
- }
- }
- catch (Exception ex)
- {
- items = (List<String>)kit;
- }
-
- final Trade charge = new Trade("kit-" + kitName, ess);
- try
- {
- charge.isAffordableFor(user);
- }
- catch (Exception ex)
- {
- user.sendMessage(ex.getMessage());
- return;
- }
+ charge.charge(user);
+ user.sendMessage(_("kitGive", kitName));
- boolean spew = false;
- for (String d : items)
- {
- final String[] parts = d.split("[^0-9]+", 3);
- final int id = Material.getMaterial(Integer.parseInt(parts[0])).getId();
- final int amount = parts.length > 1 ? Integer.parseInt(parts[parts.length > 2 ? 2 : 1]) : 1;
- final short data = parts.length > 2 ? Short.parseShort(parts[1]) : 0;
- final HashMap<Integer,ItemStack> overfilled = user.getInventory().addItem(new ItemStack(id, amount, data));
- for (ItemStack itemStack : overfilled.values())
- {
- user.getWorld().dropItemNaturally(user.getLocation(), itemStack);
- spew = true;
- }
- }
- if (spew)
- {
- user.sendMessage(Util.i18n("kitInvFull"));
- }
- try
- {
- charge.charge(user);
- }
- catch (Exception ex)
- {
- user.sendMessage(ex.getMessage());
- }
- user.sendMessage(Util.format("kitGive", kitName));
- }
- catch (Exception ex)
- {
- user.sendMessage(Util.i18n("kitError2"));
- user.sendMessage(Util.i18n("kitErrorHelp"));
- }
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java
index dc4387833..be9ac61f5 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java
@@ -1,9 +1,10 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
+import org.bukkit.entity.LightningStrike;
import org.bukkit.entity.Player;
@@ -15,7 +16,7 @@ public class Commandlightning extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
User user = null;
@@ -31,19 +32,40 @@ public class Commandlightning extends EssentialsCommand
if (server.matchPlayer(args[0]).isEmpty())
{
- throw new Exception(Util.i18n("playerNotFound"));
+ throw new Exception(_("playerNotFound"));
}
- for (Player p : server.matchPlayer(args[0]))
+ int power = 1;
+ if (args.length > 1)
{
- sender.sendMessage(Util.format("lightningUse", p.getDisplayName()));
- p.getWorld().strikeLightning(p.getLocation());
- if (!ess.getUser(p).isGodModeEnabled()) {
- p.setHealth(p.getHealth() < 5 ? 0 : p.getHealth() - 5);
+ try
+ {
+ power = Integer.parseInt(args[1]);
+ }
+ catch (NumberFormatException ex)
+ {
+ }
+ }
+
+ for (Player matchPlayer : server.matchPlayer(args[0]))
+ {
+ sender.sendMessage(_("lightningUse", matchPlayer.getDisplayName()));
+ if (power <= 0)
+ {
+ matchPlayer.getWorld().strikeLightningEffect(matchPlayer.getLocation());
+ }
+ else
+ {
+ LightningStrike strike = matchPlayer.getWorld().strikeLightning(matchPlayer.getLocation());
+ matchPlayer.damage(power - 1, strike);
+ }
+ if (!ess.getUser(matchPlayer).isGodModeEnabled())
+ {
+ matchPlayer.setHealth(matchPlayer.getHealth() < 5 ? 0 : matchPlayer.getHealth() - 5);
}
if (ess.getSettings().warnOnSmite())
{
- p.sendMessage(Util.i18n("lightningSmited"));
+ matchPlayer.sendMessage(_("lightningSmited"));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java
index 98066d7e7..92833a66c 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java
@@ -1,17 +1,11 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import java.util.*;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.bukkit.ChatColor;
public class Commandlist extends EssentialsCommand
@@ -22,7 +16,7 @@ public class Commandlist extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
boolean showhidden = false;
if (sender instanceof Player)
@@ -37,50 +31,49 @@ public class Commandlist extends EssentialsCommand
showhidden = true;
}
int playerHidden = 0;
- for (Player p : server.getOnlinePlayers())
+ for (Player onlinePlayer : server.getOnlinePlayers())
{
- if (ess.getUser(p).isHidden())
+ if (ess.getUser(onlinePlayer).isHidden())
{
playerHidden++;
}
}
- //TODO: move these to messages file
- StringBuilder online = new StringBuilder();
- online.append(ChatColor.BLUE).append("There are ").append(ChatColor.RED).append(server.getOnlinePlayers().length - playerHidden);
+
+ String online;
if (showhidden && playerHidden > 0)
{
- online.append(ChatColor.GRAY).append("/").append(playerHidden);
+ online = _("listAmountHidden", server.getOnlinePlayers().length - playerHidden, playerHidden, server.getMaxPlayers());
+ } else {
+ online = _("listAmount",server.getOnlinePlayers().length - playerHidden, server.getMaxPlayers());
}
- online.append(ChatColor.BLUE).append(" out of a maximum ").append(ChatColor.RED).append(server.getMaxPlayers());
- online.append(ChatColor.BLUE).append(" players online.");
- sender.sendMessage(online.toString());
+ sender.sendMessage(online);
if (ess.getSettings().getSortListByGroups())
{
Map<String, List<User>> sort = new HashMap<String, List<User>>();
- for (Player p : server.getOnlinePlayers())
+ for (Player OnlinePlayer : server.getOnlinePlayers())
{
- User u = ess.getUser(p);
- if (u.isHidden() && !showhidden)
+ final User player = ess.getUser(OnlinePlayer);
+ if (player.isHidden() && !showhidden)
{
continue;
}
- String group = u.getGroup();
+ final String group = player.getGroup();
List<User> list = sort.get(group);
if (list == null)
{
list = new ArrayList<User>();
sort.put(group, list);
}
- list.add(u);
+ list.add(player);
}
- String[] groups = sort.keySet().toArray(new String[0]);
+ final String[] groups = sort.keySet().toArray(new String[0]);
Arrays.sort(groups, String.CASE_INSENSITIVE_ORDER);
for (String group : groups)
{
- StringBuilder groupString = new StringBuilder();
+ final StringBuilder groupString = new StringBuilder();
groupString.append(group).append(": ");
- List<User> users = sort.get(group);
+ final List<User> users = sort.get(group);
Collections.sort(users);
boolean first = true;
for (User user : users)
@@ -95,11 +88,11 @@ public class Commandlist extends EssentialsCommand
}
if (user.isAfk())
{
- groupString.append("§7[AFK]§f");
+ groupString.append(_("listAfkTag"));
}
if (user.isHidden())
{
- groupString.append("§7[HIDDEN]§f");
+ groupString.append(_("listHiddenTag"));
}
groupString.append(user.getDisplayName());
groupString.append("§f");
@@ -109,20 +102,20 @@ public class Commandlist extends EssentialsCommand
}
else
{
- List<User> users = new ArrayList<User>();
- for (Player p : server.getOnlinePlayers())
+ final List<User> users = new ArrayList<User>();
+ for (Player OnlinePlayer : server.getOnlinePlayers())
{
- final User u = ess.getUser(p);
- if (u.isHidden() && !showhidden)
+ final User player = ess.getUser(OnlinePlayer);
+ if (player.isHidden() && !showhidden)
{
continue;
}
- users.add(u);
+ users.add(player);
}
Collections.sort(users);
- StringBuilder onlineUsers = new StringBuilder();
- onlineUsers.append(Util.i18n("connectedPlayers"));
+ final StringBuilder onlineUsers = new StringBuilder();
+ onlineUsers.append(_("connectedPlayers"));
boolean first = true;
for (User user : users)
{
@@ -136,11 +129,11 @@ public class Commandlist extends EssentialsCommand
}
if (user.isAfk())
{
- onlineUsers.append("§7[AFK]§f");
+ onlineUsers.append(_("listAfkTag"));
}
if (user.isHidden())
{
- onlineUsers.append("§7[HIDDEN]§f");
+ onlineUsers.append(_("listHiddenTag"));
}
onlineUsers.append(user.getDisplayName());
onlineUsers.append("§f");
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java
index ddc26aadc..4a9928b85 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java
@@ -1,10 +1,11 @@
package com.earth2me.essentials.commands;
-import java.util.List;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import java.util.List;
import org.bukkit.ChatColor;
+import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -16,29 +17,30 @@ public class Commandmail extends EssentialsCommand
super("mail");
}
+ //TODO: Tidy this up
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length >= 1 && "read".equalsIgnoreCase(args[0]))
{
- List<String> mail = user.getMails();
+ final List<String> mail = user.getMails();
if (mail.isEmpty())
{
- user.sendMessage(Util.i18n("noMail"));
+ user.sendMessage(_("noMail"));
throw new NoChargeException();
}
- for (String s : mail)
+ for (String messages : mail)
{
- user.sendMessage(s);
+ user.sendMessage(messages);
}
- user.sendMessage(Util.i18n("mailClear"));
+ user.sendMessage(_("mailClear"));
return;
}
if (args.length >= 3 && "send".equalsIgnoreCase(args[0]))
{
if (!user.isAuthorized("essentials.mail.send"))
{
- throw new Exception(Util.i18n("noMailSendPerm"));
+ throw new Exception(_("noPerm","essentials.mail.send"));
}
Player player = server.getPlayer(args[1]);
@@ -53,19 +55,29 @@ public class Commandmail extends EssentialsCommand
}
if (u == null)
{
- throw new Exception(Util.format("playerNeverOnServer", args[1]));
+ throw new Exception(_("playerNeverOnServer", args[1]));
}
if (!u.isIgnoredPlayer(user.getName()))
{
- u.addMail(ChatColor.stripColor(user.getDisplayName()) + ": " + getFinalArg(args, 2));
+ u.addMail(user.getName() + ": " + Util.stripColor(getFinalArg(args, 2)));
+ }
+ user.sendMessage(_("mailSent"));
+ return;
+ }
+ if (args.length > 1 && "sendall".equalsIgnoreCase(args[0]))
+ {
+ if (!user.isAuthorized("essentials.mail.sendall"))
+ {
+ throw new Exception(_("noPerm","essentials.mail.sendall"));
}
- user.sendMessage(Util.i18n("mailSent"));
+ ess.scheduleAsyncDelayedTask(new SendAll(user.getName() + ": " + Util.stripColor(getFinalArg(args, 1))));
+ user.sendMessage(_("mailSent"));
return;
}
if (args.length >= 1 && "clear".equalsIgnoreCase(args[0]))
{
user.setMails(null);
- user.sendMessage(Util.i18n("mailCleared"));
+ user.sendMessage(_("mailCleared"));
return;
}
throw new NotEnoughArgumentsException();
@@ -76,11 +88,11 @@ public class Commandmail extends EssentialsCommand
{
if (args.length >= 1 && "read".equalsIgnoreCase(args[0]))
{
- throw new Exception(Util.format("onlyPlayers", commandLabel + " read"));
+ throw new Exception(_("onlyPlayers", commandLabel + " read"));
}
else if (args.length >= 1 && "clear".equalsIgnoreCase(args[0]))
{
- throw new Exception(Util.format("onlyPlayers", commandLabel + " clear"));
+ throw new Exception(_("onlyPlayers", commandLabel + " clear"));
}
else if (args.length >= 3 && "send".equalsIgnoreCase(args[0]))
{
@@ -96,12 +108,16 @@ public class Commandmail extends EssentialsCommand
}
if (u == null)
{
- throw new Exception(Util.format("playerNeverOnServer", args[1]));
+ throw new Exception(_("playerNeverOnServer", args[1]));
}
u.addMail("Server: " + getFinalArg(args, 2));
- sender.sendMessage(Util.i18n("mailSent"));
+ sender.sendMessage(_("mailSent"));
return;
}
+ else if (args.length >= 1 && "sendall".equalsIgnoreCase(args[0]))
+ {
+ ess.scheduleAsyncDelayedTask(new SendAll("Server: " + getFinalArg(args, 2)));
+ }
else if (args.length >= 2)
{
//allow sending from console without "send" argument, since it's the only thing the console can do
@@ -117,12 +133,36 @@ public class Commandmail extends EssentialsCommand
}
if (u == null)
{
- throw new Exception(Util.format("playerNeverOnServer", args[0]));
+ throw new Exception(_("playerNeverOnServer", args[0]));
}
u.addMail("Server: " + getFinalArg(args, 1));
- sender.sendMessage(Util.i18n("mailSent"));
+ sender.sendMessage(_("mailSent"));
return;
}
throw new NotEnoughArgumentsException();
}
+
+
+ private class SendAll implements Runnable
+ {
+ String message;
+
+ public SendAll(String message)
+ {
+ this.message = message;
+ }
+
+ @Override
+ public void run()
+ {
+ for (String username : ess.getUserMap().getAllUniqueUsers())
+ {
+ User user = ess.getUserMap().getUser(username);
+ if (user != null)
+ {
+ user.addMail(message);
+ }
+ }
+ }
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandme.java b/Essentials/src/com/earth2me/essentials/commands/Commandme.java
index 779e78420..3cdddf99c 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandme.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandme.java
@@ -1,8 +1,9 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import org.bukkit.Server;
public class Commandme extends EssentialsCommand
@@ -17,7 +18,7 @@ public class Commandme extends EssentialsCommand
{
if (user.isMuted())
{
- throw new Exception(Util.i18n("voiceSilenced"));
+ throw new Exception(_("voiceSilenced"));
}
if (args.length < 1)
@@ -28,9 +29,13 @@ public class Commandme extends EssentialsCommand
String message = getFinalArg(args, 0);
if (user.isAuthorized("essentials.chat.color"))
{
- message = message.replaceAll("&([0-9a-f])", "§$1");
+ message = message.replaceAll("&([0-9a-fk])", "§$1");
+ }
+ else {
+ message = Util.stripColor(message);
}
+
- ess.broadcastMessage(user, Util.format("action", user.getDisplayName(), message));
+ ess.broadcastMessage(user, _("action", user.getDisplayName(), message));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmore.java b/Essentials/src/com/earth2me/essentials/commands/Commandmore.java
new file mode 100644
index 000000000..3fce3110c
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandmore.java
@@ -0,0 +1,50 @@
+package com.earth2me.essentials.commands;
+
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import java.util.Locale;
+import org.bukkit.Server;
+import org.bukkit.inventory.ItemStack;
+
+
+public class Commandmore extends EssentialsCommand
+{
+ public Commandmore()
+ {
+ super("more");
+ }
+
+ @Override
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
+ {
+ final ItemStack stack = user.getItemInHand();
+ if (stack == null)
+ {
+ throw new Exception(_("cantSpawnItem", "Air"));
+ }
+ if (stack.getAmount() >= ((user.isAuthorized("essentials.oversizedstacks"))
+ ? ess.getSettings().getOversizedStackSize() : stack.getMaxStackSize()))
+ {
+ throw new NoChargeException();
+ }
+ final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
+ if (ess.getSettings().permissionBasedItemSpawn()
+ ? (!user.isAuthorized("essentials.itemspawn.item-all")
+ && !user.isAuthorized("essentials.itemspawn.item-" + itemname)
+ && !user.isAuthorized("essentials.itemspawn.item-" + stack.getTypeId()))
+ : (!user.isAuthorized("essentials.itemspawn.exempt")
+ && !user.canSpawnItem(stack.getTypeId())))
+ {
+ throw new Exception(_("cantSpawnItem", itemname));
+ }
+ if (user.isAuthorized("essentials.oversizedstacks"))
+ {
+ stack.setAmount(ess.getSettings().getOversizedStackSize());
+ }
+ else
+ {
+ stack.setAmount(stack.getMaxStackSize());
+ }
+ user.updateInventory();
+ }
+} \ No newline at end of file
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmotd.java b/Essentials/src/com/earth2me/essentials/commands/Commandmotd.java
index c695338f6..0031504e8 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandmotd.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandmotd.java
@@ -1,6 +1,9 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Util;
+import com.earth2me.essentials.textreader.IText;
+import com.earth2me.essentials.textreader.KeywordReplacer;
+import com.earth2me.essentials.textreader.TextInput;
+import com.earth2me.essentials.textreader.TextPager;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -11,13 +14,13 @@ public class Commandmotd extends EssentialsCommand
{
super("motd");
}
-
+
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- for (String m : ess.getMotd(sender, Util.i18n("noMotd")))
- {
- sender.sendMessage(m);
- }
+ final IText input = new TextInput(sender, "motd", true, ess);
+ final IText output = new KeywordReplacer(input, sender, ess);
+ final TextPager pager = new TextPager(output);
+ pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, commandLabel, sender);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java
index f14935648..de4b921e6 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java
@@ -1,13 +1,14 @@
package com.earth2me.essentials.commands;
-import java.util.List;
-import org.bukkit.Server;
-import org.bukkit.entity.Player;
import com.earth2me.essentials.Console;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IReplyTo;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import java.util.List;
+import org.bukkit.Server;
import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
public class Commandmsg extends EssentialsCommand
@@ -25,63 +26,75 @@ public class Commandmsg extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
+ String message = getFinalArg(args, 1);
if (sender instanceof Player)
{
User user = ess.getUser(sender);
if (user.isMuted())
{
- throw new Exception(Util.i18n("voiceSilenced"));
+ throw new Exception(_("voiceSilenced"));
+ }
+ if (user.isAuthorized("essentials.msg.color"))
+ {
+ message = message.replaceAll("&([0-9a-fk])", "§$1");
+ }
+ else
+ {
+ message = Util.stripColor(message);
}
}
+ else
+ {
+ message = message.replaceAll("&([0-9a-fk])", "§$1");
+ }
- String message = getFinalArg(args, 1);
- String translatedMe = Util.i18n("me");
+ final String translatedMe = _("me");
- IReplyTo replyTo = sender instanceof Player ? ess.getUser((Player)sender) : Console.getConsoleReplyTo();
- String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
+ final IReplyTo replyTo = sender instanceof Player ? ess.getUser((Player)sender) : Console.getConsoleReplyTo();
+ final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
if (args[0].equalsIgnoreCase(Console.NAME))
{
- sender.sendMessage(Util.format("msgFormat", translatedMe, Console.NAME, message));
+ sender.sendMessage(_("msgFormat", translatedMe, Console.NAME, message));
CommandSender cs = Console.getCommandSender(server);
- cs.sendMessage(Util.format("msgFormat", senderName, translatedMe, message));
+ cs.sendMessage(_("msgFormat", senderName, translatedMe, message));
replyTo.setReplyTo(cs);
Console.getConsoleReplyTo().setReplyTo(sender);
return;
}
- List<Player> matches = server.matchPlayer(args[0]);
+ final List<Player> matchedPlayers = server.matchPlayer(args[0]);
- if (matches.isEmpty())
+ if (matchedPlayers.isEmpty())
{
- throw new Exception(Util.i18n("playerNotFound"));
+ throw new Exception(_("playerNotFound"));
}
int i = 0;
- for (Player p : matches)
+ for (Player matchedPlayer : matchedPlayers)
{
- final User u = ess.getUser(p);
+ final User u = ess.getUser(matchedPlayer);
if (u.isHidden())
{
i++;
}
}
- if (i == matches.size())
+ if (i == matchedPlayers.size())
{
- throw new Exception(Util.i18n("playerNotFound"));
+ throw new Exception(_("playerNotFound"));
}
- for (Player p : matches)
+ for (Player matchedPlayer : matchedPlayers)
{
- sender.sendMessage(Util.format("msgFormat", translatedMe, p.getDisplayName(), message));
- final User u = ess.getUser(p);
- if (sender instanceof Player && (u.isIgnoredPlayer(((Player)sender).getName()) || u.isHidden()))
+ sender.sendMessage(_("msgFormat", translatedMe, matchedPlayer.getDisplayName(), message));
+ final User matchedUser = ess.getUser(matchedPlayer);
+ if (sender instanceof Player && (matchedUser.isIgnoredPlayer(((Player)sender).getName()) || matchedUser.isHidden()))
{
continue;
}
- p.sendMessage(Util.format("msgFormat", senderName, translatedMe, message));
- replyTo.setReplyTo(ess.getUser(p));
- ess.getUser(p).setReplyTo(sender);
+ matchedPlayer.sendMessage(_("msgFormat", senderName, translatedMe, message));
+ replyTo.setReplyTo(ess.getUser(matchedPlayer));
+ ess.getUser(matchedPlayer).setReplyTo(sender);
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmute.java b/Essentials/src/com/earth2me/essentials/commands/Commandmute.java
index 1777c5b48..3e70cc507 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandmute.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandmute.java
@@ -1,9 +1,10 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
public class Commandmute extends EssentialsCommand
@@ -14,17 +15,17 @@ public class Commandmute extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- User p = getPlayer(server, args, 0, true);
- if (!p.isMuted() && p.isAuthorized("essentials.mute.exempt"))
+ final User player = getPlayer(server, args, 0, true);
+ if (!player.isMuted() && player.isAuthorized("essentials.mute.exempt"))
{
- throw new Exception(Util.i18n("muteExempt"));
+ throw new Exception(_("muteExempt"));
}
long muteTimestamp = 0;
if (args.length > 1)
@@ -32,19 +33,19 @@ public class Commandmute extends EssentialsCommand
String time = getFinalArg(args, 1);
muteTimestamp = Util.parseDateDiff(time, true);
}
- p.setMuteTimeout(muteTimestamp);
- boolean muted = p.toggleMuted();
+ player.setMuteTimeout(muteTimestamp);
+ final boolean muted = player.toggleMuted();
sender.sendMessage(
muted
? (muteTimestamp > 0
- ? Util.format("mutedPlayerFor", p.getDisplayName(), Util.formatDateDiff(muteTimestamp))
- : Util.format("mutedPlayer", p.getDisplayName()))
- : Util.format("unmutedPlayer", p.getDisplayName()));
- p.sendMessage(
+ ? _("mutedPlayerFor", player.getDisplayName(), Util.formatDateDiff(muteTimestamp))
+ : _("mutedPlayer", player.getDisplayName()))
+ : _("unmutedPlayer", player.getDisplayName()));
+ player.sendMessage(
muted
? (muteTimestamp > 0
- ? Util.format("playerMutedFor", Util.formatDateDiff(muteTimestamp))
- : Util.i18n("playerMuted"))
- : Util.i18n("playerUnmuted"));
+ ? _("playerMutedFor", Util.formatDateDiff(muteTimestamp))
+ : _("playerMuted"))
+ : _("playerUnmuted"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnear.java b/Essentials/src/com/earth2me/essentials/commands/Commandnear.java
new file mode 100644
index 000000000..0afcf1650
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandnear.java
@@ -0,0 +1,120 @@
+package com.earth2me.essentials.commands;
+
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import org.bukkit.Location;
+import org.bukkit.Server;
+import org.bukkit.World;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+
+public class Commandnear extends EssentialsCommand
+{
+ public Commandnear()
+ {
+ super("near");
+ }
+
+ @Override
+ protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
+ {
+ long radius = 200;
+ User otherUser = null;
+
+ if (args.length > 0)
+ {
+ try
+ {
+ otherUser = getPlayer(server, args, 0);
+ }
+ catch (Exception ex)
+ {
+ try
+ {
+ radius = Long.parseLong(args[0]);
+ }
+ catch (NumberFormatException e)
+ {
+ }
+ }
+ }
+ if (args.length > 1 && otherUser != null)
+ {
+ try
+ {
+ radius = Long.parseLong(args[1]);
+ }
+ catch (NumberFormatException e)
+ {
+ }
+ }
+ if (otherUser == null || user.isAuthorized("essentials.near.others"))
+ {
+ user.sendMessage(_("nearbyPlayers", getLocal(server, otherUser == null ? user : otherUser, radius)));
+ }
+ else
+ {
+ user.sendMessage(_("noAccessCommand"));
+ }
+ }
+
+ @Override
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
+
+ User otherUser = null;
+ if (args.length > 0)
+ {
+ otherUser = getPlayer(server, args, 0);
+ }
+ else
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ long radius = 200;
+ if (args.length > 1)
+ {
+ try
+ {
+ radius = Long.parseLong(args[1]);
+ }
+ catch (NumberFormatException e)
+ {
+ }
+ }
+ sender.sendMessage(_("nearbyPlayers", getLocal(server, otherUser, radius)));
+ }
+
+ private String getLocal(final Server server, final User user, final long radius)
+ {
+ final Location loc = user.getLocation();
+ final World world = loc.getWorld();
+ final StringBuilder output = new StringBuilder();
+ final long radiusSquared = radius * radius;
+
+ for (Player onlinePlayer : server.getOnlinePlayers())
+ {
+ final User player = ess.getUser(onlinePlayer);
+ if (!player.equals(user) && !player.isHidden())
+ {
+ final Location playerLoc = player.getLocation();
+ if (playerLoc.getWorld() != world)
+ {
+ continue;
+ }
+
+ final long delta = (long)playerLoc.distanceSquared(loc);
+ if (delta < radiusSquared)
+ {
+ if (output.length() > 0)
+ {
+ output.append(", ");
+ }
+ output.append(player.getDisplayName()).append("§f(§4").append((long)Math.sqrt(delta)).append("m§f)");
+ }
+ }
+ }
+ return output.length() > 1 ? output.toString() : _("none");
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java
index f2165aebc..b9fbccb37 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java
@@ -1,10 +1,12 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import java.util.Locale;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
public class Commandnick extends EssentialsCommand
@@ -15,96 +17,107 @@ public class Commandnick extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
-
- if (!ess.getSettings().changeDisplayName()) {
- throw new Exception(Util.i18n("nickDisplayName"));
+ if (!ess.getSettings().changeDisplayName())
+ {
+ throw new Exception(_("nickDisplayName"));
}
-
if (args.length > 1)
{
if (!user.isAuthorized("essentials.nick.others"))
{
- throw new Exception(Util.i18n("nickOthersPermission"));
+ throw new Exception(_("nickOthersPermission"));
}
-
- setOthersNickname(server, user, args);
+ setNickname(server, getPlayer(server, args, 0), formatNickname(user, args[1]));
+ user.sendMessage(_("nickChanged"));
return;
}
+ setNickname(server, user, formatNickname(user, args[0]));
+ }
-
- String nick = args[0];
- if ("off".equalsIgnoreCase(nick) || user.getName().equalsIgnoreCase(nick))
+ @Override
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
+ if (args.length < 2)
{
- user.setDisplayNick(user.getName());
- user.setNickname(null);
- user.sendMessage(Util.i18n("nickNoMore"));
- return;
+ throw new NotEnoughArgumentsException();
+ }
+ if (!ess.getSettings().changeDisplayName())
+ {
+ throw new Exception(_("nickDisplayName"));
+ }
+ if ((args[0].equalsIgnoreCase("*") || args[0].equalsIgnoreCase("all")) && args[1].equalsIgnoreCase("off"))
+ {
+ resetAllNicknames(server);
+ }
+ else
+ {
+ setNickname(server, getPlayer(server, args, 0), formatNickname(null, args[1]));
}
+ sender.sendMessage(_("nickChanged"));
+ }
- if (nick.matches("[^a-zA-Z_0-9]"))
+ private String formatNickname(final User user, final String nick)
+ {
+ if (user == null || user.isAuthorized("essentials.nick.color"))
{
- throw new Exception(Util.i18n("nickNamesAlpha"));
+ return nick.replace('&', '\u00a7').replaceAll("\u00a7+k", "");
+ } else {
+ return Util.stripColor(nick);
}
+ }
- for (Player p : server.getOnlinePlayers())
+ private void resetAllNicknames(final Server server)
+ {
+ for (Player player : server.getOnlinePlayers())
{
- if (user == p)
+ try
{
- continue;
+ setNickname(server, ess.getUser(player), "off");
}
- String dn = p.getDisplayName().toLowerCase();
- String n = p.getName().toLowerCase();
- String nk = nick.toLowerCase();
- if (nk.equals(dn) || nk.equals(n))
+ catch (Exception ex)
{
- throw new Exception(Util.i18n("nickInUse"));
}
}
-
- user.setDisplayNick(ess.getSettings().getNicknamePrefix() + nick);
- user.setNickname(nick);
- user.sendMessage(Util.format("nickSet", user.getDisplayName() + "§7."));
}
- @Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ private void setNickname(final Server server, final User target, final String nick) throws Exception
{
- if (args.length < 2)
+ if (!nick.matches("^[a-zA-Z_0-9\u00a7]+$"))
{
- throw new NotEnoughArgumentsException();
- }
-
- if (!ess.getSettings().changeDisplayName()) {
- sender.sendMessage(Util.i18n("nickDisplayName"));
- return;
+ throw new Exception(_("nickNamesAlpha"));
}
-
- setOthersNickname(server, sender, args);
-
- }
-
- private void setOthersNickname(Server server, CommandSender sender, String[] args) throws Exception
- {
- User target = getPlayer(server, args, 0);
- String nick = args[1];
- if ("off".equalsIgnoreCase(nick) || target.getName().equalsIgnoreCase(nick))
+ else if ("off".equalsIgnoreCase(nick) || target.getName().equalsIgnoreCase(nick))
{
- target.setDisplayNick(target.getName());
target.setNickname(null);
- target.sendMessage(Util.i18n("nickNoMore"));
+ target.setDisplayNick();
+ target.sendMessage(_("nickNoMore"));
}
else
{
- target.setDisplayNick(ess.getSettings().getNicknamePrefix() + nick);
+ for (Player p : server.getOnlinePlayers())
+ {
+ if (target.getBase() == p)
+ {
+ continue;
+ }
+ String dn = p.getDisplayName().toLowerCase(Locale.ENGLISH);
+ String n = p.getName().toLowerCase(Locale.ENGLISH);
+ String nk = nick.toLowerCase(Locale.ENGLISH);
+ if (nk.equals(dn) || nk.equals(n))
+ {
+ throw new Exception(_("nickInUse"));
+ }
+ }
+
target.setNickname(nick);
- target.sendMessage(Util.format("nickSet", target.getDisplayName() + "§7."));
+ target.setDisplayNick();
+ target.sendMessage(_("nickSet", target.getDisplayName() + "§7."));
}
- sender.sendMessage(Util.i18n("nickChanged"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java
index 9aa4f8ac0..df497a352 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java
@@ -22,7 +22,7 @@ public class Commandnuke extends EssentialsCommand
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws NoSuchFieldException, NotEnoughArgumentsException
{
List<Player> targets;
- if (args.length > 0)
+ if (args.length > 0)
{
targets = new ArrayList<Player>();
int pos = 0;
@@ -34,14 +34,15 @@ public class Commandnuke extends EssentialsCommand
}
else
{
- targets = Arrays.asList(server.getOnlinePlayers());
+ targets = Arrays.asList(server.getOnlinePlayers());
}
ess.getTNTListener().enable();
for (Player player : targets)
{
- if (player == null) {
+ if (player == null)
+ {
continue;
- }
+ }
player.sendMessage("May death rain upon them");
final Location loc = player.getLocation();
final World world = loc.getWorld();
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpay.java b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java
index 9be844996..01e1fcffb 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandpay.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java
@@ -1,9 +1,10 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.User;
import org.bukkit.Server;
import org.bukkit.entity.Player;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
public class Commandpay extends EssentialsCommand
@@ -20,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\\.]", ""));
@@ -32,11 +38,13 @@ public class Commandpay extends EssentialsCommand
continue;
}
user.payUser(u, amount);
+ Trade.log("Command", "Pay", "Player", user.getName(), new Trade(amount, ess), u.getName(), new Trade(amount, ess), user.getLocation(), ess);
foundUser = true;
}
-
- if(foundUser == false) {
- throw new NoSuchFieldException(Util.i18n("playerNotFound"));
+
+ if (foundUser == false)
+ {
+ throw new NoSuchFieldException(_("playerNotFound"));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandping.java b/Essentials/src/com/earth2me/essentials/commands/Commandping.java
index 1f4cdd3dc..1fad701b2 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandping.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandping.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
public class Commandping extends EssentialsCommand
@@ -15,6 +15,6 @@ public class Commandping extends EssentialsCommand
@Override
public void run(Server server, User player, String commandLabel, String[] args) throws Exception
{
- player.sendMessage(Util.i18n("pong"));
+ player.sendMessage(_("pong"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java
index c9e8dea58..ca03364b2 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java
@@ -1,9 +1,11 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.inventory.ItemStack;
@@ -22,20 +24,20 @@ public class Commandpowertool extends EssentialsCommand
String command = getFinalArg(args, 0);
// check to see if this is a clear all command
- if(command != null && command.equalsIgnoreCase("clearall"))
+ if (command != null && command.equalsIgnoreCase("d:"))
{
user.clearAllPowertools();
- user.sendMessage(Util.i18n("powerToolClearAll"));
+ user.sendMessage(_("powerToolClearAll"));
return;
}
-
+
final ItemStack itemStack = user.getItemInHand();
if (itemStack == null || itemStack.getType() == Material.AIR)
{
- throw new Exception(Util.i18n("powerToolAir"));
+ throw new Exception(_("powerToolAir"));
}
- final String itemName = itemStack.getType().toString().toLowerCase().replaceAll("_", " ");
+ final String itemName = itemStack.getType().toString().toLowerCase(Locale.ENGLISH).replaceAll("_", " ");
List<String> powertools = user.getPowertool(itemStack);
if (command != null && !command.isEmpty())
{
@@ -43,11 +45,11 @@ public class Commandpowertool extends EssentialsCommand
{
if (powertools == null || powertools.isEmpty())
{
- throw new Exception(Util.format("powerToolListEmpty", itemName));
+ throw new Exception(_("powerToolListEmpty", itemName));
}
else
{
- user.sendMessage(Util.format("powerToolList", Util.joinList(powertools), itemName));
+ user.sendMessage(_("powerToolList", Util.joinList(powertools), itemName));
}
return;
}
@@ -58,11 +60,11 @@ public class Commandpowertool extends EssentialsCommand
command = command.substring(2);
if (!powertools.contains(command))
{
- throw new Exception(Util.format("powerToolNoSuchCommandAssigned", command, itemName));
+ throw new Exception(_("powerToolNoSuchCommandAssigned", command, itemName));
}
powertools.remove(command);
- user.sendMessage(Util.format("powerToolRemove", command, itemName));
+ user.sendMessage(_("powerToolRemove", command, itemName));
}
catch (Exception e)
{
@@ -74,11 +76,16 @@ public class Commandpowertool extends EssentialsCommand
{
if (command.startsWith("a:"))
{
+ if (!user.isAuthorized("essentials.powertool.append"))
+ {
+ throw new Exception(_("noPerm", "essentials.powertool.append"));
+ }
command = command.substring(2);
if (powertools.contains(command))
{
- throw new Exception(Util.format("powerToolAlreadySet", command, itemName));
+ throw new Exception(_("powerToolAlreadySet", command, itemName));
}
+
}
else if (powertools != null && !powertools.isEmpty())
{
@@ -91,7 +98,7 @@ public class Commandpowertool extends EssentialsCommand
}
powertools.add(command);
- user.sendMessage(Util.format("powerToolAttach", Util.joinList(powertools), itemName));
+ user.sendMessage(_("powerToolAttach", Util.joinList(powertools), itemName));
}
}
else
@@ -100,7 +107,7 @@ public class Commandpowertool extends EssentialsCommand
{
powertools.clear();
}
- user.sendMessage(Util.format("powerToolRemoveAll", itemName));
+ user.sendMessage(_("powerToolRemoveAll", itemName));
}
user.setPowertool(itemStack, powertools);
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpowertooltoggle.java b/Essentials/src/com/earth2me/essentials/commands/Commandpowertooltoggle.java
index af51f2628..c8b737dfa 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandpowertooltoggle.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandpowertooltoggle.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import org.bukkit.Server;
@@ -15,15 +15,13 @@ public class Commandpowertooltoggle extends EssentialsCommand
@Override
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- if(!user.hasPowerTools())
+ if (!user.hasPowerTools())
{
- user.sendMessage(Util.i18n("noPowerTools"));
+ user.sendMessage(_("noPowerTools"));
return;
- }
+ }
user.sendMessage(user.togglePowerToolsEnabled()
- ? Util.i18n("powerToolsEnabled")
- : Util.i18n("powerToolsDisabled"));
+ ? _("powerToolsEnabled")
+ : _("powerToolsDisabled"));
}
-
-
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandptime.java b/Essentials/src/com/earth2me/essentials/commands/Commandptime.java
index 115bb20ef..b16cbdc34 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandptime.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandptime.java
@@ -1,17 +1,12 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.DescParseTickFormat;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
+import java.util.*;
+import org.bukkit.Server;
import org.bukkit.World;
+import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -53,7 +48,7 @@ public class Commandptime extends EssentialsCommand
User user = ess.getUser(sender);
if ((!users.contains(user) || users.size() > 1) && user != null && !user.isAuthorized("essentials.ptime.others"))
{
- user.sendMessage(Util.i18n("pTimeOthersPermission"));
+ user.sendMessage(_("pTimeOthersPermission"));
return;
}
@@ -98,30 +93,28 @@ public class Commandptime extends EssentialsCommand
{
if (users.size() > 1)
{
- sender.sendMessage(Util.format("pTimePlayers"));
+ sender.sendMessage(_("pTimePlayers"));
}
for (User user : users)
{
if (user.getPlayerTimeOffset() == 0)
{
- sender.sendMessage(Util.format("pTimeNormal", user.getName()));
+ sender.sendMessage(_("pTimeNormal", user.getName()));
}
else
{
String time = DescParseTickFormat.format(user.getPlayerTime());
if (!user.isPlayerTimeRelative())
{
- sender.sendMessage(Util.format("pTimeCurrentFixed", user.getName(), time));
+ sender.sendMessage(_("pTimeCurrentFixed", user.getName(), time));
}
else
{
- sender.sendMessage(Util.format("pTimeCurrent", user.getName(), time));
+ sender.sendMessage(_("pTimeCurrent", user.getName(), time));
}
}
}
-
- return;
}
/**
@@ -169,18 +162,18 @@ public class Commandptime extends EssentialsCommand
// Inform the sender of the change
if (ticks == null)
{
- sender.sendMessage(Util.format("pTimeReset", msg.toString()));
+ sender.sendMessage(_("pTimeReset", msg.toString()));
}
else
{
String time = DescParseTickFormat.format(ticks);
if (!relative)
{
- sender.sendMessage(Util.format("pTimeSetFixed", time, msg.toString()));
+ sender.sendMessage(_("pTimeSetFixed", time, msg.toString()));
}
else
{
- sender.sendMessage(Util.format("pTimeSet", time, msg.toString()));
+ sender.sendMessage(_("pTimeSet", time, msg.toString()));
}
}
}
@@ -232,7 +225,7 @@ public class Commandptime extends EssentialsCommand
// We failed to understand the world target...
else
{
- throw new Exception(Util.i18n("playerNotFound"));
+ throw new Exception(_("playerNotFound"));
}
return users;
@@ -242,6 +235,7 @@ public class Commandptime extends EssentialsCommand
class UserNameComparator implements Comparator<User>
{
+ @Override
public int compare(User a, User b)
{
return a.getName().compareTo(b.getName());
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandr.java b/Essentials/src/com/earth2me/essentials/commands/Commandr.java
index daf83034a..9e30225ac 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandr.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandr.java
@@ -1,10 +1,11 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.Console;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IReplyTo;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
-import org.bukkit.*;
+import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -17,7 +18,7 @@ public class Commandr extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
@@ -25,26 +26,48 @@ public class Commandr extends EssentialsCommand
}
String message = getFinalArg(args, 0);
- IReplyTo replyTo = sender instanceof Player ? ess.getUser((Player)sender) : Console.getConsoleReplyTo();
- String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
- CommandSender target = replyTo.getReplyTo();
- String targetName = target instanceof Player ? ((Player)target).getDisplayName() : Console.NAME;
+ IReplyTo replyTo;
+ String senderName;
+
+ if (sender instanceof Player)
+ {
+ User user = ess.getUser(sender);
+ if (user.isAuthorized("essentials.msg.color"))
+ {
+ message = message.replaceAll("&([0-9a-fk])", "§$1");
+ }
+ else
+ {
+ message = Util.stripColor(message);
+ }
+ replyTo = user;
+ senderName = user.getDisplayName();
+ }
+ else
+ {
+ message = message.replaceAll("&([0-9a-fk])", "§$1");
+ replyTo = Console.getConsoleReplyTo();
+ senderName = Console.NAME;
+ }
+
+ final CommandSender target = replyTo.getReplyTo();
+ final String targetName = target instanceof Player ? ((Player)target).getDisplayName() : Console.NAME;
if (target == null)
{
- throw new Exception(Util.i18n("foreverAlone"));
+ throw new Exception(_("foreverAlone"));
}
- sender.sendMessage(Util.format("msgFormat", Util.i18n("me"), targetName, message));
+ sender.sendMessage(_("msgFormat", _("me"), targetName, message));
if (target instanceof Player)
{
- User u = ess.getUser(target);
- if (u.isIgnoredPlayer(sender instanceof Player ? ((Player)sender).getName() : Console.NAME))
+ User player = ess.getUser(target);
+ if (player.isIgnoredPlayer(sender instanceof Player ? ((Player)sender).getName() : Console.NAME))
{
return;
}
}
- target.sendMessage(Util.format("msgFormat", senderName, Util.i18n("me"), message));
+ target.sendMessage(_("msgFormat", senderName, _("me"), message));
replyTo.setReplyTo(target);
if (target != sender)
{
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java
index 5ed4ef9e6..b48ac5bcb 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java
@@ -1,11 +1,12 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import java.util.Locale;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
-import org.bukkit.ChatColor;
public class Commandrealname extends EssentialsCommand
@@ -16,28 +17,28 @@ public class Commandrealname extends EssentialsCommand
}
@Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- final String whois = args[0].toLowerCase();
- for (Player p : server.getOnlinePlayers())
+ final String whois = args[0].toLowerCase(Locale.ENGLISH);
+ for (Player onlinePlayer : server.getOnlinePlayers())
{
- final User u = ess.getUser(p);
+ final User u = ess.getUser(onlinePlayer);
if (u.isHidden())
{
continue;
}
- final String displayName = ChatColor.stripColor(u.getDisplayName()).toLowerCase();
+ final String displayName = Util.stripColor(u.getDisplayName()).toLowerCase(Locale.ENGLISH);
if (!whois.equals(displayName)
- && !displayName.equals(ChatColor.stripColor(ess.getSettings().getNicknamePrefix()) + whois)
+ && !displayName.equals(Util.stripColor(ess.getSettings().getNicknamePrefix()) + whois)
&& !whois.equalsIgnoreCase(u.getName()))
{
continue;
}
- sender.sendMessage(u.getDisplayName() + " " + Util.i18n("is") + " " + u.getName());
+ sender.sendMessage(u.getDisplayName() + " " + _("is") + " " + u.getName());
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandreloadall.java b/Essentials/src/com/earth2me/essentials/commands/Commandreloadall.java
deleted file mode 100644
index bd4f59dcc..000000000
--- a/Essentials/src/com/earth2me/essentials/commands/Commandreloadall.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.earth2me.essentials.commands;
-
-import com.earth2me.essentials.Util;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandreloadall extends EssentialsCommand
-{
- public Commandreloadall()
- {
- super("reloadall");
- }
-
- @Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- server.reload();
- sender.sendMessage(Util.i18n("reloadAllPlugins"));
- }
-}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandremove.java b/Essentials/src/com/earth2me/essentials/commands/Commandremove.java
new file mode 100644
index 000000000..d245d1239
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandremove.java
@@ -0,0 +1,161 @@
+package com.earth2me.essentials.commands;
+
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import java.util.Locale;
+import org.bukkit.Chunk;
+import org.bukkit.Server;
+import org.bukkit.World;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.*;
+
+
+public class Commandremove extends EssentialsCommand
+{
+ public Commandremove()
+ {
+ super("remove");
+ }
+
+
+ private enum ToRemove
+ {
+ DROPS,
+ ARROWS,
+ BOATS,
+ MINECARTS,
+ XP,
+ PAINTINGS
+ }
+
+ @Override
+ protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
+ {
+ if (args.length < 1)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ ToRemove toRemove;
+ final World world = user.getWorld();
+ int radius = 0;
+
+ if (args.length < 2)
+ {
+ try
+ {
+ radius = Integer.parseInt(args[1]);
+ }
+ catch (NumberFormatException e)
+ {
+ throw new Exception(_("numberRequired"));
+ }
+ }
+
+ try
+ {
+ toRemove = ToRemove.valueOf(args[0].toUpperCase(Locale.ENGLISH));
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new NotEnoughArgumentsException(); //TODO: translate and list types
+ }
+
+ removeEntities(user, world, toRemove, radius);
+ }
+
+ @Override
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ World world;
+ world = ess.getWorld(args[1]);
+
+ if (world == null)
+ {
+ throw new Exception(_("invalidWorld"));
+ }
+ ToRemove toRemove;
+ try
+ {
+ toRemove = ToRemove.valueOf(args[0].toUpperCase(Locale.ENGLISH));
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new NotEnoughArgumentsException(); //TODO: translate and list types
+ }
+ removeEntities(sender, world, toRemove, 0);
+ }
+
+ protected void removeEntities(final CommandSender sender, final World world, final ToRemove toRemove, int radius) throws Exception
+ {
+ int removed = 0;
+ if (radius > 0) {
+ radius*=radius;
+ }
+ for (Chunk chunk : world.getLoadedChunks())
+ {
+ for (Entity e : chunk.getEntities())
+ {
+ if (radius > 0)
+ {
+ if (((Player)sender).getLocation().distanceSquared(e.getLocation()) > radius)
+ {
+ continue;
+ }
+ }
+ if (toRemove == ToRemove.DROPS)
+ {
+ if (e instanceof Item)
+ {
+ e.remove();
+ removed++;
+ }
+ }
+ else if (toRemove == ToRemove.ARROWS)
+ {
+ if (e instanceof Projectile)
+ {
+ e.remove();
+ removed++;
+ }
+ }
+ else if (toRemove == ToRemove.BOATS)
+ {
+ if (e instanceof Boat)
+ {
+ e.remove();
+ removed++;
+ }
+ }
+ else if (toRemove == ToRemove.DROPS)
+ {
+ if (e instanceof Minecart)
+ {
+ e.remove();
+ removed++;
+ }
+ }
+ else if (toRemove == ToRemove.XP)
+ {
+ if (e instanceof ExperienceOrb)
+ {
+ e.remove();
+ removed++;
+ }
+ }
+ else if (toRemove == ToRemove.PAINTINGS)
+ {
+ if (e instanceof Painting)
+ {
+ e.remove();
+ removed++;
+ }
+ }
+ }
+ }
+ sender.sendMessage(_("removed", removed));
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java
index d6bcad464..cf9e43f9f 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java
@@ -1,12 +1,10 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.ChargeException;
-import com.earth2me.essentials.IUser;
-import com.earth2me.essentials.Trade;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.*;
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.inventory.ItemStack;
@@ -32,9 +30,17 @@ public class Commandrepair extends EssentialsCommand
final ItemStack item = user.getItemInHand();
if (item == null)
{
- throw new Exception(Util.i18n("repairInvalidType"));
+ throw new Exception(_("repairInvalidType"));
}
- final String itemName = item.getType().toString().toLowerCase();
+
+ if (!item.getEnchantments().isEmpty()
+ && !ess.getSettings().getRepairEnchanted()
+ && !user.isAuthorized("essentials.repair.enchanted"))
+ {
+ throw new Exception(_("repairEnchanted"));
+ }
+
+ final String itemName = item.getType().toString().toLowerCase(Locale.ENGLISH);
final Trade charge = new Trade("repair-" + itemName.replace('_', '-'), ess);
charge.isAffordableFor(user);
@@ -43,22 +49,25 @@ public class Commandrepair extends EssentialsCommand
charge.charge(user);
- user.sendMessage(Util.format("repair", itemName.replace('_', ' ')));
+ user.sendMessage(_("repair", itemName.replace('_', ' ')));
}
else if (args[0].equalsIgnoreCase("all"))
{
final List<String> repaired = new ArrayList<String>();
repairItems(user.getInventory().getContents(), user, repaired);
- repairItems(user.getInventory().getArmorContents(), user, repaired);
+ if (user.isAuthorized("essentials.repair.armor"))
+ {
+ repairItems(user.getInventory().getArmorContents(), user, repaired);
+ }
if (repaired.isEmpty())
{
- throw new Exception(Util.format("repairNone"));
+ throw new Exception(_("repairNone"));
}
else
{
- user.sendMessage(Util.format("repair", Util.joinList(repaired)));
+ user.sendMessage(_("repair", Util.joinList(repaired)));
}
}
@@ -73,12 +82,12 @@ public class Commandrepair extends EssentialsCommand
final Material material = Material.getMaterial(item.getTypeId());
if (material.isBlock() || material.getMaxDurability() < 0)
{
- throw new Exception(Util.i18n("repairInvalidType"));
+ throw new Exception(_("repairInvalidType"));
}
if (item.getDurability() == 0)
{
- throw new Exception(Util.i18n("repairAlreadyFixed"));
+ throw new Exception(_("repairAlreadyFixed"));
}
item.setDurability((short)0);
@@ -92,7 +101,7 @@ public class Commandrepair extends EssentialsCommand
{
continue;
}
- final String itemName = item.getType().toString().toLowerCase();
+ final String itemName = item.getType().toString().toLowerCase(Locale.ENGLISH);
final Trade charge = new Trade("repair-" + itemName.replace('_', '-'), ess);
try
{
@@ -103,6 +112,12 @@ public class Commandrepair extends EssentialsCommand
user.sendMessage(ex.getMessage());
continue;
}
+ if (!item.getEnchantments().isEmpty()
+ && !ess.getSettings().getRepairEnchanted()
+ && !user.isAuthorized("essentials.repair.enchanted"))
+ {
+ continue;
+ }
try
{
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrules.java b/Essentials/src/com/earth2me/essentials/commands/Commandrules.java
index 39f7de68e..d87c4f41b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandrules.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandrules.java
@@ -1,6 +1,9 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Util;
+import com.earth2me.essentials.textreader.IText;
+import com.earth2me.essentials.textreader.KeywordReplacer;
+import com.earth2me.essentials.textreader.TextInput;
+import com.earth2me.essentials.textreader.TextPager;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -13,11 +16,11 @@ public class Commandrules extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- for (String m : ess.getLines(sender, "rules", Util.i18n("noRules")))
- {
- sender.sendMessage(m);
- }
+ final IText input = new TextInput(sender, "rules", true, ess);
+ final IText output = new KeywordReplacer(input, sender, ess);
+ final TextPager pager = new TextPager(output);
+ pager.showPage(args.length > 0 ? args[0] : null, args.length > 1 ? args[1] : null, "rules", sender);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java
index c355f5aff..cf500e094 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java
@@ -1,5 +1,6 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.Server;
@@ -14,7 +15,7 @@ public class Commandseen extends EssentialsCommand
}
@Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
@@ -23,16 +24,20 @@ public class Commandseen extends EssentialsCommand
try
{
User u = getPlayer(server, args, 0);
- sender.sendMessage(Util.format("seenOnline",u.getDisplayName(), Util.formatDateDiff(u.getLastLogin())));
+ sender.sendMessage(_("seenOnline", u.getDisplayName(), Util.formatDateDiff(u.getLastLogin())));
}
catch (NoSuchFieldException e)
{
User u = ess.getOfflineUser(args[0]);
if (u == null)
{
- throw new Exception(Util.i18n("playerNotFound"));
+ throw new Exception(_("playerNotFound"));
+ }
+ sender.sendMessage(_("seenOffline", u.getDisplayName(), Util.formatDateDiff(u.getLastLogout())));
+ if (u.isBanned())
+ {
+ sender.sendMessage(_("whoisBanned", _("true")));
}
- sender.sendMessage(Util.format("seenOffline", u.getDisplayName(), Util.formatDateDiff(u.getLastLogout())));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
index a8ef83dc0..d59c09b1e 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
@@ -1,12 +1,14 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
-import com.earth2me.essentials.InventoryWorkaround;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import java.util.Locale;
import java.util.logging.Level;
import org.bukkit.Material;
+import org.bukkit.Server;
import org.bukkit.inventory.ItemStack;
@@ -18,7 +20,7 @@ public class Commandsell extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
@@ -76,7 +78,7 @@ public class Commandsell extends EssentialsCommand
{
if (is == null || is.getType() == Material.AIR)
{
- throw new Exception(Util.i18n("itemSellAir"));
+ throw new Exception(_("itemSellAir"));
}
int id = is.getTypeId();
int amount = 0;
@@ -94,11 +96,11 @@ public class Commandsell extends EssentialsCommand
if (Double.isNaN(worth))
{
- throw new Exception(Util.i18n("itemCannotBeSold"));
+ throw new Exception(_("itemCannotBeSold"));
}
if (requireStack && !stack)
{
- throw new Exception(Util.i18n("itemMustBeStacked"));
+ throw new Exception(_("itemMustBeStacked"));
}
@@ -117,12 +119,16 @@ public class Commandsell extends EssentialsCommand
{
continue;
}
+ if (!s.getEnchantments().equals(is.getEnchantments()))
+ {
+ continue;
+ }
max += s.getAmount();
}
if (stack)
{
- amount *= 64;
+ amount *= is.getType().getMaxStackSize();
}
if (amount < 1)
{
@@ -131,15 +137,15 @@ public class Commandsell extends EssentialsCommand
if (requireStack)
{
- amount -= amount % 64;
+ amount -= amount % is.getType().getMaxStackSize();
}
if (amount > max || amount < 1)
{
if (!isBulkSell)
{
- user.sendMessage(Util.i18n("itemNotEnough1"));
- user.sendMessage(Util.i18n("itemNotEnough2"));
- throw new Exception(Util.i18n("itemNotEnough3"));
+ user.sendMessage(_("itemNotEnough1"));
+ user.sendMessage(_("itemNotEnough2"));
+ throw new Exception(_("itemNotEnough3"));
}
else
{
@@ -147,13 +153,15 @@ public class Commandsell extends EssentialsCommand
}
}
- final ItemStack ris = new ItemStack(is.getType(), amount, is.getDurability());
- InventoryWorkaround.removeItem(user.getInventory(), true, ris);
+ //TODO: Prices for Enchantments
+ final ItemStack ris = is.clone();
+ ris.setAmount(amount);
+ InventoryWorkaround.removeItem(user.getInventory(), true, true, ris);
user.updateInventory();
Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(worth * amount, ess), user.getLocation(), ess);
user.giveMoney(worth * amount);
- user.sendMessage(Util.format("itemSold", Util.formatCurrency(worth * amount, ess), amount, is.getType().toString().toLowerCase(), Util.formatCurrency(worth, ess)));
- logger.log(Level.INFO, Util.format("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(), Util.formatCurrency(worth * amount, ess), amount, Util.formatCurrency(worth, ess)));
+ user.sendMessage(_("itemSold", Util.formatCurrency(worth * amount, ess), amount, is.getType().toString().toLowerCase(Locale.ENGLISH), Util.formatCurrency(worth, ess)));
+ logger.log(Level.INFO, _("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(Locale.ENGLISH), Util.formatCurrency(worth * amount, ess), amount, Util.formatCurrency(worth, ess)));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
index b59984f05..e7687fcfd 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
@@ -1,8 +1,9 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import java.util.Locale;
+import org.bukkit.Server;
public class Commandsethome extends EssentialsCommand
@@ -13,7 +14,7 @@ public class Commandsethome extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, String[] args) throws Exception
{
if (args.length > 0)
{
@@ -29,18 +30,19 @@ public class Commandsethome extends EssentialsCommand
if (user.isAuthorized("essentials.sethome.multiple"))
{
if ((user.isAuthorized("essentials.sethome.multiple.unlimited")) || (user.getHomes().size() < ess.getSettings().getHomeLimit(user))
- || (user.getHomes().contains(args[0].toLowerCase())))
+ || (user.getHomes().contains(args[0].toLowerCase(Locale.ENGLISH))))
{
- user.setHome(args[0].toLowerCase());
+ user.setHome(args[0].toLowerCase(Locale.ENGLISH));
}
else
{
- throw new Exception(Util.format("maxHomes", ess.getSettings().getHomeLimit(user)));
+ throw new Exception(_("maxHomes", ess.getSettings().getHomeLimit(user)));
}
}
- else {
- throw new Exception(Util.format("maxHomes", 1));
+ else
+ {
+ throw new Exception(_("maxHomes", 1));
}
}
else
@@ -54,9 +56,9 @@ public class Commandsethome extends EssentialsCommand
}
if (usersHome == null)
{
- throw new Exception(Util.i18n("playerNotFound"));
+ throw new Exception(_("playerNotFound"));
}
- String name = args[1].toLowerCase();
+ String name = args[1].toLowerCase(Locale.ENGLISH);
if (!user.isAuthorized("essentials.sethome.multiple"))
{
name = "home";
@@ -69,7 +71,7 @@ public class Commandsethome extends EssentialsCommand
{
user.setHome();
}
- user.sendMessage(Util.i18n("homeSet"));
+ user.sendMessage(_("homeSet"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java
index d9b0eac4d..8ed298303 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
public class Commandsetjail extends EssentialsCommand
@@ -11,16 +11,16 @@ public class Commandsetjail extends EssentialsCommand
{
super("setjail");
}
-
+
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- ess.getJail().setJail(user.getLocation(), args[0]);
- user.sendMessage(Util.format("jailSet",args[0]));
-
+ ess.getJails().setJail(args[0], user.getLocation());
+ user.sendMessage(_("jailSet", args[0]));
+
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
index ccdacab57..1a7d27b4b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
@@ -1,9 +1,9 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
import org.bukkit.Location;
import org.bukkit.Server;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
public class Commandsetwarp extends EssentialsCommand
@@ -14,15 +14,19 @@ public class Commandsetwarp extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
+
+ if (args[0].matches("[0-9]+")) {
+ throw new NotEnoughArgumentsException();
+ }
- Location loc = user.getLocation();
+ final Location loc = user.getLocation();
ess.getWarps().setWarp(args[0], loc);
- user.sendMessage(Util.format("warpSet", args[0]));
+ user.sendMessage(_("warpSet", args[0]));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java
index 086b1549d..1d236b70a 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
import org.bukkit.inventory.ItemStack;
@@ -14,7 +14,7 @@ public class Commandsetworth extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 2)
{
@@ -23,6 +23,6 @@ public class Commandsetworth extends EssentialsCommand
ItemStack stack = ess.getItemDb().get(args[0]);
ess.getWorth().setPrice(stack, Double.parseDouble(args[1]));
- user.sendMessage(Util.i18n("worthSet"));
+ user.sendMessage(_("worthSet"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java b/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java
index 8e95e8237..6080642a1 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java
@@ -1,10 +1,10 @@
package com.earth2me.essentials.commands;
+
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import org.bukkit.Server;
-
public class Commandsocialspy extends EssentialsCommand
{
public Commandsocialspy()
@@ -13,8 +13,8 @@ public class Commandsocialspy extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- user.sendMessage("§7SocialSpy " + (user.toggleSocialSpy() ? Util.i18n("enabled") : Util.i18n("disabled")));
+ user.sendMessage("§7SocialSpy " + (user.toggleSocialSpy() ? _("enabled") : _("disabled")));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java
index 18e4fb349..73c86eba4 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java
@@ -1,11 +1,13 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Mob;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import java.util.Locale;
+import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Server;
-import org.bukkit.block.Block;
import org.bukkit.block.CreatureSpawner;
@@ -17,38 +19,44 @@ public class Commandspawner extends EssentialsCommand
}
@Override
- protected void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1 || args[0].length() < 2)
{
- throw new NotEnoughArgumentsException();
- //TODO: user.sendMessage("§7Mobs: Zombie PigZombie Skeleton Slime Chicken Pig Monster Spider Creeper Ghast Squid Giant Cow Sheep Wolf");
+ throw new NotEnoughArgumentsException(_("mobsAvailable", Util.joinList(Mob.getMobList())));
}
- final Block target = user.getTarget().getTargetBlock();
- if (target.getType() != Material.MOB_SPAWNER)
+ final Location target = Util.getTarget(user);
+ if (target == null || target.getBlock().getType() != Material.MOB_SPAWNER)
{
- throw new Exception(Util.i18n("mobSpawnTarget"));
+ throw new Exception(_("mobSpawnTarget"));
}
try
{
String name = args[0];
- name = name.equalsIgnoreCase("CaveSpider") ? "CaveSpider" : name.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(name);
Mob mob = null;
mob = Mob.fromName(name);
if (mob == null)
{
- user.sendMessage(Util.i18n("invalidMob"));
+ user.sendMessage(_("invalidMob"));
return;
}
- ((CreatureSpawner)target.getState()).setCreatureType(mob.getType());
- user.sendMessage(Util.format("setSpawner", mob.name));
+ if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH)))
+ {
+ throw new Exception(_("unableToSpawnMob"));
+ }
+ if (!user.isAuthorized("essentials.spawner." + mob.name.toLowerCase()))
+ {
+ throw new Exception(_("unableToSpawnMob"));
+ }
+ ((CreatureSpawner)target.getBlock().getState()).setCreatureType(mob.getType());
+ user.sendMessage(_("setSpawner", mob.name));
}
catch (Throwable ex)
{
- throw new Exception(Util.i18n("mobSpawnError"), ex);
+ throw new Exception(_("mobSpawnError"), ex);
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
index 3ea3aae40..f867a1503 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
@@ -1,20 +1,17 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Location;
-import org.bukkit.Server;
-import com.earth2me.essentials.User;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Mob;
import com.earth2me.essentials.Mob.MobException;
-import com.earth2me.essentials.TargetBlock;
+import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import java.util.Locale;
import java.util.Random;
import org.bukkit.DyeColor;
+import org.bukkit.Location;
+import org.bukkit.Server;
import org.bukkit.block.Block;
-import org.bukkit.entity.Creeper;
-import org.bukkit.entity.Entity;
-import org.bukkit.entity.Sheep;
-import org.bukkit.entity.Slime;
-import org.bukkit.entity.Wolf;
+import org.bukkit.entity.*;
public class Commandspawnmob extends EssentialsCommand
@@ -25,19 +22,17 @@ public class Commandspawnmob extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
- throw new NotEnoughArgumentsException();
- //TODO: user.sendMessage("§7Mobs: Zombie PigZombie Skeleton Slime Chicken Pig Monster Spider Creeper Ghast Squid Giant Cow Sheep Wolf");
+ throw new NotEnoughArgumentsException(_("mobsAvailable", Util.joinList(Mob.getMobList())));
}
- String[] mountparts = args[0].split(",");
+ final String[] mountparts = args[0].split(",");
String[] parts = mountparts[0].split(":");
String mobType = parts[0];
- mobType = mobType.equalsIgnoreCase("CaveSpider") ? "CaveSpider" : mobType.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(mobType);
String mobData = null;
if (parts.length == 2)
{
@@ -49,7 +44,6 @@ public class Commandspawnmob extends EssentialsCommand
{
parts = mountparts[1].split(":");
mountType = parts[0];
- mountType = mountType.equalsIgnoreCase("CaveSpider") ? "CaveSpider" : mountType.equalsIgnoreCase("PigZombie") ? "PigZombie" : Util.capitalCase(mountType);
if (parts.length == 2)
{
mountData = parts[1];
@@ -65,32 +59,37 @@ public class Commandspawnmob extends EssentialsCommand
mob = Mob.fromName(mobType);
if (mob == null)
{
- throw new Exception(Util.i18n("invalidMob"));
+ throw new Exception(_("invalidMob"));
}
-
- if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase()))
+
+ if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH)))
{
- throw new Exception(Util.i18n("unableToSpawnMob"));
+ throw new Exception(_("disabledToSpawnMob"));
}
-
- int[] ignore =
+ if (!user.isAuthorized("essentials.spawnmob." + mob.name.toLowerCase()))
{
- 8, 9
- };
- Block block = (new TargetBlock(user, 300, 0.2, ignore)).getTargetBlock();
+ throw new Exception(_("noPermToSpawnMob"));
+ }
+
+ final Block block = Util.getTarget(user).getBlock();
if (block == null)
{
- throw new Exception(Util.i18n("unableToSpawnMob"));
+ throw new Exception(_("unableToSpawnMob"));
+ }
+ User otherUser = null;
+ if (args.length >= 3)
+ {
+ otherUser = getPlayer(ess.getServer(), args, 2);
}
- Location loc = block.getLocation();
- Location sloc = Util.getSafeDestination(loc);
+ final Location loc = (otherUser == null) ? block.getLocation() : otherUser.getLocation();
+ final Location sloc = Util.getSafeDestination(loc);
try
{
spawnedMob = mob.spawn(user, server, sloc);
}
catch (MobException e)
{
- throw new Exception(Util.i18n("unableToSpawnMob"));
+ throw new Exception(_("unableToSpawnMob"));
}
if (mountType != null)
@@ -98,13 +97,17 @@ public class Commandspawnmob extends EssentialsCommand
mobMount = Mob.fromName(mountType);
if (mobMount == null)
{
- user.sendMessage(Util.i18n("invalidMob"));
+ user.sendMessage(_("invalidMob"));
return;
}
-
- if (ess.getSettings().getProtectPreventSpawn(mobMount.getType().toString().toLowerCase()))
+
+ if (ess.getSettings().getProtectPreventSpawn(mobMount.getType().toString().toLowerCase(Locale.ENGLISH)))
+ {
+ throw new Exception(_("disabledToSpawnMob"));
+ }
+ if (!user.isAuthorized("essentials.spawnmob." + mobMount.name.toLowerCase()))
{
- throw new Exception(Util.i18n("unableToSpawnMob"));
+ throw new Exception(_("noPermToSpawnMob"));
}
try
{
@@ -112,26 +115,26 @@ public class Commandspawnmob extends EssentialsCommand
}
catch (MobException e)
{
- throw new Exception(Util.i18n("unableToSpawnMob"));
+ throw new Exception(_("unableToSpawnMob"));
}
spawnedMob.setPassenger(spawnedMount);
}
if (mobData != null)
{
- changeMobData(mob.name, spawnedMob, mobData, user);
+ changeMobData(mob.getType(), spawnedMob, mobData, user);
}
if (spawnedMount != null && mountData != null)
{
- changeMobData(mobMount.name, spawnedMount, mountData, user);
+ changeMobData(mobMount.getType(), spawnedMount, mountData, user);
}
- if (args.length == 2)
+ if (args.length >= 2)
{
int mobCount = Integer.parseInt(args[1]);
int serverLimit = ess.getSettings().getSpawnMobLimit();
if (mobCount > serverLimit)
{
mobCount = serverLimit;
- user.sendMessage(Util.i18n("mobSpawnLimit"));
+ user.sendMessage(_("mobSpawnLimit"));
}
try
@@ -147,43 +150,43 @@ public class Commandspawnmob extends EssentialsCommand
}
catch (MobException e)
{
- throw new Exception(Util.i18n("unableToSpawnMob"));
+ throw new Exception(_("unableToSpawnMob"));
}
spawnedMob.setPassenger(spawnedMount);
}
if (mobData != null)
{
- changeMobData(mob.name, spawnedMob, mobData, user);
+ changeMobData(mob.getType(), spawnedMob, mobData, user);
}
if (spawnedMount != null && mountData != null)
{
- changeMobData(mobMount.name, spawnedMount, mountData, user);
+ changeMobData(mobMount.getType(), spawnedMount, mountData, user);
}
}
- user.sendMessage(args[1] + " " + mob.name.toLowerCase() + mob.suffix + " " + Util.i18n("spawned"));
+ user.sendMessage(args[1] + " " + mob.name.toLowerCase(Locale.ENGLISH) + mob.suffix + " " + _("spawned"));
}
catch (MobException e1)
{
- throw new Exception(Util.i18n("unableToSpawnMob"), e1);
+ throw new Exception(_("unableToSpawnMob"), e1);
}
catch (NumberFormatException e2)
{
- throw new Exception(Util.i18n("numberRequired"), e2);
+ throw new Exception(_("numberRequired"), e2);
}
catch (NullPointerException np)
{
- throw new Exception(Util.i18n("soloMob"), np);
+ throw new Exception(_("soloMob"), np);
}
}
else
{
- user.sendMessage(mob.name + " " + Util.i18n("spawned"));
+ user.sendMessage(mob.name + " " + _("spawned"));
}
}
- private void changeMobData(String type, Entity spawned, String data, User user) throws Exception
+ private void changeMobData(final CreatureType type, final Entity spawned, final String data, final User user) throws Exception
{
- if ("Slime".equalsIgnoreCase(type))
+ if (type == CreatureType.SLIME || type == CreatureType.MAGMA_CUBE)
{
try
{
@@ -191,40 +194,67 @@ public class Commandspawnmob extends EssentialsCommand
}
catch (Exception e)
{
- throw new Exception(Util.i18n("slimeMalformedSize"), e);
+ throw new Exception(_("slimeMalformedSize"), e);
}
}
- if ("Sheep".equalsIgnoreCase(type))
+ if ((type == CreatureType.SHEEP
+ || type == CreatureType.COW
+ || type == CreatureType.MUSHROOM_COW
+ || type == CreatureType.CHICKEN
+ || type == CreatureType.PIG
+ || type == CreatureType.WOLF)
+ && data.equalsIgnoreCase("baby"))
{
+ ((Animals)spawned).setAge(-24000);
+ return;
+ }
+ if (type == CreatureType.SHEEP)
+ {
+ if (data.toLowerCase(Locale.ENGLISH).contains("baby"))
+ {
+ ((Sheep)spawned).setAge(-24000);
+ }
+ final String color = data.toUpperCase(Locale.ENGLISH).replace("BABY", "");
try
{
- if (data.equalsIgnoreCase("random"))
+
+ if (color.equalsIgnoreCase("random"))
{
Random rand = new Random();
((Sheep)spawned).setColor(DyeColor.values()[rand.nextInt(DyeColor.values().length)]);
}
else
{
- ((Sheep)spawned).setColor(DyeColor.valueOf(data.toUpperCase()));
+ ((Sheep)spawned).setColor(DyeColor.valueOf(color));
}
}
catch (Exception e)
{
- throw new Exception(Util.i18n("sheepMalformedColor"), e);
+ throw new Exception(_("sheepMalformedColor"), e);
}
}
- if ("Wolf".equalsIgnoreCase(type) && data.equalsIgnoreCase("tamed"))
+ if (type == CreatureType.WOLF
+ && data.toLowerCase(Locale.ENGLISH).startsWith("tamed"))
{
- Wolf wolf = ((Wolf)spawned);
+ final Wolf wolf = ((Wolf)spawned);
wolf.setTamed(true);
wolf.setOwner(user);
wolf.setSitting(true);
+ if (data.equalsIgnoreCase("tamedbaby"))
+ {
+ ((Animals)spawned).setAge(-24000);
+ }
}
- if ("Wolf".equalsIgnoreCase(type) && data.equalsIgnoreCase("angry"))
+ if (type == CreatureType.WOLF
+ && data.toLowerCase(Locale.ENGLISH).startsWith("angry"))
{
((Wolf)spawned).setAngry(true);
+ if (data.equalsIgnoreCase("angrybaby"))
+ {
+ ((Animals)spawned).setAge(-24000);
+ }
}
- if ("Creeper".equalsIgnoreCase(type) && data.equalsIgnoreCase("powered"))
+ if (type == CreatureType.CREEPER && data.equalsIgnoreCase("powered"))
{
((Creeper)spawned).setPowered(true);
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java
new file mode 100644
index 000000000..7f758ad2e
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java
@@ -0,0 +1,42 @@
+package com.earth2me.essentials.commands;
+
+import com.earth2me.essentials.User;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+import org.bukkit.command.PluginCommand;
+
+
+public class Commandsudo extends EssentialsCommand
+{
+ public Commandsudo()
+ {
+ super("sudo");
+ }
+
+ @Override
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+
+ final User user = getPlayer(server, args, 0, false);
+ final String command = args[1];
+ final String[] arguments = new String[args.length - 2];
+ if (arguments.length > 0)
+ {
+ System.arraycopy(args, 2, arguments, 0, args.length - 2);
+ }
+
+ //TODO: Translate this.
+ sender.sendMessage("Running the command as " + user.getDisplayName());
+
+ final PluginCommand execCommand = ess.getServer().getPluginCommand(command);
+ if (execCommand != null)
+ {
+ execCommand.execute(user.getBase(), command, arguments);
+ }
+
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java b/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java
index ca9fee47b..aa2ed5567 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
public class Commandsuicide extends EssentialsCommand
@@ -13,11 +13,11 @@ public class Commandsuicide extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
user.setHealth(0);
- user.sendMessage(Util.i18n("suicideMessage"));
+ user.sendMessage(_("suicideMessage"));
ess.broadcastMessage(user,
- Util.format("suicideSuccess",user.getDisplayName()));
+ _("suicideSuccess", user.getDisplayName()));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
index bc8442da4..144d19d15 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
@@ -1,11 +1,12 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.Console;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.OfflinePlayer;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -23,40 +24,40 @@ public class Commandtempban extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
- final User player = getPlayer(server, args, 0, true);
- if (player.getBase() instanceof OfflinePlayer)
+ final User user = getPlayer(server, args, 0, true);
+ if (user.getBase() instanceof OfflinePlayer)
{
if (sender instanceof Player
&& !ess.getUser(sender).isAuthorized("essentials.tempban.offline"))
{
- sender.sendMessage(Util.i18n("tempbanExempt"));
+ sender.sendMessage(_("tempbanExempt"));
return;
}
}
else
{
- if (player.isAuthorized("essentials.tempban.exempt"))
+ if (user.isAuthorized("essentials.tempban.exempt"))
{
- sender.sendMessage(Util.i18n("tempbanExempt"));
+ sender.sendMessage(_("tempbanExempt"));
return;
}
}
final String time = getFinalArg(args, 1);
final long banTimestamp = Util.parseDateDiff(time, true);
- final String banReason = Util.format("tempBanned", Util.formatDateDiff(banTimestamp));
- player.setBanReason(banReason);
- player.setBanTimeout(banTimestamp);
- player.setBanned(true);
- player.kickPlayer(banReason);
- String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
-
- for(Player p : server.getOnlinePlayers())
+ final String banReason = _("tempBanned", Util.formatDateDiff(banTimestamp));
+ user.setBanReason(banReason);
+ user.setBanTimeout(banTimestamp);
+ user.setBanned(true);
+ user.kickPlayer(banReason);
+ final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
+
+ for (Player onlinePlayer : server.getOnlinePlayers())
{
- User u = ess.getUser(p);
- if(u.isAuthorized("essentials.ban.notify"))
+ final User player = ess.getUser(onlinePlayer);
+ if (player.isAuthorized("essentials.ban.notify"))
{
- p.sendMessage(Util.format("playerBanned", senderName, player.getName(), banReason));
+ onlinePlayer.sendMessage(_("playerBanned", senderName, user.getName(), banReason));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java b/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java
index 34f5c3fed..3cb60e6e3 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.World;
@@ -14,27 +14,27 @@ public class Commandthunder extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- World world = user.getWorld();
- boolean setThunder = args[0].equalsIgnoreCase("true");
+ final World world = user.getWorld();
+ final boolean setThunder = args[0].equalsIgnoreCase("true");
if (args.length > 1)
{
world.setThundering(setThunder ? true : false);
world.setThunderDuration(Integer.parseInt(args[1]) * 20);
- user.sendMessage(Util.format("thunderDuration", (setThunder ? Util.i18n("enabled") : Util.i18n("disabled")), Integer.parseInt(args[1])));
-
+ user.sendMessage(_("thunderDuration", (setThunder ? _("enabled") : _("disabled")), Integer.parseInt(args[1])));
+
}
else
{
world.setThundering(setThunder ? true : false);
- user.sendMessage(Util.format("thunder", setThunder ? Util.i18n("enabled") : Util.i18n("disabled")));
+ user.sendMessage(_("thunder", setThunder ? _("enabled") : _("disabled")));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java
index 687396f53..c49f34fbd 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java
@@ -1,12 +1,12 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.DescParseTickFormat;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import java.util.*;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
-import java.util.*;
public class Commandtime extends EssentialsCommand
@@ -37,7 +37,7 @@ public class Commandtime extends EssentialsCommand
final User user = ess.getUser(sender);
if (user != null && !user.isAuthorized("essentials.time.set"))
{
- user.sendMessage(Util.i18n("timeSetPermission"));
+ user.sendMessage(_("timeSetPermission"));
return;
}
@@ -58,26 +58,25 @@ public class Commandtime extends EssentialsCommand
/**
* Used to get the time and inform
*/
- private void getWorldsTime(CommandSender sender, Collection<World> worlds)
+ private void getWorldsTime(final CommandSender sender, final Collection<World> worlds)
{
if (worlds.size() == 1)
{
- Iterator<World> iter = worlds.iterator();
+ final Iterator<World> iter = worlds.iterator();
sender.sendMessage(DescParseTickFormat.format(iter.next().getTime()));
return;
}
for (World world : worlds)
{
- sender.sendMessage(Util.format("timeCurrentWorld", world.getName(), DescParseTickFormat.format(world.getTime())));
+ sender.sendMessage(_("timeWorldCurrent", world.getName(), DescParseTickFormat.format(world.getTime())));
}
- return;
}
/**
* Used to set the time and inform of the change
*/
- private void setWorldsTime(CommandSender sender, Collection<World> worlds, long ticks)
+ private void setWorldsTime(final CommandSender sender, final Collection<World> worlds, final long ticks)
{
// Update the time
for (World world : worlds)
@@ -87,35 +86,31 @@ public class Commandtime extends EssentialsCommand
world.setTime(time + 24000 + ticks);
}
- // Inform the sender of the change
- //sender.sendMessage("");
-
- StringBuilder msg = new StringBuilder();
- boolean first = true;
+ final StringBuilder output = new StringBuilder();
for (World world : worlds)
{
- if (msg.length() > 0)
+ if (output.length() > 0)
{
- msg.append(", ");
+ output.append(", ");
}
- msg.append(world.getName());
+ output.append(world.getName());
}
- sender.sendMessage(Util.format("timeWorldSet", DescParseTickFormat.format(ticks), msg.toString()));
+ sender.sendMessage(_("timeWorldSet", DescParseTickFormat.format(ticks), output.toString()));
}
/**
* Used to parse an argument of the type "world(s) selector"
*/
- private Set<World> getWorlds(Server server, CommandSender sender, String selector) throws Exception
+ private Set<World> getWorlds(final Server server, final CommandSender sender, final String selector) throws Exception
{
- Set<World> worlds = new TreeSet<World>(new WorldNameComparator());
+ final Set<World> worlds = new TreeSet<World>(new WorldNameComparator());
// If there is no selector we want the world the user is currently in. Or all worlds if it isn't a user.
if (selector == null)
{
- User user = ess.getUser(sender);
+ final User user = ess.getUser(sender);
if (user == null)
{
worlds.addAll(server.getWorlds());
@@ -128,7 +123,7 @@ public class Commandtime extends EssentialsCommand
}
// Try to find the world with name = selector
- World world = server.getWorld(selector);
+ final World world = server.getWorld(selector);
if (world != null)
{
worlds.add(world);
@@ -141,7 +136,7 @@ public class Commandtime extends EssentialsCommand
// We failed to understand the world target...
else
{
- throw new Exception(Util.i18n("invalidWorld"));
+ throw new Exception(_("invalidWorld"));
}
return worlds;
@@ -151,7 +146,8 @@ public class Commandtime extends EssentialsCommand
class WorldNameComparator implements Comparator<World>
{
- public int compare(World a, World b)
+ @Override
+ public int compare(final World a, final World b)
{
return a.getName().compareTo(b.getName());
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java
index 625a375d8..f98343311 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java
@@ -1,10 +1,11 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.OfflinePlayer;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -16,90 +17,90 @@ public class Commandtogglejail extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- User p = getPlayer(server, args, 0, true);
+ final User player = getPlayer(server, args, 0, true);
- if (args.length >= 2 && !p.isJailed())
+ if (args.length >= 2 && !player.isJailed())
{
- if (p.getBase() instanceof OfflinePlayer)
+ if (player.getBase() instanceof OfflinePlayer)
{
if (sender instanceof Player
&& !ess.getUser(sender).isAuthorized("essentials.togglejail.offline"))
{
- sender.sendMessage(Util.i18n("mayNotJail"));
+ sender.sendMessage(_("mayNotJail"));
return;
}
}
else
{
- if (p.isAuthorized("essentials.jail.exempt"))
+ if (player.isAuthorized("essentials.jail.exempt"))
{
- sender.sendMessage(Util.i18n("mayNotJail"));
+ sender.sendMessage(_("mayNotJail"));
return;
}
}
- if (!(p.getBase() instanceof OfflinePlayer))
+ if (!(player.getBase() instanceof OfflinePlayer))
{
- ess.getJail().sendToJail(p, args[1]);
+ ess.getJails().sendToJail(player, args[1]);
}
else
{
// Check if jail exists
- ess.getJail().getJail(args[1]);
+ ess.getJails().getJail(args[1]);
}
- p.setJailed(true);
- p.sendMessage(Util.i18n("userJailed"));
- p.setJail(null);
- p.setJail(args[1]);
+ player.setJailed(true);
+ player.sendMessage(_("userJailed"));
+ player.setJail(null);
+ player.setJail(args[1]);
long timeDiff = 0;
if (args.length > 2)
{
- String time = getFinalArg(args, 2);
+ final String time = getFinalArg(args, 2);
timeDiff = Util.parseDateDiff(time, true);
- p.setJailTimeout(timeDiff);
+ player.setJailTimeout(timeDiff);
}
sender.sendMessage((timeDiff > 0
- ? Util.format("playerJailedFor", p.getName(), Util.formatDateDiff(timeDiff))
- : Util.format("playerJailed", p.getName())));
+ ? _("playerJailedFor", player.getName(), Util.formatDateDiff(timeDiff))
+ : _("playerJailed", player.getName())));
return;
}
- if (args.length >= 2 && p.isJailed() && !args[1].equalsIgnoreCase(p.getJail()))
+ if (args.length >= 2 && player.isJailed() && !args[1].equalsIgnoreCase(player.getJail()))
{
- sender.sendMessage(Util.format("jailAlreadyIncarcerated", p.getJail()));
+ sender.sendMessage(_("jailAlreadyIncarcerated", player.getJail()));
return;
}
- if (args.length >= 2 && p.isJailed() && args[1].equalsIgnoreCase(p.getJail()))
+ if (args.length >= 2 && player.isJailed() && args[1].equalsIgnoreCase(player.getJail()))
{
- String time = getFinalArg(args, 2);
- long timeDiff = Util.parseDateDiff(time, true);
- p.setJailTimeout(timeDiff);
- sender.sendMessage(Util.format("jailSentenceExtended", Util.formatDateDiff(timeDiff)));
+ final String time = getFinalArg(args, 2);
+ final long timeDiff = Util.parseDateDiff(time, true);
+ player.setJailTimeout(timeDiff);
+ sender.sendMessage(_("jailSentenceExtended", Util.formatDateDiff(timeDiff)));
return;
}
- if (args.length == 1 || (args.length == 2 && args[1].equalsIgnoreCase(p.getJail())))
+ if (args.length == 1 || (args.length == 2 && args[1].equalsIgnoreCase(player.getJail())))
{
- if (!p.isJailed())
+ if (!player.isJailed())
{
throw new NotEnoughArgumentsException();
}
- p.setJailed(false);
- p.setJailTimeout(0);
- p.sendMessage(Util.format("jailReleasedPlayerNotify"));
- p.setJail(null);
- if (!(p.getBase() instanceof OfflinePlayer))
+ player.setJailed(false);
+ player.setJailTimeout(0);
+ player.sendMessage(_("jailReleasedPlayerNotify"));
+ player.setJail(null);
+ if (!(player.getBase() instanceof OfflinePlayer))
{
- p.getTeleport().back();
+ player.getTeleport().back();
}
- sender.sendMessage(Util.format("jailReleased", p.getName()));
+ sender.sendMessage(_("jailReleased", player.getName()));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtop.java b/Essentials/src/com/earth2me/essentials/commands/Commandtop.java
index ee5bfbe45..e91d0984a 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtop.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtop.java
@@ -1,10 +1,11 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.User;
import org.bukkit.Location;
import org.bukkit.Server;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Commandtop extends EssentialsCommand
@@ -15,12 +16,12 @@ public class Commandtop extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- int topX = user.getLocation().getBlockX();
- int topZ = user.getLocation().getBlockZ();
- int topY = user.getWorld().getHighestBlockYAt(topX, topZ);
- user.getTeleport().teleport(new Location(user.getWorld(), user.getLocation().getX(), topY + 1, user.getLocation().getZ()), new Trade(this.getName(), ess));
- user.sendMessage(Util.i18n("teleportTop"));
+ final int topX = user.getLocation().getBlockX();
+ final int topZ = user.getLocation().getBlockZ();
+ final int topY = user.getWorld().getHighestBlockYAt(topX, topZ);
+ user.getTeleport().teleport(new Location(user.getWorld(), user.getLocation().getX(), topY + 1, user.getLocation().getZ()), new Trade(this.getName(), ess), TeleportCause.COMMAND);
+ user.sendMessage(_("teleportTop"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
index 480fb6153..7ea3f0541 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
@@ -1,11 +1,12 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Trade;
import com.earth2me.essentials.Console;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
import org.bukkit.command.CommandSender;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Commandtp extends EssentialsCommand
@@ -16,7 +17,7 @@ public class Commandtp extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
switch (args.length)
{
@@ -24,44 +25,44 @@ public class Commandtp extends EssentialsCommand
throw new NotEnoughArgumentsException();
case 1:
- User p = getPlayer(server, args, 0);
- if (!p.isTeleportEnabled())
+ final User player = getPlayer(server, args, 0);
+ if (!player.isTeleportEnabled())
{
- throw new Exception(Util.format("teleportDisabled", p.getDisplayName()));
+ throw new Exception(_("teleportDisabled", player.getDisplayName()));
}
- user.sendMessage(Util.i18n("teleporting"));
- Trade charge = new Trade(this.getName(), ess);
+ user.sendMessage(_("teleporting"));
+ final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
- user.getTeleport().teleport(p, charge);
+ user.getTeleport().teleport(player, charge, TeleportCause.COMMAND);
throw new NoChargeException();
- case 2:
+ default:
if (!user.isAuthorized("essentials.tpohere"))
{
+ //TODO: Translate this
throw new Exception("You need access to /tpohere to teleport other players.");
}
- user.sendMessage(Util.i18n("teleporting"));
- User target = getPlayer(server, args, 0);
- User toPlayer = getPlayer(server, args, 1);
- target.getTeleport().now(toPlayer, false);
- target.sendMessage(Util.format("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName()));
+ user.sendMessage(_("teleporting"));
+ final User target = getPlayer(server, args, 0);
+ final User toPlayer = getPlayer(server, args, 1);
+ target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND);
+ target.sendMessage(_("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName()));
break;
- }
+ }
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 2)
{
throw new NotEnoughArgumentsException();
}
- sender.sendMessage(Util.i18n("teleporting"));
- User target = getPlayer(server, args, 0);
- User toPlayer = getPlayer(server, args, 1);
- target.getTeleport().now(toPlayer, false);
- target.sendMessage(Util.format("teleportAtoB", Console.NAME, toPlayer.getDisplayName()));
- return;
+ sender.sendMessage(_("teleporting"));
+ final User target = getPlayer(server, args, 0);
+ final User toPlayer = getPlayer(server, args, 1);
+ target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND);
+ target.sendMessage(_("teleportAtoB", Console.NAME, toPlayer.getDisplayName()));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java
index 32cbe3bd9..34195d51a 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
public class Commandtpa extends EssentialsCommand
@@ -20,18 +20,22 @@ public class Commandtpa extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- User p = getPlayer(server, args, 0);
- if (!p.isTeleportEnabled())
+ User player = getPlayer(server, args, 0);
+ if (!player.isTeleportEnabled())
{
- throw new Exception(Util.format("teleportDisabled", p.getDisplayName()));
+ throw new Exception(_("teleportDisabled", player.getDisplayName()));
}
- if (!p.isIgnoredPlayer(user.getName()))
+ if (!player.isIgnoredPlayer(user.getName()))
{
- p.requestTeleport(user, false);
- p.sendMessage(Util.format("teleportRequest", user.getDisplayName()));
- p.sendMessage(Util.i18n("typeTpaccept"));
- p.sendMessage(Util.i18n("typeTpdeny"));
+ player.requestTeleport(user, false);
+ player.sendMessage(_("teleportRequest", user.getDisplayName()));
+ player.sendMessage(_("typeTpaccept"));
+ player.sendMessage(_("typeTpdeny"));
+ if (ess.getSettings().getTpaAcceptCancellation() != 0)
+ {
+ player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation()));
+ }
}
- user.sendMessage(Util.format("requestSent", p.getDisplayName()));
+ user.sendMessage(_("requestSent", player.getDisplayName()));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java
index 97897852f..c0abdc1ad 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -15,7 +15,7 @@ public class Commandtpaall extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
@@ -27,29 +27,33 @@ public class Commandtpaall extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- User p = getPlayer(server, args, 0);
- teleportAAllPlayers(server, sender, p);
+ final User player = getPlayer(server, args, 0);
+ teleportAAllPlayers(server, sender, player);
}
- private void teleportAAllPlayers(Server server, CommandSender sender, User p)
+ private void teleportAAllPlayers(final Server server, final CommandSender sender, final User user)
{
- sender.sendMessage(Util.i18n("teleportAAll"));
- for (Player player : server.getOnlinePlayers())
+ sender.sendMessage(_("teleportAAll"));
+ for (Player onlinePlayer : server.getOnlinePlayers())
{
- User u = ess.getUser(player);
- if (p == u)
+ final User player = ess.getUser(onlinePlayer);
+ if (user == player)
{
continue;
}
- if (!u.isTeleportEnabled())
+ if (!player.isTeleportEnabled())
{
continue;
}
try
{
- u.requestTeleport(p, true);
- u.sendMessage(Util.format("teleportHereRequest", p.getDisplayName()));
- u.sendMessage(Util.i18n("typeTpaccept"));
+ player.requestTeleport(user, true);
+ player.sendMessage(_("teleportHereRequest", user.getDisplayName()));
+ player.sendMessage(_("typeTpaccept"));
+ if (ess.getSettings().getTpaAcceptCancellation() != 0)
+ {
+ player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation()));
+ }
}
catch (Exception ex)
{
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
index 043f23172..0cece3310 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
@@ -1,9 +1,11 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.OfflinePlayer;
import com.earth2me.essentials.Trade;
-import org.bukkit.Server;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Commandtpaccept extends EssentialsCommand
@@ -14,34 +16,43 @@ public class Commandtpaccept extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- User p = user.getTeleportRequest();
- if (p == null)
+ final User target = user.getTeleportRequest();
+ if (target == null
+ || target.getBase() instanceof OfflinePlayer
+ || (user.isTeleportRequestHere() && !target.isAuthorized("essentials.tpahere")))
+ {
+ throw new Exception(_("noPendingRequest"));
+ }
+
+ long timeout = ess.getSettings().getTpaAcceptCancellation();
+ if (timeout != 0 && (System.currentTimeMillis() - user.getTeleportRequestTime()) / 1000 > timeout)
{
- throw new Exception(Util.i18n("noPendingRequest"));
+ user.requestTeleport(null, false);
+ throw new Exception(_("requestTimedOut"));
}
- Trade charge = new Trade(this.getName(), ess);
+ final Trade charge = new Trade(this.getName(), ess);
if (user.isTeleportRequestHere())
{
charge.isAffordableFor(user);
}
else
{
- charge.isAffordableFor(p);
+ charge.isAffordableFor(target);
}
- user.sendMessage(Util.i18n("requestAccepted"));
- p.sendMessage(Util.format("requestAcceptedFrom", user.getDisplayName()));
-
+ user.sendMessage(_("requestAccepted"));
+ target.sendMessage(_("requestAcceptedFrom", user.getDisplayName()));
+
if (user.isTeleportRequestHere())
{
- user.getTeleport().teleport(p, charge);
+ user.getTeleport().teleport(target, charge, TeleportCause.COMMAND);
}
else
{
- p.getTeleport().teleport(user, charge);
+ target.getTeleport().teleport(user, charge, TeleportCause.COMMAND);
}
user.requestTeleport(null, false);
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java
index 935721345..376c2be44 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
public class Commandtpahere extends EssentialsCommand
@@ -13,21 +13,25 @@ public class Commandtpahere extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- User p = getPlayer(server, args, 0);
- if (!p.isTeleportEnabled())
+ final User player = getPlayer(server, args, 0);
+ if (!player.isTeleportEnabled())
+ {
+ throw new Exception(_("teleportDisabled", player.getDisplayName()));
+ }
+ player.requestTeleport(user, true);
+ player.sendMessage(_("teleportHereRequest", user.getDisplayName()));
+ player.sendMessage(_("typeTpaccept"));
+ if (ess.getSettings().getTpaAcceptCancellation() != 0)
{
- throw new Exception(Util.format("teleportDisabled", p.getDisplayName()));
+ player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation()));
}
- p.requestTeleport(user, true);
- p.sendMessage(Util.format("teleportHereRequest", user.getDisplayName()));
- p.sendMessage(Util.i18n("typeTpaccept"));
- user.sendMessage(Util.format("requestSent", p.getDisplayName()));
+ user.sendMessage(_("requestSent", player.getDisplayName()));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
index 1cb6321ea..f21f1a6bc 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
@@ -1,10 +1,11 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Commandtpall extends EssentialsCommand
@@ -15,7 +16,7 @@ public class Commandtpall extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
@@ -27,23 +28,23 @@ public class Commandtpall extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- User p = getPlayer(server, args, 0);
- teleportAllPlayers(server, sender, p);
+ final User player = getPlayer(server, args, 0);
+ teleportAllPlayers(server, sender, player);
}
- private void teleportAllPlayers(Server server, CommandSender sender, User p)
+ private void teleportAllPlayers(Server server, CommandSender sender, User user)
{
- sender.sendMessage(Util.i18n("teleportAll"));
- for (Player player : server.getOnlinePlayers())
+ sender.sendMessage(_("teleportAll"));
+ for (Player onlinePlayer : server.getOnlinePlayers())
{
- User u = ess.getUser(player);
- if (p == u)
+ final User player = ess.getUser(onlinePlayer);
+ if (user == player)
{
continue;
}
try
{
- u.getTeleport().now(p, false);
+ player.getTeleport().now(user, false, TeleportCause.COMMAND);
}
catch (Exception ex)
{
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java
index 5d7764ae6..92bba1054 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
public class Commandtpdeny extends EssentialsCommand
@@ -13,16 +13,16 @@ public class Commandtpdeny extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- User p = user.getTeleportRequest();
- if (p == null)
+ final User player = user.getTeleportRequest();
+ if (player == null)
{
- throw new Exception(Util.i18n("noPendingRequest"));
+ throw new Exception(_("noPendingRequest"));
}
- user.sendMessage(Util.i18n("requestDenied"));
- p.sendMessage(Util.format("requestDeniedFrom", user.getDisplayName()));
+ user.sendMessage(_("requestDenied"));
+ player.sendMessage(_("requestDeniedFrom", user.getDisplayName()));
user.requestTeleport(null, false);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java
index bba8d8743..733091d1a 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java
@@ -1,9 +1,10 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Trade;
-import org.bukkit.Server;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Commandtphere extends EssentialsCommand
@@ -14,16 +15,16 @@ public class Commandtphere extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- User p = getPlayer(server, args, 0);
- if (!p.isTeleportEnabled())
+ final User player = getPlayer(server, args, 0);
+ if (!player.isTeleportEnabled())
{
- throw new Exception(Util.format("teleportDisabled", p.getDisplayName()));
+ throw new Exception(_("teleportDisabled", player.getDisplayName()));
}
- p.getTeleport().teleport(user, new Trade(this.getName(), ess));
- user.sendMessage(Util.i18n("teleporting"));
- p.sendMessage(Util.i18n("teleporting"));
+ player.getTeleport().teleport(user, new Trade(this.getName(), ess), TeleportCause.COMMAND);
+ user.sendMessage(_("teleporting"));
+ player.sendMessage(_("teleporting"));
throw new NoChargeException();
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java
index 5a4e082e0..7c13b80d4 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java
@@ -1,9 +1,10 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.OfflinePlayer;
-import org.bukkit.Server;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Commandtpo extends EssentialsCommand
@@ -14,7 +15,7 @@ public class Commandtpo extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
@@ -22,22 +23,22 @@ public class Commandtpo extends EssentialsCommand
}
//Just basically the old tp command
- User p = getPlayer(server, args, 0, true);
+ final User player = getPlayer(server, args, 0, true);
// Check if user is offline
- if (p.getBase() instanceof OfflinePlayer)
+ if (player.getBase() instanceof OfflinePlayer)
{
- throw new NoSuchFieldException(Util.i18n("playerNotFound"));
+ throw new NoSuchFieldException(_("playerNotFound"));
}
// Verify permission
- if (!p.isHidden() || user.isAuthorized("essentials.teleport.hidden"))
+ if (!player.isHidden() || user.isAuthorized("essentials.teleport.hidden"))
{
- user.getTeleport().now(p, false);
- user.sendMessage(Util.i18n("teleporting"));
+ user.getTeleport().now(player, false, TeleportCause.COMMAND);
+ user.sendMessage(_("teleporting"));
}
else
{
- throw new NoSuchFieldException(Util.i18n("playerNotFound"));
+ throw new NoSuchFieldException(_("playerNotFound"));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java
index 7af39854f..e226f0702 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java
@@ -1,9 +1,10 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.OfflinePlayer;
-import org.bukkit.Server;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Commandtpohere extends EssentialsCommand
@@ -14,7 +15,7 @@ public class Commandtpohere extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
@@ -22,23 +23,23 @@ public class Commandtpohere extends EssentialsCommand
}
//Just basically the old tphere command
- User p = getPlayer(server, args, 0, true);
+ final User player = getPlayer(server, args, 0, true);
// Check if user is offline
- if (p.getBase() instanceof OfflinePlayer)
+ if (player.getBase() instanceof OfflinePlayer)
{
- throw new NoSuchFieldException(Util.i18n("playerNotFound"));
+ throw new NoSuchFieldException(_("playerNotFound"));
}
// Verify permission
- if (!p.isHidden() || user.isAuthorized("essentials.teleport.hidden"))
+ if (!player.isHidden() || user.isAuthorized("essentials.teleport.hidden"))
{
- p.getTeleport().now(user, false);
- user.sendMessage(Util.i18n("teleporting"));
+ player.getTeleport().now(user, false, TeleportCause.COMMAND);
+ user.sendMessage(_("teleporting"));
}
else
{
- throw new NoSuchFieldException(Util.i18n("playerNotFound"));
+ throw new NoSuchFieldException(_("playerNotFound"));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
index ce7c369e4..226fa44e3 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
@@ -1,10 +1,11 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.User;
import org.bukkit.Location;
import org.bukkit.Server;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Commandtppos extends EssentialsCommand
@@ -15,27 +16,29 @@ public class Commandtppos extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 3)
{
throw new NotEnoughArgumentsException();
}
- int x = Integer.parseInt(args[0]);
- int y = Integer.parseInt(args[1]);
- int z = Integer.parseInt(args[2]);
- Location l = new Location(user.getWorld(), x, y, z);
- if (args.length > 3) {
- l.setYaw(Float.parseFloat(args[3]));
+ final int x = Integer.parseInt(args[0]);
+ final int y = Integer.parseInt(args[1]);
+ final int z = Integer.parseInt(args[2]);
+ final Location location = new Location(user.getWorld(), x, y, z);
+ if (args.length > 3)
+ {
+ location.setYaw((Float.parseFloat(args[3]) + 180 + 360) % 360);
}
- if (args.length > 4) {
- l.setPitch(Float.parseFloat(args[4]));
+ if (args.length > 4)
+ {
+ location.setPitch(Float.parseFloat(args[4]));
}
- Trade charge = new Trade(this.getName(), ess);
+ final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
- user.sendMessage(Util.i18n("teleporting"));
- user.getTeleport().teleport(l, charge);
+ user.sendMessage(_("teleporting"));
+ user.getTeleport().teleport(location, charge, TeleportCause.COMMAND);
throw new NoChargeException();
}
} \ No newline at end of file
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java b/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java
index f880c5d34..1fc4c2aa4 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.Server;
public class Commandtptoggle extends EssentialsCommand
@@ -13,10 +13,10 @@ public class Commandtptoggle extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
user.sendMessage(user.toggleTeleportEnabled()
- ? Util.i18n("teleportationEnabled")
- : Util.i18n("teleportationDisabled"));
+ ? _("teleportationEnabled")
+ : _("teleportationDisabled"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtree.java b/Essentials/src/com/earth2me/essentials/commands/Commandtree.java
index 8013453ab..20cc9d46f 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtree.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtree.java
@@ -1,13 +1,11 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.TargetBlock;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.TreeType;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
-import org.bukkit.Material;
-import org.bukkit.block.Block;
public class Commandtree extends EssentialsCommand
@@ -18,9 +16,9 @@ public class Commandtree extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- Object tree = new Object();
+ TreeType tree;
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
@@ -37,25 +35,29 @@ public class Commandtree extends EssentialsCommand
{
tree = TreeType.TREE;
}
+ else if (args[0].equalsIgnoreCase("redmushroom"))
+ {
+ tree = TreeType.RED_MUSHROOM;
+ }
+ else if (args[0].equalsIgnoreCase("brownmushroom"))
+ {
+ tree = TreeType.BROWN_MUSHROOM;
+ }
else
{
throw new NotEnoughArgumentsException();
}
-
- final int[] ignore =
- {
- 8, 9
- };
- final Location loc = (new TargetBlock(user, 300, 0.2, ignore)).getTargetBlock().getLocation();
+
+ final Location loc = Util.getTarget(user);
final Location safeLocation = Util.getSafeDestination(loc);
- final boolean success = user.getWorld().generateTree(safeLocation, (TreeType)tree);
+ final boolean success = user.getWorld().generateTree(safeLocation, tree);
if (success)
{
- user.sendMessage(Util.i18n("treeSpawned"));
+ user.sendMessage(_("treeSpawned"));
}
else
{
- user.sendMessage(Util.i18n("treeFailure"));
+ user.sendMessage(_("treeFailure"));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
index 4877c2aeb..8bc3ad068 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -20,16 +20,16 @@ public class Commandunban extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
-
+
try
{
- final User u = getPlayer(server, args, 0, true);
- u.setBanned(false);
- sender.sendMessage(Util.i18n("unbannedPlayer"));
+ final User player = getPlayer(server, args, 0, true);
+ player.setBanned(false);
+ sender.sendMessage(_("unbannedPlayer"));
}
catch (NoSuchFieldException e)
{
- sender.sendMessage(Util.i18n("playerNotFound"));
+ throw new Exception(_("playerNotFound"));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java
index ea2c88f78..c539a596c 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java
@@ -1,6 +1,7 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Util;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -19,8 +20,15 @@ public class Commandunbanip extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
-
+ try
+ {
+ final User user = getPlayer(server, args, 0, true);
+ ess.getServer().unbanIP(user.getLastLoginAddress());
+ }
+ catch (Exception ex)
+ {
+ }
ess.getServer().unbanIP(args[0]);
- sender.sendMessage(Util.i18n("unbannedIP"));
+ sender.sendMessage(_("unbannedIP"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java b/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
index cebbcaf8c..beff6a77b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
@@ -1,9 +1,10 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.InventoryWorkaround;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import java.util.List;
+import java.util.Locale;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.inventory.ItemStack;
@@ -17,7 +18,7 @@ public class Commandunlimited extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
@@ -33,17 +34,17 @@ public class Commandunlimited extends EssentialsCommand
if (args[0].equalsIgnoreCase("list"))
{
- String list = getList(target);
+ final String list = getList(target);
user.sendMessage(list);
}
else if (args[0].equalsIgnoreCase("clear"))
{
- List<Integer> itemList = target.getUnlimited();
+ final List<Integer> itemList = target.getUnlimited();
int index = 0;
while (itemList.size() > index)
{
- Integer item = itemList.get(index);
+ final Integer item = itemList.get(index);
if (toggleUnlimited(user, target, item.toString()) == false)
{
index++;
@@ -56,36 +57,36 @@ public class Commandunlimited extends EssentialsCommand
}
}
- private String getList(User target)
+ private String getList(final User target)
{
- StringBuilder sb = new StringBuilder();
- sb.append(Util.i18n("unlimitedItems")).append(" ");
+ final StringBuilder output = new StringBuilder();
+ output.append(_("unlimitedItems")).append(" ");
boolean first = true;
- List<Integer> items = target.getUnlimited();
+ final List<Integer> items = target.getUnlimited();
if (items.isEmpty())
{
- sb.append(Util.i18n("none"));
+ output.append(_("none"));
}
for (Integer integer : items)
{
if (!first)
{
- sb.append(", ");
+ output.append(", ");
}
first = false;
- String matname = Material.getMaterial(integer).toString().toLowerCase().replace("_", "");
- sb.append(matname);
+ final String matname = Material.getMaterial(integer).toString().toLowerCase(Locale.ENGLISH).replace("_", "");
+ output.append(matname);
}
- return sb.toString();
+ return output.toString();
}
- private Boolean toggleUnlimited(User user, User target, String item) throws Exception
+ private Boolean toggleUnlimited(final User user, final User target, final String item) throws Exception
{
- ItemStack stack = ess.getItemDb().get(item, 1);
+ final ItemStack stack = ess.getItemDb().get(item, 1);
stack.setAmount(Math.min(stack.getType().getMaxStackSize(), 2));
- String itemname = stack.getType().toString().toLowerCase().replace("_", "");
+ final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
if (ess.getSettings().permissionBasedItemSpawn()
&& (!user.isAuthorized("essentials.unlimited.item-all")
&& !user.isAuthorized("essentials.unlimited.item-" + itemname)
@@ -93,7 +94,7 @@ public class Commandunlimited extends EssentialsCommand
&& !((stack.getType() == Material.WATER_BUCKET || stack.getType() == Material.LAVA_BUCKET)
&& user.isAuthorized("essentials.unlimited.item-bucket"))))
{
- throw new Exception(Util.format("unlimitedItemPermission", itemname));
+ throw new Exception(_("unlimitedItemPermission", itemname));
}
String message = "disableUnlimited";
@@ -102,7 +103,7 @@ public class Commandunlimited extends EssentialsCommand
{
message = "enableUnlimited";
enableUnlimited = true;
- if (!InventoryWorkaround.containsItem(target.getInventory(), true, stack))
+ if (!InventoryWorkaround.containsItem(target.getInventory(), true, true, stack))
{
target.getInventory().addItem(stack);
}
@@ -110,9 +111,9 @@ public class Commandunlimited extends EssentialsCommand
if (user != target)
{
- user.sendMessage(Util.format(message, itemname, target.getDisplayName()));
+ user.sendMessage(_(message, itemname, target.getDisplayName()));
}
- target.sendMessage(Util.format(message, itemname, target.getDisplayName()));
+ target.sendMessage(_(message, itemname, target.getDisplayName()));
target.setUnlimited(stack, enableUnlimited);
return true;
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java
index 36d1d0df0..51b64563b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java
@@ -1,13 +1,16 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Trade;
-import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import com.earth2me.essentials.Warps;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Commandwarp extends EssentialsCommand
@@ -20,41 +23,15 @@ public class Commandwarp extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length == 0 || args[0].matches("[0-9]+"))
{
if (!user.isAuthorized("essentials.warp.list"))
{
- throw new Exception(Util.i18n("warpListPermission"));
- }
-
- Warps warps = ess.getWarps();
- if (warps.isEmpty())
- {
- throw new Exception(Util.i18n("noWarpsDefined"));
- }
- final List<String> warpNameList = new ArrayList<String>(warps.getWarpNames());
- final Iterator<String> iterator = warpNameList.iterator();
- while (iterator.hasNext())
- {
- final String warpName = iterator.next();
- if (ess.getSettings().getPerWarpPermission() && !user.isAuthorized("essentials.warp." + warpName))
- {
- iterator.remove();
- }
- }
- int page = 1;
- if (args.length > 0)
- {
- page = Integer.parseInt(args[0]);
- }
- if (warpNameList.size() > WARPS_PER_PAGE)
- {
- user.sendMessage(Util.format("warpsCount", warpNameList.size(), page, (int)Math.ceil(warpNameList.size() / (double)WARPS_PER_PAGE)));
+ throw new Exception(_("warpListPermission"));
}
- final int warpPage = (page - 1) * WARPS_PER_PAGE;
- user.sendMessage(Util.joinList(warpNameList.subList(warpPage, warpPage+Math.min(warpNameList.size() - warpPage, WARPS_PER_PAGE))));
+ warpList(user, args);
throw new NoChargeException();
}
if (args.length > 0)
@@ -65,7 +42,7 @@ public class Commandwarp extends EssentialsCommand
otherUser = ess.getUser(server.getPlayer(args[1]));
if (otherUser == null)
{
- throw new Exception(Util.i18n("playerNotFound"));
+ throw new Exception(_("playerNotFound"));
}
warpUser(otherUser, args[0]);
throw new NoChargeException();
@@ -75,19 +52,79 @@ public class Commandwarp extends EssentialsCommand
}
}
- private void warpUser(User user, String name) throws Exception
+ @Override
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
+ if (args.length < 2 || args[0].matches("[0-9]+"))
+ {
+ warpList(sender, args);
+ throw new NoChargeException();
+ }
+ User otherUser = ess.getUser(server.getPlayer(args[1]));
+ if (otherUser == null)
+ {
+ throw new Exception(_("playerNotFound"));
+ }
+ warpUser(otherUser, args[0]);
+ throw new NoChargeException();
+
+ }
+
+ //TODO: Use one of the new text classes, like /help ?
+ private void warpList(final CommandSender sender, final String[] args) throws Exception
+ {
+ final Warps warps = ess.getWarps();
+ if (warps.isEmpty())
+ {
+ throw new Exception(_("noWarpsDefined"));
+ }
+ final List<String> warpNameList = new ArrayList<String>(warps.getWarpNames());
+
+ if (sender instanceof User)
+ {
+ final Iterator<String> iterator = warpNameList.iterator();
+ while (iterator.hasNext())
+ {
+ final String warpName = iterator.next();
+ if (ess.getSettings().getPerWarpPermission() && !((User)sender).isAuthorized("essentials.warp." + warpName))
+ {
+ iterator.remove();
+ }
+ }
+ }
+ int page = 1;
+ if (args.length > 0)
+ {
+ page = Integer.parseInt(args[0]);
+ }
+
+ final int warpPage = (page - 1) * WARPS_PER_PAGE;
+ final String warpList = Util.joinList(warpNameList.subList(warpPage, warpPage + Math.min(warpNameList.size() - warpPage, WARPS_PER_PAGE)));
+
+ if (warpNameList.size() > WARPS_PER_PAGE)
+ {
+ sender.sendMessage(_("warpsCount", warpNameList.size(), page, (int)Math.ceil(warpNameList.size() / (double)WARPS_PER_PAGE)));
+ sender.sendMessage(warpList);
+ }
+ else
+ {
+ sender.sendMessage(_("warps", warpList));
+ }
+ }
+
+ private void warpUser(final User user, final String name) throws Exception
{
- Trade charge = new Trade(this.getName(), ess);
+ final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
if (ess.getSettings().getPerWarpPermission())
{
if (user.isAuthorized("essentials.warp." + name))
{
- user.getTeleport().warp(name, charge);
+ user.getTeleport().warp(name, charge, TeleportCause.COMMAND);
return;
}
- throw new Exception(Util.i18n("warpUsePermission"));
+ throw new Exception(_("warpUsePermission"));
}
- user.getTeleport().warp(name, charge);
+ user.getTeleport().warp(name, charge, TeleportCause.COMMAND);
}
} \ No newline at end of file
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandweather.java b/Essentials/src/com/earth2me/essentials/commands/Commandweather.java
index 9603e9f72..1229c9ee4 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandweather.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandweather.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
@@ -14,46 +14,46 @@ public class Commandweather extends EssentialsCommand
super("weather");
}
+ //TODO: Remove duplication
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- boolean isStorm = args[0].equalsIgnoreCase("storm");
- World world = user.getWorld();
+ final boolean isStorm = args[0].equalsIgnoreCase("storm");
+ final World world = user.getWorld();
if (args.length > 1)
{
world.setStorm(isStorm ? true : false);
world.setWeatherDuration(Integer.parseInt(args[1]) * 20);
user.sendMessage(isStorm
- ? Util.format("weatherStormFor", world.getName(), args[1])
- : Util.format("weatherSunFor", world.getName(), args[1]));
- return;
+ ? _("weatherStormFor", world.getName(), args[1])
+ : _("weatherSunFor", world.getName(), args[1]));
}
else
{
world.setStorm(isStorm ? true : false);
user.sendMessage(isStorm
- ? Util.format("weatherStorm", world.getName())
- : Util.format("weatherSun", world.getName()));
- return;
+ ? _("weatherStorm", world.getName())
+ : _("weatherSun", world.getName()));
}
}
+ //TODO: Translate these
@Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 2) //running from console means inserting a world arg before other args
{
throw new Exception("When running from console, usage is: /" + commandLabel + " <world> <storm/sun> [duration]");
}
- boolean isStorm = args[1].equalsIgnoreCase("storm");
- World world = server.getWorld(args[0]);
+ final boolean isStorm = args[1].equalsIgnoreCase("storm");
+ final World world = server.getWorld(args[0]);
if (world == null)
{
throw new Exception("World named " + args[0] + " not found!");
@@ -64,17 +64,15 @@ public class Commandweather extends EssentialsCommand
world.setStorm(isStorm ? true : false);
world.setWeatherDuration(Integer.parseInt(args[2]) * 20);
sender.sendMessage(isStorm
- ? Util.format("weatherStormFor", world.getName(), args[2])
- : Util.format("weatherSunFor", world.getName(), args[2]));
- return;
+ ? _("weatherStormFor", world.getName(), args[2])
+ : _("weatherSunFor", world.getName(), args[2]));
}
else
{
world.setStorm(isStorm ? true : false);
sender.sendMessage(isStorm
- ? Util.format("weatherStorm", world.getName())
- : Util.format("weatherSun", world.getName()));
- return;
+ ? _("weatherStorm", world.getName())
+ : _("weatherSun", world.getName()));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java
index 1769202f5..7e211455e 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java
@@ -1,11 +1,12 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import java.util.Locale;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
-import org.bukkit.ChatColor;
public class Commandwhois extends EssentialsCommand
@@ -16,7 +17,7 @@ public class Commandwhois extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
@@ -34,39 +35,42 @@ public class Commandwhois extends EssentialsCommand
{
showhidden = true;
}
- String whois = args[0].toLowerCase();
- int prefixLength = ChatColor.stripColor(ess.getSettings().getNicknamePrefix()).length();
- for (Player p : server.getOnlinePlayers())
+ final String whois = args[0].toLowerCase(Locale.ENGLISH);
+ final int prefixLength = Util.stripColor(ess.getSettings().getNicknamePrefix()).length();
+ for (Player onlinePlayer : server.getOnlinePlayers())
{
- User u = ess.getUser(p);
- if (u.isHidden() && !showhidden)
+ final User user = ess.getUser(onlinePlayer);
+ if (user.isHidden() && !showhidden)
{
continue;
}
- String dn = ChatColor.stripColor(u.getNick());
- if (!whois.equalsIgnoreCase(dn)
- && !whois.equalsIgnoreCase(dn.substring(prefixLength))
- && !whois.equalsIgnoreCase(u.getName()))
+ final String nickName = Util.stripColor(user.getNickname());
+ if (!whois.equalsIgnoreCase(nickName)
+ && !whois.substring(prefixLength).equalsIgnoreCase(nickName)
+ && !whois.equalsIgnoreCase(user.getName()))
{
continue;
}
sender.sendMessage("");
- sender.sendMessage(Util.format("whoisIs", u.getDisplayName(), u.getName()));
- sender.sendMessage(Util.format("whoisHealth", u.getHealth()));
- sender.sendMessage(Util.format("whoisLocation", u.getLocation().getWorld().getName(), u.getLocation().getBlockX(), u.getLocation().getBlockY(), u.getLocation().getBlockZ()));
+ sender.sendMessage(_("whoisIs", user.getDisplayName(), user.getName()));
+ sender.sendMessage(_("whoisHealth", user.getHealth()));
+ sender.sendMessage(_("whoisOP", (user.isOp() ? _("true") : _("false"))));
+ sender.sendMessage(_("whoisGod", (user.isGodModeEnabled() ? _("true") : _("false"))));
+ sender.sendMessage(_("whoisGamemode", _(user.getGameMode().toString().toLowerCase(Locale.ENGLISH))));
+ sender.sendMessage(_("whoisLocation", user.getLocation().getWorld().getName(), user.getLocation().getBlockX(), user.getLocation().getBlockY(), user.getLocation().getBlockZ()));
if (!ess.getSettings().isEcoDisabled())
{
- sender.sendMessage(Util.format("whoisMoney", Util.formatCurrency(u.getMoney(), ess)));
+ sender.sendMessage(_("whoisMoney", Util.formatCurrency(user.getMoney(), ess)));
}
- sender.sendMessage(u.isAfk()
- ? Util.i18n("whoisStatusAway")
- : Util.i18n("whoisStatusAvailable"));
- sender.sendMessage(Util.format("whoisIPAddress", u.getAddress().getAddress().toString()));
- final String location = u.getGeoLocation();
- if (location != null
+ sender.sendMessage(user.isAfk()
+ ? _("whoisStatusAway")
+ : _("whoisStatusAvailable"));
+ sender.sendMessage(_("whoisIPAddress", user.getAddress().getAddress().toString()));
+ final String location = user.getGeoLocation();
+ if (location != null
&& (sender instanceof Player ? ess.getUser(sender).isAuthorized("essentials.geoip.show") : true))
{
- sender.sendMessage(Util.format("whoisGeoLocation", location));
+ sender.sendMessage(_("whoisGeoLocation", location));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java
index 557f46dbf..41554c8ce 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java
@@ -1,12 +1,13 @@
package com.earth2me.essentials.commands;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.User;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.World;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Commandworld extends EssentialsCommand
@@ -24,7 +25,7 @@ public class Commandworld extends EssentialsCommand
if (args.length < 1)
{
World nether = null;
-
+
final List<World> worlds = server.getWorlds();
for (World world2 : worlds)
@@ -46,9 +47,18 @@ public class Commandworld extends EssentialsCommand
world = ess.getWorld(getFinalArg(args, 0));
if (world == null)
{
- user.sendMessage(Util.i18n("invalidWorld"));
- user.sendMessage(Util.format("possibleWorlds", server.getWorlds().size() - 1));
- user.sendMessage(Util.i18n("typeWorldName"));
+ user.sendMessage(_("invalidWorld"));
+ user.sendMessage(_("possibleWorlds", server.getWorlds().size() - 1));
+ user.sendMessage(_("typeWorldName"));
+ throw new NoChargeException();
+ }
+ }
+
+ if (ess.getSettings().getIsWorldTeleportPermissions())
+ {
+ if (!user.isAuthorized("essentials.world." + world.getName()))
+ {
+ user.sendMessage(_("invalidWorld")); //TODO: Make a "world teleport denied" translation
throw new NoChargeException();
}
}
@@ -62,7 +72,8 @@ public class Commandworld extends EssentialsCommand
{
factor = 1.0 / 8.0;
}
- else {
+ else
+ {
factor = 1.0;
}
@@ -71,7 +82,7 @@ public class Commandworld extends EssentialsCommand
final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
- user.getTeleport().teleport(target, charge);
+ user.getTeleport().teleport(target, charge, TeleportCause.COMMAND);
throw new NoChargeException();
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
index 2a7e107bc..586b31873 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
@@ -1,9 +1,10 @@
package com.earth2me.essentials.commands;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
-
+import java.util.Locale;
+import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.inventory.ItemStack;
@@ -15,15 +16,16 @@ public class Commandworth extends EssentialsCommand
super("worth");
}
+ //TODO: Remove duplication
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- ItemStack is = user.getInventory().getItemInHand();
- int amount = is.getAmount();
+ ItemStack iStack = user.getInventory().getItemInHand();
+ int amount = iStack.getAmount();
if (args.length > 0)
{
- is = ess.getItemDb().get(args[0]);
+ iStack = ess.getItemDb().get(args[0]);
}
try
@@ -35,40 +37,40 @@ public class Commandworth extends EssentialsCommand
}
catch (NumberFormatException ex)
{
- amount = is.getType().getMaxStackSize();
+ amount = iStack.getType().getMaxStackSize();
}
- is.setAmount(amount);
- double worth = ess.getWorth().getPrice(is);
+ iStack.setAmount(amount);
+ final double worth = ess.getWorth().getPrice(iStack);
if (Double.isNaN(worth))
{
- throw new Exception(Util.i18n("itemCannotBeSold"));
+ throw new Exception(_("itemCannotBeSold"));
}
- user.sendMessage(is.getDurability() != 0
- ? Util.format("worthMeta",
- is.getType().toString().toLowerCase().replace("_", ""),
- is.getDurability(),
- Util.formatCurrency(worth * amount, ess),
- amount,
- Util.formatCurrency(worth, ess))
- : Util.format("worth",
- is.getType().toString().toLowerCase().replace("_", ""),
- Util.formatCurrency(worth * amount, ess),
- amount,
- Util.formatCurrency(worth, ess)));
+ user.sendMessage(iStack.getDurability() != 0
+ ? _("worthMeta",
+ iStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""),
+ iStack.getDurability(),
+ Util.formatCurrency(worth * amount, ess),
+ amount,
+ Util.formatCurrency(worth, ess))
+ : _("worth",
+ iStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""),
+ Util.formatCurrency(worth * amount, ess),
+ amount,
+ Util.formatCurrency(worth, ess)));
}
@Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- ItemStack is = ess.getItemDb().get(args[0]);
- int amount = is.getAmount();
+ ItemStack iStack = ess.getItemDb().get(args[0]);
+ int amount = iStack.getAmount();
try
{
@@ -79,28 +81,28 @@ public class Commandworth extends EssentialsCommand
}
catch (NumberFormatException ex)
{
- amount = is.getType().getMaxStackSize();
+ amount = iStack.getType().getMaxStackSize();
}
- is.setAmount(amount);
- double worth = ess.getWorth().getPrice(is);
+ iStack.setAmount(amount);
+ final double worth = ess.getWorth().getPrice(iStack);
if (Double.isNaN(worth))
{
- throw new Exception(Util.i18n("itemCannotBeSold"));
+ throw new Exception(_("itemCannotBeSold"));
}
- sender.sendMessage(is.getDurability() != 0
- ? Util.format("worthMeta",
- is.getType().toString().toLowerCase().replace("_", ""),
- is.getDurability(),
- Util.formatCurrency(worth * amount, ess),
- amount,
- Util.formatCurrency(worth, ess))
- : Util.format("worth",
- is.getType().toString().toLowerCase().replace("_", ""),
- Util.formatCurrency(worth * amount, ess),
- amount,
- Util.formatCurrency(worth, ess)));
+ sender.sendMessage(iStack.getDurability() != 0
+ ? _("worthMeta",
+ iStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""),
+ iStack.getDurability(),
+ Util.formatCurrency(worth * amount, ess),
+ amount,
+ Util.formatCurrency(worth, ess))
+ : _("worth",
+ iStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""),
+ Util.formatCurrency(worth * amount, ess),
+ amount,
+ Util.formatCurrency(worth, ess)));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
index 58da18c21..13328e1b5 100644
--- a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
+++ b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
@@ -1,23 +1,24 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.ChargeException;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.IEssentialsModule;
+import com.earth2me.essentials.OfflinePlayer;
import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.User;
import java.util.List;
+import java.util.logging.Logger;
import org.bukkit.Server;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
-import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.OfflinePlayer;
import org.bukkit.entity.Player;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
-import java.util.logging.Logger;
public abstract class EssentialsCommand implements IEssentialsCommand
{
private final transient String name;
protected transient IEssentials ess;
+ protected transient IEssentialsModule module;
protected final static Logger logger = Logger.getLogger("Minecraft");
protected EssentialsCommand(final String name)
@@ -25,11 +26,19 @@ public abstract class EssentialsCommand implements IEssentialsCommand
this.name = name;
}
+ @Override
public void setEssentials(final IEssentials ess)
{
this.ess = ess;
}
+
+ @Override
+ public void setEssentialsModule(final IEssentialsModule module)
+ {
+ this.module = module;
+ }
+ @Override
public String getName()
{
return name;
@@ -46,12 +55,16 @@ public abstract class EssentialsCommand implements IEssentialsCommand
{
throw new NotEnoughArgumentsException();
}
+ if (args[pos].isEmpty())
+ {
+ throw new NoSuchFieldException(_("playerNotFound"));
+ }
final User user = ess.getUser(args[pos]);
if (user != null)
{
if (!getOffline && (user.getBase() instanceof OfflinePlayer || user.isHidden()))
{
- throw new NoSuchFieldException(Util.i18n("playerNotFound"));
+ throw new NoSuchFieldException(_("playerNotFound"));
}
return user;
}
@@ -73,7 +86,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand
return userMatch;
}
}
- throw new NoSuchFieldException(Util.i18n("playerNotFound"));
+ throw new NoSuchFieldException(_("playerNotFound"));
}
@Override
@@ -98,7 +111,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- throw new Exception(Util.format("onlyPlayers", commandLabel));
+ throw new Exception(_("onlyPlayers", commandLabel));
}
public static String getFinalArg(final String[] args, final int start)
diff --git a/Essentials/src/com/earth2me/essentials/commands/IEssentialsCommand.java b/Essentials/src/com/earth2me/essentials/commands/IEssentialsCommand.java
index a5192ba10..439c14d70 100644
--- a/Essentials/src/com/earth2me/essentials/commands/IEssentialsCommand.java
+++ b/Essentials/src/com/earth2me/essentials/commands/IEssentialsCommand.java
@@ -1,10 +1,11 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.IEssentialsModule;
import com.earth2me.essentials.User;
+import org.bukkit.Server;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
-import org.bukkit.Server;
public interface IEssentialsCommand
@@ -16,6 +17,8 @@ public interface IEssentialsCommand
void run(Server server, CommandSender sender, String commandLabel, Command cmd, String[] args)
throws Exception;
-
+
void setEssentials(IEssentials ess);
+
+ void setEssentialsModule(IEssentialsModule module);
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/NotEnoughArgumentsException.java b/Essentials/src/com/earth2me/essentials/commands/NotEnoughArgumentsException.java
index 615a556b9..0c47b9893 100644
--- a/Essentials/src/com/earth2me/essentials/commands/NotEnoughArgumentsException.java
+++ b/Essentials/src/com/earth2me/essentials/commands/NotEnoughArgumentsException.java
@@ -1,15 +1,20 @@
package com.earth2me.essentials.commands;
-public class NotEnoughArgumentsException extends Exception {
+public class NotEnoughArgumentsException extends Exception
+{
public NotEnoughArgumentsException()
{
- super();
+ super("");
}
-
- public NotEnoughArgumentsException(final Throwable ex)
+
+ public NotEnoughArgumentsException(final String string)
{
- super(ex);
+ super(string);
}
+ public NotEnoughArgumentsException(final Throwable ex)
+ {
+ super("", ex);
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java
new file mode 100644
index 000000000..934d94fa2
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java
@@ -0,0 +1,51 @@
+package com.earth2me.essentials.craftbukkit;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import net.minecraft.server.ChunkPosition;
+import net.minecraft.server.Packet60Explosion;
+import org.bukkit.Location;
+import org.bukkit.Server;
+import org.bukkit.block.Block;
+import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.CraftWorld;
+import org.bukkit.entity.Player;
+import org.bukkit.event.entity.EntityExplodeEvent;
+
+
+public class FakeExplosion
+{
+ public static void createExplosion(final EntityExplodeEvent event, final Server server, final Player[] players)
+ {
+ try
+ {
+ final Set<ChunkPosition> set = new HashSet<ChunkPosition>(event.blockList().size());
+ final List<ChunkPosition> blocksUnderPlayers = new ArrayList<ChunkPosition>(players.length);
+ final Location loc = event.getLocation();
+ for (Player player : players)
+ {
+ if (player.getWorld().equals(loc.getWorld()))
+ {
+ blocksUnderPlayers.add(new ChunkPosition(player.getLocation().getBlockX(), player.getLocation().getBlockY() - 1, player.getLocation().getBlockZ()));
+ }
+ }
+ for (Block block : event.blockList())
+ {
+ final ChunkPosition cp = new ChunkPosition(block.getX(), block.getY(), block.getZ());
+ if (!blocksUnderPlayers.contains(cp))
+ {
+ set.add(cp);
+ }
+ }
+ ((CraftServer)server).getHandle().sendPacketNearby(loc.getX(), loc.getY(), loc.getZ(), 64.0, ((CraftWorld)loc.getWorld()).getHandle().worldProvider.dimension, new Packet60Explosion(loc.getX(), loc.getY(), loc.getZ(), 3.0F, set));
+ }
+ catch (Throwable ex)
+ {
+ Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/FakeInventory.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java
index fef6db7d0..992791710 100644
--- a/Essentials/src/com/earth2me/essentials/FakeInventory.java
+++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java
@@ -1,4 +1,4 @@
-package com.earth2me.essentials;
+package com.earth2me.essentials.craftbukkit;
import java.util.HashMap;
import org.bukkit.Material;
@@ -19,7 +19,7 @@ public class FakeInventory implements Inventory
{
continue;
}
- this.items[i] = new ItemStack(items[i].getTypeId(), items[i].getAmount(), items[i].getDurability());
+ this.items[i] = items[i].clone();
}
}
diff --git a/Essentials/src/com/earth2me/essentials/FakeWorld.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java
index 0b5d68be1..bd4d09111 100644
--- a/Essentials/src/com/earth2me/essentials/FakeWorld.java
+++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java
@@ -1,24 +1,12 @@
-package com.earth2me.essentials;
+package com.earth2me.essentials.craftbukkit;
+import java.io.File;
import java.util.List;
import java.util.UUID;
-import org.bukkit.BlockChangeDelegate;
-import org.bukkit.Chunk;
-import org.bukkit.ChunkSnapshot;
-import org.bukkit.Difficulty;
-import org.bukkit.Effect;
-import org.bukkit.Location;
-import org.bukkit.TreeType;
-import org.bukkit.World;
+import org.bukkit.*;
import org.bukkit.block.Biome;
import org.bukkit.block.Block;
-import org.bukkit.entity.Arrow;
-import org.bukkit.entity.CreatureType;
-import org.bukkit.entity.Entity;
-import org.bukkit.entity.Item;
-import org.bukkit.entity.LightningStrike;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.entity.Player;
+import org.bukkit.entity.*;
import org.bukkit.generator.BlockPopulator;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.inventory.ItemStack;
@@ -27,376 +15,448 @@ import org.bukkit.util.Vector;
public class FakeWorld implements World
{
-
private final String name;
private final Environment env;
- FakeWorld(String string, Environment environment)
+
+ public FakeWorld(String string, Environment environment)
{
this.name = string;
this.env = environment;
}
+ @Override
public Block getBlockAt(int i, int i1, int i2)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public Block getBlockAt(Location lctn)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public int getBlockTypeIdAt(int i, int i1, int i2)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public int getBlockTypeIdAt(Location lctn)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public int getHighestBlockYAt(int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public int getHighestBlockYAt(Location lctn)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public Chunk getChunkAt(int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public Chunk getChunkAt(Location lctn)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public Chunk getChunkAt(Block block)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean isChunkLoaded(Chunk chunk)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public Chunk[] getLoadedChunks()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void loadChunk(Chunk chunk)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean isChunkLoaded(int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void loadChunk(int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean loadChunk(int i, int i1, boolean bln)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean unloadChunk(int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean unloadChunk(int i, int i1, boolean bln)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean unloadChunk(int i, int i1, boolean bln, boolean bln1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean unloadChunkRequest(int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean unloadChunkRequest(int i, int i1, boolean bln)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean regenerateChunk(int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean refreshChunk(int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public Item dropItem(Location lctn, ItemStack is)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public Item dropItemNaturally(Location lctn, ItemStack is)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public Arrow spawnArrow(Location lctn, Vector vector, float f, float f1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean generateTree(Location lctn, TreeType tt)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean generateTree(Location lctn, TreeType tt, BlockChangeDelegate bcd)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public LivingEntity spawnCreature(Location lctn, CreatureType ct)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public LightningStrike strikeLightning(Location lctn)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public LightningStrike strikeLightningEffect(Location lctn)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public List<Entity> getEntities()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public List<LivingEntity> getLivingEntities()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public List<Player> getPlayers()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public String getName()
{
return name;
}
+ @Override
public long getId()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public Location getSpawnLocation()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean setSpawnLocation(int i, int i1, int i2)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public long getTime()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void setTime(long l)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public long getFullTime()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void setFullTime(long l)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean hasStorm()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void setStorm(boolean bln)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public int getWeatherDuration()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void setWeatherDuration(int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean isThundering()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void setThundering(boolean bln)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public int getThunderDuration()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void setThunderDuration(int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public Environment getEnvironment()
{
return env;
}
+ @Override
public long getSeed()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean getPVP()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void setPVP(boolean bln)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void save()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean createExplosion(double d, double d1, double d2, float f)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean createExplosion(Location lctn, float f)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public ChunkGenerator getGenerator()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public List<BlockPopulator> getPopulators()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void playEffect(Location lctn, Effect effect, int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void playEffect(Location lctn, Effect effect, int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean createExplosion(double d, double d1, double d2, float f, boolean bln)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean createExplosion(Location lctn, float f, boolean bln)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public <T extends Entity> T spawn(Location lctn, Class<T> type) throws IllegalArgumentException
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public ChunkSnapshot getEmptyChunkSnapshot(int i, int i1, boolean bln, boolean bln1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public void setSpawnFlags(boolean bln, boolean bln1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean getAllowAnimals()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public boolean getAllowMonsters()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public UUID getUID()
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public Block getHighestBlockAt(int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public Block getHighestBlockAt(Location lctn)
{
throw new UnsupportedOperationException("Not supported yet.");
}
-
+ @Override
public Biome getBiome(int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public double getTemperature(int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
+ @Override
public double getHumidity(int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
@@ -437,22 +497,28 @@ public class FakeWorld implements World
{
throw new UnsupportedOperationException("Not supported yet.");
}
-
+
@Override
public Difficulty getDifficulty()
{
throw new UnsupportedOperationException("Not supported yet.");
}
-
+
@Override
public void setDifficulty(Difficulty difficulty)
{
throw new UnsupportedOperationException("Not supported yet.");
}
-
+
@Override
public int getSeaLevel()
{
throw new UnsupportedOperationException("Not supported yet.");
- }
+ }
+
+ @Override
+ public File getWorldFolder()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/InventoryWorkaround.java b/Essentials/src/com/earth2me/essentials/craftbukkit/InventoryWorkaround.java
index 0470488b8..308568452 100644
--- a/Essentials/src/com/earth2me/essentials/InventoryWorkaround.java
+++ b/Essentials/src/com/earth2me/essentials/craftbukkit/InventoryWorkaround.java
@@ -1,5 +1,6 @@
-package com.earth2me.essentials;
+package com.earth2me.essentials.craftbukkit;
+import com.earth2me.essentials.craftbukkit.FakeInventory;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Location;
@@ -19,12 +20,12 @@ public final class InventoryWorkaround
{
}
- public static int first(final Inventory inventory, final ItemStack item, final boolean forceDurability, final boolean forceAmount)
+ public static int first(final Inventory inventory, final ItemStack item, final boolean forceDurability, final boolean forceAmount, final boolean forceEnchantments)
{
- return next(inventory, item, 0, forceDurability, forceAmount);
+ return next(inventory, item, 0, forceDurability, forceAmount, forceEnchantments);
}
- public static int next(final Inventory cinventory, final ItemStack item, final int start, final boolean forceDurability, final boolean forceAmount)
+ public static int next(final Inventory cinventory, final ItemStack item, final int start, final boolean forceDurability, final boolean forceAmount, final boolean forceEnchantments)
{
final ItemStack[] inventory = cinventory.getContents();
for (int i = start; i < inventory.length; i++)
@@ -34,7 +35,7 @@ public final class InventoryWorkaround
{
continue;
}
- if (item.getTypeId() == cItem.getTypeId() && (!forceAmount || item.getAmount() == cItem.getAmount()) && (!forceDurability || cItem.getDurability() == item.getDurability()))
+ if (item.getTypeId() == cItem.getTypeId() && (!forceAmount || item.getAmount() == cItem.getAmount()) && (!forceDurability || cItem.getDurability() == item.getDurability()) && (!forceEnchantments || cItem.getEnchantments().equals(item.getEnchantments())))
{
return i;
}
@@ -44,6 +45,11 @@ public final class InventoryWorkaround
public static int firstPartial(final Inventory cinventory, final ItemStack item, final boolean forceDurability)
{
+ return firstPartial(cinventory, item, forceDurability, item.getType().getMaxStackSize());
+ }
+
+ public static int firstPartial(final Inventory cinventory, final ItemStack item, final boolean forceDurability, final int maxAmount)
+ {
if (item == null)
{
return -1;
@@ -56,7 +62,7 @@ public final class InventoryWorkaround
{
continue;
}
- if (item.getTypeId() == cItem.getTypeId() && cItem.getAmount() < cItem.getType().getMaxStackSize() && (!forceDurability || cItem.getDurability() == item.getDurability()))
+ if (item.getTypeId() == cItem.getTypeId() && cItem.getAmount() < maxAmount && (!forceDurability || cItem.getDurability() == item.getDurability()) && cItem.getEnchantments().equals(item.getEnchantments()))
{
return i;
}
@@ -80,6 +86,11 @@ public final class InventoryWorkaround
public static Map<Integer, ItemStack> addItem(final Inventory cinventory, final boolean forceDurability, final ItemStack... items)
{
+ return addItem(cinventory, forceDurability, 0, items);
+ }
+
+ public static Map<Integer, ItemStack> addItem(final Inventory cinventory, final boolean forceDurability, final int oversizedStacks, final ItemStack... items)
+ {
final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
/* TODO: some optimization
@@ -101,10 +112,10 @@ public final class InventoryWorkaround
{
if (combined[j] == null)
{
- combined[j] = new ItemStack(items[i].getType(), items[i].getAmount(), items[i].getDurability());
+ combined[j] = items[i].clone();
break;
}
- if (combined[j].getTypeId() == items[i].getTypeId() && (!forceDurability || combined[j].getDurability() == items[i].getDurability()))
+ if (combined[j].getTypeId() == items[i].getTypeId() && (!forceDurability || combined[j].getDurability() == items[i].getDurability()) && combined[j].getEnchantments().equals(items[i].getEnchantments()))
{
combined[j].setAmount(combined[j].getAmount() + items[i].getAmount());
break;
@@ -124,7 +135,8 @@ public final class InventoryWorkaround
while (true)
{
// Do we already have a stack of it?
- final int firstPartial = firstPartial(cinventory, item, forceDurability);
+ final int maxAmount = oversizedStacks > item.getType().getMaxStackSize() ? oversizedStacks : item.getType().getMaxStackSize();
+ final int firstPartial = firstPartial(cinventory, item, forceDurability, maxAmount);
// Drat! no partial stack
if (firstPartial == -1)
@@ -141,10 +153,12 @@ public final class InventoryWorkaround
else
{
// More than a single stack!
- if (item.getAmount() > item.getType().getMaxStackSize())
+ if (item.getAmount() > maxAmount)
{
- cinventory.setItem(firstFree, new ItemStack(item.getTypeId(), item.getType().getMaxStackSize(), item.getDurability()));
- item.setAmount(item.getAmount() - item.getType().getMaxStackSize());
+ final ItemStack stack = item.clone();
+ stack.setAmount(maxAmount);
+ cinventory.setItem(firstFree, stack);
+ item.setAmount(item.getAmount() - maxAmount);
}
else
{
@@ -161,8 +175,7 @@ public final class InventoryWorkaround
final int amount = item.getAmount();
final int partialAmount = partialItem.getAmount();
- final int maxAmount = partialItem.getType().getMaxStackSize();
-
+
// Check if it fully fits
if (amount + partialAmount <= maxAmount)
{
@@ -179,7 +192,7 @@ public final class InventoryWorkaround
return leftover;
}
- public static Map<Integer, ItemStack> removeItem(final Inventory cinventory, final boolean forceDurability, final ItemStack... items)
+ public static Map<Integer, ItemStack> removeItem(final Inventory cinventory, final boolean forceDurability, final boolean forceEnchantments, final ItemStack... items)
{
final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
@@ -204,7 +217,7 @@ public final class InventoryWorkaround
}
// get first Item, ignore the amount
- final int first = first(cinventory, item, forceDurability, false);
+ final int first = first(cinventory, item, forceDurability, false, forceEnchantments);
// Drat! we don't have this type in the inventory
if (first == -1)
@@ -237,7 +250,7 @@ public final class InventoryWorkaround
return leftover;
}
- public static boolean containsItem(final Inventory cinventory, final boolean forceDurability, final ItemStack... items)
+ public static boolean containsItem(final Inventory cinventory, final boolean forceDurability, final boolean forceEnchantments, final ItemStack... items)
{
final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
@@ -256,10 +269,10 @@ public final class InventoryWorkaround
{
if (combined[j] == null)
{
- combined[j] = new ItemStack(items[i].getType(), items[i].getAmount(), items[i].getDurability());
+ combined[j] = items[i].clone();
break;
}
- if (combined[j].getTypeId() == items[i].getTypeId() && (!forceDurability || combined[j].getDurability() == items[i].getDurability()))
+ if (combined[j].getTypeId() == items[i].getTypeId() && (!forceDurability || combined[j].getDurability() == items[i].getDurability()) && (!forceEnchantments || combined[j].getEnchantments().equals(items[i].getEnchantments())))
{
combined[j].setAmount(combined[j].getAmount() + items[i].getAmount());
break;
@@ -285,7 +298,7 @@ public final class InventoryWorkaround
break;
}
- final int slot = next(cinventory, item, position, forceDurability, false);
+ final int slot = next(cinventory, item, position, forceDurability, false, forceEnchantments);
// Drat! we don't have this type in the inventory
if (slot == -1)
@@ -318,14 +331,18 @@ public final class InventoryWorkaround
final int maxStackSize = itm.getType().getMaxStackSize();
final int stacks = itm.getAmount() / maxStackSize;
final int leftover = itm.getAmount() % maxStackSize;
- Item[] itemStacks = new Item[stacks + (leftover > 0 ? 1 : 0)];
+ final Item[] itemStacks = new Item[stacks + (leftover > 0 ? 1 : 0)];
for (int i = 0; i < stacks; i++)
{
- itemStacks[i] = loc.getWorld().dropItem(loc, new ItemStack(itm.getType(), maxStackSize, itm.getDurability()));
+ final ItemStack stack = itm.clone();
+ stack.setAmount(maxStackSize);
+ itemStacks[i] = loc.getWorld().dropItem(loc, stack);
}
if (leftover > 0)
{
- itemStacks[stacks] = loc.getWorld().dropItem(loc, new ItemStack(itm.getType(), leftover, itm.getDurability()));
+ final ItemStack stack = itm.clone();
+ stack.setAmount(leftover);
+ itemStacks[stacks] = loc.getWorld().dropItem(loc, stack);
}
return itemStacks;
}
diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/ItemDupeFix.java b/Essentials/src/com/earth2me/essentials/craftbukkit/ItemDupeFix.java
new file mode 100644
index 000000000..243049e0a
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/craftbukkit/ItemDupeFix.java
@@ -0,0 +1,25 @@
+package com.earth2me.essentials.craftbukkit;
+
+import net.minecraft.server.EntityPlayer;
+import org.bukkit.craftbukkit.entity.CraftPlayer;
+import org.bukkit.event.player.PlayerListener;
+import org.bukkit.event.player.PlayerTeleportEvent;
+
+
+public class ItemDupeFix extends PlayerListener
+{
+ @Override
+ public void onPlayerTeleport(final PlayerTeleportEvent event)
+ {
+ if (event.isCancelled())
+ {
+ return;
+ }
+ final CraftPlayer player = (CraftPlayer)event.getPlayer();
+ final EntityPlayer entity = player.getHandle();
+ if (entity.activeContainer != entity.defaultContainer)
+ {
+ entity.closeInventory();
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/OfflineBedLocation.java b/Essentials/src/com/earth2me/essentials/craftbukkit/OfflineBedLocation.java
new file mode 100644
index 000000000..3ddfd20b5
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/craftbukkit/OfflineBedLocation.java
@@ -0,0 +1,52 @@
+package com.earth2me.essentials.craftbukkit;
+
+import com.earth2me.essentials.IEssentials;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import net.minecraft.server.NBTTagCompound;
+import net.minecraft.server.WorldNBTStorage;
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.CraftWorld;
+
+
+public class OfflineBedLocation
+{
+ public static Location getBedLocation(final String playername, final IEssentials ess)
+ {
+ try
+ {
+ final CraftServer cserver = (CraftServer)ess.getServer();
+ if (cserver == null)
+ {
+ return null;
+ }
+ final WorldNBTStorage wnbtStorage = (WorldNBTStorage)cserver.getHandle().playerFileData;
+ if (wnbtStorage == null)
+ {
+ return null;
+ }
+ final NBTTagCompound playerStorage = wnbtStorage.getPlayerData(playername);
+ if (playerStorage == null)
+ {
+ return null;
+ }
+
+ if (playerStorage.hasKey("SpawnX") && playerStorage.hasKey("SpawnY") && playerStorage.hasKey("SpawnZ"))
+ {
+ String spawnWorld = playerStorage.getString("SpawnWorld");
+ if ("".equals(spawnWorld))
+ {
+ spawnWorld = cserver.getWorlds().get(0).getName();
+ }
+ return new Location(cserver.getWorld(spawnWorld), playerStorage.getInt("SpawnX"), playerStorage.getInt("SpawnY"), playerStorage.getInt("SpawnZ"));
+ }
+ return null;
+ }
+ catch (Throwable ex)
+ {
+ Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
+ return null;
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/SetBed.java b/Essentials/src/com/earth2me/essentials/craftbukkit/SetBed.java
new file mode 100644
index 000000000..331d14139
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/craftbukkit/SetBed.java
@@ -0,0 +1,25 @@
+package com.earth2me.essentials.craftbukkit;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import net.minecraft.server.ChunkCoordinates;
+import org.bukkit.block.Block;
+import org.bukkit.craftbukkit.entity.CraftPlayer;
+import org.bukkit.entity.Player;
+
+
+public class SetBed
+{
+ public static void setBed(final Player player, final Block block)
+ {
+ try
+ {
+ final CraftPlayer cplayer = (CraftPlayer)player;
+ cplayer.getHandle().a(new ChunkCoordinates(block.getX(), block.getY(), block.getZ()));
+ }
+ catch (Throwable ex)
+ {
+ Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java b/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java
new file mode 100644
index 000000000..5b1161851
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java
@@ -0,0 +1,58 @@
+package com.earth2me.essentials.craftbukkit;
+
+import org.bukkit.entity.Player;
+
+
+public class SetExpFix
+{
+ public static void setTotalExperience(final Player player, final int exp)
+ {
+ if (exp < 0)
+ {
+ throw new IllegalArgumentException("Experience is negative!");
+ }
+ player.setExp(0);
+ player.setLevel(0);
+ player.setTotalExperience(0);
+ int amount = exp;
+ while (amount > 0)
+ {
+ final int expToLevel = getExpToLevel(player);
+ amount -= expToLevel;
+ if (amount >= 0)
+ {
+ // give until next level
+ player.giveExp(expToLevel);
+ }
+ else
+ {
+ // give the rest
+ amount += expToLevel;
+ player.giveExp(amount);
+ amount = 0;
+ }
+ }
+ }
+
+ private static int getExpToLevel(final Player player)
+ {
+ return getExpToLevel(player.getLevel());
+ }
+
+ private static int getExpToLevel(final int level)
+ {
+ return 7 + (level * 7 >> 1);
+ }
+
+ public static int getTotalExperience(final Player player)
+ {
+ int exp = (int) (getExpToLevel(player) * player.getExp());
+ int currentLevel = player.getLevel();
+
+ while (currentLevel > 0) {
+ currentLevel--;
+ exp += getExpToLevel(currentLevel);
+ }
+ return exp;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/ShowInventory.java b/Essentials/src/com/earth2me/essentials/craftbukkit/ShowInventory.java
new file mode 100644
index 000000000..fb2050ce4
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/craftbukkit/ShowInventory.java
@@ -0,0 +1,46 @@
+package com.earth2me.essentials.craftbukkit;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import net.minecraft.server.EntityPlayer;
+import net.minecraft.server.IInventory;
+import net.minecraft.server.PlayerInventory;
+import org.bukkit.craftbukkit.entity.CraftPlayer;
+import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
+import org.bukkit.entity.Player;
+import org.bukkit.inventory.ItemStack;
+
+
+public class ShowInventory
+{
+ public static void showEmptyInventory(final Player player)
+ {
+ try
+ {
+ final EntityPlayer entityPlayer = ((CraftPlayer)player).getHandle();
+ final CraftInventoryPlayer inv = new CraftInventoryPlayer(new PlayerInventory(((CraftPlayer)player).getHandle()));
+ inv.clear();
+ entityPlayer.a((IInventory)inv.getInventory());
+ }
+ catch (Throwable ex)
+ {
+ Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
+ }
+ }
+
+ public static void showFilledInventory(final Player player, final ItemStack stack)
+ {
+ try
+ {
+ final EntityPlayer entityPlayer = ((CraftPlayer)player).getHandle();
+ final CraftInventoryPlayer inv = new CraftInventoryPlayer(new PlayerInventory(((CraftPlayer)player).getHandle()));
+ inv.clear();
+ InventoryWorkaround.addItem(inv, true, stack);
+ entityPlayer.a((IInventory)inv.getInventory());
+ }
+ catch (Throwable ex)
+ {
+ Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/perm/BPermissionsHandler.java b/Essentials/src/com/earth2me/essentials/perm/BPermissionsHandler.java
index b30a7c0c7..fea268f90 100644
--- a/Essentials/src/com/earth2me/essentials/perm/BPermissionsHandler.java
+++ b/Essentials/src/com/earth2me/essentials/perm/BPermissionsHandler.java
@@ -1,17 +1,18 @@
package com.earth2me.essentials.perm;
import de.bananaco.permissions.Permissions;
+import de.bananaco.permissions.info.InfoReader;
import de.bananaco.permissions.interfaces.PermissionSet;
import de.bananaco.permissions.worlds.WorldPermissionsManager;
-import de.bananaco.permissions.info.InfoReader;
import java.util.List;
import org.bukkit.entity.Player;
-public class BPermissionsHandler implements IPermissionsHandler
+public class BPermissionsHandler extends SuperpermsHandler
{
private final transient WorldPermissionsManager wpm;
private final transient InfoReader info;
+
public BPermissionsHandler()
{
wpm = Permissions.getWorldPermissionsManager();
@@ -51,13 +52,13 @@ public class BPermissionsHandler implements IPermissionsHandler
}
return groups.contains(group);
}
-
+
@Override
public boolean canBuild(final Player base, final String group)
{
return hasPermission(base, "essentials.build") || hasPermission(base, "bPermissions.build");
}
-
+
@Override
public String getPrefix(final Player base)
{
@@ -70,9 +71,4 @@ public class BPermissionsHandler implements IPermissionsHandler
return info.getSuffix(base);
}
- @Override
- public boolean hasPermission(final Player base, final String node)
- {
- return base.hasPermission(node);
- }
}
diff --git a/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java b/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java
index 20b3806e0..8c3cdf1e2 100644
--- a/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java
+++ b/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java
@@ -2,11 +2,10 @@ package com.earth2me.essentials.perm;
import java.util.Arrays;
import java.util.List;
-import org.bukkit.entity.Player;
-import org.bukkit.plugin.Plugin;
-
import org.anjocaido.groupmanager.GroupManager;
import org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler;
+import org.bukkit.entity.Player;
+import org.bukkit.plugin.Plugin;
public class GroupManagerHandler implements IPermissionsHandler
@@ -22,6 +21,10 @@ public class GroupManagerHandler implements IPermissionsHandler
public String getGroup(final Player base)
{
final AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base);
+ if (handler == null)
+ {
+ return null;
+ }
return handler.getGroup(base.getName());
}
@@ -29,6 +32,10 @@ public class GroupManagerHandler implements IPermissionsHandler
public List<String> getGroups(final Player base)
{
final AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base);
+ if (handler == null)
+ {
+ return null;
+ }
return Arrays.asList(handler.getGroups(base.getName()));
}
@@ -36,6 +43,10 @@ public class GroupManagerHandler implements IPermissionsHandler
public boolean canBuild(final Player base, final String group)
{
final AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base);
+ if (handler == null)
+ {
+ return false;
+ }
return handler.canUserBuild(base.getName());
}
@@ -43,6 +54,10 @@ public class GroupManagerHandler implements IPermissionsHandler
public boolean inGroup(final Player base, final String group)
{
AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base);
+ if (handler == null)
+ {
+ return false;
+ }
return handler.inGroup(base.getName(), group);
}
@@ -50,6 +65,10 @@ public class GroupManagerHandler implements IPermissionsHandler
public boolean hasPermission(final Player base, final String node)
{
AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base);
+ if (handler == null)
+ {
+ return false;
+ }
return handler.has(base, node);
}
@@ -57,6 +76,10 @@ public class GroupManagerHandler implements IPermissionsHandler
public String getPrefix(final Player base)
{
AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base);
+ if (handler == null)
+ {
+ return null;
+ }
return handler.getUserPrefix(base.getName());
}
@@ -64,6 +87,10 @@ public class GroupManagerHandler implements IPermissionsHandler
public String getSuffix(final Player base)
{
AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base);
+ if (handler == null)
+ {
+ return null;
+ }
return handler.getUserSuffix(base.getName());
}
}
diff --git a/Essentials/src/com/earth2me/essentials/perm/PermissionsExHandler.java b/Essentials/src/com/earth2me/essentials/perm/PermissionsExHandler.java
index 4062a162c..5d8e62232 100644
--- a/Essentials/src/com/earth2me/essentials/perm/PermissionsExHandler.java
+++ b/Essentials/src/com/earth2me/essentials/perm/PermissionsExHandler.java
@@ -88,7 +88,7 @@ public class PermissionsExHandler implements IPermissionsHandler
{
return null;
}
-
+
return user.getSuffix(base.getWorld().getName());
}
}
diff --git a/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java b/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java
index ab69d9fe4..8c16aab7a 100644
--- a/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java
+++ b/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java
@@ -99,7 +99,7 @@ public class PermissionsHandler implements IPermissionsHandler
public void checkPermissions()
{
final PluginManager pluginManager = plugin.getServer().getPluginManager();
-
+
final Plugin permExPlugin = pluginManager.getPlugin("PermissionsEx");
if (permExPlugin != null && permExPlugin.isEnabled())
{
@@ -121,7 +121,7 @@ public class PermissionsHandler implements IPermissionsHandler
}
return;
}
-
+
final Plugin GMplugin = pluginManager.getPlugin("GroupManager");
if (GMplugin != null && GMplugin.isEnabled())
{
@@ -132,7 +132,7 @@ public class PermissionsHandler implements IPermissionsHandler
}
return;
}
-
+
final Plugin permBukkitPlugin = pluginManager.getPlugin("PermissionsBukkit");
if (permBukkitPlugin != null && permBukkitPlugin.isEnabled())
{
diff --git a/Essentials/src/com/earth2me/essentials/register/payment/Method.java b/Essentials/src/com/earth2me/essentials/register/payment/Method.java
index ea4477077..a942667e8 100644
--- a/Essentials/src/com/earth2me/essentials/register/payment/Method.java
+++ b/Essentials/src/com/earth2me/essentials/register/payment/Method.java
@@ -13,15 +13,15 @@ import org.bukkit.plugin.Plugin;
public interface Method
{
/**
- * Encodes the Plugin into an Object disguised as the Plugin.
- * If you want the original Plugin Class you must cast it to the correct
- * Plugin, to do so you have to verify the name and or version then cast.
+ * Encodes the Plugin into an Object disguised as the Plugin. If you want the original Plugin Class you must cast it
+ * to the correct Plugin, to do so you have to verify the name and or version then cast.
*
* <pre>
* if(method.getName().equalsIgnoreCase("iConomy"))
* iConomy plugin = ((iConomy)method.getPlugin());</pre>
- *
- * @return <code>Object</code>
+ *
+ * @return
+ * <code>Object</code>
* @see #getName()
* @see #getVersion()
*/
diff --git a/Essentials/src/com/earth2me/essentials/register/payment/Methods.java b/Essentials/src/com/earth2me/essentials/register/payment/Methods.java
index 34acf9837..f8729923e 100644
--- a/Essentials/src/com/earth2me/essentials/register/payment/Methods.java
+++ b/Essentials/src/com/earth2me/essentials/register/payment/Methods.java
@@ -2,29 +2,28 @@ package com.earth2me.essentials.register.payment;
import java.util.HashSet;
import java.util.Set;
-
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
/**
- * The <code>Methods</code> initializes Methods that utilize the Method interface
- * based on a "first come, first served" basis.
+ * The
+ * <code>Methods</code> initializes Methods that utilize the Method interface based on a "first come, first served"
+ * basis.
*
* Allowing you to check whether a payment method exists or not.
*
- * Methods also allows you to set a preferred method of payment before it captures
- * payment plugins in the initialization process.
+ * Methods also allows you to set a preferred method of payment before it captures payment plugins in the initialization
+ * process.
*
- * in <code>bukkit.yml</code>:
- * <blockquote><pre>
+ * in
+ * <code>bukkit.yml</code>: <blockquote><pre>
* economy:
* preferred: "iConomy"
* </pre></blockquote>
*
- * @author: Nijikokun <nijikokun@shortmail.com> (@nijikokun)
- * @copyright: Copyright (C) 2011
- * @license: AOL license <http://aol.nexua.org>
+ * @author: Nijikokun <nijikokun@shortmail.com> (@nijikokun) @copyright: Copyright (C) 2011 @license: AOL license
+ * <http://aol.nexua.org>
*/
public class Methods
{
@@ -53,6 +52,7 @@ public class Methods
addMethod("BOSEconomy", new com.earth2me.essentials.register.payment.methods.BOSE7());
addMethod("Currency", new com.earth2me.essentials.register.payment.methods.MCUR());
Dependencies.add("MultiCurrency");
+ addMethod("Vault", new com.earth2me.essentials.register.payment.methods.VaultEco());
}
/**
@@ -79,6 +79,7 @@ public class Methods
/**
* Use to get version of Register plugin
+ *
* @return version
*/
public static String getVersion()
@@ -87,10 +88,11 @@ public class Methods
}
/**
- * Returns an array of payment method names that have been loaded
- * through the <code>_init</code> method.
+ * Returns an array of payment method names that have been loaded through the
+ * <code>_init</code> method.
*
- * @return <code>Set<String></code> - Array of payment methods that are loaded.
+ * @return
+ * <code>Set<String></code> - Array of payment methods that are loaded.
* @see #setMethod(org.bukkit.plugin.Plugin)
*/
public static Set<String> getDependencies()
@@ -99,8 +101,8 @@ public class Methods
}
/**
- * Interprets Plugin class data to verify whether it is compatible with an existing payment
- * method to use for payments and other various economic activity.
+ * Interprets Plugin class data to verify whether it is compatible with an existing payment method to use for
+ * payments and other various economic activity.
*
* @param plugin Plugin data from bukkit, Internal Class file.
* @return Method <em>or</em> Null
@@ -128,7 +130,8 @@ public class Methods
/**
* Verifies if Register has set a payment method for usage yet.
*
- * @return <code>boolean</code>
+ * @return
+ * <code>boolean</code>
* @see #setMethod(org.bukkit.plugin.Plugin)
* @see #checkDisabled(org.bukkit.plugin.Plugin)
*/
@@ -138,11 +141,11 @@ public class Methods
}
/**
- * Checks Plugin Class against a multitude of checks to verify it's usability
- * as a payment method.
+ * Checks Plugin Class against a multitude of checks to verify it's usability as a payment method.
*
* @param <code>PluginManager</code> the plugin manager for the server
- * @return <code>boolean</code> True on success, False on failure.
+ * @return
+ * <code>boolean</code> True on success, False on failure.
*/
public static boolean setMethod(PluginManager manager)
{
@@ -243,7 +246,8 @@ public class Methods
/**
* Sets the preferred economy
*
- * @return <code>boolean</code>
+ * @return
+ * <code>boolean</code>
*/
public static boolean setPreferred(String check)
{
@@ -259,7 +263,9 @@ public class Methods
/**
* Grab the existing and initialized (hopefully) Method Class.
*
- * @return <code>Method</code> <em>or</em> <code>Null</code>
+ * @return
+ * <code>Method</code> <em>or</em>
+ * <code>Null</code>
*/
public static Method getMethod()
{
@@ -267,11 +273,11 @@ public class Methods
}
/**
- * Verify is a plugin is disabled, only does this if we there is an existing payment
- * method initialized in Register.
+ * Verify is a plugin is disabled, only does this if we there is an existing payment method initialized in Register.
*
* @param method Plugin data from bukkit, Internal Class file.
- * @return <code>boolean</code>
+ * @return
+ * <code>boolean</code>
*/
public static boolean checkDisabled(Plugin method)
{
diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java
index bc3893d5e..c3b71d4e3 100644
--- a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java
+++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java
@@ -1,7 +1,6 @@
package com.earth2me.essentials.register.payment.methods;
import com.earth2me.essentials.register.payment.Method;
-
import cosine.boseconomy.BOSEconomy;
import org.bukkit.plugin.Plugin;
@@ -18,26 +17,31 @@ public class BOSE6 implements Method
{
private BOSEconomy BOSEconomy;
+ @Override
public BOSEconomy getPlugin()
{
return this.BOSEconomy;
}
+ @Override
public String getName()
{
return "BOSEconomy";
}
+ @Override
public String getVersion()
{
return "0.6.2";
}
+ @Override
public int fractionalDigits()
{
return 0;
}
+ @Override
public String format(double amount)
{
String currency = this.BOSEconomy.getMoneyNamePlural();
@@ -50,27 +54,32 @@ public class BOSE6 implements Method
return amount + " " + currency;
}
+ @Override
public boolean hasBanks()
{
return true;
}
+ @Override
public boolean hasBank(String bank)
{
return this.BOSEconomy.bankExists(bank);
}
+ @Override
public boolean hasAccount(String name)
{
return this.BOSEconomy.playerRegistered(name, false);
}
+ @Override
public boolean hasBankAccount(String bank, String name)
{
return this.BOSEconomy.isBankOwner(bank, name)
|| this.BOSEconomy.isBankMember(bank, name);
}
+ @Override
public boolean createAccount(String name)
{
if (hasAccount(name))
@@ -82,6 +91,7 @@ public class BOSE6 implements Method
return true;
}
+ @Override
public boolean createAccount(String name, Double balance)
{
if (hasAccount(name))
@@ -94,6 +104,7 @@ public class BOSE6 implements Method
return true;
}
+ @Override
public MethodAccount getAccount(String name)
{
if (!hasAccount(name))
@@ -104,6 +115,7 @@ public class BOSE6 implements Method
return new BOSEAccount(name, this.BOSEconomy);
}
+ @Override
public MethodBankAccount getBankAccount(String bank, String name)
{
if (!hasBankAccount(bank, name))
@@ -114,6 +126,7 @@ public class BOSE6 implements Method
return new BOSEBankAccount(bank, BOSEconomy);
}
+ @Override
public boolean isCompatible(Plugin plugin)
{
return plugin.getDescription().getName().equalsIgnoreCase("boseconomy")
@@ -121,6 +134,7 @@ public class BOSE6 implements Method
&& plugin.getDescription().getVersion().equals("0.6.2");
}
+ @Override
public void setPlugin(Plugin plugin)
{
BOSEconomy = (BOSEconomy)plugin;
@@ -138,23 +152,27 @@ public class BOSE6 implements Method
this.BOSEconomy = bOSEconomy;
}
+ @Override
public double balance()
{
return (double)this.BOSEconomy.getPlayerMoney(this.name);
}
+ @Override
public boolean set(double amount)
{
int IntAmount = (int)Math.ceil(amount);
return this.BOSEconomy.setPlayerMoney(this.name, IntAmount, false);
}
+ @Override
public boolean add(double amount)
{
int IntAmount = (int)Math.ceil(amount);
return this.BOSEconomy.addPlayerMoney(this.name, IntAmount, false);
}
+ @Override
public boolean subtract(double amount)
{
int IntAmount = (int)Math.ceil(amount);
@@ -162,6 +180,7 @@ public class BOSE6 implements Method
return this.BOSEconomy.setPlayerMoney(this.name, (balance - IntAmount), false);
}
+ @Override
public boolean multiply(double amount)
{
int IntAmount = (int)Math.ceil(amount);
@@ -169,6 +188,7 @@ public class BOSE6 implements Method
return this.BOSEconomy.setPlayerMoney(this.name, (balance * IntAmount), false);
}
+ @Override
public boolean divide(double amount)
{
int IntAmount = (int)Math.ceil(amount);
@@ -176,26 +196,31 @@ public class BOSE6 implements Method
return this.BOSEconomy.setPlayerMoney(this.name, (balance / IntAmount), false);
}
+ @Override
public boolean hasEnough(double amount)
{
return (this.balance() >= amount);
}
+ @Override
public boolean hasOver(double amount)
{
return (this.balance() > amount);
}
+ @Override
public boolean hasUnder(double amount)
{
return (this.balance() < amount);
}
+ @Override
public boolean isNegative()
{
return (this.balance() < 0);
}
+ @Override
public boolean remove()
{
return false;
@@ -214,27 +239,32 @@ public class BOSE6 implements Method
this.BOSEconomy = bOSEconomy;
}
+ @Override
public String getBankName()
{
return this.bank;
}
+ @Override
public int getBankId()
{
return -1;
}
+ @Override
public double balance()
{
return (double)this.BOSEconomy.getBankMoney(bank);
}
+ @Override
public boolean set(double amount)
{
int IntAmount = (int)Math.ceil(amount);
return this.BOSEconomy.setBankMoney(bank, IntAmount, true);
}
+ @Override
public boolean add(double amount)
{
int IntAmount = (int)Math.ceil(amount);
@@ -242,6 +272,7 @@ public class BOSE6 implements Method
return this.BOSEconomy.setBankMoney(bank, (balance + IntAmount), false);
}
+ @Override
public boolean subtract(double amount)
{
int IntAmount = (int)Math.ceil(amount);
@@ -249,6 +280,7 @@ public class BOSE6 implements Method
return this.BOSEconomy.setBankMoney(bank, (balance - IntAmount), false);
}
+ @Override
public boolean multiply(double amount)
{
int IntAmount = (int)Math.ceil(amount);
@@ -256,6 +288,7 @@ public class BOSE6 implements Method
return this.BOSEconomy.setBankMoney(bank, (balance * IntAmount), false);
}
+ @Override
public boolean divide(double amount)
{
int IntAmount = (int)Math.ceil(amount);
@@ -263,26 +296,31 @@ public class BOSE6 implements Method
return this.BOSEconomy.setBankMoney(bank, (balance / IntAmount), false);
}
+ @Override
public boolean hasEnough(double amount)
{
return (this.balance() >= amount);
}
+ @Override
public boolean hasOver(double amount)
{
return (this.balance() > amount);
}
+ @Override
public boolean hasUnder(double amount)
{
return (this.balance() < amount);
}
+ @Override
public boolean isNegative()
{
return (this.balance() < 0);
}
+ @Override
public boolean remove()
{
return this.BOSEconomy.removeBank(bank);
diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java
index 72d1f763e..d21ea6244 100644
--- a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java
+++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java
@@ -1,7 +1,6 @@
package com.earth2me.essentials.register.payment.methods;
import com.earth2me.essentials.register.payment.Method;
-
import cosine.boseconomy.BOSEconomy;
import org.bukkit.plugin.Plugin;
@@ -18,26 +17,31 @@ public class BOSE7 implements Method
{
private BOSEconomy BOSEconomy;
+ @Override
public BOSEconomy getPlugin()
{
return this.BOSEconomy;
}
+ @Override
public String getName()
{
return "BOSEconomy";
}
+ @Override
public String getVersion()
{
return "0.7.0";
}
+ @Override
public int fractionalDigits()
{
return this.BOSEconomy.getFractionalDigits();
}
+ @Override
public String format(double amount)
{
String currency = this.BOSEconomy.getMoneyNamePlural();
@@ -50,26 +54,31 @@ public class BOSE7 implements Method
return amount + " " + currency;
}
+ @Override
public boolean hasBanks()
{
return true;
}
+ @Override
public boolean hasBank(String bank)
{
return this.BOSEconomy.bankExists(bank);
}
+ @Override
public boolean hasAccount(String name)
{
return this.BOSEconomy.playerRegistered(name, false);
}
+ @Override
public boolean hasBankAccount(String bank, String name)
{
return this.BOSEconomy.isBankOwner(bank, name) || this.BOSEconomy.isBankMember(bank, name);
}
+ @Override
public boolean createAccount(String name)
{
if (hasAccount(name))
@@ -81,6 +90,7 @@ public class BOSE7 implements Method
return true;
}
+ @Override
public boolean createAccount(String name, Double balance)
{
if (hasAccount(name))
@@ -93,6 +103,7 @@ public class BOSE7 implements Method
return true;
}
+ @Override
public MethodAccount getAccount(String name)
{
if (!hasAccount(name))
@@ -103,6 +114,7 @@ public class BOSE7 implements Method
return new BOSEAccount(name, this.BOSEconomy);
}
+ @Override
public MethodBankAccount getBankAccount(String bank, String name)
{
if (!hasBankAccount(bank, name))
@@ -113,6 +125,7 @@ public class BOSE7 implements Method
return new BOSEBankAccount(bank, BOSEconomy);
}
+ @Override
public boolean isCompatible(Plugin plugin)
{
return plugin.getDescription().getName().equalsIgnoreCase("boseconomy")
@@ -120,6 +133,7 @@ public class BOSE7 implements Method
&& !plugin.getDescription().getVersion().equals("0.6.2");
}
+ @Override
public void setPlugin(Plugin plugin)
{
BOSEconomy = (BOSEconomy)plugin;
@@ -137,59 +151,70 @@ public class BOSE7 implements Method
this.BOSEconomy = bOSEconomy;
}
+ @Override
public double balance()
{
return this.BOSEconomy.getPlayerMoneyDouble(this.name);
}
+ @Override
public boolean set(double amount)
{
return this.BOSEconomy.setPlayerMoney(this.name, amount, false);
}
+ @Override
public boolean add(double amount)
{
return this.BOSEconomy.addPlayerMoney(this.name, amount, false);
}
+ @Override
public boolean subtract(double amount)
{
double balance = this.balance();
return this.BOSEconomy.setPlayerMoney(this.name, (balance - amount), false);
}
+ @Override
public boolean multiply(double amount)
{
double balance = this.balance();
return this.BOSEconomy.setPlayerMoney(this.name, (balance * amount), false);
}
+ @Override
public boolean divide(double amount)
{
double balance = this.balance();
return this.BOSEconomy.setPlayerMoney(this.name, (balance / amount), false);
}
+ @Override
public boolean hasEnough(double amount)
{
return (this.balance() >= amount);
}
+ @Override
public boolean hasOver(double amount)
{
return (this.balance() > amount);
}
+ @Override
public boolean hasUnder(double amount)
{
return (this.balance() < amount);
}
+ @Override
public boolean isNegative()
{
return (this.balance() < 0);
}
+ @Override
public boolean remove()
{
return false;
@@ -208,70 +233,83 @@ public class BOSE7 implements Method
this.BOSEconomy = bOSEconomy;
}
+ @Override
public String getBankName()
{
return this.bank;
}
+ @Override
public int getBankId()
{
return -1;
}
+ @Override
public double balance()
{
return this.BOSEconomy.getBankMoneyDouble(bank);
}
+ @Override
public boolean set(double amount)
{
return this.BOSEconomy.setBankMoney(bank, amount, true);
}
+ @Override
public boolean add(double amount)
{
double balance = this.balance();
return this.BOSEconomy.setBankMoney(bank, (balance + amount), false);
}
+ @Override
public boolean subtract(double amount)
{
double balance = this.balance();
return this.BOSEconomy.setBankMoney(bank, (balance - amount), false);
}
+ @Override
public boolean multiply(double amount)
{
double balance = this.balance();
return this.BOSEconomy.setBankMoney(bank, (balance * amount), false);
}
+ @Override
public boolean divide(double amount)
{
double balance = this.balance();
return this.BOSEconomy.setBankMoney(bank, (balance / amount), false);
}
+ @Override
public boolean hasEnough(double amount)
{
return (this.balance() >= amount);
}
+ @Override
public boolean hasOver(double amount)
{
return (this.balance() > amount);
}
+ @Override
public boolean hasUnder(double amount)
{
return (this.balance() < amount);
}
+ @Override
public boolean isNegative()
{
return (this.balance() < 0);
}
+ @Override
public boolean remove()
{
return this.BOSEconomy.removeBank(bank);
diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java
index 53d8ed120..87d633b5c 100644
--- a/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java
+++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java
@@ -1,10 +1,8 @@
package com.earth2me.essentials.register.payment.methods;
import com.earth2me.essentials.register.payment.Method;
-
import me.ashtheking.currency.Currency;
import me.ashtheking.currency.CurrencyList;
-
import org.bukkit.plugin.Plugin;
@@ -19,73 +17,87 @@ public class MCUR implements Method
{
private Currency currencyList;
+ @Override
public Object getPlugin()
{
return this.currencyList;
}
+ @Override
public String getName()
{
return "MultiCurrency";
}
+ @Override
public String getVersion()
{
return "0.09";
}
+ @Override
public int fractionalDigits()
{
return -1;
}
+ @Override
public String format(double amount)
{
return amount + " Currency";
}
+ @Override
public boolean hasBanks()
{
return false;
}
+ @Override
public boolean hasBank(String bank)
{
return false;
}
+ @Override
public boolean hasAccount(String name)
{
return true;
}
+ @Override
public boolean hasBankAccount(String bank, String name)
{
return false;
}
+ @Override
public boolean createAccount(String name)
{
CurrencyList.setValue((String)CurrencyList.maxCurrency(name)[0], name, 0);
return true;
}
+ @Override
public boolean createAccount(String name, Double balance)
{
CurrencyList.setValue((String)CurrencyList.maxCurrency(name)[0], name, balance);
return true;
}
+ @Override
public MethodAccount getAccount(String name)
{
return new MCurrencyAccount(name);
}
+ @Override
public MethodBankAccount getBankAccount(String bank, String name)
{
return null;
}
+ @Override
public boolean isCompatible(Plugin plugin)
{
return (plugin.getDescription().getName().equalsIgnoreCase("Currency")
@@ -93,6 +105,7 @@ public class MCUR implements Method
&& plugin instanceof Currency;
}
+ @Override
public void setPlugin(Plugin plugin)
{
currencyList = (Currency)plugin;
@@ -108,57 +121,68 @@ public class MCUR implements Method
this.name = name;
}
+ @Override
public double balance()
{
return CurrencyList.getValue((String)CurrencyList.maxCurrency(name)[0], name);
}
+ @Override
public boolean set(double amount)
{
CurrencyList.setValue((String)CurrencyList.maxCurrency(name)[0], name, amount);
return true;
}
+ @Override
public boolean add(double amount)
{
return CurrencyList.add(name, amount);
}
+ @Override
public boolean subtract(double amount)
{
return CurrencyList.subtract(name, amount);
}
+ @Override
public boolean multiply(double amount)
{
return CurrencyList.multiply(name, amount);
}
+ @Override
public boolean divide(double amount)
{
return CurrencyList.divide(name, amount);
}
+ @Override
public boolean hasEnough(double amount)
{
return CurrencyList.hasEnough(name, amount);
}
+ @Override
public boolean hasOver(double amount)
{
return CurrencyList.hasOver(name, amount);
}
+ @Override
public boolean hasUnder(double amount)
{
return CurrencyList.hasUnder(name, amount);
}
+ @Override
public boolean isNegative()
{
return CurrencyList.isNegative(name);
}
+ @Override
public boolean remove()
{
return CurrencyList.remove(name);
diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java
new file mode 100644
index 000000000..c7757f66b
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java
@@ -0,0 +1,328 @@
+package com.earth2me.essentials.register.payment.methods;
+
+import net.milkbowl.vault.Vault;
+import net.milkbowl.vault.economy.Economy;
+
+import org.bukkit.plugin.Plugin;
+import org.bukkit.plugin.RegisteredServiceProvider;
+
+import com.earth2me.essentials.register.payment.Method;
+
+
+public class VaultEco implements Method
+{
+ private Vault vault;
+ private Economy economy;
+
+ @Override
+ public Vault getPlugin()
+ {
+ return this.vault;
+ }
+
+ @Override
+ public boolean createAccount(String name, Double amount)
+ {
+ if (hasAccount(name))
+ {
+ return false;
+ }
+
+ return false;
+ }
+
+ @Override
+ public String getName()
+ {
+
+ return this.vault.getDescription().getName().concat(" - Economy: ").concat(economy == null ? "NoEco" : economy.getName());
+ }
+
+ @Override
+ public String getVersion()
+ {
+ return this.vault.getDescription().getVersion();
+ }
+
+ @Override
+ public int fractionalDigits()
+ {
+ return 0;
+ }
+
+ @Override
+ public String format(double amount)
+ {
+ return this.economy.format(amount);
+ }
+
+ @Override
+ public boolean hasBanks()
+ {
+ return this.economy.hasBankSupport();
+ }
+
+ @Override
+ public boolean hasBank(String bank)
+ {
+ return this.economy.getBanks().contains(bank);
+ }
+
+ @Override
+ public boolean hasAccount(String name)
+ {
+ return this.economy.hasAccount(name);
+ }
+
+ @Override
+ public boolean hasBankAccount(String bank, String name)
+ {
+ return this.economy.isBankOwner(bank, name).transactionSuccess()
+ || this.economy.isBankMember(bank, name).transactionSuccess();
+ }
+
+ @Override
+ public boolean createAccount(String name)
+ {
+ return this.economy.createBank(name, "").transactionSuccess();
+ }
+
+ public boolean createAccount(String name, double balance)
+ {
+ if (!this.economy.createBank(name, "").transactionSuccess())
+ {
+ return false;
+ }
+ return this.economy.bankDeposit(name, balance).transactionSuccess();
+ }
+
+ @Override
+ public MethodAccount getAccount(String name)
+ {
+ if (!hasAccount(name))
+ {
+ return null;
+ }
+
+ return new VaultAccount(name, this.economy);
+ }
+
+ @Override
+ public MethodBankAccount getBankAccount(String bank, String name)
+ {
+ if (!hasBankAccount(bank, name))
+ {
+ return null;
+ }
+
+ return new VaultBankAccount(bank, economy);
+ }
+
+ @Override
+ public boolean isCompatible(Plugin plugin)
+ {
+ RegisteredServiceProvider<Economy> ecoPlugin = plugin.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
+ return plugin instanceof Vault && ecoPlugin != null && !ecoPlugin.getProvider().getName().equals("Essentials Economy");
+ }
+
+ @Override
+ public void setPlugin(Plugin plugin)
+ {
+ this.vault = (Vault)plugin;
+ RegisteredServiceProvider<Economy> economyProvider = this.vault.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
+ if (economyProvider != null)
+ {
+ this.economy = economyProvider.getProvider();
+ }
+ }
+
+
+ public class VaultAccount implements MethodAccount
+ {
+ private final String name;
+ private final Economy economy;
+
+ public VaultAccount(String name, Economy economy)
+ {
+ this.name = name;
+ this.economy = economy;
+ }
+
+ @Override
+ public double balance()
+ {
+ return this.economy.getBalance(this.name);
+ }
+
+ @Override
+ public boolean set(double amount)
+ {
+ if (!this.economy.withdrawPlayer(this.name, this.balance()).transactionSuccess())
+ {
+ return false;
+ }
+ if (amount == 0)
+ {
+ return true;
+ }
+ return this.economy.depositPlayer(this.name, amount).transactionSuccess();
+ }
+
+ @Override
+ public boolean add(double amount)
+ {
+ return this.economy.depositPlayer(this.name, amount).transactionSuccess();
+ }
+
+ @Override
+ public boolean subtract(double amount)
+ {
+ return this.economy.withdrawPlayer(this.name, amount).transactionSuccess();
+ }
+
+ @Override
+ public boolean multiply(double amount)
+ {
+ double balance = this.balance();
+ return this.set(balance * amount);
+ }
+
+ @Override
+ public boolean divide(double amount)
+ {
+ double balance = this.balance();
+ return this.set(balance / amount);
+ }
+
+ @Override
+ public boolean hasEnough(double amount)
+ {
+ return (this.balance() >= amount);
+ }
+
+ @Override
+ public boolean hasOver(double amount)
+ {
+ return (this.balance() > amount);
+ }
+
+ @Override
+ public boolean hasUnder(double amount)
+ {
+ return (this.balance() < amount);
+ }
+
+ @Override
+ public boolean isNegative()
+ {
+ return (this.balance() < 0);
+ }
+
+ @Override
+ public boolean remove()
+ {
+ return this.set(0.0);
+ }
+ }
+
+
+ public class VaultBankAccount implements MethodBankAccount
+ {
+ private final String bank;
+ private final Economy economy;
+
+ public VaultBankAccount(String bank, Economy economy)
+ {
+ this.bank = bank;
+ this.economy = economy;
+ }
+
+ @Override
+ public String getBankName()
+ {
+ return this.bank;
+ }
+
+ @Override
+ public int getBankId()
+ {
+ return -1;
+ }
+
+ @Override
+ public double balance()
+ {
+ return this.economy.bankBalance(this.bank).balance;
+ }
+
+ @Override
+ public boolean set(double amount)
+ {
+ if (!this.economy.bankWithdraw(this.bank, this.balance()).transactionSuccess())
+ {
+ return false;
+ }
+ if (amount == 0)
+ {
+ return true;
+ }
+ return this.economy.bankDeposit(this.bank, amount).transactionSuccess();
+ }
+
+ @Override
+ public boolean add(double amount)
+ {
+ return this.economy.bankDeposit(this.bank, amount).transactionSuccess();
+ }
+
+ @Override
+ public boolean subtract(double amount)
+ {
+ return this.economy.bankWithdraw(this.bank, amount).transactionSuccess();
+ }
+
+ @Override
+ public boolean multiply(double amount)
+ {
+ double balance = this.balance();
+ return this.set(balance * amount);
+ }
+
+ @Override
+ public boolean divide(double amount)
+ {
+ double balance = this.balance();
+ return this.set(balance / amount);
+ }
+
+ @Override
+ public boolean hasEnough(double amount)
+ {
+ return (this.balance() >= amount);
+ }
+
+ @Override
+ public boolean hasOver(double amount)
+ {
+ return (this.balance() > amount);
+ }
+
+ @Override
+ public boolean hasUnder(double amount)
+ {
+ return (this.balance() < amount);
+ }
+
+ @Override
+ public boolean isNegative()
+ {
+ return (this.balance() < 0);
+ }
+
+ @Override
+ public boolean remove()
+ {
+ return this.set(0.0);
+ }
+ }
+} \ No newline at end of file
diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java
index 1f33df12c..52fb36e15 100644
--- a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java
+++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java
@@ -3,8 +3,6 @@ package com.earth2me.essentials.register.payment.methods;
import com.earth2me.essentials.register.payment.Method;
import com.nijiko.coelho.iConomy.iConomy;
import com.nijiko.coelho.iConomy.system.Account;
-
-
import org.bukkit.plugin.Plugin;
@@ -19,51 +17,61 @@ public class iCo4 implements Method
{
private iConomy iConomy;
+ @Override
public iConomy getPlugin()
{
return this.iConomy;
}
+ @Override
public String getName()
{
return "iConomy";
}
+ @Override
public String getVersion()
{
return "4";
}
+ @Override
public int fractionalDigits()
{
return 2;
}
+ @Override
public String format(double amount)
{
return com.nijiko.coelho.iConomy.iConomy.getBank().format(amount);
}
+ @Override
public boolean hasBanks()
{
return false;
}
+ @Override
public boolean hasBank(String bank)
{
return false;
}
+ @Override
public boolean hasAccount(String name)
{
return com.nijiko.coelho.iConomy.iConomy.getBank().hasAccount(name);
}
+ @Override
public boolean hasBankAccount(String bank, String name)
{
return false;
}
+ @Override
public boolean createAccount(String name)
{
if (hasAccount(name))
@@ -83,6 +91,7 @@ public class iCo4 implements Method
return true;
}
+ @Override
public boolean createAccount(String name, Double balance)
{
if (hasAccount(name))
@@ -102,16 +111,19 @@ public class iCo4 implements Method
return true;
}
+ @Override
public MethodAccount getAccount(String name)
{
return new iCoAccount(com.nijiko.coelho.iConomy.iConomy.getBank().getAccount(name));
}
+ @Override
public MethodBankAccount getBankAccount(String bank, String name)
{
return null;
}
+ @Override
public boolean isCompatible(Plugin plugin)
{
return plugin.getDescription().getName().equalsIgnoreCase("iconomy")
@@ -119,6 +131,7 @@ public class iCo4 implements Method
&& plugin instanceof iConomy;
}
+ @Override
public void setPlugin(Plugin plugin)
{
iConomy = (iConomy)plugin;
@@ -139,11 +152,13 @@ public class iCo4 implements Method
return account;
}
+ @Override
public double balance()
{
return this.account.getBalance();
}
+ @Override
public boolean set(double amount)
{
if (this.account == null)
@@ -154,6 +169,7 @@ public class iCo4 implements Method
return true;
}
+ @Override
public boolean add(double amount)
{
if (this.account == null)
@@ -164,6 +180,7 @@ public class iCo4 implements Method
return true;
}
+ @Override
public boolean subtract(double amount)
{
if (this.account == null)
@@ -174,6 +191,7 @@ public class iCo4 implements Method
return true;
}
+ @Override
public boolean multiply(double amount)
{
if (this.account == null)
@@ -184,6 +202,7 @@ public class iCo4 implements Method
return true;
}
+ @Override
public boolean divide(double amount)
{
if (this.account == null)
@@ -194,26 +213,31 @@ public class iCo4 implements Method
return true;
}
+ @Override
public boolean hasEnough(double amount)
{
return this.account.hasEnough(amount);
}
+ @Override
public boolean hasOver(double amount)
{
return this.account.hasOver(amount);
}
+ @Override
public boolean hasUnder(double amount)
{
return (this.balance() < amount);
}
+ @Override
public boolean isNegative()
{
return this.account.isNegative();
}
+ @Override
public boolean remove()
{
if (this.account == null)
diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java
index d56873c3f..3b2fb2f6d 100644
--- a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java
+++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java
@@ -6,8 +6,6 @@ import com.iConomy.system.Account;
import com.iConomy.system.BankAccount;
import com.iConomy.system.Holdings;
import com.iConomy.util.Constants;
-
-
import org.bukkit.plugin.Plugin;
@@ -22,51 +20,61 @@ public class iCo5 implements Method
{
private iConomy iConomy;
+ @Override
public iConomy getPlugin()
{
return this.iConomy;
}
+ @Override
public String getName()
{
return "iConomy";
}
+ @Override
public String getVersion()
{
return "5";
}
+ @Override
public int fractionalDigits()
{
return 2;
}
+ @Override
public String format(double amount)
{
return com.iConomy.iConomy.format(amount);
}
+ @Override
public boolean hasBanks()
{
return Constants.Banking;
}
+ @Override
public boolean hasBank(String bank)
{
return (hasBanks()) && com.iConomy.iConomy.Banks.exists(bank);
}
+ @Override
public boolean hasAccount(String name)
{
return com.iConomy.iConomy.hasAccount(name);
}
+ @Override
public boolean hasBankAccount(String bank, String name)
{
return (hasBank(bank)) && com.iConomy.iConomy.getBank(bank).hasAccount(name);
}
+ @Override
public boolean createAccount(String name)
{
if (hasAccount(name))
@@ -77,6 +85,7 @@ public class iCo5 implements Method
return com.iConomy.iConomy.Accounts.create(name);
}
+ @Override
public boolean createAccount(String name, Double balance)
{
if (hasAccount(name))
@@ -94,16 +103,19 @@ public class iCo5 implements Method
return true;
}
+ @Override
public MethodAccount getAccount(String name)
{
return new iCoAccount(com.iConomy.iConomy.getAccount(name));
}
+ @Override
public MethodBankAccount getBankAccount(String bank, String name)
{
return new iCoBankAccount(com.iConomy.iConomy.getBank(bank).getAccount(name));
}
+ @Override
public boolean isCompatible(Plugin plugin)
{
return plugin.getDescription().getName().equalsIgnoreCase("iconomy")
@@ -111,6 +123,7 @@ public class iCo5 implements Method
&& plugin instanceof iConomy;
}
+ @Override
public void setPlugin(Plugin plugin)
{
iConomy = (iConomy)plugin;
@@ -133,11 +146,13 @@ public class iCo5 implements Method
return account;
}
+ @Override
public double balance()
{
return this.holdings.balance();
}
+ @Override
public boolean set(double amount)
{
if (this.holdings == null)
@@ -148,6 +163,7 @@ public class iCo5 implements Method
return true;
}
+ @Override
public boolean add(double amount)
{
if (this.holdings == null)
@@ -158,6 +174,7 @@ public class iCo5 implements Method
return true;
}
+ @Override
public boolean subtract(double amount)
{
if (this.holdings == null)
@@ -168,6 +185,7 @@ public class iCo5 implements Method
return true;
}
+ @Override
public boolean multiply(double amount)
{
if (this.holdings == null)
@@ -178,6 +196,7 @@ public class iCo5 implements Method
return true;
}
+ @Override
public boolean divide(double amount)
{
if (this.holdings == null)
@@ -188,26 +207,31 @@ public class iCo5 implements Method
return true;
}
+ @Override
public boolean hasEnough(double amount)
{
return this.holdings.hasEnough(amount);
}
+ @Override
public boolean hasOver(double amount)
{
return this.holdings.hasOver(amount);
}
+ @Override
public boolean hasUnder(double amount)
{
return this.holdings.hasUnder(amount);
}
+ @Override
public boolean isNegative()
{
return this.holdings.isNegative();
}
+ @Override
public boolean remove()
{
if (this.account == null)
@@ -236,21 +260,25 @@ public class iCo5 implements Method
return account;
}
+ @Override
public String getBankName()
{
return this.account.getBankName();
}
+ @Override
public int getBankId()
{
return this.account.getBankId();
}
+ @Override
public double balance()
{
return this.holdings.balance();
}
+ @Override
public boolean set(double amount)
{
if (this.holdings == null)
@@ -261,6 +289,7 @@ public class iCo5 implements Method
return true;
}
+ @Override
public boolean add(double amount)
{
if (this.holdings == null)
@@ -271,6 +300,7 @@ public class iCo5 implements Method
return true;
}
+ @Override
public boolean subtract(double amount)
{
if (this.holdings == null)
@@ -281,6 +311,7 @@ public class iCo5 implements Method
return true;
}
+ @Override
public boolean multiply(double amount)
{
if (this.holdings == null)
@@ -291,6 +322,7 @@ public class iCo5 implements Method
return true;
}
+ @Override
public boolean divide(double amount)
{
if (this.holdings == null)
@@ -301,26 +333,31 @@ public class iCo5 implements Method
return true;
}
+ @Override
public boolean hasEnough(double amount)
{
return this.holdings.hasEnough(amount);
}
+ @Override
public boolean hasOver(double amount)
{
return this.holdings.hasOver(amount);
}
+ @Override
public boolean hasUnder(double amount)
{
return this.holdings.hasUnder(amount);
}
+ @Override
public boolean isNegative()
{
return this.holdings.isNegative();
}
+ @Override
public boolean remove()
{
if (this.account == null)
diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java
index 1feee30af..1a2950847 100644
--- a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java
+++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java
@@ -5,8 +5,6 @@ import com.iCo6.iConomy;
import com.iCo6.system.Account;
import com.iCo6.system.Accounts;
import com.iCo6.system.Holdings;
-
-
import org.bukkit.plugin.Plugin;
@@ -21,51 +19,61 @@ public class iCo6 implements Method
{
private iConomy iConomy;
+ @Override
public iConomy getPlugin()
{
return this.iConomy;
}
+ @Override
public String getName()
{
return "iConomy";
}
+ @Override
public String getVersion()
{
return "6";
}
+ @Override
public int fractionalDigits()
{
return 2;
}
+ @Override
public String format(double amount)
{
return com.iCo6.iConomy.format(amount);
}
+ @Override
public boolean hasBanks()
{
return false;
}
+ @Override
public boolean hasBank(String bank)
{
return false;
}
+ @Override
public boolean hasAccount(String name)
{
return (new Accounts()).exists(name);
}
+ @Override
public boolean hasBankAccount(String bank, String name)
{
return false;
}
+ @Override
public boolean createAccount(String name)
{
if (hasAccount(name))
@@ -76,6 +84,7 @@ public class iCo6 implements Method
return (new Accounts()).create(name);
}
+ @Override
public boolean createAccount(String name, Double balance)
{
if (hasAccount(name))
@@ -86,16 +95,19 @@ public class iCo6 implements Method
return (new Accounts()).create(name, balance);
}
+ @Override
public MethodAccount getAccount(String name)
{
return new iCoAccount((new Accounts()).get(name));
}
+ @Override
public MethodBankAccount getBankAccount(String bank, String name)
{
return null;
}
+ @Override
public boolean isCompatible(Plugin plugin)
{
return plugin.getDescription().getName().equalsIgnoreCase("iconomy")
@@ -103,6 +115,7 @@ public class iCo6 implements Method
&& plugin instanceof iConomy;
}
+ @Override
public void setPlugin(Plugin plugin)
{
iConomy = (iConomy)plugin;
@@ -125,11 +138,13 @@ public class iCo6 implements Method
return account;
}
+ @Override
public double balance()
{
return this.holdings.getBalance();
}
+ @Override
public boolean set(double amount)
{
if (this.holdings == null)
@@ -140,6 +155,7 @@ public class iCo6 implements Method
return true;
}
+ @Override
public boolean add(double amount)
{
if (this.holdings == null)
@@ -150,6 +166,7 @@ public class iCo6 implements Method
return true;
}
+ @Override
public boolean subtract(double amount)
{
if (this.holdings == null)
@@ -160,6 +177,7 @@ public class iCo6 implements Method
return true;
}
+ @Override
public boolean multiply(double amount)
{
if (this.holdings == null)
@@ -170,6 +188,7 @@ public class iCo6 implements Method
return true;
}
+ @Override
public boolean divide(double amount)
{
if (this.holdings == null)
@@ -180,26 +199,31 @@ public class iCo6 implements Method
return true;
}
+ @Override
public boolean hasEnough(double amount)
{
return this.holdings.hasEnough(amount);
}
+ @Override
public boolean hasOver(double amount)
{
return this.holdings.hasOver(amount);
}
+ @Override
public boolean hasUnder(double amount)
{
return this.holdings.hasUnder(amount);
}
+ @Override
public boolean isNegative()
{
return this.holdings.isNegative();
}
+ @Override
public boolean remove()
{
if (this.account == null)
diff --git a/Essentials/src/com/earth2me/essentials/settings/Backup.java b/Essentials/src/com/earth2me/essentials/settings/Backup.java
index 1b59260db..f43af47c0 100644
--- a/Essentials/src/com/earth2me/essentials/settings/Backup.java
+++ b/Essentials/src/com/earth2me/essentials/settings/Backup.java
@@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
-public class Backup extends StorageObject
+public class Backup implements StorageObject
{
@Comment("Interval in minutes")
private long interval = 60;
diff --git a/Essentials/src/com/earth2me/essentials/settings/Chat.java b/Essentials/src/com/earth2me/essentials/settings/Chat.java
index 7c02c0e88..623228c4e 100644
--- a/Essentials/src/com/earth2me/essentials/settings/Chat.java
+++ b/Essentials/src/com/earth2me/essentials/settings/Chat.java
@@ -8,17 +8,15 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
-public class Chat extends StorageObject
+public class Chat implements StorageObject
{
@Comment("The character(s) to prefix all nicknames, so that you know they are not true usernames.")
private String nicknamePrefix = "~";
-
@Comment("Disable this if you have any other plugin, that modifies the displayname of a user.")
private boolean changeDisplayname = true;
-
private String displaynameFormat = "{PREFIX}{NICKNAMEPREFIX}{NAME}{SUFFIX}";
-
- @Comment({
+ @Comment(
+ {
"If EssentialsChat is installed, this will define how far a player's voice travels, in blocks. Set to 0 to make all chat global.",
"Note that users with the \"essentials.chat.spy\" permission will hear everything, regardless of this setting.",
"Users with essentials.chat.shout can override this by prefixing text with an exclamation mark (!)",
@@ -26,7 +24,6 @@ public class Chat extends StorageObject
"You can add command costs for shout/question by adding chat-shout and chat-question to the command costs section."
})
private int localRadius = 0;
-
@Comment("Set the default chat format here, it will be overwritten by group specific chat formats.")
private String defaultFormat = "&7[{GROUP}]&f {DISPLAYNAME}&7:&f {MESSAGE}";
}
diff --git a/Essentials/src/com/earth2me/essentials/settings/Commands.java b/Essentials/src/com/earth2me/essentials/settings/Commands.java
index 771cef12b..08efc881c 100644
--- a/Essentials/src/com/earth2me/essentials/settings/Commands.java
+++ b/Essentials/src/com/earth2me/essentials/settings/Commands.java
@@ -1,12 +1,6 @@
package com.earth2me.essentials.settings;
-import com.earth2me.essentials.settings.commands.Afk;
-import com.earth2me.essentials.settings.commands.God;
-import com.earth2me.essentials.settings.commands.Help;
-import com.earth2me.essentials.settings.commands.Home;
-import com.earth2me.essentials.settings.commands.Kit;
-import com.earth2me.essentials.settings.commands.Lightning;
-import com.earth2me.essentials.settings.commands.Spawnmob;
+import com.earth2me.essentials.settings.commands.*;
import com.earth2me.essentials.storage.Comment;
import com.earth2me.essentials.storage.ListType;
import com.earth2me.essentials.storage.StorageObject;
@@ -18,7 +12,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
-public class Commands extends StorageObject
+public class Commands implements StorageObject
{
private Afk afk = new Afk();
private God god = new God();
@@ -40,7 +34,6 @@ public class Commands extends StorageObject
"If god is set using WorldGuard, use /ungod to remove then use whichever you see fit."
})
private List<String> overwritten = new ArrayList<String>();
-
@ListType
@Comment("Disabled commands will be completelly unavailable on the server.")
private List<String> disabled = new ArrayList<String>();
diff --git a/Essentials/src/com/earth2me/essentials/settings/Economy.java b/Essentials/src/com/earth2me/essentials/settings/Economy.java
index b18f05b96..5872dada9 100644
--- a/Essentials/src/com/earth2me/essentials/settings/Economy.java
+++ b/Essentials/src/com/earth2me/essentials/settings/Economy.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.settings;
import com.earth2me.essentials.storage.Comment;
-import com.earth2me.essentials.storage.MapType;
+import com.earth2me.essentials.storage.MapValueType;
import com.earth2me.essentials.storage.StorageObject;
import java.util.HashMap;
import java.util.Map;
@@ -11,11 +11,11 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
-public class Economy extends StorageObject
+public class Economy implements StorageObject
{
@Comment("Defines the balance with which new players begin. Defaults to 0.")
private double startingBalance = 0.0;
- @MapType(Double.class)
+ @MapValueType(Double.class)
@Comment("Defines the cost to use the given commands PER USE")
private Map<String, Double> commandCosts = new HashMap<String, Double>();
@Comment("Set this to a currency symbol you want to use.")
@@ -39,4 +39,5 @@ public class Economy extends StorageObject
}
@Comment("Enable this to log all interactions with trade/buy/sell signs and sell command")
private boolean logEnabled = false;
+ private Worth worth = new Worth();
}
diff --git a/Essentials/src/com/earth2me/essentials/settings/General.java b/Essentials/src/com/earth2me/essentials/settings/General.java
index 77143eb1a..a7cf537bb 100644
--- a/Essentials/src/com/earth2me/essentials/settings/General.java
+++ b/Essentials/src/com/earth2me/essentials/settings/General.java
@@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
-public class General extends StorageObject
+public class General implements StorageObject
{
@Comment("Backup runs a command while saving is disabled")
private Backup backup = new Backup();
diff --git a/Essentials/src/com/earth2me/essentials/settings/GroupOptions.java b/Essentials/src/com/earth2me/essentials/settings/GroupOptions.java
index 1e0137302..7b16a471b 100644
--- a/Essentials/src/com/earth2me/essentials/settings/GroupOptions.java
+++ b/Essentials/src/com/earth2me/essentials/settings/GroupOptions.java
@@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
-public class GroupOptions extends StorageObject
+public class GroupOptions implements StorageObject
{
@Comment("Message format of chat messages")
private String messageFormat;
diff --git a/Essentials/src/com/earth2me/essentials/settings/Groups.java b/Essentials/src/com/earth2me/essentials/settings/Groups.java
index 06565d376..5e67db890 100644
--- a/Essentials/src/com/earth2me/essentials/settings/Groups.java
+++ b/Essentials/src/com/earth2me/essentials/settings/Groups.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.settings;
import com.earth2me.essentials.storage.Comment;
-import com.earth2me.essentials.storage.MapType;
+import com.earth2me.essentials.storage.MapValueType;
import com.earth2me.essentials.storage.StorageObject;
import java.util.LinkedHashMap;
import lombok.Data;
@@ -10,9 +10,10 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
-public class Groups extends StorageObject
-{
- public Groups() {
+public class Groups implements StorageObject
+{
+ public Groups()
+ {
GroupOptions defaultOptions = new GroupOptions();
groups.put("default", defaultOptions);
}
@@ -22,6 +23,6 @@ public class Groups extends StorageObject
"All group names have to be lower case.",
"The groups can be connected to users using the permission essentials.groups.groupname"
})
- @MapType(GroupOptions.class)
+ @MapValueType(GroupOptions.class)
private LinkedHashMap<String, GroupOptions> groups = new LinkedHashMap<String, GroupOptions>();
}
diff --git a/Essentials/src/com/earth2me/essentials/settings/Jails.java b/Essentials/src/com/earth2me/essentials/settings/Jails.java
new file mode 100644
index 000000000..4f9b79197
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/settings/Jails.java
@@ -0,0 +1,18 @@
+package com.earth2me.essentials.settings;
+
+import com.earth2me.essentials.storage.MapValueType;
+import com.earth2me.essentials.storage.StorageObject;
+import java.util.HashMap;
+import java.util.Map;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.bukkit.Location;
+
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class Jails implements StorageObject
+{
+ @MapValueType(Location.class)
+ private Map<String, Location> jails = new HashMap<String, Location>();
+}
diff --git a/Essentials/src/com/earth2me/essentials/settings/Location.java b/Essentials/src/com/earth2me/essentials/settings/Location.java
deleted file mode 100644
index 0535fdf52..000000000
--- a/Essentials/src/com/earth2me/essentials/settings/Location.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.earth2me.essentials.settings;
-
-import com.earth2me.essentials.storage.StorageObject;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import org.bukkit.Server;
-
-
-@Data
-@EqualsAndHashCode(callSuper = false)
-public class Location extends StorageObject
-{
- private String worldName = "Test";
- private double x;
- private double y;
- private double z;
- private Float yaw;
- private Float pitch;
-
- public org.bukkit.Location getBukkit(Server server)
- {
- if (yaw == null || pitch == null)
- {
- return new org.bukkit.Location(server.getWorld(worldName), x, y, z);
- }
- return new org.bukkit.Location(server.getWorld(worldName), x, y, z, yaw, pitch);
- }
-}
diff --git a/Essentials/src/com/earth2me/essentials/settings/Locations.java b/Essentials/src/com/earth2me/essentials/settings/Locations.java
new file mode 100644
index 000000000..7e7f1a63d
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/settings/Locations.java
@@ -0,0 +1,22 @@
+package com.earth2me.essentials.settings;
+
+import com.earth2me.essentials.storage.MapValueType;
+import com.earth2me.essentials.storage.StorageObject;
+import java.util.HashMap;
+import java.util.Map;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.bukkit.Location;
+
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class Locations implements StorageObject
+{
+ @MapValueType(Location.class)
+ Map<String, Location> jails = new HashMap<String, Location>();
+ @MapValueType(Location.class)
+ Map<String, Location> warps = new HashMap<String, Location>();
+ @MapValueType(Location.class)
+ Map<String, Location> spawns = new HashMap<String, Location>();
+}
diff --git a/Essentials/src/com/earth2me/essentials/settings/Settings.java b/Essentials/src/com/earth2me/essentials/settings/Settings.java
index 890bfef4e..4c2ff2dd9 100644
--- a/Essentials/src/com/earth2me/essentials/settings/Settings.java
+++ b/Essentials/src/com/earth2me/essentials/settings/Settings.java
@@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
-public class Settings extends StorageObject
+public class Settings implements StorageObject
{
@Comment(
{
diff --git a/Essentials/src/com/earth2me/essentials/settings/Spawns.java b/Essentials/src/com/earth2me/essentials/settings/Spawns.java
new file mode 100644
index 000000000..a0afa450c
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/settings/Spawns.java
@@ -0,0 +1,18 @@
+package com.earth2me.essentials.settings;
+
+import com.earth2me.essentials.storage.MapValueType;
+import com.earth2me.essentials.storage.StorageObject;
+import java.util.HashMap;
+import java.util.Map;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.bukkit.Location;
+
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class Spawns implements StorageObject
+{
+ @MapValueType(Location.class)
+ private Map<String, Location> spawns = new HashMap<String, Location>();
+}
diff --git a/Essentials/src/com/earth2me/essentials/settings/Worth.java b/Essentials/src/com/earth2me/essentials/settings/Worth.java
new file mode 100644
index 000000000..707f907cf
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/settings/Worth.java
@@ -0,0 +1,34 @@
+package com.earth2me.essentials.settings;
+
+import com.earth2me.essentials.storage.EnchantmentLevel;
+import com.earth2me.essentials.storage.MapKeyType;
+import com.earth2me.essentials.storage.MapValueType;
+import com.earth2me.essentials.storage.StorageObject;
+import java.util.HashMap;
+import java.util.Map;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.bukkit.Material;
+import org.bukkit.enchantments.Enchantment;
+import org.bukkit.material.MaterialData;
+
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class Worth implements StorageObject
+{
+ @MapKeyType(MaterialData.class)
+ @MapValueType(Double.class)
+ private Map<MaterialData, Double> sell = new HashMap<MaterialData, Double>();
+ @MapKeyType(MaterialData.class)
+ @MapValueType(Double.class)
+ private Map<MaterialData, Double> buy = new HashMap<MaterialData, Double>();
+ @MapKeyType(EnchantmentLevel.class)
+ @MapValueType(Double.class)
+ private Map<EnchantmentLevel, Double> enchantmentMultiplier = new HashMap<EnchantmentLevel, Double>();
+
+ public Worth()
+ {
+ sell.put(new MaterialData(Material.APPLE, (byte)0), 1.0);
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/settings/commands/Afk.java b/Essentials/src/com/earth2me/essentials/settings/commands/Afk.java
index 20076c273..80cae7e8a 100644
--- a/Essentials/src/com/earth2me/essentials/settings/commands/Afk.java
+++ b/Essentials/src/com/earth2me/essentials/settings/commands/Afk.java
@@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
-public class Afk extends StorageObject
+public class Afk implements StorageObject
{
@Comment(
{
diff --git a/Essentials/src/com/earth2me/essentials/settings/commands/God.java b/Essentials/src/com/earth2me/essentials/settings/commands/God.java
index 7740eaab1..a6f5dbfc3 100644
--- a/Essentials/src/com/earth2me/essentials/settings/commands/God.java
+++ b/Essentials/src/com/earth2me/essentials/settings/commands/God.java
@@ -5,9 +5,10 @@ import com.earth2me.essentials.storage.StorageObject;
import lombok.Data;
import lombok.EqualsAndHashCode;
+
@Data
-@EqualsAndHashCode(callSuper=false)
-public class God extends StorageObject
+@EqualsAndHashCode(callSuper = false)
+public class God implements StorageObject
{
@Comment("Turn off god mode when people exit")
private boolean removeOnDisconnect = false;
diff --git a/Essentials/src/com/earth2me/essentials/settings/commands/Help.java b/Essentials/src/com/earth2me/essentials/settings/commands/Help.java
index 03a9d5958..0b4787471 100644
--- a/Essentials/src/com/earth2me/essentials/settings/commands/Help.java
+++ b/Essentials/src/com/earth2me/essentials/settings/commands/Help.java
@@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
-public class Help extends StorageObject
+public class Help implements StorageObject
{
@Comment("Show other plugins commands in help")
private boolean showNonEssCommandsInHelp = true;
diff --git a/Essentials/src/com/earth2me/essentials/settings/commands/Home.java b/Essentials/src/com/earth2me/essentials/settings/commands/Home.java
index 6ec2f1339..8b3a0ca82 100644
--- a/Essentials/src/com/earth2me/essentials/settings/commands/Home.java
+++ b/Essentials/src/com/earth2me/essentials/settings/commands/Home.java
@@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
-public class Home extends StorageObject
+public class Home implements StorageObject
{
@Comment("When players die, should they respawn at their homes, instead of the spawnpoint?")
private boolean respawnAtHome = false;
diff --git a/Essentials/src/com/earth2me/essentials/settings/commands/Kit.java b/Essentials/src/com/earth2me/essentials/settings/commands/Kit.java
index 59b0b9a82..87aa42d3c 100644
--- a/Essentials/src/com/earth2me/essentials/settings/commands/Kit.java
+++ b/Essentials/src/com/earth2me/essentials/settings/commands/Kit.java
@@ -1,28 +1,28 @@
package com.earth2me.essentials.settings.commands;
-import com.earth2me.essentials.storage.MapType;
+import com.earth2me.essentials.storage.MapValueType;
import com.earth2me.essentials.storage.StorageObject;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import org.bukkit.Material;
+import org.bukkit.inventory.ItemStack;
@Data
@EqualsAndHashCode(callSuper = false)
-public class Kit extends StorageObject
+public class Kit implements StorageObject
{
-
public Kit()
{
final KitObject kit = new KitObject();
kit.setDelay(10.0);
- kit.setItems(Arrays.asList("277 1,278 1,279 1".split(",")));
+ kit.getItems().add(new ItemStack(Material.DIAMOND_SPADE, 1));
+ kit.getItems().add(new ItemStack(Material.DIAMOND_PICKAXE, 1));
+ kit.getItems().add(new ItemStack(Material.DIAMOND_AXE, 1));
kits.put("tools", kit);
}
-
-
- @MapType(KitObject.class)
- private Map<String,KitObject> kits = new HashMap<String, KitObject>();
+ @MapValueType(KitObject.class)
+ private Map<String, KitObject> kits = new HashMap<String, KitObject>();
}
diff --git a/Essentials/src/com/earth2me/essentials/settings/commands/KitObject.java b/Essentials/src/com/earth2me/essentials/settings/commands/KitObject.java
index 93f6c6ade..fe0353be9 100644
--- a/Essentials/src/com/earth2me/essentials/settings/commands/KitObject.java
+++ b/Essentials/src/com/earth2me/essentials/settings/commands/KitObject.java
@@ -6,13 +6,14 @@ import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import org.bukkit.inventory.ItemStack;
@Data
@EqualsAndHashCode(callSuper = false)
-public class KitObject extends StorageObject
+public class KitObject implements StorageObject
{
- @ListType
- private List<String> items = new ArrayList<String>();
+ @ListType(ItemStack.class)
+ private List<ItemStack> items = new ArrayList<ItemStack>();
private Double delay;
}
diff --git a/Essentials/src/com/earth2me/essentials/settings/commands/Lightning.java b/Essentials/src/com/earth2me/essentials/settings/commands/Lightning.java
index 510857247..e40e645da 100644
--- a/Essentials/src/com/earth2me/essentials/settings/commands/Lightning.java
+++ b/Essentials/src/com/earth2me/essentials/settings/commands/Lightning.java
@@ -5,9 +5,10 @@ import com.earth2me.essentials.storage.StorageObject;
import lombok.Data;
import lombok.EqualsAndHashCode;
+
@Data
@EqualsAndHashCode(callSuper = false)
-public class Lightning extends StorageObject
+public class Lightning implements StorageObject
{
@Comment("Shall we notify users when using /lightning")
private boolean warnPlayer = true;
diff --git a/Essentials/src/com/earth2me/essentials/settings/commands/Spawnmob.java b/Essentials/src/com/earth2me/essentials/settings/commands/Spawnmob.java
index 771da32d1..37d41c296 100644
--- a/Essentials/src/com/earth2me/essentials/settings/commands/Spawnmob.java
+++ b/Essentials/src/com/earth2me/essentials/settings/commands/Spawnmob.java
@@ -5,9 +5,10 @@ import com.earth2me.essentials.storage.StorageObject;
import lombok.Data;
import lombok.EqualsAndHashCode;
+
@Data
@EqualsAndHashCode(callSuper = false)
-public class Spawnmob extends StorageObject
+public class Spawnmob implements StorageObject
{
@Comment("The maximum amount of monsters, a player can spawn with a call of /spawnmob.")
private int limit = 10;
diff --git a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java
index b9d224cec..b0df73a42 100644
--- a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java
+++ b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java
@@ -1,11 +1,9 @@
package com.earth2me.essentials.signs;
-import com.earth2me.essentials.Trade;
-import com.earth2me.essentials.ChargeException;
-import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.*;
import java.util.HashSet;
+import java.util.Locale;
import java.util.Set;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -30,14 +28,14 @@ public class EssentialsSign
{
final ISign sign = new EventSign(event);
final User user = ess.getUser(event.getPlayer());
- if (!(user.isAuthorized("essentials.signs." + signName.toLowerCase() + ".create")
- || user.isAuthorized("essentials.signs.create." + signName.toLowerCase())))
+ if (!(user.isAuthorized("essentials.signs." + signName.toLowerCase(Locale.ENGLISH) + ".create")
+ || user.isAuthorized("essentials.signs.create." + signName.toLowerCase(Locale.ENGLISH))))
{
// Return true, so other plugins can use the same sign title, just hope
// they won't change it to §1[Signname]
return true;
}
- sign.setLine(0, Util.format("signFormatFail", this.signName));
+ sign.setLine(0, _("signFormatFail", this.signName));
try
{
final boolean ret = onSignCreate(sign, user, getUsername(user), ess);
@@ -61,12 +59,12 @@ public class EssentialsSign
public String getSuccessName()
{
- return Util.format("signFormatSuccess", this.signName);
+ return _("signFormatSuccess", this.signName);
}
public String getTemplateName()
{
- return Util.format("signFormatTemplate", this.signName);
+ return _("signFormatTemplate", this.signName);
}
private String getUsername(final User user)
@@ -80,8 +78,8 @@ public class EssentialsSign
final User user = ess.getUser(player);
try
{
- return (user.isAuthorized("essentials.signs." + signName.toLowerCase() + ".use")
- || user.isAuthorized("essentials.signs.use." + signName.toLowerCase()))
+ return (user.isAuthorized("essentials.signs." + signName.toLowerCase(Locale.ENGLISH) + ".use")
+ || user.isAuthorized("essentials.signs.use." + signName.toLowerCase(Locale.ENGLISH)))
&& onSignInteract(sign, user, getUsername(user), ess);
}
catch (ChargeException ex)
@@ -102,8 +100,8 @@ public class EssentialsSign
final User user = ess.getUser(player);
try
{
- return (user.isAuthorized("essentials.signs." + signName.toLowerCase() + ".break")
- || user.isAuthorized("essentials.signs.break." + signName.toLowerCase()))
+ return (user.isAuthorized("essentials.signs." + signName.toLowerCase(Locale.ENGLISH) + ".break")
+ || user.isAuthorized("essentials.signs.break." + signName.toLowerCase(Locale.ENGLISH)))
&& onSignBreak(sign, user, getUsername(user), ess);
}
catch (SignException ex)
@@ -177,7 +175,7 @@ public class EssentialsSign
}
return false;
}
-
+
public boolean onBlockBreak(final Block block, final IEssentials ess)
{
return true;
@@ -192,7 +190,7 @@ public class EssentialsSign
{
return true;
}
-
+
public boolean onBlockIgnite(final Block block, final IEssentials ess)
{
return true;
@@ -275,6 +273,13 @@ public class EssentialsSign
protected final void validateTrade(final ISign sign, final int amountIndex, final int itemIndex,
final User player, final IEssentials ess) throws SignException
{
+ if (sign.getLine(itemIndex).equalsIgnoreCase("exp") || sign.getLine(itemIndex).equalsIgnoreCase("xp"))
+ {
+ int amount = getIntegerPositive(sign.getLine(amountIndex));
+ sign.setLine(amountIndex, Integer.toString(amount));
+ sign.setLine(itemIndex, "exp");
+ return;
+ }
final Trade trade = getTrade(sign, amountIndex, itemIndex, player, ess);
final ItemStack item = trade.getItemStack();
sign.setLine(amountIndex, Integer.toString(item.getAmount()));
@@ -284,12 +289,16 @@ public class EssentialsSign
protected final Trade getTrade(final ISign sign, final int amountIndex, final int itemIndex,
final User player, final IEssentials ess) throws SignException
{
-
+ if (sign.getLine(itemIndex).equalsIgnoreCase("exp") || sign.getLine(itemIndex).equalsIgnoreCase("xp"))
+ {
+ final int amount = getIntegerPositive(sign.getLine(amountIndex));
+ return new Trade(amount, ess);
+ }
final ItemStack item = getItemStack(sign.getLine(itemIndex), 1, ess);
final int amount = Math.min(getIntegerPositive(sign.getLine(amountIndex)), item.getType().getMaxStackSize() * player.getInventory().getSize());
if (item.getTypeId() == 0 || amount < 1)
{
- throw new SignException(Util.i18n("moreThanZero"));
+ throw new SignException(_("moreThanZero"));
}
item.setAmount(amount);
return new Trade(item, ess);
@@ -311,7 +320,7 @@ public class EssentialsSign
final int quantity = getInteger(line);
if (quantity < 1)
{
- throw new SignException(Util.i18n("moreThanZero"));
+ throw new SignException(_("moreThanZero"));
}
return quantity;
}
@@ -355,7 +364,7 @@ public class EssentialsSign
final double quantity = getDouble(line);
if (Math.round(quantity * 100.0) < 1.0)
{
- throw new SignException(Util.i18n("moreThanZero"));
+ throw new SignException(_("moreThanZero"));
}
return quantity;
}
@@ -382,7 +391,7 @@ public class EssentialsSign
final String line = sign.getLine(index).trim();
if (line.isEmpty())
{
- return new Trade(signName.toLowerCase() + "sign", ess);
+ return new Trade(signName.toLowerCase(Locale.ENGLISH) + "sign", ess);
}
final Double money = getMoney(line);
@@ -391,15 +400,20 @@ public class EssentialsSign
final String[] split = line.split("[ :]+", 2);
if (split.length != 2)
{
- throw new SignException(Util.i18n("invalidCharge"));
+ throw new SignException(_("invalidCharge"));
}
final int quantity = getIntegerPositive(split[0]);
- final String item = split[1].toLowerCase();
+ final String item = split[1].toLowerCase(Locale.ENGLISH);
if (item.equalsIgnoreCase("times"))
{
sign.setLine(index, (quantity - decrement) + " times");
- return new Trade(signName.toLowerCase() + "sign", ess);
+ return new Trade(signName.toLowerCase(Locale.ENGLISH) + "sign", ess);
+ }
+ else if (item.equalsIgnoreCase("exp") || item.equalsIgnoreCase("xp"))
+ {
+ sign.setLine(index, quantity + " exp");
+ return new Trade(quantity, ess);
}
else
{
@@ -426,24 +440,27 @@ public class EssentialsSign
this.block = event.getBlock();
}
+ @Override
public final String getLine(final int index)
{
return event.getLine(index);
}
+ @Override
public final void setLine(final int index, final String text)
{
event.setLine(index, text);
}
+ @Override
public Block getBlock()
{
return block;
}
+ @Override
public void updateSign()
{
- return;
}
}
@@ -459,21 +476,25 @@ public class EssentialsSign
this.sign = (Sign)block.getState();
}
+ @Override
public final String getLine(final int index)
{
return sign.getLine(index);
}
+ @Override
public final void setLine(final int index, final String text)
{
sign.setLine(index, text);
}
+ @Override
public final Block getBlock()
{
return block;
}
+ @Override
public final void updateSign()
{
sign.update();
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBalance.java b/Essentials/src/com/earth2me/essentials/signs/SignBalance.java
index 3b961eef6..0b7328ba5 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignBalance.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignBalance.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.signs;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
public class SignBalance extends EssentialsSign
@@ -15,7 +15,7 @@ public class SignBalance extends EssentialsSign
@Override
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
{
- player.sendMessage(Util.format("balance", player.getMoney()));
+ player.sendMessage(_("balance", player.getMoney()));
return true;
}
}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java
index 7320f27a4..2840df298 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java
@@ -8,14 +8,7 @@ import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
-import org.bukkit.event.block.BlockBreakEvent;
-import org.bukkit.event.block.BlockBurnEvent;
-import org.bukkit.event.block.BlockIgniteEvent;
-import org.bukkit.event.block.BlockListener;
-import org.bukkit.event.block.BlockPistonExtendEvent;
-import org.bukkit.event.block.BlockPistonRetractEvent;
-import org.bukkit.event.block.BlockPlaceEvent;
-import org.bukkit.event.block.SignChangeEvent;
+import org.bukkit.event.block.*;
public class SignBlockListener extends BlockListener
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBuy.java b/Essentials/src/com/earth2me/essentials/signs/SignBuy.java
index 39704ff0d..aa4e41426 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignBuy.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignBuy.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.signs;
-import com.earth2me.essentials.Trade;
import com.earth2me.essentials.ChargeException;
import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
@@ -27,7 +27,8 @@ public class SignBuy extends EssentialsSign
final Trade items = getTrade(sign, 1, 2, player, ess);
final Trade charge = getTrade(sign, 3, ess);
charge.isAffordableFor(player);
- if (!items.pay(player, false)) {
+ if (!items.pay(player, false))
+ {
throw new ChargeException("Inventory full");
}
charge.charge(player);
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java
index e4d050305..f747ac07c 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java
@@ -2,8 +2,7 @@ package com.earth2me.essentials.signs;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
-import net.minecraft.server.InventoryPlayer;
-import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
+import com.earth2me.essentials.craftbukkit.ShowInventory;
public class SignDisposal extends EssentialsSign
@@ -16,9 +15,7 @@ public class SignDisposal extends EssentialsSign
@Override
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess)
{
- final CraftInventoryPlayer inv = new CraftInventoryPlayer(new InventoryPlayer(player.getHandle()));
- inv.clear();
- player.showInventory(inv);
+ ShowInventory.showEmptyInventory(player.getBase());
return true;
}
}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java b/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java
new file mode 100644
index 000000000..5907442d9
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java
@@ -0,0 +1,121 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.ChargeException;
+import com.earth2me.essentials.Enchantments;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
+import java.util.Locale;
+import org.bukkit.Material;
+import org.bukkit.enchantments.Enchantment;
+import org.bukkit.inventory.ItemStack;
+
+
+public class SignEnchant extends EssentialsSign
+{
+ public SignEnchant()
+ {
+ super("Enchant");
+ }
+
+ @Override
+ protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ final ItemStack stack = sign.getLine(1).equals("*") || sign.getLine(1).equalsIgnoreCase("any") ? null : getItemStack(sign.getLine(1), 1, ess);
+ final String[] enchantLevel = sign.getLine(2).split(":");
+ if (enchantLevel.length != 2)
+ {
+ throw new SignException(_("invalidSignLine", 3));
+ }
+ final Enchantment enchantment = Enchantments.getByName(enchantLevel[0]);
+ if (enchantment == null)
+ {
+ throw new SignException(_("enchantmentNotFound"));
+ }
+ int level;
+ try
+ {
+ level = Integer.parseInt(enchantLevel[1]);
+ }
+ catch (NumberFormatException ex)
+ {
+ throw new SignException(ex.getMessage());
+ }
+ if (level < 1 || level > enchantment.getMaxLevel())
+ {
+ level = enchantment.getMaxLevel();
+ sign.setLine(2, enchantLevel[0] + ":" + level);
+ }
+ try
+ {
+ if (stack != null)
+ {
+ stack.addEnchantment(enchantment, level);
+ }
+ }
+ catch (Throwable ex)
+ {
+ throw new SignException(ex.getMessage());
+ }
+ getTrade(sign, 3, ess);
+ return true;
+ }
+
+ @Override
+ protected boolean onSignInteract(ISign sign, User player, String username, IEssentials ess) throws SignException, ChargeException
+ {
+ final ItemStack search = sign.getLine(1).equals("*") || sign.getLine(1).equalsIgnoreCase("any") ? null : getItemStack(sign.getLine(1), 1, ess);
+ int slot = -1;
+ final Trade charge = getTrade(sign, 3, ess);
+ charge.isAffordableFor(player);
+ final String[] enchantLevel = sign.getLine(2).split(":");
+ if (enchantLevel.length != 2)
+ {
+ throw new SignException(_("invalidSignLine", 3));
+ }
+ final Enchantment enchantment = Enchantments.getByName(enchantLevel[0]);
+ if (enchantment == null)
+ {
+ throw new SignException(_("enchantmentNotFound"));
+ }
+ int level;
+ try
+ {
+ level = Integer.parseInt(enchantLevel[1]);
+ }
+ catch (NumberFormatException ex)
+ {
+ level = enchantment.getMaxLevel();
+ }
+
+ final ItemStack playerHand = player.getItemInHand();
+ if (playerHand == null
+ || playerHand.getAmount() != 1
+ || (playerHand.containsEnchantment(enchantment)
+ && playerHand.getEnchantmentLevel(enchantment) == level))
+ {
+ throw new SignException(_("missingItems", 1, sign.getLine(1)));
+ }
+ if (search != null && playerHand.getType() != search.getType())
+ {
+ throw new SignException(_("missingItems", 1, search.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' ')));
+ }
+
+ final ItemStack toEnchant = playerHand;
+ try
+ {
+ toEnchant.addEnchantment(enchantment, level);
+ }
+ catch (Exception ex)
+ {
+ throw new SignException(ex.getMessage(), ex);
+ }
+
+ charge.charge(player);
+ Trade.log("Sign", "Enchant", "Interact", username, charge, username, charge, sign.getBlock().getLocation(), ess);
+ player.updateInventory();
+ return true;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java b/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java
index 4f6736989..09bdbeea5 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java
@@ -4,7 +4,6 @@ import com.earth2me.essentials.IEssentials;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.event.entity.EndermanPickupEvent;
-import org.bukkit.event.entity.EndermanPlaceEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityListener;
@@ -70,5 +69,5 @@ public class SignEntityListener extends EntityListener
return;
}
}
- }
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java
index 8939f4bea..7af7dffd7 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java
@@ -1,11 +1,11 @@
package com.earth2me.essentials.signs;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.InventoryWorkaround;
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
-import net.minecraft.server.InventoryPlayer;
-import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
+import com.earth2me.essentials.craftbukkit.ShowInventory;
+import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
@@ -27,11 +27,13 @@ public class SignFree extends EssentialsSign
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
{
final ItemStack item = getItemStack(sign.getLine(1), 1, ess);
- item.setAmount(item.getType().getMaxStackSize()*9*4);
- final CraftInventoryPlayer inv = new CraftInventoryPlayer(new InventoryPlayer(player.getHandle()));
- inv.clear();
- InventoryWorkaround.addItem(inv, true, item);
- player.showInventory(inv);
+ if (item.getType() == Material.AIR)
+ {
+ throw new SignException(_("cantSpawnItem", "Air"));
+ }
+
+ item.setAmount(item.getType().getMaxStackSize() * 9 * 4);
+ ShowInventory.showFilledInventory(player.getBase(), item);
Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), sign.getBlock().getLocation(), ess);
return true;
}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignGameMode.java b/Essentials/src/com/earth2me/essentials/signs/SignGameMode.java
new file mode 100644
index 000000000..37a9fb1b8
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignGameMode.java
@@ -0,0 +1,37 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.ChargeException;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.User;
+import java.util.Locale;
+import org.bukkit.GameMode;
+
+
+public class SignGameMode extends EssentialsSign
+{
+ public SignGameMode()
+ {
+ super("GameMode");
+ }
+
+ @Override
+ protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ validateTrade(sign, 1, ess);
+ return true;
+ }
+
+ @Override
+ protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ final Trade charge = getTrade(sign, 1, ess);
+ charge.isAffordableFor(player);
+
+ player.setGameMode(player.getGameMode() == GameMode.SURVIVAL ? GameMode.CREATIVE : GameMode.SURVIVAL);
+ player.sendMessage(_("gameMode", _(player.getGameMode().toString().toLowerCase(Locale.ENGLISH)), player.getDisplayName()));
+ charge.charge(player);
+ return true;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignHeal.java b/Essentials/src/com/earth2me/essentials/signs/SignHeal.java
index cc932c5e2..be8b7ba1d 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignHeal.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignHeal.java
@@ -1,10 +1,10 @@
package com.earth2me.essentials.signs;
-import com.earth2me.essentials.Trade;
import com.earth2me.essentials.ChargeException;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
public class SignHeal extends EssentialsSign
@@ -29,7 +29,7 @@ public class SignHeal extends EssentialsSign
player.setHealth(20);
player.setFoodLevel(20);
player.setFireTicks(0);
- player.sendMessage(Util.i18n("youAreHealed"));
+ player.sendMessage(_("youAreHealed"));
charge.charge(player);
return true;
}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignKit.java b/Essentials/src/com/earth2me/essentials/signs/SignKit.java
new file mode 100644
index 000000000..32a169592
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignKit.java
@@ -0,0 +1,73 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.*;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+
+public class SignKit extends EssentialsSign
+{
+ public SignKit()
+ {
+ super("Kit");
+ }
+
+ @Override
+ protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ validateTrade(sign, 3, ess);
+
+ final String kitName = sign.getLine(1).toLowerCase(Locale.ENGLISH);
+
+ if (kitName.isEmpty())
+ {
+ sign.setLine(1, "§dKit name!");
+ return false;
+ }
+ else
+ {
+ try
+ {
+ ess.getSettings().getKit(kitName);
+ }
+ catch (Exception ex)
+ {
+ throw new SignException(ex.getMessage(), ex);
+ }
+ final String group = sign.getLine(2);
+ if ("Everyone".equalsIgnoreCase(group) || "Everybody".equalsIgnoreCase(group))
+ {
+ sign.setLine(2, "§2Everyone");
+ }
+ return true;
+ }
+ }
+
+ @Override
+ protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ final String kitName = sign.getLine(1).toLowerCase(Locale.ENGLISH);
+ final String group = sign.getLine(2);
+ if ((!group.isEmpty() && ("§2Everyone".equals(group) || player.inGroup(group)))
+ || (group.isEmpty() && (player.isAuthorized("essentials.kit." + kitName))))
+ {
+ final Trade charge = getTrade(sign, 3, ess);
+ charge.isAffordableFor(player);
+ try
+ {
+ final Object kit = ess.getSettings().getKit(kitName);
+ final Map<String, Object> els = (Map<String, Object>)kit;
+ final List<String> items = Kit.getItems(player, els);
+ Kit.expandItems(ess, player, items);
+ charge.charge(player);
+ }
+ catch (Exception ex)
+ {
+ throw new SignException(ex.getMessage(), ex);
+ }
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignMail.java b/Essentials/src/com/earth2me/essentials/signs/SignMail.java
index 1c3d162c4..b220fb2f5 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignMail.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignMail.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.signs;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import java.util.List;
@@ -19,14 +19,14 @@ public class SignMail extends EssentialsSign
final List<String> mail = player.getMails();
if (mail.isEmpty())
{
- player.sendMessage(Util.i18n("noNewMail"));
+ player.sendMessage(_("noNewMail"));
return false;
}
for (String s : mail)
{
player.sendMessage(s);
}
- player.sendMessage(Util.i18n("markMailAsRead"));
+ player.sendMessage(_("markMailAsRead"));
return true;
}
}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignProtection.java b/Essentials/src/com/earth2me/essentials/signs/SignProtection.java
index 157535cd9..f64b6f3f1 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignProtection.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignProtection.java
@@ -1,15 +1,12 @@
package com.earth2me.essentials.signs;
import com.earth2me.essentials.ChargeException;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import org.bukkit.ChatColor;
+import java.util.*;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -35,12 +32,17 @@ public class SignProtection extends EssentialsSign
protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
{
sign.setLine(3, "§4" + username);
- if (hasAdjacentBlock(sign.getBlock()) && isBlockProtected(sign.getBlock(), player, username, true) != SignProtectionState.NOT_ALLOWED)
+ if (hasAdjacentBlock(sign.getBlock()))
{
- sign.setLine(3, "§1" + username);
- return true;
+ final SignProtectionState state = isBlockProtected(sign.getBlock(), player, username, true);
+ if (state == SignProtectionState.NOSIGN || state == SignProtectionState.OWNER
+ || player.isAuthorized("essentials.signs.protection.override"))
+ {
+ sign.setLine(3, "§1" + username);
+ return true;
+ }
}
- player.sendMessage(Util.i18n("signProtectInvalidLocation"));
+ player.sendMessage(_("signProtectInvalidLocation"));
return false;
}
@@ -145,7 +147,7 @@ public class SignProtection extends EssentialsSign
{
return SignProtectionState.OWNER;
}
- if (ChatColor.stripColor(sign.getLine(3)).equalsIgnoreCase(username))
+ if (Util.stripColor(sign.getLine(3)).equalsIgnoreCase(username))
{
return SignProtectionState.OWNER;
}
@@ -183,11 +185,6 @@ public class SignProtection extends EssentialsSign
SignProtectionState retstate = SignProtectionState.NOSIGN;
for (SignProtectionState state : signs.values())
{
-
- if (state == SignProtectionState.OWNER)
- {
- return state;
- }
if (state == SignProtectionState.ALLOWED)
{
retstate = state;
@@ -197,6 +194,16 @@ public class SignProtection extends EssentialsSign
retstate = state;
}
}
+ if (!secure || retstate == SignProtectionState.NOSIGN)
+ {
+ for (SignProtectionState state : signs.values())
+ {
+ if (state == SignProtectionState.OWNER)
+ {
+ return state;
+ }
+ }
+ }
return retstate;
}
@@ -249,7 +256,7 @@ public class SignProtection extends EssentialsSign
if ((state == SignProtectionState.ALLOWED || state == SignProtectionState.NOT_ALLOWED)
&& !player.isAuthorized("essentials.signs.protection.override"))
{
- player.sendMessage(Util.format("noPlacePermission", block.getType().toString().toLowerCase()));
+ player.sendMessage(_("noPlacePermission", block.getType().toString().toLowerCase(Locale.ENGLISH)));
return false;
}
}
@@ -274,7 +281,7 @@ public class SignProtection extends EssentialsSign
}
- player.sendMessage(Util.format("noAccessPermission", block.getType().toString().toLowerCase()));
+ player.sendMessage(_("noAccessPermission", block.getType().toString().toLowerCase(Locale.ENGLISH)));
return false;
}
@@ -297,10 +304,10 @@ public class SignProtection extends EssentialsSign
}
- player.sendMessage(Util.format("noDestroyPermission", block.getType().toString().toLowerCase()));
+ player.sendMessage(_("noDestroyPermission", block.getType().toString().toLowerCase(Locale.ENGLISH)));
return false;
}
-
+
@Override
public boolean onBlockBreak(final Block block, final IEssentials ess)
{
@@ -324,7 +331,7 @@ public class SignProtection extends EssentialsSign
return state == SignProtectionState.NOSIGN;
}
-
+
@Override
public boolean onBlockIgnite(final Block block, final IEssentials ess)
{
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignSell.java b/Essentials/src/com/earth2me/essentials/signs/SignSell.java
index 2a5a8cfcc..442a503c2 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignSell.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignSell.java
@@ -1,8 +1,8 @@
package com.earth2me.essentials.signs;
-import com.earth2me.essentials.Trade;
import com.earth2me.essentials.ChargeException;
import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignSpawnmob.java b/Essentials/src/com/earth2me/essentials/signs/SignSpawnmob.java
index 071b61be1..7c4cfcd54 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignSpawnmob.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignSpawnmob.java
@@ -9,7 +9,6 @@ import com.earth2me.essentials.commands.Commandspawnmob;
public class SignSpawnmob extends EssentialsSign
{
-
public SignSpawnmob()
{
super("Spawnmob");
@@ -30,7 +29,8 @@ public class SignSpawnmob extends EssentialsSign
charge.isAffordableFor(player);
Commandspawnmob command = new Commandspawnmob();
command.setEssentials(ess);
- String[] args = new String[] {
+ String[] args = new String[]
+ {
sign.getLine(2), sign.getLine(1)
};
try
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignTime.java b/Essentials/src/com/earth2me/essentials/signs/SignTime.java
index 120347467..99c579ff4 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignTime.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignTime.java
@@ -1,10 +1,10 @@
package com.earth2me.essentials.signs;
-import com.earth2me.essentials.Trade;
import com.earth2me.essentials.ChargeException;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
public class SignTime extends EssentialsSign
@@ -29,7 +29,7 @@ public class SignTime extends EssentialsSign
sign.setLine(1, "§2Night");
return true;
}
- throw new SignException(Util.i18n("onlyDayNight"));
+ throw new SignException(_("onlyDayNight"));
}
@Override
@@ -52,6 +52,6 @@ public class SignTime extends EssentialsSign
charge.charge(player);
return true;
}
- throw new SignException(Util.i18n("onlyDayNight"));
+ throw new SignException(_("onlyDayNight"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java
index 6c956165a..943a14a83 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java
@@ -1,15 +1,13 @@
package com.earth2me.essentials.signs;
-import com.earth2me.essentials.ChargeException;
-import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.Trade;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.*;
import org.bukkit.inventory.ItemStack;
-
+//TODO: Sell Enchantment on Trade signs?
public class SignTrade extends EssentialsSign
-{
+{
+
public SignTrade()
{
super("Trade");
@@ -45,7 +43,7 @@ public class SignTrade extends EssentialsSign
{
if (store == null)
{
- throw new SignException(Util.i18n("tradeSignEmptyOwner"), e);
+ throw new SignException(_("tradeSignEmptyOwner"), e);
}
}
Trade.log("Sign", "Trade", "OwnerInteract", username, store, username, stored, sign.getBlock().getLocation(), ess);
@@ -73,13 +71,16 @@ public class SignTrade extends EssentialsSign
final Trade trade = getTrade(sign, 2, false, false, ess);
if (trade.getItemStack() != null && player.getItemInHand() != null
&& trade.getItemStack().getTypeId() == player.getItemInHand().getTypeId()
- && trade.getItemStack().getDurability() == player.getItemInHand().getDurability())
+ && trade.getItemStack().getDurability() == player.getItemInHand().getDurability()
+ && trade.getItemStack().getEnchantments().equals(player.getItemInHand().getEnchantments()))
{
int amount = player.getItemInHand().getAmount();
amount -= amount % trade.getItemStack().getAmount();
if (amount > 0)
{
- final Trade store = new Trade(new ItemStack(player.getItemInHand().getTypeId(), amount, player.getItemInHand().getDurability()), ess);
+ final ItemStack stack = player.getItemInHand().clone();
+ stack.setAmount(amount);
+ final Trade store = new Trade(stack, ess);
addAmount(sign, 2, store, ess);
store.charge(player);
return store;
@@ -150,7 +151,7 @@ public class SignTrade extends EssentialsSign
amount -= amount % money;
if (amount < 0.01 || money < 0.01)
{
- throw new SignException(Util.i18n("moreThanZero"));
+ throw new SignException(_("moreThanZero"));
}
sign.setLine(index, Util.formatCurrency(money, ess) + ":" + Util.formatCurrency(amount, ess).substring(1));
return;
@@ -160,10 +161,15 @@ public class SignTrade extends EssentialsSign
if (split.length == 2 && !amountNeeded)
{
final int amount = getIntegerPositive(split[0]);
- final ItemStack item = getItemStack(split[1], amount, ess);
- if (amount < 1 || item.getTypeId() == 0)
+
+ if (amount < 1)
+ {
+ throw new SignException(_("moreThanZero"));
+ }
+ if (!(split[1].equalsIgnoreCase("exp") || split[1].equalsIgnoreCase("xp"))
+ && getItemStack(split[1], amount, ess).getTypeId() == 0)
{
- throw new SignException(Util.i18n("moreThanZero"));
+ throw new SignException(_("moreThanZero"));
}
String newline = amount + " " + split[1] + ":0";
if ((newline + amount).length() > 15)
@@ -177,17 +183,21 @@ public class SignTrade extends EssentialsSign
if (split.length == 3 && amountNeeded)
{
final int stackamount = getIntegerPositive(split[0]);
- final ItemStack item = getItemStack(split[1], stackamount, ess);
int amount = getIntegerPositive(split[2]);
amount -= amount % stackamount;
- if (amount < 1 || stackamount < 1 || item.getTypeId() == 0)
+ if (amount < 1 || stackamount < 1)
{
- throw new SignException(Util.i18n("moreThanZero"));
+ throw new SignException(_("moreThanZero"));
+ }
+ if (!(split[1].equalsIgnoreCase("exp") || split[1].equalsIgnoreCase("xp"))
+ && getItemStack(split[1], stackamount, ess).getTypeId() == 0)
+ {
+ throw new SignException(_("moreThanZero"));
}
sign.setLine(index, stackamount + " " + split[1] + ":" + amount);
return;
}
- throw new SignException(Util.format("invalidSignLine", index + 1));
+ throw new SignException(_("invalidSignLine", index + 1));
}
protected final Trade getTrade(final ISign sign, final int index, final boolean fullAmount, final boolean notEmpty, final IEssentials ess) throws SignException
@@ -212,24 +222,38 @@ public class SignTrade extends EssentialsSign
}
catch (SignException e)
{
- throw new SignException(Util.i18n("tradeSignEmpty"));
+ throw new SignException(_("tradeSignEmpty"));
}
}
if (split.length == 3)
{
- final int stackamount = getIntegerPositive(split[0]);
- final ItemStack item = getItemStack(split[1], stackamount, ess);
- int amount = getInteger(split[2]);
- amount -= amount % stackamount;
- if (notEmpty && (amount < 1 || stackamount < 1 || item.getTypeId() == 0))
+ if (split[1].equalsIgnoreCase("exp") || split[1].equalsIgnoreCase("xp"))
{
- throw new SignException(Util.i18n("tradeSignEmpty"));
+ final int stackamount = getIntegerPositive(split[0]);
+ int amount = getInteger(split[2]);
+ amount -= amount % stackamount;
+ if (notEmpty && (amount < 1 || stackamount < 1))
+ {
+ throw new SignException(_("tradeSignEmpty"));
+ }
+ return new Trade(fullAmount ? amount : stackamount, ess);
+ }
+ else
+ {
+ final int stackamount = getIntegerPositive(split[0]);
+ final ItemStack item = getItemStack(split[1], stackamount, ess);
+ int amount = getInteger(split[2]);
+ amount -= amount % stackamount;
+ if (notEmpty && (amount < 1 || stackamount < 1 || item.getTypeId() == 0))
+ {
+ throw new SignException(_("tradeSignEmpty"));
+ }
+ item.setAmount(fullAmount ? amount : stackamount);
+ return new Trade(item, ess);
}
- item.setAmount(fullAmount ? amount : stackamount);
- return new Trade(item, ess);
}
- throw new SignException(Util.format("invalidSignLine", index + 1));
+ throw new SignException(_("invalidSignLine", index + 1));
}
protected final void substractAmount(final ISign sign, final int index, final Trade trade, final IEssentials ess) throws SignException
@@ -244,6 +268,11 @@ public class SignTrade extends EssentialsSign
{
changeAmount(sign, index, -item.getAmount(), ess);
}
+ final Integer exp = trade.getExperience();
+ if (exp != null)
+ {
+ changeAmount(sign, index, -exp.intValue(), ess);
+ }
}
protected final void addAmount(final ISign sign, final int index, final Trade trade, final IEssentials ess) throws SignException
@@ -258,10 +287,16 @@ public class SignTrade extends EssentialsSign
{
changeAmount(sign, index, item.getAmount(), ess);
}
+ final Integer exp = trade.getExperience();
+ if (exp != null)
+ {
+ changeAmount(sign, index, exp.intValue(), ess);
+ }
}
private void changeAmount(final ISign sign, final int index, final double value, final IEssentials ess) throws SignException
{
+
final String line = sign.getLine(index).trim();
if (line.isEmpty())
{
@@ -287,17 +322,33 @@ public class SignTrade extends EssentialsSign
if (split.length == 3)
{
- final int stackamount = getIntegerPositive(split[0]);
- final ItemStack item = getItemStack(split[1], stackamount, ess);
- final int amount = getInteger(split[2]);
- final String newline = stackamount + " " + split[1] + ":" + (amount + Math.round(value));
- if (newline.length() > 15)
+ if (split[1].equalsIgnoreCase("exp") || split[1].equalsIgnoreCase("xp"))
{
- throw new SignException("Line too long!");
+ final int stackamount = getIntegerPositive(split[0]);
+ final int amount = getInteger(split[2]);
+ final String newline = stackamount + " " + split[1] + ":" + (amount + Math.round(value));
+ if (newline.length() > 15)
+ {
+ throw new SignException("Line too long!");
+ }
+ sign.setLine(index, newline);
+ return;
+ }
+ else
+ {
+ final int stackamount = getIntegerPositive(split[0]);
+ //TODO: Unused local variable
+ final ItemStack item = getItemStack(split[1], stackamount, ess);
+ final int amount = getInteger(split[2]);
+ final String newline = stackamount + " " + split[1] + ":" + (amount + Math.round(value));
+ if (newline.length() > 15)
+ {
+ throw new SignException("Line too long!");
+ }
+ sign.setLine(index, newline);
+ return;
}
- sign.setLine(index, newline);
- return;
}
- throw new SignException(Util.format("invalidSignLine", index + 1));
+ throw new SignException(_("invalidSignLine", index + 1));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignWarp.java b/Essentials/src/com/earth2me/essentials/signs/SignWarp.java
index 244450d8a..76e8e730b 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignWarp.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignWarp.java
@@ -1,9 +1,10 @@
package com.earth2me.essentials.signs;
-import com.earth2me.essentials.Trade;
import com.earth2me.essentials.ChargeException;
import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class SignWarp extends EssentialsSign
@@ -35,7 +36,7 @@ public class SignWarp extends EssentialsSign
throw new SignException(ex.getMessage(), ex);
}
final String group = sign.getLine(2);
- if ("Everyone".equalsIgnoreCase(group))
+ if ("Everyone".equalsIgnoreCase(group) || "Everybody".equalsIgnoreCase(group))
{
sign.setLine(2, "§2Everyone");
}
@@ -56,7 +57,7 @@ public class SignWarp extends EssentialsSign
final Trade charge = getTrade(sign, 3, ess);
try
{
- player.getTeleport().warp(warpName, charge);
+ player.getTeleport().warp(warpName, charge, TeleportCause.PLUGIN);
}
catch (Exception ex)
{
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignWeather.java b/Essentials/src/com/earth2me/essentials/signs/SignWeather.java
index 05496ac14..559fcc2e3 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignWeather.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignWeather.java
@@ -1,10 +1,10 @@
package com.earth2me.essentials.signs;
import com.earth2me.essentials.ChargeException;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
public class SignWeather extends EssentialsSign
@@ -29,7 +29,7 @@ public class SignWeather extends EssentialsSign
sign.setLine(1, "§2Storm");
return true;
}
- throw new SignException(Util.i18n("onlySunStorm"));
+ throw new SignException(_("onlySunStorm"));
}
@Override
@@ -50,7 +50,6 @@ public class SignWeather extends EssentialsSign
charge.charge(player);
return true;
}
- throw new SignException(Util.i18n("onlySunStorm"));
+ throw new SignException(_("onlySunStorm"));
}
}
-
diff --git a/Essentials/src/com/earth2me/essentials/signs/Signs.java b/Essentials/src/com/earth2me/essentials/signs/Signs.java
index 53ed1d6b0..e29d45ad4 100644
--- a/Essentials/src/com/earth2me/essentials/signs/Signs.java
+++ b/Essentials/src/com/earth2me/essentials/signs/Signs.java
@@ -6,8 +6,11 @@ public enum Signs
BALANCE(new SignBalance()),
BUY(new SignBuy()),
DISPOSAL(new SignDisposal()),
+ ENCHANT(new SignEnchant()),
FREE(new SignFree()),
+ GAMEMODE(new SignGameMode()),
HEAL(new SignHeal()),
+ KIT(new SignKit()),
MAIL(new SignMail()),
PROTECTION(new SignProtection()),
SELL(new SignSell()),
diff --git a/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java b/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java
new file mode 100644
index 000000000..d48b4a060
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java
@@ -0,0 +1,69 @@
+package com.earth2me.essentials.storage;
+
+import com.earth2me.essentials.IEssentials;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.logging.Level;
+import org.bukkit.Bukkit;
+import org.bukkit.plugin.Plugin;
+
+
+public abstract class AbstractDelayedYamlFileReader<T extends StorageObject> implements Runnable
+{
+ private final transient File file;
+ private final transient Class<T> clazz;
+ private final transient Plugin plugin;
+
+ public AbstractDelayedYamlFileReader(final IEssentials ess, final File file, final Class<T> clazz)
+ {
+ this.file = file;
+ this.clazz = clazz;
+ this.plugin = ess;
+ ess.scheduleAsyncDelayedTask(this);
+ }
+
+ public abstract void onStart();
+
+ @Override
+ public void run()
+ {
+ onStart();
+ try
+ {
+ final FileReader reader = new FileReader(file);
+ try
+ {
+ final T object = new YamlStorageReader(reader, plugin).load(clazz);
+ onSuccess(object);
+ }
+ finally
+ {
+ try
+ {
+ reader.close();
+ }
+ catch (IOException ex)
+ {
+ Bukkit.getLogger().log(Level.SEVERE, "File can't be closed: " + file.toString(), ex);
+ }
+ }
+
+ }
+ catch (FileNotFoundException ex)
+ {
+ onException();
+ Bukkit.getLogger().log(Level.INFO, "File not found: " + file.toString());
+ }
+ catch (ObjectLoadException ex)
+ {
+ onException();
+ Bukkit.getLogger().log(Level.SEVERE, "File broken: " + file.toString(), ex.getCause());
+ }
+ }
+
+ public abstract void onSuccess(T object);
+
+ public abstract void onException();
+}
diff --git a/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileWriter.java b/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileWriter.java
new file mode 100644
index 000000000..697ef7730
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileWriter.java
@@ -0,0 +1,55 @@
+package com.earth2me.essentials.storage;
+
+import com.earth2me.essentials.IEssentials;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.PrintWriter;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.bukkit.Bukkit;
+
+
+public abstract class AbstractDelayedYamlFileWriter implements Runnable
+{
+ private final transient File file;
+
+ public AbstractDelayedYamlFileWriter(IEssentials ess, File file)
+ {
+ this.file = file;
+ ess.scheduleAsyncDelayedTask(this);
+ }
+
+ public abstract StorageObject getObject();
+
+ @Override
+ public void run()
+ {
+ PrintWriter pw = null;
+ try
+ {
+ final StorageObject object = getObject();
+ final File folder = file.getParentFile();
+ if (!folder.exists())
+ {
+ folder.mkdirs();
+ }
+ pw = new PrintWriter(file);
+ new YamlStorageWriter(pw).save(object);
+ }
+ catch (FileNotFoundException ex)
+ {
+ Bukkit.getLogger().log(Level.SEVERE, file.toString(), ex);
+ }
+ finally
+ {
+ onFinish();
+ if (pw != null)
+ {
+ pw.close();
+ }
+ }
+
+ }
+
+ public abstract void onFinish();
+}
diff --git a/Essentials/src/com/earth2me/essentials/storage/AsyncStorageObjectHolder.java b/Essentials/src/com/earth2me/essentials/storage/AsyncStorageObjectHolder.java
new file mode 100644
index 000000000..31c61a63f
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/storage/AsyncStorageObjectHolder.java
@@ -0,0 +1,148 @@
+package com.earth2me.essentials.storage;
+
+import com.earth2me.essentials.IConf;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.api.IReload;
+import java.io.File;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.logging.Level;
+import org.bukkit.Bukkit;
+
+
+public abstract class AsyncStorageObjectHolder<T extends StorageObject> implements IConf, IStorageObjectHolder<T>, IReload
+{
+ private transient T data;
+ private final transient ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
+ private final transient Class<T> clazz;
+ protected final transient IEssentials ess;
+
+ public AsyncStorageObjectHolder(final IEssentials ess, final Class<T> clazz)
+ {
+ this.ess = ess;
+ this.clazz = clazz;
+ try
+ {
+ this.data = clazz.newInstance();
+ }
+ catch (Exception ex)
+ {
+ Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
+ }
+ }
+
+ public T getData()
+ {
+ return data;
+ }
+
+ public void acquireReadLock()
+ {
+ rwl.readLock().lock();
+ }
+
+ public void acquireWriteLock()
+ {
+ while (rwl.getReadHoldCount() > 0)
+ {
+ rwl.readLock().unlock();
+ }
+ rwl.writeLock().lock();
+ rwl.readLock().lock();
+ }
+
+ public void close()
+ {
+ unlock();
+ }
+
+ public void unlock()
+ {
+ if (rwl.isWriteLockedByCurrentThread())
+ {
+ rwl.writeLock().unlock();
+ new StorageObjectDataWriter();
+ }
+ while (rwl.getReadHoldCount() > 0)
+ {
+ rwl.readLock().unlock();
+ }
+ }
+
+ @Override
+ public void reloadConfig()
+ {
+ new StorageObjectDataReader();
+ }
+
+ @Override
+ public void onReload()
+ {
+ new StorageObjectDataReader();
+ }
+
+ public abstract File getStorageFile();
+
+
+ private class StorageObjectDataWriter extends AbstractDelayedYamlFileWriter
+ {
+ public StorageObjectDataWriter()
+ {
+ super(ess, getStorageFile());
+ }
+
+ @Override
+ public StorageObject getObject()
+ {
+ acquireReadLock();
+ return getData();
+ }
+
+ @Override
+ public void onFinish()
+ {
+ unlock();
+ }
+ }
+
+
+ private class StorageObjectDataReader extends AbstractDelayedYamlFileReader<T>
+ {
+ public StorageObjectDataReader()
+ {
+ super(ess, getStorageFile(), clazz);
+ }
+
+ @Override
+ public void onStart()
+ {
+ rwl.writeLock().lock();
+ }
+
+ @Override
+ public void onSuccess(final T object)
+ {
+ if (object != null)
+ {
+ data = object;
+ }
+ rwl.writeLock().unlock();
+ }
+
+ @Override
+ public void onException()
+ {
+ if (data == null)
+ {
+ try
+ {
+ data = clazz.newInstance();
+ }
+ catch (Exception ex)
+ {
+ Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
+ }
+ }
+ rwl.writeLock().unlock();
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java b/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java
new file mode 100644
index 000000000..5070be552
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java
@@ -0,0 +1,433 @@
+package com.earth2me.essentials.storage;
+
+import java.beans.IntrospectionException;
+import java.lang.reflect.Field;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.regex.Pattern;
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.Material;
+import org.bukkit.World;
+import org.bukkit.enchantments.Enchantment;
+import org.bukkit.inventory.ItemStack;
+import org.bukkit.material.MaterialData;
+import org.bukkit.plugin.Plugin;
+import org.bukkit.plugin.java.JavaPluginLoader;
+import org.yaml.snakeyaml.TypeDescription;
+import org.yaml.snakeyaml.constructor.Constructor;
+import org.yaml.snakeyaml.error.YAMLException;
+import org.yaml.snakeyaml.introspector.Property;
+import org.yaml.snakeyaml.nodes.*;
+
+
+public class BukkitConstructor extends Constructor
+{
+ private final transient Pattern NUMPATTERN = Pattern.compile("\\d+");
+ private final transient Plugin plugin;
+
+ public BukkitConstructor(final Class clazz, final Plugin plugin)
+ {
+ super(clazz);
+ this.plugin = plugin;
+ yamlClassConstructors.put(NodeId.scalar, new ConstructBukkitScalar());
+ yamlClassConstructors.put(NodeId.mapping, new ConstructBukkitMapping());
+ }
+
+
+ private class ConstructBukkitScalar extends ConstructScalar
+ {
+ @Override
+ public Object construct(final Node node)
+ {
+ if (node.getType().equals(Material.class))
+ {
+ final String val = (String)constructScalar((ScalarNode)node);
+ Material mat;
+ if (NUMPATTERN.matcher(val).matches())
+ {
+ final int typeId = Integer.parseInt(val);
+ mat = Material.getMaterial(typeId);
+ }
+ else
+ {
+ mat = Material.matchMaterial(val);
+ }
+ return mat;
+ }
+ if (node.getType().equals(MaterialData.class))
+ {
+ final String val = (String)constructScalar((ScalarNode)node);
+ if (val.isEmpty())
+ {
+ return null;
+ }
+ final String[] split = val.split("[:+',;.]", 2);
+ if (split.length == 0)
+ {
+ return null;
+ }
+ Material mat;
+ if (NUMPATTERN.matcher(split[0]).matches())
+ {
+ final int typeId = Integer.parseInt(split[0]);
+ mat = Material.getMaterial(typeId);
+ }
+ else
+ {
+ mat = Material.matchMaterial(split[0]);
+ }
+ if (mat == null)
+ {
+ return null;
+ }
+ byte data = 0;
+ if (split.length == 2 && NUMPATTERN.matcher(split[1]).matches())
+ {
+ data = Byte.parseByte(split[1]);
+ }
+ return new MaterialData(mat, data);
+ }
+ if (node.getType().equals(ItemStack.class))
+ {
+ final String val = (String)constructScalar((ScalarNode)node);
+ if (val.isEmpty())
+ {
+ return null;
+ }
+ final String[] split1 = val.split("\\W");
+ if (split1.length == 0)
+ {
+ return null;
+ }
+ final String[] split2 = split1[0].split("[:+',;.]", 2);
+ if (split2.length == 0)
+ {
+ return null;
+ }
+ Material mat;
+ if (NUMPATTERN.matcher(split2[0]).matches())
+ {
+ final int typeId = Integer.parseInt(split2[0]);
+ mat = Material.getMaterial(typeId);
+ }
+ else
+ {
+ mat = Material.matchMaterial(split2[0]);
+ }
+ if (mat == null)
+ {
+ return null;
+ }
+ short data = 0;
+ if (split2.length == 2 && NUMPATTERN.matcher(split2[1]).matches())
+ {
+ data = Short.parseShort(split2[1]);
+ }
+ int size = mat.getMaxStackSize();
+ if (split1.length > 1 && NUMPATTERN.matcher(split1[1]).matches())
+ {
+ size = Integer.parseInt(split1[1]);
+ }
+ final ItemStack stack = new ItemStack(mat, size, data);
+ if (split1.length > 2)
+ {
+ for (int i = 2; i < split1.length; i++)
+ {
+ final String[] split3 = split1[0].split("[:+',;.]", 2);
+ if (split3.length < 1)
+ {
+ continue;
+ }
+ Enchantment enchantment;
+ if (NUMPATTERN.matcher(split3[0]).matches())
+ {
+ final int enchantId = Integer.parseInt(split3[0]);
+ enchantment = Enchantment.getById(enchantId);
+ }
+ else
+ {
+ enchantment = Enchantment.getByName(split3[0].toUpperCase(Locale.ENGLISH));
+ }
+ if (enchantment == null)
+ {
+ continue;
+ }
+ int level = enchantment.getStartLevel();
+ if (split3.length == 2 && NUMPATTERN.matcher(split3[1]).matches())
+ {
+ level = Integer.parseInt(split3[1]);
+ }
+ if (level < enchantment.getStartLevel())
+ {
+ level = enchantment.getStartLevel();
+ }
+ if (level > enchantment.getMaxLevel())
+ {
+ level = enchantment.getMaxLevel();
+ }
+ stack.addUnsafeEnchantment(enchantment, level);
+ }
+ }
+ return stack;
+ }
+ if (node.getType().equals(EnchantmentLevel.class))
+ {
+ final String val = (String)constructScalar((ScalarNode)node);
+ if (val.isEmpty())
+ {
+ return null;
+ }
+ final String[] split = val.split("[:+',;.]", 2);
+ if (split.length == 0)
+ {
+ return null;
+ }
+ Enchantment enchant;
+ if (NUMPATTERN.matcher(split[0]).matches())
+ {
+ final int typeId = Integer.parseInt(split[0]);
+ enchant = Enchantment.getById(typeId);
+ }
+ else
+ {
+ enchant = Enchantment.getByName(split[0].toUpperCase(Locale.ENGLISH));
+ }
+ if (enchant == null)
+ {
+ return null;
+ }
+ int level = enchant.getStartLevel();
+ if (split.length == 2 && NUMPATTERN.matcher(split[1]).matches())
+ {
+ level = Integer.parseInt(split[1]);
+ }
+ if (level < enchant.getStartLevel())
+ {
+ level = enchant.getStartLevel();
+ }
+ if (level > enchant.getMaxLevel())
+ {
+ level = enchant.getMaxLevel();
+ }
+ return new EnchantmentLevel(enchant, level);
+ }
+ return super.construct(node);
+ }
+ }
+
+
+ private class ConstructBukkitMapping extends ConstructMapping
+ {
+ @Override
+ public Object construct(final Node node)
+ {
+ if (node.getType().equals(Location.class))
+ {
+ //TODO: NPE checks
+ final MappingNode mnode = (MappingNode)node;
+ String worldName = "";
+ double x = 0, y = 0, z = 0;
+ float yaw = 0, pitch = 0;
+ if (mnode.getValue().size() < 4)
+ {
+ return null;
+ }
+ for (NodeTuple nodeTuple : mnode.getValue())
+ {
+ final String key = (String)constructScalar((ScalarNode)nodeTuple.getKeyNode());
+ final ScalarNode snode = (ScalarNode)nodeTuple.getValueNode();
+ if (key.equalsIgnoreCase("world"))
+ {
+ worldName = (String)constructScalar(snode);
+ }
+ if (key.equalsIgnoreCase("x"))
+ {
+ x = Double.parseDouble((String)constructScalar(snode));
+ }
+ if (key.equalsIgnoreCase("y"))
+ {
+ y = Double.parseDouble((String)constructScalar(snode));
+ }
+ if (key.equalsIgnoreCase("z"))
+ {
+ z = Double.parseDouble((String)constructScalar(snode));
+ }
+ if (key.equalsIgnoreCase("yaw"))
+ {
+ yaw = Float.parseFloat((String)constructScalar(snode));
+ }
+ if (key.equalsIgnoreCase("pitch"))
+ {
+ pitch = Float.parseFloat((String)constructScalar(snode));
+ }
+ }
+ if (worldName == null || worldName.isEmpty())
+ {
+ return null;
+ }
+ final World world = Bukkit.getWorld(worldName);
+ if (world == null)
+ {
+ return null;
+ }
+ return new Location(world, x, y, z, yaw, pitch);
+ }
+ return super.construct(node);
+ }
+
+ protected Object constructJavaBean2ndStep(final MappingNode node, final Object object)
+ {
+ Map<Class<? extends Object>, TypeDescription> typeDefinitions;
+ try
+ {
+ final Field typeDefField = Constructor.class.getDeclaredField("typeDefinitions");
+ typeDefField.setAccessible(true);
+ typeDefinitions = (Map<Class<? extends Object>, TypeDescription>)typeDefField.get((Constructor)BukkitConstructor.this);
+ if (typeDefinitions == null) {
+ throw new NullPointerException();
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new YAMLException(ex);
+ }
+ flattenMapping(node);
+ final Class<? extends Object> beanType = node.getType();
+ final List<NodeTuple> nodeValue = node.getValue();
+ for (NodeTuple tuple : nodeValue)
+ {
+ ScalarNode keyNode;
+ if (tuple.getKeyNode() instanceof ScalarNode)
+ {
+ // key must be scalar
+ keyNode = (ScalarNode)tuple.getKeyNode();
+ }
+ else
+ {
+ throw new YAMLException("Keys must be scalars but found: " + tuple.getKeyNode());
+ }
+ final Node valueNode = tuple.getValueNode();
+ // keys can only be Strings
+ keyNode.setType(String.class);
+ final String key = (String)constructObject(keyNode);
+ try
+ {
+ Property property;
+ try
+ {
+ property = getProperty(beanType, key);
+ }
+ catch (YAMLException e)
+ {
+ continue;
+ }
+ valueNode.setType(property.getType());
+ final TypeDescription memberDescription = typeDefinitions.get(beanType);
+ boolean typeDetected = false;
+ if (memberDescription != null)
+ {
+ switch (valueNode.getNodeId())
+ {
+ case sequence:
+ final SequenceNode snode = (SequenceNode)valueNode;
+ final Class<? extends Object> memberType = memberDescription.getListPropertyType(key);
+ if (memberType != null)
+ {
+ snode.setListType(memberType);
+ typeDetected = true;
+ }
+ else if (property.getType().isArray())
+ {
+ snode.setListType(property.getType().getComponentType());
+ typeDetected = true;
+ }
+ break;
+ case mapping:
+ final MappingNode mnode = (MappingNode)valueNode;
+ final Class<? extends Object> keyType = memberDescription.getMapKeyType(key);
+ if (keyType != null)
+ {
+ mnode.setTypes(keyType, memberDescription.getMapValueType(key));
+ typeDetected = true;
+ }
+ break;
+ }
+ }
+ if (!typeDetected && valueNode.getNodeId() != NodeId.scalar)
+ {
+ // only if there is no explicit TypeDescription
+ final Class<?>[] arguments = property.getActualTypeArguments();
+ if (arguments != null)
+ {
+ // type safe (generic) collection may contain the
+ // proper class
+ if (valueNode.getNodeId() == NodeId.sequence)
+ {
+ final Class<?> t = arguments[0];
+ final SequenceNode snode = (SequenceNode)valueNode;
+ snode.setListType(t);
+ }
+ else if (valueNode.getTag().equals(Tag.SET))
+ {
+ final Class<?> t = arguments[0];
+ final MappingNode mnode = (MappingNode)valueNode;
+ mnode.setOnlyKeyType(t);
+ mnode.setUseClassConstructor(true);
+ }
+ else if (property.getType().isAssignableFrom(Map.class))
+ {
+ final Class<?> ketType = arguments[0];
+ final Class<?> valueType = arguments[1];
+ final MappingNode mnode = (MappingNode)valueNode;
+ mnode.setTypes(ketType, valueType);
+ mnode.setUseClassConstructor(true);
+ }
+ else
+ {
+ // the type for collection entries cannot be
+ // detected
+ }
+ }
+ }
+ final Object value = constructObject(valueNode);
+ property.set(object, value);
+ }
+ catch (Exception e)
+ {
+ throw new YAMLException("Cannot create property=" + key + " for JavaBean="
+ + object + "; " + e.getMessage(), e);
+ }
+ }
+ return object;
+ }
+ }
+
+ @Override
+ protected Class<?> getClassForNode(final Node node)
+ {
+ Class<?> clazz;
+ final String name = node.getTag().getClassName();
+ if (plugin == null)
+ {
+ clazz = super.getClassForNode(node);
+ }
+ else
+ {
+ final JavaPluginLoader jpl = (JavaPluginLoader)plugin.getPluginLoader();
+ clazz = jpl.getClassByName(name);
+ }
+
+ if (clazz == null)
+ {
+ throw new YAMLException("Class not found: " + name);
+ }
+ else
+ {
+ return clazz;
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/storage/Comment.java b/Essentials/src/com/earth2me/essentials/storage/Comment.java
index b43cec980..8cb9d4d31 100644
--- a/Essentials/src/com/earth2me/essentials/storage/Comment.java
+++ b/Essentials/src/com/earth2me/essentials/storage/Comment.java
@@ -1,10 +1,6 @@
package com.earth2me.essentials.storage;
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import java.lang.annotation.*;
@Target(ElementType.FIELD)
diff --git a/Essentials/src/com/earth2me/essentials/storage/EnchantmentLevel.java b/Essentials/src/com/earth2me/essentials/storage/EnchantmentLevel.java
new file mode 100644
index 000000000..a664929f3
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/storage/EnchantmentLevel.java
@@ -0,0 +1,80 @@
+package com.earth2me.essentials.storage;
+
+import java.util.Map.Entry;
+import org.bukkit.enchantments.Enchantment;
+
+
+public class EnchantmentLevel implements Entry<Enchantment, Integer>
+{
+ private Enchantment enchantment;
+ private int level;
+
+ public EnchantmentLevel(final Enchantment enchantment, final int level)
+ {
+ this.enchantment = enchantment;
+ this.level = level;
+ }
+
+ public Enchantment getEnchantment()
+ {
+ return enchantment;
+ }
+
+ public void setEnchantment(final Enchantment enchantment)
+ {
+ this.enchantment = enchantment;
+ }
+
+ public int getLevel()
+ {
+ return level;
+ }
+
+ public void setLevel(final int level)
+ {
+ this.level = level;
+ }
+
+ @Override
+ public Enchantment getKey()
+ {
+ return enchantment;
+ }
+
+ @Override
+ public Integer getValue()
+ {
+ return level;
+ }
+
+ @Override
+ public Integer setValue(final Integer v)
+ {
+ int t = level;
+ level = v;
+ return t;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return enchantment.hashCode() ^ level;
+ }
+
+ @Override
+ public boolean equals(final Object obj)
+ {
+ if (obj instanceof Entry)
+ {
+ final Entry entry = (Entry)obj;
+ if (entry.getKey() instanceof Enchantment
+ && entry.getValue() instanceof Integer)
+ {
+ final Enchantment enchantment = (Enchantment)entry.getKey();
+ final Integer level = (Integer)entry.getValue();
+ return this.enchantment.equals(enchantment) && this.level == level.intValue();
+ }
+ }
+ return false;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/storage/IStorageObjectHolder.java b/Essentials/src/com/earth2me/essentials/storage/IStorageObjectHolder.java
new file mode 100644
index 000000000..f48e54002
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/storage/IStorageObjectHolder.java
@@ -0,0 +1,17 @@
+package com.earth2me.essentials.storage;
+
+import com.earth2me.essentials.user.UserData;
+
+
+public interface IStorageObjectHolder<T extends StorageObject>
+{
+ T getData();
+
+ void acquireReadLock();
+
+ void acquireWriteLock();
+
+ void close();
+
+ void unlock();
+}
diff --git a/Essentials/src/com/earth2me/essentials/storage/IStorageReader.java b/Essentials/src/com/earth2me/essentials/storage/IStorageReader.java
new file mode 100644
index 000000000..d59adafe0
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/storage/IStorageReader.java
@@ -0,0 +1,7 @@
+package com.earth2me.essentials.storage;
+
+
+public interface IStorageReader
+{
+ <T extends StorageObject> T load(final Class<? extends T> clazz) throws ObjectLoadException;
+}
diff --git a/Essentials/src/com/earth2me/essentials/storage/IStorageWriter.java b/Essentials/src/com/earth2me/essentials/storage/IStorageWriter.java
new file mode 100644
index 000000000..5b8498869
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/storage/IStorageWriter.java
@@ -0,0 +1,7 @@
+package com.earth2me.essentials.storage;
+
+
+public interface IStorageWriter
+{
+ void save(final StorageObject object);
+}
diff --git a/Essentials/src/com/earth2me/essentials/storage/MapType.java b/Essentials/src/com/earth2me/essentials/storage/MapKeyType.java
index dc5636315..aa162e51c 100644
--- a/Essentials/src/com/earth2me/essentials/storage/MapType.java
+++ b/Essentials/src/com/earth2me/essentials/storage/MapKeyType.java
@@ -8,7 +8,7 @@ import java.lang.annotation.Target;
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
-public @interface MapType
+public @interface MapKeyType
{
Class value() default String.class;
} \ No newline at end of file
diff --git a/Essentials/src/com/earth2me/essentials/storage/MapValueType.java b/Essentials/src/com/earth2me/essentials/storage/MapValueType.java
new file mode 100644
index 000000000..1b5fff978
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/storage/MapValueType.java
@@ -0,0 +1,14 @@
+package com.earth2me.essentials.storage;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface MapValueType
+{
+ Class value() default String.class;
+} \ No newline at end of file
diff --git a/Essentials/src/com/earth2me/essentials/storage/ObjectLoadException.java b/Essentials/src/com/earth2me/essentials/storage/ObjectLoadException.java
new file mode 100644
index 000000000..8b804abc3
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/storage/ObjectLoadException.java
@@ -0,0 +1,10 @@
+package com.earth2me.essentials.storage;
+
+
+public class ObjectLoadException extends Exception
+{
+ public ObjectLoadException(Throwable thrwbl)
+ {
+ super(thrwbl);
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/storage/StorageObject.java b/Essentials/src/com/earth2me/essentials/storage/StorageObject.java
index a35338516..0c66fefcf 100644
--- a/Essentials/src/com/earth2me/essentials/storage/StorageObject.java
+++ b/Essentials/src/com/earth2me/essentials/storage/StorageObject.java
@@ -1,250 +1,6 @@
package com.earth2me.essentials.storage;
-import java.io.PrintWriter;
-import java.io.Reader;
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.yaml.snakeyaml.DumperOptions;
-import org.yaml.snakeyaml.TypeDescription;
-import org.yaml.snakeyaml.Yaml;
-import org.yaml.snakeyaml.composer.Composer;
-import org.yaml.snakeyaml.constructor.Constructor;
-import org.yaml.snakeyaml.introspector.PropertyUtils;
-
-public class StorageObject
+public interface StorageObject
{
- protected Class<? extends StorageObject> clazz;
-
- protected StorageObject()
- {
- }
- private static Map<Class, Constructor> constructors = new HashMap<Class, Constructor>();
-
- public static <T extends StorageObject> T load(Class<? extends T> clazz, Reader reader)
- {
- Constructor constructor;
- if (constructors.containsKey(clazz))
- {
- constructor = constructors.get(clazz);
- }
- else
- {
- constructor = prepareConstructor(clazz);
- constructors.put(clazz, constructor);
- }
-
- final Yaml yaml = new Yaml(constructor);
- T ret = (T)yaml.load(reader);
- if (ret == null)
- {
- try
- {
- ret = (T)clazz.newInstance();
- }
- catch (InstantiationException ex)
- {
- Logger.getLogger(StorageObject.class.getName()).log(Level.SEVERE, null, ex);
- }
- catch (IllegalAccessException ex)
- {
- Logger.getLogger(StorageObject.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- ret.clazz = clazz;
- return ret;
- }
-
- private static Constructor prepareConstructor(final Class<?> clazz)
- {
- final Constructor constructor = new Constructor(clazz);
- final Set<Class> classes = new HashSet<Class>();
-
- prepareConstructor(constructor, classes, clazz);
- return constructor;
- }
-
- private static void prepareConstructor(final Constructor constructor, final Set<Class> classes, final Class clazz)
- {
- classes.add(clazz);
- final TypeDescription description = new TypeDescription(clazz);
- for (Field field : clazz.getDeclaredFields())
- {
- final ListType listType = field.getAnnotation(ListType.class);
- if (listType != null)
- {
- description.putListPropertyType(field.getName(), listType.value());
- if (StorageObject.class.isAssignableFrom(listType.value())
- && !classes.contains(listType.value()))
- {
- prepareConstructor(constructor, classes, listType.value());
- }
- }
- final MapType mapType = field.getAnnotation(MapType.class);
- if (mapType != null)
- {
- description.putMapPropertyType(field.getName(), String.class, mapType.value());
- if (StorageObject.class.isAssignableFrom(mapType.value())
- && !classes.contains(mapType.value()))
- {
- prepareConstructor(constructor, classes, mapType.value());
- }
- }
- if (StorageObject.class.isAssignableFrom(field.getType())
- && !classes.contains(field.getType()))
- {
- prepareConstructor(constructor, classes, field.getType());
- }
- }
- constructor.addTypeDescription(description);
- }
- private transient Yaml yaml;
-
- public void save(final PrintWriter writer)
- {
- final DumperOptions ops = new DumperOptions();
- yaml = new Yaml(ops);
- try
- {
- writeToFile(this, writer, 0, clazz);
- }
- catch (IllegalArgumentException ex)
- {
- Logger.getLogger(StorageObject.class.getName()).log(Level.SEVERE, null, ex);
- }
- catch (IllegalAccessException ex)
- {
- Logger.getLogger(StorageObject.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
-
- private void writeToFile(final Object object, final PrintWriter writer, final int depth, final Class clazz) throws IllegalArgumentException, IllegalAccessException
- {
- for (Field field : clazz.getDeclaredFields())
- {
- final int modifier = field.getModifiers();
- if (Modifier.isPrivate(modifier) && !Modifier.isTransient(modifier) && !Modifier.isStatic(modifier))
- {
- field.setAccessible(true);
- final boolean commentPresent = field.isAnnotationPresent(Comment.class);
- final String name = field.getName();
- if (commentPresent)
- {
- final Comment comments = field.getAnnotation(Comment.class);
- for (String comment : comments.value())
- {
- final String trimmed = comment.trim();
- if (trimmed.isEmpty())
- {
- continue;
- }
- writeIndention(writer, depth);
- writer.print("# ");
- writer.print(trimmed);
- writer.println();
- }
- }
-
- final Object data = field.get(object);
- if (data == null && !commentPresent)
- {
- continue;
- }
- writeIndention(writer, depth);
- if (data == null && commentPresent)
- {
- writer.print('#');
- }
- writer.print(name);
- writer.print(": ");
- if (data == null && commentPresent)
- {
- writer.println();
- writer.println();
- continue;
- }
- if (data instanceof StorageObject)
- {
- writer.println();
- writeToFile(data, writer, depth + 1, data.getClass());
- }
- else if (data instanceof Map)
- {
- writer.println();
- for (Entry<String, Object> entry : ((Map<String, Object>)data).entrySet())
- {
- final Object value = entry.getValue();
- if (value != null)
- {
- writeIndention(writer, depth + 1);
- writer.print(entry.getKey());
- writer.print(": ");
- if (value instanceof StorageObject)
- {
- writer.println();
- writeToFile(value, writer, depth + 2, value.getClass());
- }
- else if (value instanceof String || value instanceof Boolean || value instanceof Number)
- {
- yaml.dumpAll(Collections.singletonList(value).iterator(), writer);
- writer.println();
- }
- else
- {
- throw new UnsupportedOperationException();
- }
-
- }
- }
- }
- else if (data instanceof Collection)
- {
- writer.println();
- for (Object entry : (Collection<Object>)data)
- {
- if (entry != null)
- {
- writeIndention(writer, depth + 1);
- writer.print("- ");
- if (entry instanceof String || entry instanceof Boolean || entry instanceof Number)
- {
- yaml.dumpAll(Collections.singletonList(entry).iterator(), writer);
- }
- else
- {
- throw new UnsupportedOperationException();
- }
- }
- }
- writer.println();
- }
- else if (data instanceof String || data instanceof Boolean || data instanceof Number)
- {
- yaml.dumpAll(Collections.singletonList(data).iterator(), writer);
- writer.println();
- }
- else
- {
- throw new UnsupportedOperationException();
- }
- }
- }
- }
-
- private void writeIndention(final PrintWriter writer, final int depth)
- {
- for (int i = 0; i < depth; i++)
- {
- writer.print(" ");
- }
- }
}
diff --git a/Essentials/src/com/earth2me/essentials/storage/YamlStorageReader.java b/Essentials/src/com/earth2me/essentials/storage/YamlStorageReader.java
new file mode 100644
index 000000000..5d1ff668a
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/storage/YamlStorageReader.java
@@ -0,0 +1,119 @@
+package com.earth2me.essentials.storage;
+
+import java.io.Reader;
+import java.lang.reflect.Field;
+import java.util.*;
+import java.util.concurrent.locks.ReentrantLock;
+import org.bukkit.plugin.Plugin;
+import org.yaml.snakeyaml.TypeDescription;
+import org.yaml.snakeyaml.Yaml;
+import org.yaml.snakeyaml.constructor.Constructor;
+
+
+public class YamlStorageReader implements IStorageReader
+{
+ private transient static final Map<Class, Yaml> PREPARED_YAMLS = Collections.synchronizedMap(new HashMap<Class, Yaml>());
+ private transient static final Map<Class, ReentrantLock> LOCKS = new HashMap<Class, ReentrantLock>();
+ private transient final Reader reader;
+ private transient final Plugin plugin;
+
+ public YamlStorageReader(final Reader reader, final Plugin plugin)
+ {
+ this.reader = reader;
+ this.plugin = plugin;
+ }
+
+ @Override
+ public <T extends StorageObject> T load(final Class<? extends T> clazz) throws ObjectLoadException
+ {
+ Yaml yaml = PREPARED_YAMLS.get(clazz);
+ if (yaml == null)
+ {
+ yaml = new Yaml(prepareConstructor(clazz));
+ PREPARED_YAMLS.put(clazz, yaml);
+ }
+ ReentrantLock lock;
+ synchronized (LOCKS)
+ {
+ lock = LOCKS.get(clazz);
+ if (lock == null)
+ {
+ lock = new ReentrantLock();
+ }
+ }
+ lock.lock();
+ try
+ {
+ T object = (T)yaml.load(reader);
+ if (object == null) {
+ object = clazz.newInstance();
+ }
+ return object;
+ }
+ catch (Exception ex)
+ {
+ throw new ObjectLoadException(ex);
+ }
+ finally
+ {
+ lock.unlock();
+ }
+ }
+
+ private Constructor prepareConstructor(final Class<?> clazz)
+ {
+ final Constructor constructor = new BukkitConstructor(clazz, plugin);
+ final Set<Class> classes = new HashSet<Class>();
+
+ prepareConstructor(constructor, classes, clazz);
+ return constructor;
+ }
+
+ private void prepareConstructor(final Constructor constructor, final Set<Class> classes, final Class clazz)
+ {
+ classes.add(clazz);
+ final TypeDescription description = new TypeDescription(clazz);
+ for (Field field : clazz.getDeclaredFields())
+ {
+ prepareList(field, description, classes, constructor);
+ prepareMap(field, description, classes, constructor);
+ if (StorageObject.class.isAssignableFrom(field.getType())
+ && !classes.contains(field.getType()))
+ {
+ prepareConstructor(constructor, classes, field.getType());
+ }
+ }
+ constructor.addTypeDescription(description);
+ }
+
+ private void prepareList(final Field field, final TypeDescription description, final Set<Class> classes, final Constructor constructor)
+ {
+ final ListType listType = field.getAnnotation(ListType.class);
+ if (listType != null)
+ {
+ description.putListPropertyType(field.getName(), listType.value());
+ if (StorageObject.class.isAssignableFrom(listType.value())
+ && !classes.contains(listType.value()))
+ {
+ prepareConstructor(constructor, classes, listType.value());
+ }
+ }
+ }
+
+ private void prepareMap(final Field field, final TypeDescription description, final Set<Class> classes, final Constructor constructor)
+ {
+ final MapValueType mapType = field.getAnnotation(MapValueType.class);
+ if (mapType != null)
+ {
+ final MapKeyType mapKeyType = field.getAnnotation(MapKeyType.class);
+ description.putMapPropertyType(field.getName(),
+ mapKeyType == null ? String.class : mapKeyType.value(),
+ mapType.value());
+ if (StorageObject.class.isAssignableFrom(mapType.value())
+ && !classes.contains(mapType.value()))
+ {
+ prepareConstructor(constructor, classes, mapType.value());
+ }
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/storage/YamlStorageWriter.java b/Essentials/src/com/earth2me/essentials/storage/YamlStorageWriter.java
new file mode 100644
index 000000000..fd1f0f863
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/storage/YamlStorageWriter.java
@@ -0,0 +1,340 @@
+package com.earth2me.essentials.storage;
+
+import java.io.PrintWriter;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.regex.Pattern;
+import org.bukkit.Location;
+import org.bukkit.Material;
+import org.bukkit.enchantments.Enchantment;
+import org.bukkit.inventory.ItemStack;
+import org.bukkit.material.MaterialData;
+import org.yaml.snakeyaml.Yaml;
+
+
+public class YamlStorageWriter implements IStorageWriter
+{
+ private transient static final Pattern NON_WORD_PATTERN = Pattern.compile("\\W");
+ private transient final PrintWriter writer;
+ private transient static final Yaml YAML = new Yaml();
+
+ public YamlStorageWriter(final PrintWriter writer)
+ {
+ this.writer = writer;
+ }
+
+ @Override
+ public void save(final StorageObject object)
+ {
+ try
+ {
+ writeToFile(object, 0, object.getClass());
+ }
+ catch (IllegalArgumentException ex)
+ {
+ Logger.getLogger(YamlStorageWriter.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ catch (IllegalAccessException ex)
+ {
+ Logger.getLogger(YamlStorageWriter.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+
+ private void writeToFile(final Object object, final int depth, final Class clazz) throws IllegalAccessException
+ {
+ for (Field field : clazz.getDeclaredFields())
+ {
+ final int modifier = field.getModifiers();
+ if (Modifier.isPrivate(modifier) && !Modifier.isTransient(modifier) && !Modifier.isStatic(modifier))
+ {
+ field.setAccessible(true);
+
+ final Object data = field.get(object);
+ if (writeKey(field, depth, data))
+ {
+ continue;
+ }
+ if (data instanceof StorageObject)
+ {
+ writer.println();
+ writeToFile(data, depth + 1, data.getClass());
+ }
+ else if (data instanceof Map)
+ {
+ writeMap((Map<Object, Object>)data, depth + 1);
+ }
+ else if (data instanceof Collection)
+ {
+ writeCollection((Collection<Object>)data, depth + 1);
+ }
+ else if (data instanceof Location)
+ {
+ writeLocation((Location)data, depth + 1);
+ }
+ else
+ {
+ writeScalar(data);
+ writer.println();
+ }
+ }
+ }
+ }
+
+ private boolean writeKey(final Field field, final int depth, final Object data)
+ {
+ final boolean commentPresent = writeComment(field, depth);
+ if (data == null && !commentPresent)
+ {
+ return true;
+ }
+ writeIndention(depth);
+ if (data == null && commentPresent)
+ {
+ writer.print('#');
+ }
+ final String name = field.getName();
+ writer.print(name);
+ writer.print(": ");
+ if (data == null && commentPresent)
+ {
+ writer.println();
+ writer.println();
+ return true;
+ }
+ return false;
+ }
+
+ private boolean writeComment(final Field field, final int depth)
+ {
+ final boolean commentPresent = field.isAnnotationPresent(Comment.class);
+ if (commentPresent)
+ {
+ final Comment comments = field.getAnnotation(Comment.class);
+ for (String comment : comments.value())
+ {
+ final String trimmed = comment.trim();
+ if (trimmed.isEmpty())
+ {
+ continue;
+ }
+ writeIndention(depth);
+ writer.print("# ");
+ writer.print(trimmed);
+ writer.println();
+ }
+ }
+ return commentPresent;
+ }
+
+ private void writeCollection(final Collection<Object> data, final int depth) throws IllegalAccessException
+ {
+ writer.println();
+ if (data.isEmpty())
+ {
+ writer.println();
+ }
+ for (Object entry : data)
+ {
+ if (entry != null)
+ {
+ writeIndention(depth);
+ writer.print("- ");
+ if (entry instanceof StorageObject)
+ {
+ writer.println();
+ writeToFile(entry, depth + 1, entry.getClass());
+ }
+ else if (entry instanceof Location)
+ {
+ writeLocation((Location)entry, depth + 1);
+ }
+ else
+ {
+ writeScalar(entry);
+ }
+ }
+ }
+ writer.println();
+ }
+
+ private void writeMap(final Map<Object, Object> data, final int depth) throws IllegalArgumentException, IllegalAccessException
+ {
+ writer.println();
+ if (data.isEmpty())
+ {
+ writer.println();
+ }
+ for (Entry<Object, Object> entry : data.entrySet())
+ {
+ final Object value = entry.getValue();
+ if (value != null)
+ {
+ writeIndention(depth);
+ writeKey(entry.getKey());
+ writer.print(": ");
+ if (value instanceof StorageObject)
+ {
+ writer.println();
+ writeToFile(value, depth + 1, value.getClass());
+ }
+ else if (value instanceof Collection)
+ {
+ writeCollection((Collection<Object>)value, depth + 1);
+ }
+ else if (value instanceof Location)
+ {
+ writeLocation((Location)value, depth + 1);
+ }
+ else
+ {
+ writeScalar(value);
+ writer.println();
+ }
+ }
+ }
+ }
+
+ private void writeIndention(final int depth)
+ {
+ for (int i = 0; i < depth; i++)
+ {
+ writer.print(" ");
+ }
+ }
+
+ private void writeScalar(final Object data)
+ {
+ if (data instanceof String || data instanceof Boolean || data instanceof Number)
+ {
+ synchronized (YAML)
+ {
+ YAML.dumpAll(Collections.singletonList(data).iterator(), writer);
+ }
+ }
+ else if (data instanceof Material)
+ {
+ writeMaterial(data);
+ writer.println();
+ }
+ else if (data instanceof MaterialData)
+ {
+ writeMaterialData(data);
+ writer.println();
+ }
+ else if (data instanceof ItemStack)
+ {
+ writeItemStack(data);
+ writer.println();
+ }
+ else if (data instanceof EnchantmentLevel)
+ {
+ writeEnchantmentLevel(data);
+ writer.println();
+ }
+ else
+ {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ private void writeKey(final Object data)
+ {
+ if (data instanceof String || data instanceof Boolean || data instanceof Number)
+ {
+ String output = data.toString();
+ if (NON_WORD_PATTERN.matcher(output).find())
+ {
+ writer.print('"');
+ writer.print(output.replace("\"", "\\\""));
+ writer.print('"');
+ }
+ else
+ {
+ writer.print(output);
+ }
+ }
+ else if (data instanceof Material)
+ {
+ writeMaterial(data);
+ }
+ else if (data instanceof MaterialData)
+ {
+ writeMaterialData(data);
+ }
+ else if (data instanceof EnchantmentLevel)
+ {
+ writeEnchantmentLevel(data);
+ }
+ else
+ {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ private void writeMaterial(final Object data)
+ {
+ writer.print(data.toString().toLowerCase(Locale.ENGLISH));
+ }
+
+ private void writeMaterialData(final Object data)
+ {
+ final MaterialData matData = (MaterialData)data;
+ writeMaterial(matData.getItemType());
+ if (matData.getData() > 0)
+ {
+ writer.print(':');
+ writer.print(matData.getData());
+ }
+ }
+
+ private void writeItemStack(final Object data)
+ {
+ final ItemStack itemStack = (ItemStack)data;
+ writeMaterialData(itemStack.getData());
+ writer.print(' ');
+ writer.print(itemStack.getAmount());
+ for (Entry<Enchantment, Integer> entry : itemStack.getEnchantments().entrySet())
+ {
+ writer.print(' ');
+ writeEnchantmentLevel(entry);
+ }
+ }
+
+ private void writeEnchantmentLevel(Object data)
+ {
+ final Entry<Enchantment, Integer> enchLevel = (Entry<Enchantment, Integer>)data;
+ writer.print(enchLevel.getKey().getName().toLowerCase(Locale.ENGLISH));
+ writer.print(':');
+ writer.print(enchLevel.getValue());
+ }
+
+ private void writeLocation(final Location entry, final int depth)
+ {
+ writer.println();
+ writeIndention(depth);
+ writer.print("world: ");
+ writeScalar(entry.getWorld().getName());
+ writeIndention(depth);
+ writer.print("x: ");
+ writeScalar(entry.getX());
+ writeIndention(depth);
+ writer.print("y: ");
+ writeScalar(entry.getY());
+ writeIndention(depth);
+ writer.print("z: ");
+ writeScalar(entry.getZ());
+ writeIndention(depth);
+ writer.print("yaw: ");
+ writeScalar(entry.getYaw());
+ writeIndention(depth);
+ writer.print("pitch: ");
+ writeScalar(entry.getPitch());
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/textreader/ArrayListInput.java b/Essentials/src/com/earth2me/essentials/textreader/ArrayListInput.java
new file mode 100644
index 000000000..0da83f3b4
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/textreader/ArrayListInput.java
@@ -0,0 +1,31 @@
+package com.earth2me.essentials.textreader;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+
+public class ArrayListInput implements IText
+{
+ private final transient List<String> lines = new ArrayList<String>();
+
+ @Override
+ public List<String> getLines()
+ {
+ return lines;
+ }
+
+ @Override
+ public List<String> getChapters()
+ {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public Map<String, Integer> getBookmarks()
+ {
+ return Collections.emptyMap();
+ }
+
+}
diff --git a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java
new file mode 100644
index 000000000..85c00c1b6
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java
@@ -0,0 +1,146 @@
+package com.earth2me.essentials.textreader;
+
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import java.io.IOException;
+import java.util.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.bukkit.plugin.Plugin;
+import org.bukkit.plugin.PluginDescriptionFile;
+
+
+public class HelpInput implements IText
+{
+ private static final String DESCRIPTION = "description";
+ private static final String PERMISSION = "permission";
+ private static final String PERMISSIONS = "permissions";
+ private final transient List<String> lines = new ArrayList<String>();
+ private final transient List<String> chapters = new ArrayList<String>();
+ private final transient Map<String, Integer> bookmarks = new HashMap<String, Integer>();
+ private final static Logger logger = Logger.getLogger("Minecraft");
+
+ public HelpInput(final User user, final String match, final IEssentials ess) throws IOException
+ {
+ boolean reported = false;
+ String pluginName = "";
+ for (Plugin p : ess.getServer().getPluginManager().getPlugins())
+ {
+ try
+ {
+ final PluginDescriptionFile desc = p.getDescription();
+ final HashMap<String, HashMap<String, Object>> cmds = (HashMap<String, HashMap<String, Object>>)desc.getCommands();
+ pluginName = p.getDescription().getName().toLowerCase(Locale.ENGLISH);
+ for (Map.Entry<String, HashMap<String, Object>> k : cmds.entrySet())
+ {
+ try
+ {
+ if ((!match.equalsIgnoreCase(""))
+ && (!k.getKey().toLowerCase(Locale.ENGLISH).contains(match))
+ && (!(k.getValue().get(DESCRIPTION) instanceof String
+ && ((String)k.getValue().get(DESCRIPTION)).toLowerCase(Locale.ENGLISH).contains(match)))
+ && (!pluginName.contains(match)))
+ {
+ continue;
+ }
+
+ if (pluginName.contains("essentials"))
+ {
+ final String node = "essentials." + k.getKey();
+ if (!ess.getSettings().isCommandDisabled(k.getKey()) && user.isAuthorized(node))
+ {
+ lines.add("§c" + k.getKey() + "§7: " + k.getValue().get(DESCRIPTION));
+ }
+ }
+ else
+ {
+ if (ess.getSettings().showNonEssCommandsInHelp())
+ {
+ final HashMap<String, Object> value = k.getValue();
+ Object permissions = null;
+ if (value.containsKey(PERMISSION))
+ {
+ permissions = value.get(PERMISSION);
+ }
+ else if (value.containsKey(PERMISSIONS))
+ {
+ permissions = value.get(PERMISSIONS);
+ }
+ if (user.isAuthorized("essentials.help." + pluginName))
+ {
+ lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION));
+ }
+ else if (permissions instanceof List && !((List<Object>)permissions).isEmpty())
+ {
+ boolean enabled = false;
+ for (Object o : (List<Object>)permissions)
+ {
+ if (o instanceof String && user.isAuthorized(o.toString()))
+ {
+ enabled = true;
+ break;
+ }
+ }
+ if (enabled)
+ {
+ lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION));
+ }
+ }
+ else if (permissions instanceof String && !"".equals(permissions))
+ {
+ if (user.isAuthorized(permissions.toString()))
+ {
+ lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION));
+ }
+ }
+ else
+ {
+ if (!ess.getSettings().hidePermissionlessHelp())
+ {
+ lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION));
+ }
+ }
+ }
+ }
+ }
+ catch (NullPointerException ex)
+ {
+ continue;
+ }
+ }
+ }
+ catch (NullPointerException ex)
+ {
+ continue;
+ }
+ catch (Exception ex)
+ {
+ if (!reported)
+ {
+ logger.log(Level.WARNING, _("commandHelpFailedForPlugin", pluginName), ex);
+ }
+ reported = true;
+ continue;
+ }
+ }
+ }
+
+ @Override
+ public List<String> getLines()
+ {
+ return lines;
+ }
+
+ @Override
+ public List<String> getChapters()
+ {
+ return chapters;
+ }
+
+ @Override
+ public Map<String, Integer> getBookmarks()
+ {
+ return bookmarks;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/textreader/IText.java b/Essentials/src/com/earth2me/essentials/textreader/IText.java
new file mode 100644
index 000000000..851119701
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/textreader/IText.java
@@ -0,0 +1,14 @@
+package com.earth2me.essentials.textreader;
+
+import java.util.List;
+import java.util.Map;
+
+
+public interface IText
+{
+ List<String> getLines();
+
+ List<String> getChapters();
+
+ Map<String, Integer> getBookmarks();
+}
diff --git a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java
new file mode 100644
index 000000000..a7aab67ba
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java
@@ -0,0 +1,147 @@
+package com.earth2me.essentials.textreader;
+
+import com.earth2me.essentials.DescParseTickFormat;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import org.bukkit.World;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+import org.bukkit.plugin.Plugin;
+
+
+public class KeywordReplacer implements IText
+{
+ private final transient IText input;
+ private final transient List<String> replaced;
+ private final transient IEssentials ess;
+
+ public KeywordReplacer(final IText input, final CommandSender sender, final IEssentials ess)
+ {
+ this.input = input;
+ this.replaced = new ArrayList<String>(this.input.getLines().size());
+ this.ess = ess;
+ replaceKeywords(sender);
+ }
+
+ private void replaceKeywords(final CommandSender sender)
+ {
+ String displayName, ipAddress, balance, mails, world;
+ String worlds, online, unique, playerlist, date, time;
+ String worldTime12, worldTime24, worldDate, plugins;
+ String version;
+ if (sender instanceof Player)
+ {
+ final User user = ess.getUser(sender);
+ displayName = user.getDisplayName();
+ ipAddress = user.getAddress().getAddress().toString();
+ balance = Double.toString(user.getMoney());
+ mails = Integer.toString(user.getMails().size());
+ world = user.getLocation().getWorld().getName();
+ worldTime12 = DescParseTickFormat.format12(user.getWorld().getTime());
+ worldTime24 = DescParseTickFormat.format24(user.getWorld().getTime());
+ worldDate = DateFormat.getDateInstance(DateFormat.MEDIUM, ess.getI18n().getCurrentLocale()).format(DescParseTickFormat.ticksToDate(user.getWorld().getFullTime()));
+ }
+ else
+ {
+ displayName = ipAddress = balance = mails = world = worldTime12 = worldTime24 = worldDate = "";
+ }
+
+ int playerHidden = 0;
+ for (Player p : ess.getServer().getOnlinePlayers())
+ {
+ if (ess.getUser(p).isHidden())
+ {
+ playerHidden++;
+ }
+ }
+ online = Integer.toString(ess.getServer().getOnlinePlayers().length - playerHidden);
+ unique = Integer.toString(ess.getUserMap().getUniqueUsers());
+
+ final StringBuilder worldsBuilder = new StringBuilder();
+ for (World w : ess.getServer().getWorlds())
+ {
+ if (worldsBuilder.length() > 0)
+ {
+ worldsBuilder.append(", ");
+ }
+ worldsBuilder.append(w.getName());
+ }
+ worlds = worldsBuilder.toString();
+
+ final StringBuilder playerlistBuilder = new StringBuilder();
+ for (Player p : ess.getServer().getOnlinePlayers())
+ {
+ if (ess.getUser(p).isHidden())
+ {
+ continue;
+ }
+ if (playerlistBuilder.length() > 0)
+ {
+ playerlistBuilder.append(", ");
+ }
+ playerlistBuilder.append(p.getDisplayName());
+ }
+ playerlist = playerlistBuilder.toString();
+
+ final StringBuilder pluginlistBuilder = new StringBuilder();
+ for (Plugin p : ess.getServer().getPluginManager().getPlugins())
+ {
+ if (pluginlistBuilder.length() > 0)
+ {
+ pluginlistBuilder.append(", ");
+ }
+ pluginlistBuilder.append(p.getDescription().getName());
+ }
+ plugins = pluginlistBuilder.toString();
+
+ date = DateFormat.getDateInstance(DateFormat.MEDIUM, ess.getI18n().getCurrentLocale()).format(new Date());
+ time = DateFormat.getTimeInstance(DateFormat.MEDIUM, ess.getI18n().getCurrentLocale()).format(new Date());
+
+ version = ess.getServer().getVersion();
+
+ for (int i = 0; i < input.getLines().size(); i++)
+ {
+ String line = input.getLines().get(i);
+ line = line.replace("{PLAYER}", displayName);
+ line = line.replace("{IP}", ipAddress);
+ line = line.replace("{BALANCE}", balance);
+ line = line.replace("{MAILS}", mails);
+ line = line.replace("{WORLD}", world);
+ line = line.replace("{ONLINE}", online);
+ line = line.replace("{UNIQUE}", unique);
+ line = line.replace("{WORLDS}", worlds);
+ line = line.replace("{PLAYERLIST}", playerlist);
+ line = line.replace("{TIME}", time);
+ line = line.replace("{DATE}", date);
+ line = line.replace("{WORLDTIME12}", worldTime12);
+ line = line.replace("{WORLDTIME24}", worldTime24);
+ line = line.replace("{WORLDDATE}", worldDate);
+ line = line.replace("{PLUGINS}", plugins);
+ line = line.replace("{VERSION}", version);
+ replaced.add(line);
+ }
+ }
+
+ @Override
+ public List<String> getLines()
+ {
+ return replaced;
+ }
+
+ @Override
+ public List<String> getChapters()
+ {
+ return input.getChapters();
+ }
+
+ @Override
+ public Map<String, Integer> getBookmarks()
+ {
+ return input.getBookmarks();
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/textreader/TextInput.java b/Essentials/src/com/earth2me/essentials/textreader/TextInput.java
new file mode 100644
index 000000000..316a0b576
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/textreader/TextInput.java
@@ -0,0 +1,137 @@
+package com.earth2me.essentials.textreader;
+
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import java.io.*;
+import java.lang.ref.SoftReference;
+import java.util.*;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+
+public class TextInput implements IText
+{
+ private final transient List<String> lines;
+ private final transient List<String> chapters;
+ private final transient Map<String, Integer> bookmarks;
+ private final transient long lastChange;
+ private final static HashMap<String, SoftReference<TextInput>> cache = new HashMap<String, SoftReference<TextInput>>();
+
+ public TextInput(final CommandSender sender, final String filename, final boolean createFile, final IEssentials ess) throws IOException
+ {
+
+ File file = null;
+ if (sender instanceof Player)
+ {
+ final User user = ess.getUser(sender);
+ file = new File(ess.getDataFolder(), filename + "_" + Util.sanitizeFileName(user.getName()) + ".txt");
+ if (!file.exists())
+ {
+ file = new File(ess.getDataFolder(), filename + "_" + Util.sanitizeFileName(user.getGroup()) + ".txt");
+ }
+ }
+ if (file == null || !file.exists())
+ {
+ file = new File(ess.getDataFolder(), filename + ".txt");
+ }
+ if (file.exists())
+ {
+ lastChange = file.lastModified();
+ boolean readFromfile;
+ synchronized (cache)
+ {
+ final SoftReference<TextInput> inputRef = cache.get(file.getName());
+ TextInput input;
+ if (inputRef == null || (input = inputRef.get()) == null || input.lastChange < lastChange)
+ {
+ lines = new ArrayList<String>();
+ chapters = new ArrayList<String>();
+ bookmarks = new HashMap<String, Integer>();
+ cache.put(file.getName(), new SoftReference<TextInput>(this));
+ readFromfile = true;
+ }
+ else
+ {
+ lines = Collections.unmodifiableList(input.getLines());
+ chapters = Collections.unmodifiableList(input.getChapters());
+ bookmarks = Collections.unmodifiableMap(input.getBookmarks());
+ readFromfile = false;
+ }
+ }
+ if (readFromfile)
+ {
+ final BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
+ try
+ {
+ int lineNumber = 0;
+ while (bufferedReader.ready())
+ {
+ final String line = bufferedReader.readLine();
+ if (line == null)
+ {
+ break;
+ }
+ if (line.length() > 0 && line.charAt(0) == '#')
+ {
+ bookmarks.put(line.substring(1).toLowerCase(Locale.ENGLISH).replaceAll("&[0-9a-f]", ""), lineNumber);
+ chapters.add(line.substring(1).replace('&', '§').replace("§§", "&"));
+ }
+ lines.add(line.replace('&', '§').replace("§§", "&"));
+ lineNumber++;
+ }
+ }
+ finally
+ {
+ bufferedReader.close();
+ }
+ }
+ }
+ else
+ {
+ lastChange = 0;
+ lines = Collections.emptyList();
+ chapters = Collections.emptyList();
+ bookmarks = Collections.emptyMap();
+ if (createFile)
+ {
+ final InputStream input = ess.getResource(filename + ".txt");
+ final OutputStream output = new FileOutputStream(file);
+ try
+ {
+ final byte[] buffer = new byte[1024];
+ int length = input.read(buffer);
+ while (length > 0)
+ {
+ output.write(buffer, 0, length);
+ length = input.read(buffer);
+ }
+ }
+ finally
+ {
+ output.close();
+ input.close();
+ }
+ throw new FileNotFoundException("File " + filename + ".txt does not exist. Creating one for you.");
+ }
+ }
+ }
+
+ @Override
+ public List<String> getLines()
+ {
+ return lines;
+ }
+
+ @Override
+ public List<String> getChapters()
+ {
+ return chapters;
+ }
+
+ @Override
+ public Map<String, Integer> getBookmarks()
+ {
+ return bookmarks;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/textreader/TextPager.java b/Essentials/src/com/earth2me/essentials/textreader/TextPager.java
new file mode 100644
index 000000000..c23df734d
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/textreader/TextPager.java
@@ -0,0 +1,182 @@
+package com.earth2me.essentials.textreader;
+
+import static com.earth2me.essentials.I18n._;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import org.bukkit.command.CommandSender;
+
+
+public class TextPager
+{
+ private final transient IText text;
+ private final transient boolean onePage;
+
+ public TextPager(final IText text)
+ {
+ this(text, false);
+ }
+
+ public TextPager(final IText text, final boolean onePage)
+ {
+ this.text = text;
+ this.onePage = onePage;
+ }
+
+ public void showPage(final String pageStr, final String chapterPageStr, final String commandName, final CommandSender sender)
+ {
+ List<String> lines = text.getLines();
+ List<String> chapters = text.getChapters();
+ Map<String, Integer> bookmarks = text.getBookmarks();
+
+ if (bookmarks.isEmpty())
+ {
+ int page = 1;
+ try
+ {
+ page = Integer.parseInt(pageStr);
+ }
+ catch (Exception ex)
+ {
+ page = 1;
+ }
+ if (page < 1)
+ {
+ page = 1;
+ }
+
+ final int start = onePage ? 0 : (page - 1) * 9;
+ final int pages = lines.size() / 9 + (lines.size() % 9 > 0 ? 1 : 0);
+ if (!onePage)
+ {
+ sender.sendMessage(_("infoPages", page, pages));
+ }
+ for (int i = start; i < lines.size() && i < start + (onePage ? 20 : 9); i++)
+ {
+ sender.sendMessage(lines.get(i));
+ }
+ if (!onePage && page < pages)
+ {
+ sender.sendMessage(_("readNextPage", commandName, page + 1));
+ }
+ return;
+ }
+
+ if (pageStr == null || pageStr.isEmpty() || pageStr.matches("[0-9]+"))
+ {
+ if (lines.get(0).startsWith("#"))
+ {
+ if (onePage)
+ {
+ return;
+ }
+ sender.sendMessage(_("infoChapter"));
+ final StringBuilder sb = new StringBuilder();
+ boolean first = true;
+ for (String string : chapters)
+ {
+ if (!first)
+ {
+ sb.append(", ");
+ }
+ first = false;
+ sb.append(string);
+ }
+ sender.sendMessage(sb.toString());
+ return;
+ }
+ else
+ {
+ int page = 1;
+ try
+ {
+ page = Integer.parseInt(pageStr);
+ }
+ catch (Exception ex)
+ {
+ page = 1;
+ }
+ if (page < 1)
+ {
+ page = 1;
+ }
+
+ int start = onePage ? 0 : (page - 1) * 9;
+ int end;
+ for (end = 0; end < lines.size(); end++)
+ {
+ String line = lines.get(end);
+ if (line.startsWith("#"))
+ {
+ break;
+ }
+ }
+
+ int pages = end / 9 + (end % 9 > 0 ? 1 : 0);
+ if (!onePage)
+ {
+
+ sender.sendMessage(_("infoPages", page, pages));
+ }
+ for (int i = start; i < end && i < start + (onePage ? 20 : 9); i++)
+ {
+ sender.sendMessage(lines.get(i));
+ }
+ if (!onePage && page < pages)
+ {
+ sender.sendMessage(_("readNextPage", commandName, page + 1));
+ }
+ return;
+ }
+ }
+
+ int chapterpage = 0;
+ if (chapterPageStr != null)
+ {
+ try
+ {
+ chapterpage = Integer.parseInt(chapterPageStr) - 1;
+ }
+ catch (Exception ex)
+ {
+ chapterpage = 0;
+ }
+ if (chapterpage < 0)
+ {
+ chapterpage = 0;
+ }
+ }
+
+ if (!bookmarks.containsKey(pageStr.toLowerCase(Locale.ENGLISH)))
+ {
+ sender.sendMessage(_("infoUnknownChapter"));
+ return;
+ }
+ final int chapterstart = bookmarks.get(pageStr.toLowerCase(Locale.ENGLISH)) + 1;
+ int chapterend;
+ for (chapterend = chapterstart; chapterend < lines.size(); chapterend++)
+ {
+ final String line = lines.get(chapterend);
+ if (line.length() > 0 && line.charAt(0) == '#')
+ {
+ break;
+ }
+ }
+ final int start = chapterstart + (onePage ? 0 : chapterpage * 9);
+
+ final int page = chapterpage + 1;
+ final int pages = (chapterend - chapterstart) / 9 + ((chapterend - chapterstart) % 9 > 0 ? 1 : 0);
+ if (!onePage)
+ {
+ sender.sendMessage(_("infoChapterPages", pageStr, page, pages));
+ }
+ for (int i = start; i < chapterend && i < start + (onePage ? 20 : 9); i++)
+ {
+ sender.sendMessage(lines.get(i));
+ }
+ if (!onePage && page < pages)
+ {
+ sender.sendMessage(_("readNextPage", commandName, pageStr + " " + (page + 1)));
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/user/Ban.java b/Essentials/src/com/earth2me/essentials/user/Ban.java
new file mode 100644
index 000000000..ba1c22333
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/user/Ban.java
@@ -0,0 +1,14 @@
+package com.earth2me.essentials.user;
+
+import com.earth2me.essentials.storage.StorageObject;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class Ban implements StorageObject
+{
+ private String reason;
+ private long timeout;
+}
diff --git a/Essentials/src/com/earth2me/essentials/user/IOfflinePlayer.java b/Essentials/src/com/earth2me/essentials/user/IOfflinePlayer.java
new file mode 100644
index 000000000..4cdee715b
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/user/IOfflinePlayer.java
@@ -0,0 +1,15 @@
+package com.earth2me.essentials.user;
+
+import org.bukkit.Location;
+
+
+public interface IOfflinePlayer
+{
+ String getName();
+
+ String getDisplayName();
+
+ Location getBedSpawnLocation();
+
+ void setBanned(boolean bln);
+} \ No newline at end of file
diff --git a/Essentials/src/com/earth2me/essentials/user/IOfflineUser.java b/Essentials/src/com/earth2me/essentials/user/IOfflineUser.java
new file mode 100644
index 000000000..d6266df49
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/user/IOfflineUser.java
@@ -0,0 +1,9 @@
+package com.earth2me.essentials.user;
+
+import com.earth2me.essentials.storage.IStorageObjectHolder;
+
+
+public interface IOfflineUser extends IStorageObjectHolder<UserData>, IOfflinePlayer
+{
+
+}
diff --git a/Essentials/src/com/earth2me/essentials/user/Inventory.java b/Essentials/src/com/earth2me/essentials/user/Inventory.java
new file mode 100644
index 000000000..0812f54a0
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/user/Inventory.java
@@ -0,0 +1,27 @@
+package com.earth2me.essentials.user;
+
+import com.earth2me.essentials.storage.MapKeyType;
+import com.earth2me.essentials.storage.MapValueType;
+import com.earth2me.essentials.storage.StorageObject;
+import java.util.HashMap;
+import java.util.Map;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.bukkit.Material;
+import org.bukkit.inventory.ItemStack;
+
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class Inventory implements StorageObject
+{
+ private int size;
+ @MapKeyType(Integer.class)
+ @MapValueType(ItemStack.class)
+ private Map<Integer, ItemStack> items = new HashMap<Integer, ItemStack>();
+
+ public Inventory()
+ {
+ items.put(1, new ItemStack(Material.APPLE, 64));
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java
new file mode 100644
index 000000000..0e544ae06
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/user/User.java
@@ -0,0 +1,199 @@
+package com.earth2me.essentials.user;
+
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.IUser;
+import com.earth2me.essentials.Teleport;
+import com.earth2me.essentials.commands.IEssentialsCommand;
+import lombok.Cleanup;
+import org.bukkit.Location;
+import org.bukkit.OfflinePlayer;
+import org.bukkit.entity.Player;
+
+
+public class User extends UserBase implements IUser
+{
+ public User(final Player base, final IEssentials ess)
+ {
+ super(base, ess);
+ }
+
+ public User(final OfflinePlayer offlinePlayer, final IEssentials ess)
+ {
+ super(offlinePlayer, ess);
+ }
+
+ public void example()
+ {
+ // Cleanup will call close at the end of the function
+ @Cleanup
+ final User user = this;
+
+ // read lock allows to read data from the user
+ user.acquireReadLock();
+ final double money = user.getData().getMoney();
+
+ // write lock allows only one thread to modify the data
+ user.acquireWriteLock();
+ user.getData().setMoney(10 + money);
+ }
+
+ @Override
+ public long getLastTeleportTimestamp()
+ {
+ acquireReadLock();
+ try
+ {
+ return getData().getTimestamps().get("lastteleport");
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ @Override
+ public boolean isAuthorized(String node)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isAuthorized(IEssentialsCommand cmd)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isAuthorized(IEssentialsCommand cmd, String permissionPrefix)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setLastTeleportTimestamp(long time)
+ {
+ acquireWriteLock();
+ try
+ {
+ getData().getTimestamps().put("lastteleport", time);
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ @Override
+ public Location getLastLocation()
+ {
+ acquireReadLock();
+ try
+ {
+ return getData().getLastLocation();
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ @Override
+ public double getMoney()
+ {
+ acquireReadLock();
+ try
+ {
+ return getData().getMoney();
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ @Override
+ public void takeMoney(double value)
+ {
+ acquireWriteLock();
+ try
+ {
+ getData().setMoney(getData().getMoney() - value);
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ @Override
+ public void giveMoney(double value)
+ {
+ acquireWriteLock();
+ try
+ {
+ getData().setMoney(getData().getMoney() + value);
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ @Override
+ public String getGroup()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setLastLocation()
+ {
+ acquireWriteLock();
+ try
+ {
+ getData().setLastLocation(base.getLocation());
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ @Override
+ public Location getHome(String name) throws Exception
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Location getHome(Location loc) throws Exception
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isHidden()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Teleport getTeleport()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setJail(final String jail)
+ {
+ acquireWriteLock();
+ try
+ {
+ getData().setJail(jail);
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/user/UserBase.java b/Essentials/src/com/earth2me/essentials/user/UserBase.java
new file mode 100644
index 000000000..9dda2f950
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/user/UserBase.java
@@ -0,0 +1,122 @@
+package com.earth2me.essentials.user;
+
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.craftbukkit.OfflineBedLocation;
+import com.earth2me.essentials.storage.AsyncStorageObjectHolder;
+import java.io.File;
+import lombok.Delegate;
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.command.CommandSender;
+import org.bukkit.configuration.serialization.ConfigurationSerializable;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.HumanEntity;
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.entity.Player;
+import org.bukkit.permissions.Permissible;
+import org.bukkit.permissions.ServerOperator;
+import org.bukkit.OfflinePlayer;
+
+
+public abstract class UserBase extends AsyncStorageObjectHolder<UserData> implements Player, IOfflineUser
+{
+
+ @Delegate(types =
+ {
+ Player.class, Entity.class, CommandSender.class, ServerOperator.class,
+ HumanEntity.class, ConfigurationSerializable.class, LivingEntity.class,
+ Permissible.class
+ },excludes=IOfflinePlayer.class)
+ protected Player base;
+ protected transient OfflinePlayer offlinePlayer;
+
+ public UserBase(final Player base, final IEssentials ess)
+ {
+ super(ess, UserData.class);
+ this.base = base;
+ reloadConfig();
+ }
+
+ public UserBase(final OfflinePlayer offlinePlayer, final IEssentials ess)
+ {
+ super(ess, UserData.class);
+ this.offlinePlayer = offlinePlayer;
+ reloadConfig();
+ }
+
+ public final Player getBase()
+ {
+ return base;
+ }
+
+ public final Player setBase(final Player base)
+ {
+ return this.base = base;
+ }
+
+ public void update(final Player base)
+ {
+ setBase(base);
+ }
+
+ public void update(final OfflinePlayer offlinePlayer)
+ {
+ this.offlinePlayer = offlinePlayer;
+ }
+
+ public void dispose()
+ {
+ this.offlinePlayer = Bukkit.getOfflinePlayer(base.getName());
+ this.base = null;
+ }
+
+ public boolean isOnlineUser() {
+ return base != null;
+ }
+
+ @Override
+ public String getName()
+ {
+ if (isOnlineUser()) {
+ return base.getName();
+ } else {
+ return offlinePlayer.getName();
+ }
+ }
+
+ @Override
+ public String getDisplayName()
+ {
+ if (isOnlineUser()) {
+ return base.getDisplayName();
+ } else {
+ return offlinePlayer.getName();
+ }
+ }
+
+ @Override
+ public Location getBedSpawnLocation()
+ {
+ if (isOnlineUser()) {
+ return base.getBedSpawnLocation();
+ } else {
+ return OfflineBedLocation.getBedLocation(base.getName(), ess);
+ }
+ }
+
+ @Override
+ public void setBanned(boolean bln)
+ {
+ if (isOnlineUser()) {
+ base.setBanned(bln);
+ } else {
+ offlinePlayer.setBanned(bln);
+ }
+ }
+
+ @Override
+ public File getStorageFile()
+ {
+ return ess.getUserMap().getUserFile(getName());
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/user/UserData.java b/Essentials/src/com/earth2me/essentials/user/UserData.java
new file mode 100644
index 000000000..4586d0627
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/user/UserData.java
@@ -0,0 +1,56 @@
+package com.earth2me.essentials.user;
+
+import com.earth2me.essentials.storage.ListType;
+import com.earth2me.essentials.storage.MapKeyType;
+import com.earth2me.essentials.storage.MapValueType;
+import com.earth2me.essentials.storage.StorageObject;
+import java.util.*;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.bukkit.Location;
+import org.bukkit.Material;
+
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class UserData implements StorageObject
+{
+ private String nickname;
+ private double money;
+ @MapValueType(Location.class)
+ private Map<String, Location> homes = new HashMap<String, Location>();
+ @ListType(Material.class)
+ private Set<Material> unlimited = new HashSet<Material>();
+ @MapValueType(List.class)
+ @MapKeyType(Material.class)
+ private Map<Material, List<String>> powerTools = new HashMap<Material, List<String>>();
+ private Location lastLocation;
+ @MapValueType(Long.class)
+ private Map<String, Long> timestamps;
+ private String jail;
+ @ListType
+ private List<String> mails;
+ private Inventory inventory;
+ private boolean teleportEnabled;
+ @ListType
+ private Set<String> ignore;
+ private boolean godmode;
+ private boolean muted;
+ private boolean jailed;
+ private Ban ban;
+ private String ipAddress;
+ private boolean afk;
+ private boolean newplayer = true;
+ private String geolocation;
+ private boolean socialspy;
+ private boolean npc;
+ private boolean powertoolsenabled;
+
+ public UserData()
+ {
+ unlimited.add(Material.AIR);
+ unlimited.add(Material.ARROW);
+ unlimited.add(Material.APPLE);
+ powerTools.put(Material.DEAD_BUSH, Collections.singletonList("test"));
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/user/UserMap.java b/Essentials/src/com/earth2me/essentials/user/UserMap.java
new file mode 100644
index 000000000..821ee4c8f
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/user/UserMap.java
@@ -0,0 +1,128 @@
+package com.earth2me.essentials.user;
+
+import com.earth2me.essentials.IConf;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.Util;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.util.concurrent.UncheckedExecutionException;
+import java.io.File;
+import java.util.Collections;
+import java.util.Locale;
+import java.util.Set;
+import java.util.concurrent.ConcurrentSkipListSet;
+import java.util.concurrent.ExecutionException;
+import org.bukkit.Bukkit;
+import org.bukkit.entity.Player;
+
+
+public class UserMap extends CacheLoader<String, User> implements IConf
+{
+ private final transient IEssentials ess;
+ private final transient Cache<String, User> users = CacheBuilder.newBuilder().softValues().build(this);
+ private final transient ConcurrentSkipListSet<String> keys = new ConcurrentSkipListSet<String>();
+
+ public UserMap(final IEssentials ess)
+ {
+ super();
+ this.ess = ess;
+ loadAllUsersAsync(ess);
+ }
+
+ private void loadAllUsersAsync(final IEssentials ess)
+ {
+ ess.scheduleAsyncDelayedTask(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ final File userdir = new File(ess.getDataFolder(), "userdata");
+ if (!userdir.exists())
+ {
+ return;
+ }
+ keys.clear();
+ users.invalidateAll();
+ for (String string : userdir.list())
+ {
+ if (!string.endsWith(".yml"))
+ {
+ continue;
+ }
+ final String name = string.substring(0, string.length() - 4);
+ keys.add(name.toLowerCase(Locale.ENGLISH));
+ }
+ }
+ });
+ }
+
+ public boolean userExists(final String name)
+ {
+ return keys.contains(name.toLowerCase(Locale.ENGLISH));
+ }
+
+ public User getUser(final String name)
+ {
+ try
+ {
+ return users.get(name.toLowerCase(Locale.ENGLISH));
+ }
+ catch (ExecutionException ex)
+ {
+ return null;
+ }
+ catch (UncheckedExecutionException ex)
+ {
+ return null;
+ }
+ }
+
+ @Override
+ public User load(final String name) throws Exception
+ {
+ for (Player player : ess.getServer().getOnlinePlayers())
+ {
+ if (player.getName().equalsIgnoreCase(name))
+ {
+ keys.add(name.toLowerCase(Locale.ENGLISH));
+ return new User(player, ess);
+ }
+ }
+ final File userFile = getUserFile(name);
+ if (userFile.exists())
+ {
+ keys.add(name.toLowerCase(Locale.ENGLISH));
+ return new User(Bukkit.getOfflinePlayer(name), ess);
+ }
+ throw new Exception("User not found!");
+ }
+
+ @Override
+ public void reloadConfig()
+ {
+ loadAllUsersAsync(ess);
+ }
+
+ public void removeUser(final String name)
+ {
+ keys.remove(name.toLowerCase(Locale.ENGLISH));
+ users.invalidate(name.toLowerCase(Locale.ENGLISH));
+ }
+
+ public Set<String> getAllUniqueUsers()
+ {
+ return Collections.unmodifiableSet(keys);
+ }
+
+ public int getUniqueUsers()
+ {
+ return keys.size();
+ }
+
+ public File getUserFile(final String name)
+ {
+ final File userFolder = new File(ess.getDataFolder(), "userdata");
+ return new File(userFolder, Util.sanitizeFileName(name) + ".yml");
+ }
+}
diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml
index 472887d5d..877ff0c42 100644
--- a/Essentials/src/config.yml
+++ b/Essentials/src/config.yml
@@ -20,8 +20,6 @@
-
-
############################################################
# +------------------------------------------------------+ #
# | Essentials (Global) | #
@@ -53,9 +51,6 @@ teleport-delay: 0
# The delay, in seconds, required between /heal attempts
heal-cooldown: 60
-# The number of items given if the quantity parameter is left out in /item or /give.
-default-stack-size: 64
-
# What to prevent from /i /give
# e.g item-spawn-blacklist: 46,11,10
item-spawn-blacklist:
@@ -71,33 +66,14 @@ item-spawn-blacklist:
# - essentials.give.item-[itemid]
permission-based-item-spawn: false
-# Whether or not to reclaim memory on player logout; this is technical, and should only be changed under special circumstances.
-# This generally increases server stability unless very specific runtime configurations are used.
-# HOWEVER, it is known to cause lag upon users logging OUT, so beware!
-reclaim-onlogout: false
-
-# Should primitive spawn protection be enabled? For most servers, this should be flase; it is better to use a third-party plugin to protect it.
-spawn-protection: false
-
# Mob limit on spawnmob
spawnmob-limit: 10
# Shall we notify users when using /lightning
warn-on-smite: true
-# The message of the day, displayed on connect and by typing /motd.
-# Valid tags are: {PLAYER}, {IP}, {BALANCE}, {MAILS}, {WORLD}, {ONLINE}, {UNIQUE}, {PLAYERLIST}
-motd:
- - '&cWelcome, {PLAYER}&c!'
- - '&fType &c/help&f for a list of commands.'
- - 'Currently online: {PLAYERLIST}'
-
-# The server rules, available by typing /rules
-rules:
- - '[1] Be respectful'
- - '[2] Be ethical'
- - '[3] Use common sense'
-
+# motd and rules are now configured in the files motd.txt and rules.txt
+
# When a command conflicts with another plugin, by default, Essentials will try to force the OTHER plugin to take
# priority. If a command is in this list, Essentials will try to give ITSELF priority. This does not always work:
# usually whichever plugin was updated most recently wins out. However, the full name of the command will always work.
@@ -237,24 +213,51 @@ auto-afk-kick: -1
# The player has to use the command /afk to leave the afk mode.
freeze-afk-players: false
+# When the player is afk, should he be able to pickup items?
+# Enable this, when you don't want people idling in mob traps.
+disable-item-pickup-while-afk: true
+
# You can disable the death messages of minecraft here
death-messages: true
+# Add worlds to this list, if you want to automatically disable god mode there
+no-god-in-worlds:
+# - world_nether
+
+# Set to true to enable per-world permissions for teleporting with /world
+# Give someone permission to teleport to a world with essentials.world.<worldname>
+world-teleport-permissions: false
+
+# The number of items given if the quantity parameter is left out in /item or /give.
+# If this number is below 1, the maximum stack size size is given. If oversized stacks
+# is not enabled, any number higher then the maximum stack size results in more than one stack.
+default-stack-size: -1
+
+# Oversized stacks are stacks that ignore the normal max stacksize.
+# They can be obtained using /give and /item, if the player has essentials.oversizedstacks permission.
+# How many items should be in a oversized stack?
+oversized-stacksize: 64
+
+# Do you allow to repair enchanted weapons and armor?
+# If you set this to false, you can still allow it for certain players using the permission
+# essentials.repair.enchanted
+repair-enchanted: true
+
+#Do you want essentials to keep track of previous location for /back in the teleport listener?
+#If you set this to true any plugin that uses teleport will have the previous location registered.
+register-back-in-listener: false
+
############################################################
# +------------------------------------------------------+ #
# | EssentialsHome | #
# +------------------------------------------------------+ #
############################################################
-# When users die, should they respawn at their homes, instead of the spawnpoint?
-respawn-at-home: false
-
-# When a user interacts with a bed, should their home be set to that location?
-# If you enable this and remove default user access to the /sethome command, you can make beds the only way for players to set their home location.
-bed-sethome: false
+# If no home is set, send players to spawn when /home is used
+spawn-if-no-home: true
-# If no home is set send you to spawn when /home is used
-spawn-if-no-home: false
+# Allows people to set their bed at daytime
+update-bed-at-daytime: true
# Allow players to have multiple homes.
# Define different amounts of multiple homes for different permissions, e.g. essentials.sethome.multiple.vip
@@ -267,6 +270,10 @@ sethome-multiple:
# essentials.sethome.multiple.staff
staff: 10
+#Set timeout in seconds for players to accept tpa before request is cancelled.
+#Set to 0 for no timeout
+tpa-accept-cancellation: 0
+
############################################################
# +------------------------------------------------------+ #
# | EssentialsEco | #
@@ -317,24 +324,28 @@ hide-permissionless-help: true
# +------------------------------------------------------+ #
############################################################
-# If EssentialsChat is installed, this will define how far a player's voice travels, in blocks. Set to 0 to make all chat global.
-# Note that users with the "essentials.chat.spy" permission will hear everything, regardless of this setting.
-# Users with essentials.chat.shout can override this by prefixing text with an exclamation mark (!)
-# Or with essentials.chat.question can override this by prefixing text with a question mark (?)
-# You can add command costs for shout/question by adding chat-shout and chat-question to the command costs section."
chat:
+
+ # If EssentialsChat is installed, this will define how far a player's voice travels, in blocks. Set to 0 to make all chat global.
+ # Note that users with the "essentials.chat.spy" permission will hear everything, regardless of this setting.
+ # Users with essentials.chat.shout can override this by prefixing text with an exclamation mark (!)
+ # Or with essentials.chat.question can override this by prefixing text with a question mark (?)
+ # You can add command costs for shout/question by adding chat-shout and chat-question to the command costs section."
radius: 0
+ # Chat formatting can be done in two ways, you can either define a standard format for all chat
+ # Or you can give a group specific chat format, to give some extra variation.
# If set to the default chat format which "should" be compatible with ichat.
+ # For more information of chat formatting, check out the wiki: http://ess.khhq.net/wiki/Chat_Formatting
+
format: '<{DISPLAYNAME}> {MESSAGE}'
#format: '&7[{GROUP}]&f {DISPLAYNAME}&7:&f {MESSAGE}'
-
- # You can also have group-specific formats, uncomment to enable:
+
group-formats:
# Default: '{WORLDNAME} {DISPLAYNAME}&7:&f {MESSAGE}'
# Admins: '{WORLDNAME} &c[{GROUP}]&f {DISPLAYNAME}&7:&c {MESSAGE}'
-
+ # If your using group formats make sure to remove the '#' to allow the setting to be read.
@@ -346,10 +357,8 @@ chat:
protect:
# Database settings for sign/rail protection
- # get mysql.jar and sqlite and place it in your serverroot/lib directory from here:
- # http://java.net/projects/essentials/sources/svn/show/lib?rev=435
- # mysql, sqlite or none
+ # mysql or sqlite
datatype: 'sqlite'
# If you specified MySQL above, you MUST enter the appropriate details here.
@@ -360,24 +369,21 @@ protect:
# For which block types would you like to be alerted?
# You can find a list of IDs in plugins/Essentials/items.csv after loading Essentials for the first time.
+ # 10 = lava :: 11 = still lava :: 46 = TNT :: 327 = lava bucket
alert:
- # 10: lava
- # 11: still lava
- # 46: TNT
- on-placement: 10,11,46
- on-use:
- # 46: TNT
+ on-placement: 10,11,46,327
+ on-use: 327
on-break:
- # Users cannot PLACE these types of blocks/items.
- # < 255 designates a BLOCK
- # > 255 designates an ITEM (Some blocks can be placed as blocks OR items; lava blocks can be placed by lava buckets, for example.)
blacklist:
- placement: 327,326,14,56,46,11,10,9,8
- usage: 327,326,325
+
+ # Which blocks should people be prevented from placing
+ placement: 10,11,46,327
+
+ # Which items should people be prevented from using
+ usage: 327
- #prevent people from breaking blocks
- #break: 20,50
+ # Which blocks should people be prevented from breaking
break:
# Which blocks should not be pushed by pistons
@@ -401,7 +407,9 @@ protect:
creeper-explosion: false
creeper-playerdamage: false
creeper-blockdamage: false
+ enderdragon-blockdamage: true
enderman-pickup: false
+ villager-death: false
# Monsters won't follow players
# permission essentials.protect.entitytarget.bypass disables this
entitytarget: false
@@ -410,14 +418,14 @@ protect:
chicken: false
cow: false
creeper: false
- ghast: true
+ ghast: false
giant: false
monster: false
pig: false
pig_zombie: false
sheep: false
skeleton: false
- slime: true
+ slime: false
spider: false
squid: false
zombie: false
@@ -425,6 +433,12 @@ protect:
cave_spider: false
enderman: false
silverfish: false
+ ender_dragon: false
+ villager: false
+ blaze: false
+ mushroom_cow: false
+ magma_cube: false
+ snowman: false
# Maximum height the creeper should explode. -1 allows them to explode everywhere.
# Set prevent.creeper-explosion to true, if you want to disable creeper explosions.
@@ -499,7 +513,7 @@ protect:
############################################################
# +------------------------------------------------------+ #
-# | New Players | #
+# | Essentials Spawn / New Players | #
# +------------------------------------------------------+ #
############################################################
@@ -508,10 +522,18 @@ newbies:
# If so, use this format, replacing {DISPLAYNAME} with the player name.
# If not, set to ''
#announce-format: ''
- announce-format: '&dWelcome {DISPLAYNAME} to the server!'
+ announce-format: '&dWelcome {DISPLAYNAME}&d to the server!'
# When we spawn for the first time, which spawnpoint do we use?
# Set to "none" if you want to use the spawn point of the world.
spawnpoint: newbies
+# Set this to lowest, if you want Multiverse 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: 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/examples/permissionsbukkit.yml b/Essentials/src/examples/permissionsbukkit.yml
index 2251985e7..515256ef1 100644
--- a/Essentials/src/examples/permissionsbukkit.yml
+++ b/Essentials/src/examples/permissionsbukkit.yml
@@ -5,8 +5,7 @@ users:
groups:
Default:
permissions:
- permissions.build: true
- essentials.build: false
+ permissions.build: false
essentials.spawn: true
essentials.rules: true
essentials.motd: true
@@ -16,7 +15,6 @@ groups:
Builder:
permissions:
permissions.build: true
- essentials.build: true
essentials.afk: true
essentials.back: true
essentials.back.ondeath: true
diff --git a/Essentials/src/info.txt b/Essentials/src/info.txt
new file mode 100644
index 000000000..e05843dcb
--- /dev/null
+++ b/Essentials/src/info.txt
@@ -0,0 +1,41 @@
+This is the info file.
+
+This file format works for the info.txt, motd.txt and rules.txt
+
+You can create a specific file for a user or a group:
+Name it info_username.txt or info_groupname.txt
+
+This also works with motd and rules.
+
+It can contain chapters like the Chapter1 below:
+
+#Chapter1
+Lines starting with # begin a new chapter
+The user has to type /info Chapter1 to read this chapter
+
+If the file starts with a # then the user is shown a chapter selection,
+when he does not select a chapter.
+
+#Colors
+Minecraft colors:
+&0 &&0 &1 &&1 &2 &&2 &3 &&3
+&4 &&4 &5 &&5 &6 &&6 &7 &&7
+&8 &&8 &9 &&9 &a &&a &b &&b
+&c &&c &d &&d &e &&e &f &&f
+
+#Tags
+PLAYER: {PLAYER}
+IP: {IP}
+BALANCE: {BALANCE}
+MAILS: {MAILS}
+WORLD: {WORLD}
+WORLDS: {WORLDS}
+ONLINE: {ONLINE}
+UNIQUE: {UNIQUE}
+PLAYERLIST: {PLAYERLIST}
+TIME: {TIME}
+DATE: {DATE}
+WORLDTIME12: {WORLDTIME12}
+WORLDTIME24: {WORLDTIME24}
+WORLDDATE: {WORLDDATE}
+PLUGINS: {PLUGINS}
diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv
index 9dfe37218..98c25c327 100644
--- a/Essentials/src/items.csv
+++ b/Essentials/src/items.csv
@@ -360,100 +360,100 @@ wtree,17,2
wlog,17,2
wtrunk,17,2
wwood,17,2
-leaves,18,0
-leaf,18,0
-treeleaves,18,0
-logleaves,18,0
-trunkleaves,18,0
-woodleaves,18,0
-oaktreeleaves,18,0
-oaklogleaves,18,0
-oaktrunkleaves,18,0
-oakwoodleaves,18,0
-normaltreeleaves,18,0
-normallogleaves,18,0
-normaltrunkleaves,18,0
-normalwoodleaves,18,0
-otreeleaves,18,0
-ologleaves,18,0
-otrunkleaves,18,0
-owoodleaves,18,0
-ntreeleaves,18,0
-nlogleaves,18,0
-ntrunkleaves,18,0
-nwoodleaves,18,0
-treeleaf,18,0
-logleaf,18,0
-trunkleaf,18,0
-woodleaf,18,0
-oaktreeleaf,18,0
-oaklogleaf,18,0
-oaktrunkleaf,18,0
-oakwoodleaf,18,0
-normaltreeleaf,18,0
-normallogleaf,18,0
-normaltrunkleaf,18,0
-normalwoodleaf,18,0
-otreeleaf,18,0
-ologleaf,18,0
-otrunkleaf,18,0
-owoodleaf,18,0
-ntreeleaf,18,0
-nlogleaf,18,0
-ntrunkleaf,18,0
-nwoodleaf,18,0
-pineleaves,18,1
-pineleaf,18,1
-pinetreeleaves,18,1
-pinelogleaves,18,1
-pinetrunkleaves,18,1
-pinewoodleaves,18,1
-ptreeleaves,18,1
-plogleaves,18,1
-ptrunkleaves,18,1
-pwoodleaves,18,1
-pitreeleaves,18,1
-pilogleaves,18,1
-pitrunkleaves,18,1
-piwoodleaves,18,1
-pinetreeleaf,18,1
-pinelogleaf,18,1
-pinetrunkleaf,18,1
-pinewoodleaf,18,1
-ptreeleaf,18,1
-plogleaf,18,1
-ptrunkleaf,18,1
-pwoodleaf,18,1
-pitreeleaf,18,1
-pilogleaf,18,1
-pitrunkleaf,18,1
-piwoodleaf,18,1
-birchleaves,18,2
-birchleaf,18,2
-birchtreeleaves,18,2
-birchlogleaves,18,2
-birchtrunkleaves,18,2
-birchwoodleaves,18,2
-btreeleaves,18,2
-blogleaves,18,2
-btrunkleaves,18,2
-bwoodleaves,18,2
-bitreeleaves,18,2
-bilogleaves,18,2
-bitrunkleaves,18,2
-biwoodleaves,18,2
-birchtreeleaf,18,2
-birchlogleaf,18,2
-birchtrunkleaf,18,2
-birchwoodleaf,18,2
-btreeleaf,18,2
-blogleaf,18,2
-btrunkleaf,18,2
-bwoodleaf,18,2
-bitreeleaf,18,2
-bilogleaf,18,2
-bitrunkleaf,18,2
-biwoodleaf,18,2
+leaves,18,4
+leaf,18,4
+treeleaves,18,4
+logleaves,18,4
+trunkleaves,18,4
+woodleaves,18,4
+oaktreeleaves,18,4
+oaklogleaves,18,4
+oaktrunkleaves,18,4
+oakwoodleaves,18,4
+normaltreeleaves,18,4
+normallogleaves,18,4
+normaltrunkleaves,18,4
+normalwoodleaves,18,4
+otreeleaves,18,4
+ologleaves,18,4
+otrunkleaves,18,4
+owoodleaves,18,4
+ntreeleaves,18,4
+nlogleaves,18,4
+ntrunkleaves,18,4
+nwoodleaves,18,4
+treeleaf,18,4
+logleaf,18,4
+trunkleaf,18,4
+woodleaf,18,4
+oaktreeleaf,18,4
+oaklogleaf,18,4
+oaktrunkleaf,18,4
+oakwoodleaf,18,4
+normaltreeleaf,18,4
+normallogleaf,18,4
+normaltrunkleaf,18,4
+normalwoodleaf,18,4
+otreeleaf,18,4
+ologleaf,18,4
+otrunkleaf,18,4
+owoodleaf,18,4
+ntreeleaf,18,4
+nlogleaf,18,4
+ntrunkleaf,18,4
+nwoodleaf,18,4
+pineleaves,18,5
+pineleaf,18,5
+pinetreeleaves,18,5
+pinelogleaves,18,5
+pinetrunkleaves,18,5
+pinewoodleaves,18,5
+ptreeleaves,18,5
+plogleaves,18,5
+ptrunkleaves,18,5
+pwoodleaves,18,5
+pitreeleaves,18,5
+pilogleaves,18,5
+pitrunkleaves,18,5
+piwoodleaves,18,5
+pinetreeleaf,18,5
+pinelogleaf,18,5
+pinetrunkleaf,18,5
+pinewoodleaf,18,5
+ptreeleaf,18,5
+plogleaf,18,5
+ptrunkleaf,18,5
+pwoodleaf,18,5
+pitreeleaf,18,5
+pilogleaf,18,5
+pitrunkleaf,18,5
+piwoodleaf,18,5
+birchleaves,18,6
+birchleaf,18,6
+birchtreeleaves,18,6
+birchlogleaves,18,6
+birchtrunkleaves,18,6
+birchwoodleaves,18,6
+btreeleaves,18,6
+blogleaves,18,6
+btrunkleaves,18,6
+bwoodleaves,18,6
+bitreeleaves,18,6
+bilogleaves,18,6
+bitrunkleaves,18,6
+biwoodleaves,18,6
+birchtreeleaf,18,6
+birchlogleaf,18,6
+birchtrunkleaf,18,6
+birchwoodleaf,18,6
+btreeleaf,18,6
+blogleaf,18,6
+btrunkleaf,18,6
+bwoodleaf,18,6
+bitreeleaf,18,6
+bilogleaf,18,6
+bitrunkleaf,18,6
+biwoodleaf,18,6
sponge,19,0
glass,20,0
lapislazuliore,21,0
@@ -862,6 +862,18 @@ doublecstoneslab,43,3
dcstoneslab,43,3
doublecsslab,43,3
dcsslab,43,3
+brickdoublestep,43,4
+brickdstep,43,4
+bdstep,43,4
+brickdoubleslab,43,4
+brickdslab,43,4
+bdslab,43,4
+stonebrickdoublestep,43,5
+stonebdstep,43,5
+sbdstep,43,5
+stonebrickdoubleslab,43,5
+stonebdslab,43,5
+sbdslab,43,5
smoothstonestep,44,0
stonestep,44,0
sstep,44,0
@@ -894,6 +906,16 @@ cobblestoneslab,44,3
cobbleslab,44,3
cstoneslab,44,3
csslab,44,3
+brickstep,44,4
+brickblockstep,44,4
+bstep,44,4
+brickslab,44,4
+brickblockslab,44,4
+bslab,44,4
+stonebrickstep,44,5
+sbstep,44,5
+stonebrickslab,44,5
+sbslab,44,5
brickblock,45,0
blockbrick,45,0
bblock,45,0
@@ -1269,10 +1291,10 @@ mossystonebrick,98,1
mossystonebricks,98,1
mossystonebrickblock,98,1
mossystonebb,98,1
-crackedstonebrick,98,1
-crackedstonebricks,98,1
-crackedstonebrickblock,98,1
-crackedstonebb,98,1
+crackedstonebrick,98,2
+crackedstonebricks,98,2
+crackedstonebrickblock,98,2
+crackedstonebb,98,2
hugeredmushroom,99,0
bigredmushroom,99,0
brmushroom,99,0
@@ -1340,6 +1362,105 @@ cementstairs,109,0
cementbstairs,109,0
greybrickstairs,109,0
greybstairs,109,0
+mycel,110,0
+mycelium,110,0
+swampgrass,110,0
+sgrass,110,0
+waterlily,111,0
+lilypad,111,0
+lily,111,0
+swamppad,111,0
+lpad,111,0
+wlily,111,0
+netherbrick,112,0
+nbrick,112,0
+hellbrick,112,0
+deathbrick,112,0
+dbrick,112,0
+hbrick,112,0
+netherfence,113,0
+nfence,113,0
+hellfence,113,0
+deathfence,113,0
+dfence,113,0
+hfence,113,0
+netherbrickstairs,114,0
+nbrickstairs,114,0
+hellbrickstairs,114,0
+deathbrickstairs,114,0
+dbrickstairs,114,0
+hbrickstais,114,0
+netherwarts,115,0
+netherwart,115,0
+netherplant,115,0
+nethercrop,115,0
+hellwarts,115,0
+hellwart,115,0
+hellplant,115,0
+hellcrop,115,0
+deathwarts,115,0
+deathwart,115,0
+deathplant,115,0
+deathcrop,115,0
+nwarts,115,0
+nwart,115,0
+ncrop,115,0
+nplant,115,0
+hwarts,115,0
+hwart,115,0
+hplant,115,0
+hcrop,115,0
+dwarts,115,0
+dwart,115,0
+dplant,115,0
+dcrop,115,0
+enchantmenttable,116,0
+magictable,116,0
+etable,116,0
+booktable,116,0
+magicdesk,116,0
+enchantmentdesk,116,0
+edesk,116,0
+btable,116,0
+bdesk,116,0
+mtable,116,0
+mdesk,116,0
+brewingstandblock,117,0
+brewerblock,117,0
+potionstandblock,117,0
+potionbrewerblock,117,0
+pstandblock,117,0
+bstandblock,117,0
+pbrewerblock,117,0
+cauldron,118,0
+steelcauldron,118,0
+ironcauldron,118,0
+icauldron,118,0
+scauldron,118,0
+potioncauldron,118,0
+pcauldron,118,0
+enderportal,119,0
+endergoo,119,0
+endgoo,119,0
+endportal,119,0
+egoo,119,0
+eportal,119,0
+enderportalframe,120,0
+endportalframe,120,0
+endgooframe,120,0
+endergooframe,120,0
+egooframe,120,0
+eportalframe,120,0
+enderstone,121,0
+endstone,121,0
+endrock,121,0
+enderrock,121,0
+erock,121,0
+estone,121,0
+dragonegg,122,0
+degg,122,0
+bossegg,122,0
+begg,122,0
ironshovel,256,0
ironspade,256,0
ishovel,256,0
@@ -2210,6 +2331,128 @@ pearl,368,0
epearl,368,0
bluepearl,368,0
endergem,368,0
+blazerod,369,0
+goldenrod,369,0
+goldrod,369,0
+blazestick,369,0
+goldstick,369,0
+brod,369,0
+grod,369,0
+bstick,369,0
+gstick,369,0
+ghasttear,370,0
+ghastdrop,370,0
+ghosttear,370,0
+ghostdrop,370,0
+gtear,370,0
+gdrop,370,0
+goldnugget,371,0
+gnugget,371,0
+goldball,371,0
+goldpebble,371,0
+gball,371,0
+gpebble,371,0
+pigzombienugget,371,0
+pigzombieball,371,0
+pigzombiepebble,371,0
+netherstalk,372,0
+deathstalk,372,0
+hellstalk,372,0
+nstalk,372,0
+dstalk,372,0
+hstalk,372,0
+potion,373,0
+mixture,373,0
+potions,373,0
+glassbottle,374,0
+bottle,374,0
+gbottle,374,0
+gvase,374,0
+vase,374,0
+glassvase,374,0
+emptypotion,374,0
+spidereye,375,0
+eyeofspider,375,0
+spiderseye,375,0
+spiderball,375,0
+spidernugget,375,0
+spidersball,375,0
+spidersnugget,375,0
+seye,375,0
+sball,375,0
+snugget,375,0
+fermentedspidereye,376,0
+craftedspidereye,376,0
+fermentedeyeofspider,376,0
+craftedeyeofspider,376,0
+fspidereye,376,0
+feyeofspider,376,0
+ceyeofspider,376,0
+cspidereye,376,0
+blazepowder,377,0
+blazedust,377,0
+goldpowder,377,0
+golddust,377,0
+gdust,377,0
+gpowder,377,0
+bpowder,377,0
+bdust,377,0
+magmacream,378,0
+goldcream,378,0
+blazecream,378,0
+mcream,378,0
+gcream,378,0
+bcream,378,0
+combinedcream,378,0
+ccream,378,0
+bstand,379,0
+pstand,379,0
+brewingstand,379,0
+potionstand,379,0
+cauldronitem,380,0
+ironcauldronitem,380,0
+steelcauldronitem,380,0
+icauldronitem,380,0
+scauldronitem,380,0
+eyeofender,381,0
+endereye,381,0
+evilendereye,381,0
+evileyeofender,381,0
+evilenderpearl,381,0
+eeye,381,0
+eofender,381,0
+speckledmelon,382,0
+goldmelon,382,0
+sparklymelon,382,0
+glisteningmelon,382,0
+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
@@ -2228,6 +2471,7 @@ goldcd,2256,0
gorecord,2256,0
godisk,2256,0
gocd,2256,0
+record1,2256,0
greenmusicrecord,2257,0
greenmusicdisk,2257,0
greenmusiccd,2257,0
@@ -2245,4 +2489,14 @@ greendisk,2257,0
greencd,2257,0
grrecord,2257,0
grdisk,2257,0
-grcd,2257,0 \ No newline at end of file
+grcd,2257,0
+record2,2257,0
+record3,2258,0
+record4,2259,0
+record5,2260,0
+record6,2261,0
+record7,2262,0
+record8,2263,0
+record9,2264,0
+record10,2265,0
+record11,2266,0
diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties
index ef149d68c..56da9bbec 100644
--- a/Essentials/src/messages.properties
+++ b/Essentials/src/messages.properties
@@ -2,368 +2,405 @@
# Single quotes have to be doubled: ''
# Translations start here
# by:
-action = * {0} {1}
-addedToAccount = \u00a7a{0} has been added to your account.
-addedToOthersAccount = \u00a7a{0} has been added to {1} account.
-alertBroke = broke:
-alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3}
-alertPlaced = placed:
-alertUsed = used:
+action=* {0} {1}
+addedToAccount=\u00a7a{0} has been added to your account.
+addedToOthersAccount=\u00a7a{0} has been added to {1} account.
+alertBroke=broke:
+alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3}
+alertPlaced=placed:
+alertUsed=used:
autoAfkKickReason=You have been kicked for idling more than {0} minutes.
-backAfterDeath = \u00a77Use the /back command to return to your death point.
-backUsageMsg = \u00a77Returning to previous location.
-backupFinished = Backup finished
-backupStarted = Backup started
-balance = \u00a77Balance: {0}
-balanceTop = \u00a77Top {0} balances
-banExempt = \u00a7cYou can not ban that player.
-banIpAddress = \u00a77Banned IP address
-bannedIpsFileError = Error reading banned-ips.txt
-bannedIpsFileNotFound = banned-ips.txt not found
-bannedPlayersFileError = Error reading banned-players.txt
-bannedPlayersFileNotFound = banned-players.txt not found
-bigTreeFailure = \u00a7cBig tree generation failure. Try again on grass or dirt.
-bigTreeSuccess = \u00a77Big tree spawned.
-broadcast = [\u00a7cBroadcast\u00a7f]\u00a7a {0}
-buildAlert = \u00a7cYou are not permitted to build
-bukkitFormatChanged = Bukkit version format changed. Version not checked.
-burnMsg = \u00a77You set {0} on fire for {1} seconds.
-canTalkAgain = \u00a77You can talk again
-cantFindGeoIpDB = Can''t find GeoIP database!
-cantReadGeoIpDB = Failed to read GeoIP database!
-cantSpawnItem = \u00a7cYou are not allowed to spawn the item {0}
-commandFailed = Command {0} failed:
-commandHelpFailedForPlugin = Error getting help for: {0}
-commandNotLoaded = \u00a7cCommand {0} is improperly loaded.
-compassBearing = \u00a77Bearing: {0} ({1} degrees).
-configFileMoveError = Failed to move config.yml to backup location.
-configFileRenameError = Failed to rename temp file to config.yml
-connectedPlayers = Connected players:
-connectionFailed = Failed to open connection.
-cooldownWithMessage = \u00a7cCooldown: {0}
-corruptNodeInConfig = \u00a74Notice: Your configuration file has a corrupt {0} node.
-couldNotFindTemplate = Could not find template {0}
-creatingConfigFromTemplate = Creating config from template: {0}
-creatingEmptyConfig = Creating empty config: {0}
-day = day
-days = days
-defaultBanReason = The Ban Hammer has spoken!
-deleteFileError = Could not delete file: {0}
-deleteHome = \u00a77Home {0} has been removed.
-deleteJail = \u00a77Jail {0} has been removed.
-deleteWarp = \u00a77Warp {0} has been removed.
-deniedAccessCommand = {0} was denied access to command.
-dependancyDownloaded = [Essentials] Dependancy {0} downloaded successfully.
-dependancyException = [Essentials] An error occurred when trying to download a dependacy
-dependancyNotFound = [Essentials] A required dependancy was not found, downloading now.
-depth = \u00a77You are at sea level.
-depthAboveSea = \u00a77You are {0} block(s) above sea level.
-depthBelowSea = \u00a77You are {0} block(s) below sea level.
-destinationNotSet = Destination not set
-disableUnlimited = \u00a77Disabled unlimited placing of {0} for {1}.
-disabled = disabled
-dontMoveMessage = \u00a77Teleportation will commence in {0}. Don''t move.
-downloadingGeoIp = Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB)
-duplicatedUserdata = Duplicated userdata: {0} and {1}
-enableUnlimited = \u00a77Giving unlimited amount of {0} to {1}.
-enabled = enabled
-errorCallingCommand = Error calling command /{0}
-errorWithMessage = \u00a7cError: {0}
-essentialsReload = \u00a77Essentials Reloaded {0}
-extinguish = \u00a77You extinguished yourself.
-extinguishOthers = \u00a77You extinguished {0}.
-failedToCloseConfig = Failed to close config {0}
-failedToCreateConfig = Failed to create config {0}
-failedToWriteConfig = Failed to write config {0}
-fileRenameError = Renaming file {0} failed
-foreverAlone = \u00a7cYou have nobody to whom you can reply.
-freedMemory = Freed {0} MB.
-gcchunks = chunks,
-gcentities = entities
-gcfree = Free memory: {0} MB
-gcmax = Maximum memory: {0} MB
-gctotal = Allocated memory: {0} MB
-geoIpUrlEmpty = GeoIP download url is empty.
-geoIpUrlInvalid = GeoIP download url is invalid.
-geoipJoinFormat = Player {0} comes from {1}
-godDisabledFor = disabled for {0}
-godEnabledFor = enabled for {0}
-godMode = \u00a77God mode {0}.
-haveBeenReleased = \u00a77You have been released
-heal = \u00a77You have been healed.
-healOther = \u00a77Healed {0}.
-helpConsole = To view help from the console, type ?.
-helpOp = \u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1}
-helpPages = Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f:
-holeInFloor = Hole in floor
-homeSet = \u00a77Home set.
-homeSetToBed = \u00a77Your home is now set to this bed.
-homes = Homes: {0}
-hour = hour
-hours = hours
-ignorePlayer = You ignore player {0} from now on.
-illegalDate = Illegal date format.
-infoChapter = Select chapter:
-infoChapterPages = Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f:
-infoFileDoesNotExist = File info.txt does not exist. Creating one for you.
-infoPages = Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f:
-infoUnknownChapter = Unknown chapter.
-invBigger = The other users inventory is bigger than yours.
-invRestored = Your inventory has been restored.
-invSee = You see the inventory of {0}.
-invSeeHelp = Use /invsee to restore your inventory.
-invalidCharge = \u00a7cInvalid charge.
-invalidMob = Invalid mob type.
-invalidServer = Invalid server!
-invalidSignLine = Line {0} on sign is invalid.
-invalidWorld = \u00a7cInvalid world.
-inventoryCleared = \u00a77Inventory Cleared.
-inventoryClearedOthers = \u00a77Inventory of \u00a7c{0}\u00a77 cleared.
-is = is
-itemCannotBeSold = That item cannot be sold to the server.
-itemMustBeStacked = Item must be traded in stacks. A quantity of 2s would be two stacks, etc.
-itemNotEnough1 = \u00a7cYou do not have enough of that item to sell.
-itemNotEnough2 = \u00a77If you meant to sell all of your items of that type, use /sell itemname
-itemNotEnough3 = \u00a77/sell itemname -1 will sell all but one item, etc.
-itemSellAir = You really tried to sell Air? Put an item in your hand.
-itemSold = \u00a77Sold for \u00a7c{0} \u00a77({1} {2} at {3} each)
-itemSoldConsole = {0} sold {1} for \u00a77{2} \u00a77({3} items at {4} each)
-itemSpawn = \u00a77Giving {0} of {1}
-itemsCsvNotLoaded = Could not load items.csv.
-jailAlreadyIncarcerated = \u00a7cPerson is already in jail: {0}
-jailMessage = \u00a7cYou do the crime, you do the time.
-jailNotExist = That jail does not exist.
-jailReleased = \u00a77Player \u00a7e{0}\u00a77 unjailed.
-jailReleasedPlayerNotify = \u00a77You have been released!
-jailSentenceExtended = Jail time extend to: {0)
-jailSet = \u00a77Jail {0} has been set
-jumpError = That would hurt your computer''s brain.
-kickDefault = Kicked from server
-kickExempt = \u00a7cYou can not kick that person.
-kill = \u00a77Killed {0}.
-kitError = \u00a7cThere are no valid kits.
-kitError2 = \u00a7cThat kit does not exist or is improperly defined.
-kitErrorHelp = \u00a7cPerhaps an item is missing a quantity in the configuration?
-kitGive = \u00a77Giving kit {0}.
-kitInvFull = \u00a7cYour inventory was full, placing kit on the floor
-kitTimed = \u00a7cYou can''t use that kit again for another {0}.
-kits = \u00a77Kits: {0}
-lightningSmited = \u00a77You have just been smited
-lightningUse = \u00a77Smiting {0}
-loadWarpError = Failed to load warp {0}
-loadinfo = Loaded {0} build {1} by: {2}
-localFormat = Local: <{0}> {1}
-mailClear = \u00a7cTo mark your mail as read, type /mail clear
-mailCleared = \u00a77Mail Cleared!
-mailSent = \u00a77Mail sent!
-markMailAsRead = \u00a7cTo mark your mail as read, type /mail clear
-markedAsAway = \u00a77You are now marked as away.
-markedAsNotAway = \u00a77You are no longer marked as away.
+backAfterDeath=\u00a77Use the /back command to return to your death point.
+backUsageMsg=\u00a77Returning to previous location.
+backupFinished=Backup finished
+backupStarted=Backup started
+balance=\u00a77Balance: {0}
+balanceTop=\u00a77Top balances ({0})
+banExempt=\u00a7cYou can not ban that player.
+banIpAddress=\u00a77Banned IP address
+bannedIpsFileError=Error reading banned-ips.txt
+bannedIpsFileNotFound=banned-ips.txt not found
+bannedPlayersFileError=Error reading banned-players.txt
+bannedPlayersFileNotFound=banned-players.txt not found
+bigTreeFailure=\u00a7cBig tree generation failure. Try again on grass or dirt.
+bigTreeSuccess= \u00a77Big tree spawned.
+blockList=Essentials relayed the following commands to another plugin:
+broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0}
+buildAlert=\u00a7cYou are not permitted to build
+bukkitFormatChanged=Bukkit version format changed. Version not checked.
+burnMsg=\u00a77You set {0} on fire for {1} seconds.
+canTalkAgain=\u00a77You can talk again
+cantFindGeoIpDB=Can''t find GeoIP database!
+cantReadGeoIpDB=Failed to read GeoIP database!
+cantSpawnItem=\u00a7cYou are not allowed to spawn the item {0}
+commandFailed=Command {0} failed:
+commandHelpFailedForPlugin=Error getting help for: {0}
+commandNotLoaded=\u00a7cCommand {0} is improperly loaded.
+compassBearing=\u00a77Bearing: {0} ({1} degrees).
+configFileMoveError=Failed to move config.yml to backup location.
+configFileRenameError=Failed to rename temp file to config.yml
+connectedPlayers=Connected players:
+connectionFailed=Failed to open connection.
+cooldownWithMessage=\u00a7cCooldown: {0}
+corruptNodeInConfig=\u00a74Notice: Your configuration file has a corrupt {0} node.
+couldNotFindTemplate=Could not find template {0}
+creatingConfigFromTemplate=Creating config from template: {0}
+creatingEmptyConfig=Creating empty config: {0}
+creative=creative
+day=day
+days=days
+defaultBanReason=The Ban Hammer has spoken!
+deleteFileError=Could not delete file: {0}
+deleteHome=\u00a77Home {0} has been removed.
+deleteJail=\u00a77Jail {0} has been removed.
+deleteWarp=\u00a77Warp {0} has been removed.
+deniedAccessCommand={0} was denied access to command.
+dependancyDownloaded=[Essentials] Dependancy {0} downloaded successfully.
+dependancyException=[Essentials] An error occurred when trying to download a dependacy
+dependancyNotFound=[Essentials] A required dependancy was not found, downloading now.
+depth=\u00a77You are at sea level.
+depthAboveSea=\u00a77You are {0} block(s) above sea level.
+depthBelowSea=\u00a77You are {0} block(s) below sea level.
+destinationNotSet=Destination not set
+disableUnlimited=\u00a77Disabled unlimited placing of {0} for {1}.
+disabled=disabled
+disabledToSpawnMob=Spawning this mob was disabled in the config file.
+dontMoveMessage=\u00a77Teleportation will commence in {0}. Don''t move.
+downloadingGeoIp=Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB)
+duplicatedUserdata=Duplicated userdata: {0} and {1}
+enableUnlimited=\u00a77Giving unlimited amount of {0} to {1}.
+enabled=enabled
+enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand.
+enchantmentNotFound = \u00a7cEnchantment not found
+enchantmentPerm = \u00a7cYou do not have the permission for {0}
+enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item in hand.
+enchantments = \u00a77Enchantments: {0}
+errorCallingCommand=Error calling command /{0}
+errorWithMessage=\u00a7cError: {0}
+essentialsHelp1=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat
+essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat
+essentialsReload=\u00a77Essentials Reloaded {0}
+extinguish=\u00a77You extinguished yourself.
+extinguishOthers=\u00a77You extinguished {0}.
+failedToCloseConfig=Failed to close config {0}
+failedToCreateConfig=Failed to create config {0}
+failedToWriteConfig=Failed to write config {0}
+false=false
+feed=\u00a77Your appetite was sated.
+feedOther=\u00a77Satisfied {0}.
+fileRenameError=Renaming file {0} failed
+foreverAlone=\u00a7cYou have nobody to whom you can reply.
+freedMemory=Freed {0} MB.
+gameMode=\u00a77Set game mode {0} for {1}.
+gcchunks= chunks,
+gcentities= entities
+gcfree=Free memory: {0} MB
+gcmax=Maximum memory: {0} MB
+gctotal=Allocated memory: {0} MB
+geoIpUrlEmpty=GeoIP download url is empty.
+geoIpUrlInvalid=GeoIP download url is invalid.
+geoipJoinFormat=Player {0} comes from {1}
+godDisabledFor=disabled for {0}
+godEnabledFor=enabled for {0}
+godMode=\u00a77God mode {0}.
+haveBeenReleased=\u00a77You have been released
+heal=\u00a77You have been healed.
+healOther=\u00a77Healed {0}.
+helpConsole=To view help from the console, type ?.
+helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1}
+helpPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f:
+holeInFloor=Hole in floor
+homeSet=\u00a77Home set.
+homeSetToBed=\u00a77Your home is now set to this bed.
+homes=Homes: {0}
+hour=hour
+hours=hours
+ignorePlayer=You ignore player {0} from now on.
+illegalDate=Illegal date format.
+infoChapter=Select chapter:
+infoChapterPages=Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f:
+infoFileDoesNotExist=File info.txt does not exist. Creating one for you.
+infoPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f:
+infoUnknownChapter=Unknown chapter.
+invBigger=The other users inventory is bigger than yours.
+invRestored=Your inventory has been restored.
+invSee=You see the inventory of {0}.
+invSeeHelp=Use /invsee to restore your inventory.
+invalidCharge=\u00a7cInvalid charge.
+invalidMob=Invalid mob type.
+invalidServer=Invalid server!
+invalidSignLine=Line {0} on sign is invalid.
+invalidWorld=\u00a7cInvalid world.
+inventoryCleared=\u00a77Inventory Cleared.
+inventoryClearedOthers=\u00a77Inventory of \u00a7c{0}\u00a77 cleared.
+is=is
+itemCannotBeSold=That item cannot be sold to the server.
+itemMustBeStacked=Item must be traded in stacks. A quantity of 2s would be two stacks, etc.
+itemNotEnough1=\u00a7cYou do not have enough of that item to sell.
+itemNotEnough2=\u00a77If you meant to sell all of your items of that type, use /sell itemname
+itemNotEnough3=\u00a77/sell itemname -1 will sell all but one item, etc.
+itemSellAir=You really tried to sell Air? Put an item in your hand.
+itemSold=\u00a77Sold for \u00a7c{0} \u00a77({1} {2} at {3} each)
+itemSoldConsole={0} sold {1} for \u00a77{2} \u00a77({3} items at {4} each)
+itemSpawn=\u00a77Giving {0} of {1}
+itemsCsvNotLoaded=Could not load items.csv.
+jailAlreadyIncarcerated=\u00a7cPerson is already in jail: {0}
+jailMessage=\u00a7cYou do the crime, you do the time.
+jailNotExist=That jail does not exist.
+jailReleased=\u00a77Player \u00a7e{0}\u00a77 unjailed.
+jailReleasedPlayerNotify=\u00a77You have been released!
+jailSentenceExtended=Jail time extend to: {0)
+jailSet=\u00a77Jail {0} has been set
+jumpError=That would hurt your computer''s brain.
+kickDefault=Kicked from server
+kickExempt=\u00a7cYou can not kick that person.
+kill=\u00a77Killed {0}.
+kitError2=\u00a7cThat kit does not exist or is improperly defined.
+kitError=\u00a7cThere are no valid kits.
+kitErrorHelp=\u00a7cPerhaps an item is missing a quantity in the configuration?
+kitGive=\u00a77Giving kit {0}.
+kitInvFull=\u00a7cYour inventory was full, placing kit on the floor
+kitTimed=\u00a7cYou can''t use that kit again for another {0}.
+kits=\u00a77Kits: {0}
+lightningSmited=\u00a77You have just been smited
+lightningUse=\u00a77Smiting {0}
+listAfkTag = \u00a77[AFK]\u00a7f
+listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79 players online.
+listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online.
+listHiddenTag = \u00a77[HIDDEN]\u00a7f
+loadWarpError=Failed to load warp {0}
+loadinfo=Loaded {0} build {1} by: {2}
+localFormat=Local: <{0}> {1}
+mailClear=\u00a7cTo mark your mail as read, type /mail clear
+mailCleared=\u00a77Mail Cleared!
+mailSent=\u00a77Mail sent!
+markMailAsRead=\u00a7cTo mark your mail as read, type /mail clear
+markedAsAway=\u00a77You are now marked as away.
+markedAsNotAway=\u00a77You are no longer marked as away.
maxHomes=You cannot set more than {0} homes.
-mayNotJail = \u00a7cYou may not jail that person
-me = me
-minute = minute
-minutes = minutes
-missingItems = You do not have {0}x {1}.
-missingPrefixSuffix = Missing a prefix or suffix for {0}
-mobsAvailable = \u00a77Mobs: {0}
-mobSpawnError = Error while changing mob spawner.
-mobSpawnLimit = Mob quantity limited to server limit
-mobSpawnTarget = Target block must be a mob spawner.
-moneyRecievedFrom = \u00a7a{0} has been received from {1}
-moneySentTo = \u00a7a{0} has been sent to {1}
-moneyTaken = {0} taken from your bank account.
-month = month
-months = months
-moreThanZero = Quantities must be greater than 0.
-msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
-muteExempt = \u00a7cYou may not mute that player.
-mutedPlayer = Player {0} muted.
-mutedPlayerFor = Player {0} muted for {1}.
-mutedUserSpeaks = {0} tried to speak, but is muted.
-needTpohere = You need access to /tpohere to teleport other players.
-negativeBalanceError = User is not allowed to have a negative balance.
-nickChanged = Nickname changed.
+mayNotJail=\u00a7cYou may not jail that person
+me=me
+minute=minute
+minutes=minutes
+missingItems=You do not have {0}x {1}.
+missingPrefixSuffix=Missing a prefix or suffix for {0}
+mobSpawnError=Error while changing mob spawner.
+mobSpawnLimit=Mob quantity limited to server limit
+mobSpawnTarget=Target block must be a mob spawner.
+mobsAvailable=\u00a77Mobs: {0}
+moneyRecievedFrom=\u00a7a{0} has been received from {1}
+moneySentTo=\u00a7a{0} has been sent to {1}
+moneyTaken={0} taken from your bank account.
+month=month
+months=months
+moreThanZero=Quantities must be greater than 0.
+msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
+muteExempt=\u00a7cYou may not mute that player.
+mutedPlayer=Player {0} muted.
+mutedPlayerFor=Player {0} muted for {1}.
+mutedUserSpeaks={0} tried to speak, but is muted.
+nearbyPlayers=Players nearby: {0}
+needTpohere=You need access to /tpohere to teleport other players.
+negativeBalanceError=User is not allowed to have a negative balance.
+nickChanged=Nickname changed.
nickDisplayName=\u00a77You have to enable change-displayname in Essentials config.
-nickInUse = \u00a7cThat name is already in use.
-nickNamesAlpha = \u00a7cNicknames must be alphanumeric.
-nickNoMore = \u00a77You no longer have a nickname.
-nickOthersPermission = \u00a7cYou do not have permission to change the nickname of others
-nickSet = \u00a77Your nickname is now \u00a7c{0}
-noAccessCommand = \u00a7cYou do not have access to that command.
-noAccessPermission = \u00a7cYou do not have permission to access that {0}.
-noDestroyPermission = \u00a7cYou do not have permission to destroy that {0}.
-noHelpFound = \u00a7cNo matching commands.
-noHomeSet = You have not set a home.
-noHomeSetPlayer = Player has not set a home.
-noKitPermission = \u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit.
-noKits = \u00a77There are no kits available yet
-noMail = You do not have any mail
-noMailSendPerm = \u00a7cYou do not have the \u00a7fessentials.mail.send\u00a7c permission.
-noMotd = \u00a7cThere is no message of the day.
-noNewMail = \u00a77You have no new mail.
-noPendingRequest = You do not have a pending request.
-noPowerTools = You have no power tools assigned.
-noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
-noRules = \u00a7cThere are no rules specified yet.
-noWarpsDefined = No warps defined
-none = none
-notAllowedToQuestion = \u00a7cYou are not authorized to use question.
-notAllowedToShout = \u00a7cYou are not authorized to shout.
-notEnoughMoney = You do not have sufficient funds.
-notRecommendedBukkit = Bukkit version is not the recommended build for Essentials.
-notSupportedYet = Not supported yet.
-now = now
-numberRequired = A number goes there, silly.
-onlyDayNight = /time only supports day/night.
-onlyPlayers = Only in-game players can use {0}.
-onlySunStorm = /weather only supports sun/storm.
-pTimeCurrent = \u00a7e{0}''s\u00a7f time is {1}.
-pTimeCurrentFixed = \u00a7e{0}''s\u00a7f time is fixed to {1}.
-pTimeNormal = \u00a7e{0}''s\u00a7f time is normal and matches the server.
-pTimeOthersPermission = \u00a7cYou are not authorized to set other players'' time.
-pTimePlayers = These players have their own time:
-pTimeReset = Player time has been reset for: \u00a7e{0}
-pTimeSet = Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1}
-pTimeSetFixed = Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1}
-parseError = Error parsing {0} on line {1}
-pendingTeleportCancelled = \u00a7cPending teleportation request cancelled.
-permissionsError = Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled.
-playerBanned = \u00a7cPlayer {0} banned {1} for {2}
-playerInJail = \u00a7cPlayer is already in jail {0}.
-playerJailed = \u00a77Player {0} jailed.
-playerJailedFor = \u00a77Player {0} jailed for {1}.
-playerKicked = \u00a7cPlayer {0} kicked {1} for {2}
-playerMuted = \u00a77You have been muted
-playerMutedFor = \u00a77You have been muted for {0}
-playerNeverOnServer = \u00a7cPlayer {0} was never on this server.
-playerNotFound = \u00a7cPlayer not found.
-playerUnmuted = \u00a77You have been unmuted
-pong = Pong!
-possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}.
-powerToolAir = Command can''t be attached to air.
-powerToolAlreadySet = Command \u00a7c{0}\u00a7f is already assigned to {1}.
-powerToolAttach = \u00a7c{0}\u00a7f command assigned to {1}.
-powerToolClearAll = All powertool commands have been cleared.
-powerToolList = {1} has the following commands: \u00a7c{0}\u00a7f.
-powerToolListEmpty = {0} has no commands assigned.
-powerToolNoSuchCommandAssigned = Command \u00a7c{0}\u00a7f has not been assigned to {1}.
-powerToolRemove = Command \u00a7c{0}\u00a7f removed from {1}.
-powerToolRemoveAll = All commands removed from {0}.
-powerToolsEnabled = All of your power tools have been enabled.
-powerToolsDisabled = All of your power tools have been disabled.
-protectionOwner = \u00a76[EssentialsProtect] Protection owner: {0}
-questionFormat = \u00a77[Question]\u00a7f {0}
-reloadAllPlugins = \u00a77Reloaded all plugins.
-repair = You have successfully repaired your: \u00a7e{0}.
-repairAlreadyFixed = \u00a77This item does not need repairing.
-repairInvalidType = \u00a7cThis item cannot be repaired.
-repairNone = There were no items that needing repairing.
-requestAccepted = \u00a77Teleport request accepted.
-requestAcceptedFrom = \u00a77{0} accepted your teleport request.
-requestDenied = \u00a77Teleport request denied.
-requestDeniedFrom = \u00a77{0} denied your teleport request.
-requestSent = \u00a77Request sent to {0}\u00a77.
-returnPlayerToJailError = Error occurred when trying to return player to jail.
-second = second
-seconds = seconds
-seenOffline = Player {0} is offline since {1}
-seenOnline = Player {0} is online since {1}
-serverFull = Server is full
-setSpawner = Changed spawner type to {0}
-sheepMalformedColor = Malformed color.
-shoutFormat = \u00a77[Shout]\u00a7f {0}
-signFormatFail = \u00a74[{0}]
-signFormatSuccess = \u00a71[{0}]
-signFormatTemplate = [{0}]
-signProtectInvalidLocation = \u00a74You are not allowed to create sign here.
-similarWarpExist = A warp with a similar name already exists.
-slimeMalformedSize = Malformed size.
-soloMob = That mob likes to be alone
-spawnSet = \u00a77Spawn location set for group {0}.
-spawned = spawned
-suicideMessage = \u00a77Goodbye Cruel World...
-suicideSuccess = \u00a77{0} took their own life
-takenFromAccount = \u00a7c{0} has been taken from your account.
-takenFromOthersAccount = \u00a7c{0} has been taken from {1} account.
-teleportAAll = \u00a77Teleporting request sent to all players...
-teleportAll = \u00a77Teleporting all players...
-teleportAtoB = \u00a77{0}\u00a77 teleported you to {1}\u00a77.
-teleportDisabled = {0} has teleportation disabled.
-teleportHereRequest = \u00a7c{0}\u00a7c has requested that you teleport to them.
-teleportNewPlayerError = Failed to teleport new player
-teleportRequest = \u00a7c{0}\u00a7c has requested to teleport to you.
-teleportTop = \u00a77Teleporting to top.
-teleportationCommencing = \u00a77Teleportation commencing...
-teleportationDisabled = \u00a77Teleportation disabled.
-teleportationEnabled = \u00a77Teleportation enabled.
-teleporting = \u00a77Teleporting...
-teleportingPortal = \u00a77Teleporting via portal.
-tempBanned = Temporarily banned from server for {0}
-tempbanExempt = \u00a77You may not tempban that player
-thunder = You {0} thunder in your world
-thunderDuration = You {0} thunder in your world for {1} seconds.
-timeBeforeHeal = Time before next heal: {0}
-timeBeforeTeleport = Time before next teleport: {0}
-timeFormat = \u00a73{0}\u00a7f or \u00a73{1}\u00a7f or \u00a73{2}\u00a7f
-timePattern = (?:([0-9]+)\\s*y[a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
-timeSet = Time set in all worlds.
-timeSetPermission = \u00a7cYou are not authorized to set the time.
-timeWorldCurrent = The current time in {0} is \u00a73{1}
-timeWorldSet = The time was set to {0} in: \u00a7c{1}
-tradeCompleted = \u00a77Trade completed.
-tradeSignEmpty = The trade sign has nothing available for you.
-tradeSignEmptyOwner = There is nothing to collect from this trade sign.
-treeFailure = \u00a7cTree generation failure. Try again on grass or dirt.
-treeSpawned = \u00a77Tree spawned.
-typeTpaccept = \u00a77To teleport, type \u00a7c/tpaccept\u00a77.
-typeTpdeny = \u00a77To deny this request, type \u00a7c/tpdeny\u00a77.
-typeWorldName = \u00a77You can also type the name of a specific world.
-unableToSpawnMob = Unable to spawn mob.
-unbannedIP = Unbanned IP address.
-unbannedPlayer = Unbanned player.
-unignorePlayer = You are not ignoring player {0} anymore.
-unknownItemId = Unknown item id: {0}
-unknownItemInList = Unknown item {0} in {1} list.
-unknownItemName = Unknown item name: {0}
-unlimitedItemPermission = \u00a7cNo permission for unlimited item {0}.
-unlimitedItems = Unlimited items:
-unmutedPlayer = Player {0} unmuted.
-upgradingFilesError = Error while upgrading the files
-userDoesNotExist = The user {0} does not exist.
-userIsAway = {0} is now AFK
-userIsNotAway = {0} is no longer AFK
-userJailed = \u00a77You have been jailed
-userUsedPortal = {0} used an existing exit portal.
-userdataMoveBackError = Failed to move userdata/{0}.tmp to userdata/{1}
-userdataMoveError = Failed to move userdata/{0} to userdata/{1}.tmp
-usingTempFolderForTesting = Using temp folder for testing:
-versionMismatch = Version mismatch! Please update {0} to the same version.
-versionMismatchAll = Version mismatch! Please update all Essentials jars to the same version.
-voiceSilenced = \u00a77Your voice has been silenced
-warpDeleteError = Problem deleting the warp file.
-warpListPermission = \u00a7cYou do not have Permission to list that warps.
-warpNotExist = That warp does not exist.
-warpSet = \u00a77Warp {0} set.
-warpUsePermission = \u00a7cYou do not have Permission to use that warp.
-warpingTo = \u00a77Warping to {0}.
-warpsCount = \u00a77There are {0} warps. Showing page {1} of {2}.
-weatherStorm = \u00a77You set the weather to storm in {0}
-weatherStormFor = \u00a77You set the weather to storm in {0} for {1} seconds
-weatherSun = \u00a77You set the weather to sun in {0}
-weatherSunFor = \u00a77You set the weather to sun in {0} for {1} seconds
-whoisGeoLocation = \u00a79 - Location: {0}
-whoisHealth = \u00a79 - Health: {0}/20
-whoisIPAddress = \u00a79 - IP Address: {0}
-whoisIs = {0} is {1}
-whoisLocation = \u00a79 - Location: ({0}, {1}, {2}, {3})
-whoisMoney = \u00a79 - Money: {0}
-whoisStatusAvailable = \u00a79 - Status: Available
-whoisStatusAway = \u00a79 - Status: \u00a7cAway\u00a7f
-worth = \u00a77Stack of {0} worth \u00a7c{1}\u00a77 ({2} item(s) at {3} each)
-worthMeta = \u00a77Stack of {0} with metadata of {1} worth \u00a7c{2}\u00a77 ({3} item(s) at {4} each)
-worthSet = Worth value set
-year = year
-years = years
-youAreHealed = \u00a77You have been healed.
-youHaveNewMail = \u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
+nickInUse=\u00a7cThat name is already in use.
+nickNamesAlpha=\u00a7cNicknames must be alphanumeric.
+nickNoMore=\u00a77You no longer have a nickname.
+nickOthersPermission=\u00a7cYou do not have permission to change the nickname of others
+nickSet=\u00a77Your nickname is now \u00a7c{0}
+noAccessCommand=\u00a7cYou do not have access to that command.
+noAccessPermission=\u00a7cYou do not have permission to access that {0}.
+noDestroyPermission=\u00a7cYou do not have permission to destroy that {0}.
+noGodWorldWarning=\u00a7cWarning! God mode in this world disabled.
+noHelpFound=\u00a7cNo matching commands.
+noHomeSet=You have not set a home.
+noHomeSetPlayer=Player has not set a home.
+noKitPermission=\u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit.
+noKits=\u00a77There are no kits available yet
+noMail=You do not have any mail
+noMotd=\u00a7cThere is no message of the day.
+noNewMail=\u00a77You have no new mail.
+noPendingRequest=You do not have a pending request.
+noPerm=\u00a7cYou do not have the \u00a7f{0}\u00a7c permission.
+noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob.
+noPlacePermission=\u00a7cYou do not have permission to place a block near that sign.
+noPowerTools=You have no power tools assigned.
+noRules=\u00a7cThere are no rules specified yet.
+noWarpsDefined=No warps defined
+none=none
+notAllowedToQuestion=\u00a7cYou are not authorized to use question.
+notAllowedToShout=\u00a7cYou are not authorized to shout.
+notEnoughExperience=You do not have enough experience.
+notEnoughMoney=You do not have sufficient funds.
+notRecommendedBukkit= * ! * Bukkit version is not the recommended build for Essentials.
+notSupportedYet=Not supported yet.
+nothingInHand = \u00a7cYou have nothing in your hand.
+now=now
+numberRequired=A number goes there, silly.
+onlyDayNight=/time only supports day/night.
+onlyPlayers=Only in-game players can use {0}.
+onlySunStorm=/weather only supports sun/storm.
+orderBalances=Ordering balances of {0} users, please wait ...
+pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}.
+pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}.
+pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server.
+pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time.
+pTimePlayers=These players have their own time:
+pTimeReset=Player time has been reset for: \u00a7e{0}
+pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1}
+pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1}
+parseError=Error parsing {0} on line {1}
+pendingTeleportCancelled=\u00a7cPending teleportation request cancelled.
+permissionsError=Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled.
+playerBanned=\u00a7cPlayer {0} banned {1} for {2}
+playerInJail=\u00a7cPlayer is already in jail {0}.
+playerJailed=\u00a77Player {0} jailed.
+playerJailedFor= \u00a77Player {0} jailed for {1}.
+playerKicked=\u00a7cPlayer {0} kicked {1} for {2}
+playerMuted=\u00a77You have been muted
+playerMutedFor=\u00a77You have been muted for {0}
+playerNeverOnServer=\u00a7cPlayer {0} was never on this server.
+playerNotFound=\u00a7cPlayer not found.
+playerUnmuted=\u00a77You have been unmuted
+pong=Pong!
+possibleWorlds=\u00a77Possible worlds are the numbers 0 through {0}.
+powerToolAir=Command can''t be attached to air.
+powerToolAlreadySet=Command \u00a7c{0}\u00a7f is already assigned to {1}.
+powerToolAttach=\u00a7c{0}\u00a7f command assigned to {1}.
+powerToolClearAll=All powertool commands have been cleared.
+powerToolList={1} has the following commands: \u00a7c{0}\u00a7f.
+powerToolListEmpty={0} has no commands assigned.
+powerToolNoSuchCommandAssigned=Command \u00a7c{0}\u00a7f has not been assigned to {1}.
+powerToolRemove=Command \u00a7c{0}\u00a7f removed from {1}.
+powerToolRemoveAll=All commands removed from {0}.
+powerToolsDisabled=All of your power tools have been disabled.
+powerToolsEnabled=All of your power tools have been enabled.
+protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0}
+questionFormat=\u00a77[Question]\u00a7f {0}
+readNextPage=Type /{0} {1} to read the next page
+reloadAllPlugins=\u00a77Reloaded all plugins.
+removed=\u00a77Removed {0} entities.
+repair=You have successfully repaired your: \u00a7e{0}.
+repairAlreadyFixed=\u00a77This item does not need repairing.
+repairEnchanted=\u00a77You are not allowed to repair enchanted items.
+repairInvalidType=\u00a7cThis item cannot be repaired.
+repairNone=There were no items that needing repairing.
+requestAccepted=\u00a77Teleport request accepted.
+requestAcceptedFrom=\u00a77{0} accepted your teleport request.
+requestDenied=\u00a77Teleport request denied.
+requestDeniedFrom=\u00a77{0} denied your teleport request.
+requestSent=\u00a77Request sent to {0}\u00a77.
+requiredBukkit= * ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
+returnPlayerToJailError=Error occurred when trying to return player to jail.
+second=second
+seconds=seconds
+seenOffline=Player {0} is offline since {1}
+seenOnline=Player {0} is online since {1}
+serverFull=Server is full
+setSpawner=Changed spawner type to {0}
+sheepMalformedColor=Malformed color.
+shoutFormat=\u00a77[Shout]\u00a7f {0}
+signFormatFail=\u00a74[{0}]
+signFormatSuccess=\u00a71[{0}]
+signFormatTemplate=[{0}]
+signProtectInvalidLocation=\u00a74You are not allowed to create sign here.
+similarWarpExist=A warp with a similar name already exists.
+slimeMalformedSize=Malformed size.
+soloMob=That mob likes to be alone
+spawnSet=\u00a77Spawn location set for group {0}.
+spawned=spawned
+suicideMessage=\u00a77Goodbye Cruel World...
+suicideSuccess= \u00a77{0} took their own life
+survival=survival
+takenFromAccount=\u00a7c{0} has been taken from your account.
+takenFromOthersAccount=\u00a7c{0} has been taken from {1} account.
+teleportAAll=\u00a77Teleporting request sent to all players...
+teleportAll=\u00a77Teleporting all players...
+teleportAtoB=\u00a77{0}\u00a77 teleported you to {1}\u00a77.
+teleportDisabled={0} has teleportation disabled.
+teleportHereRequest=\u00a7c{0}\u00a7c has requested that you teleport to them.
+teleportNewPlayerError=Failed to teleport new player
+teleportRequest=\u00a7c{0}\u00a7c has requested to teleport to you.
+teleportTop=\u00a77Teleporting to top.
+teleportationCommencing=\u00a77Teleportation commencing...
+teleportationDisabled=\u00a77Teleportation disabled.
+teleportationEnabled=\u00a77Teleportation enabled.
+teleporting=\u00a77Teleporting...
+teleportingPortal=\u00a77Teleporting via portal.
+tempBanned=Temporarily banned from server for {0}
+tempbanExempt=\u00a77You may not tempban that player
+thunder= You {0} thunder in your world
+thunderDuration=You {0} thunder in your world for {1} seconds.
+timeBeforeHeal=Time before next heal: {0}
+timeBeforeTeleport=Time before next teleport: {0}
+timeFormat=\u00a73{0}\u00a7f or \u00a73{1}\u00a7f or \u00a73{2}\u00a7f
+timePattern=(?:([0-9]+)\\s*y[a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
+timeSet=Time set in all worlds.
+timeSetPermission=\u00a7cYou are not authorized to set the time.
+timeWorldCurrent=The current time in {0} is \u00a73{1}
+timeWorldSet=The time was set to {0} in: \u00a7c{1}
+tradeCompleted=\u00a77Trade completed.
+tradeSignEmpty=The trade sign has nothing available for you.
+tradeSignEmptyOwner=There is nothing to collect from this trade sign.
+treeFailure=\u00a7cTree generation failure. Try again on grass or dirt.
+treeSpawned=\u00a77Tree spawned.
+true=true
+typeTpaccept=\u00a77To teleport, type \u00a7c/tpaccept\u00a77.
+typeTpdeny=\u00a77To deny this request, type \u00a7c/tpdeny\u00a77.
+typeWorldName=\u00a77You can also type the name of a specific world.
+unableToSpawnMob=Unable to spawn mob.
+unbannedIP=Unbanned IP address.
+unbannedPlayer=Unbanned player.
+unignorePlayer=You are not ignoring player {0} anymore.
+unknownItemId=Unknown item id: {0}
+unknownItemInList=Unknown item {0} in {1} list.
+unknownItemName=Unknown item name: {0}
+unlimitedItemPermission=\u00a7cNo permission for unlimited item {0}.
+unlimitedItems=Unlimited items:
+unmutedPlayer=Player {0} unmuted.
+upgradingFilesError=Error while upgrading the files
+userDoesNotExist=The user {0} does not exist.
+userIsAway={0} is now AFK
+userIsNotAway={0} is no longer AFK
+userJailed=\u00a77You have been jailed
+userUsedPortal={0} used an existing exit portal.
+userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1}
+userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp
+usingTempFolderForTesting=Using temp folder for testing:
+versionMismatch=Version mismatch! Please update {0} to the same version.
+versionMismatchAll=Version mismatch! Please update all Essentials jars to the same version.
+voiceSilenced=\u00a77Your voice has been silenced
+warpDeleteError=Problem deleting the warp file.
+warpListPermission=\u00a7cYou do not have Permission to list warps.
+warpNotExist=That warp does not exist.
+warpSet=\u00a77Warp {0} set.
+warpUsePermission=\u00a7cYou do not have Permission to use that warp.
+warpingTo=\u00a77Warping to {0}.
+warps=Warps: {0}
+warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}.
+weatherStorm=\u00a77You set the weather to storm in {0}
+weatherStormFor=\u00a77You set the weather to storm in {0} for {1} seconds
+weatherSun=\u00a77You set the weather to sun in {0}
+weatherSunFor=\u00a77You set the weather to sun in {0} for {1} seconds
+whoisBanned=\u00a79 - Banned: {0}
+whoisGamemode=\u00a79 - Gamemode: {0}
+whoisGeoLocation=\u00a79 - Location: {0}
+whoisGod=\u00a79 - God mode: {0}
+whoisHealth=\u00a79 - Health: {0}/20
+whoisIPAddress=\u00a79 - IP Address: {0}
+whoisIs={0} is {1}
+whoisLocation=\u00a79 - Location: ({0}, {1}, {2}, {3})
+whoisMoney=\u00a79 - Money: {0}
+whoisOP=\u00a79 - OP: {0}
+whoisStatusAvailable=\u00a79 - Status: Available
+whoisStatusAway=\u00a79 - Status: \u00a7cAway\u00a7f
+worth=\u00a77Stack of {0} worth \u00a7c{1}\u00a77 ({2} item(s) at {3} each)
+worthMeta=\u00a77Stack of {0} with metadata of {1} worth \u00a7c{2}\u00a77 ({3} item(s) at {4} each)
+worthSet=Worth value set
+year=year
+years=years
+youAreHealed=\u00a77You have been healed.
+youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
+requestTimedOut=\u00a7cTeleport request has timed out
+teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties
index 960fd8321..ea2007b17 100644
--- a/Essentials/src/messages_da.properties
+++ b/Essentials/src/messages_da.properties
@@ -1,370 +1,406 @@
#version: TeamCity
# Single quotes have to be doubled: ''
# Translations start here
-# by: papand13, papand13@gmail.com
-action = * {0} {1}
-addedToAccount = \u00a7a{0} er tilf\u00f8jet til din konto.
-addedToOthersAccount = \u00a7a{0} er blevet tilf\u00f8jet til {1} konto.
-alertBroke = \u00f8delagde:
-alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} ved: {3}
-alertPlaced = placerede:
-alertUsed = brugte:
-autoAfkKickReason=You have been kicked for idling more than {0} minutes.
-backAfterDeath = \u00a77Brug /back kommandoen for at retunere til dit d\u00f8ds punkt.
-backUsageMsg = \u00a77Returnere til tidligere placering.
-backupFinished = Backup sluttede
-backupStarted = Backup startede
-balance = \u00a77Balance: {0}
-balanceTop = \u00a77 Top {0} saldi
-banExempt = \u00a7cDu kan ikke forbyde den p\u00e5g\u00e6ldende spiller.
-banIpAddress = \u00a77Bannede IP addresse
-bannedIpsFileError = Fejl i l\u00e6sning af banned-ips.txt
-bannedIpsFileNotFound = banned-ips.txt ikke fundet
-bannedPlayersFileError = Fejl i l\u00e6sning af banned-players.txt
-bannedPlayersFileNotFound = banned-players.txt ikke fundet
-bigTreeFailure = \u00a7cStort tr\u00e6 genererings fejl. Pr\u00f8v igen p\u00e5 gr\u00e6s eller jord.
-bigTreeSuccess = \u00a77Stort tr\u00e6 fremkaldt.
-broadcast = [\u00a7cMeddelelse\u00a7f]\u00a7a {0}
-buildAlert = \u00a7cDu er ikke tilladt at bygge!
-bukkitFormatChanged = Bukkit version format \u00e6ndret. Version er ikke checket.
-burnMsg = \u00a77Du satte ild til {0} for {1} sekunder.
-canTalkAgain = \u00a77Du kan snakke igen
-cantFindGeoIpDB = Kan ikke finde GeoIP database!
-cantReadGeoIpDB = Fejl ved l\u00e6sning af GeoIP database!
-cantSpawnItem = \u00a7cDu er ikke tilladt at spawne elementet {0}
-commandFailed = Kommando {0} fejlede:
-commandHelpFailedForPlugin=Fejl ved at f\u00e5 hj\u00e6lp til: {0}
-commandNotLoaded = \u00a7cCommand {0} er ikke indl\u00e6st korrekt.
-compassBearing = \u00a77B\u00e6rer: {0} ({1} grader).
-configFileMoveError = Kunne ikke flytte config.yml til backup placering.
-configFileRenameError = Kunne ikke omd\u00f8be temp fil til config.yml
-connectedPlayers = Tilsluttede spillere:
-connectionFailed = Failed ved \u00e5bning af forbindelse.
-cooldownWithMessage = \u00a7cNedk\u00f8lning: {0}
-corruptNodeInConfig = \u00a74Notice: Din konfigurations fil har en korrupt {0} node.
-couldNotFindTemplate = Kunne ikke finde skabelon {0}
-creatingConfigFromTemplate = Opretter config fra skabelon: {0}
-creatingEmptyConfig = Opretter tom config: {0}
-day = dag
-days = dage
-defaultBanReason = Ban hammeren har talt!
-deleteFileError = Kunne ikke slette fil: {0}
-deleteHome = \u00a77Home {0} has been removed.
-deleteJail = \u00a77F\u00e6ngsel {0} er fjernet.
-deleteWarp = \u00a77Warp {0} er fjernet.
-deniedAccessCommand = {0} var n\u00e6gtet adgang til kommando.
-dependancyDownloaded = [Essentials] Dependancy {0} downloaded successfully.
-dependancyException = [Essentials] An error occured when trying to download a dependacy
-dependancyNotFound = [Essentials] A required dependancy was not found, downloading now.
-depth = \u00a77Du er ved havoverfladen.
-depthAboveSea = \u00a77Du er {0} blok(ke) over havoverfladen.
-depthBelowSea = \u00a77Du er {0} blok(ke) under havoverfladen.
-destinationNotSet = Destination er ikke sat
-disableUnlimited = \u00a77Deaktiverede ubergr\u00e6nset placering af {0} for {1}.
-disabled = deaktiveret
-dontMoveMessage = \u00a77Teleportering vil begynde om {0}. Bev\u00e6g dig ikke.
-downloadingGeoIp = Downloader GeoIP database ... det her kan tage et stykke tid (land: 0.6 MB, by: 20MB)
-duplicatedUserdata = Duplikerede userdata: {0} og {1}
-enableUnlimited = \u00a77Giver ubegr\u00e6nset m\u00e6ngde af {0} til {1}.
-enabled = aktiveret
-errorCallingCommand = Fejl ved opkald af kommando /{0}
-errorWithMessage = \u00a7cFejl: {0}
-essentialsReload = \u00a77Essentials Genindl\u00e6st {0}
-extinguish = \u00a77Du slukkede dig selv.
-extinguishOthers = \u00a77Du slukkede {0}.
-failedToCloseConfig = Fejlede i at lukke config {0}
-failedToCreateConfig = Fejl i oprettelse af config {0}
-failedToWriteConfig = Fejlede i at skrive config {0}
-fileRenameError = Resterende fil {0} fejlede
-foreverAlone = \u00a7cDu har ingen du kan svare.
-freedMemory = Befriede {0} MB.
-gcchunks = stykker,
-gcentities = enheder
-gcfree = Free memory: {0} MB
-gcmax = Maximum memory: {0} MB
-gctotal = Allocated memory: {0} MB
-geoIpUrlEmpty = GeoIP download url er tom.
-geoIpUrlInvalid = GeoIP download url er ugyldig.
-geoipJoinFormat = Spiller {0} kommer fra {1}
-godDisabledFor = deaktiveret for {0}
-godEnabledFor = aktiveret for {0}
-godMode = \u00a77Gud tilstand {0}.
-haveBeenReleased = \u00a77Du er blevet l\u00f8sladt
-heal = \u00a77Du er blevet helbredt.
-healOther = \u00a77Helbredt {0}.
-helpConsole = For at se hj\u00e6lp fra konsolen, skriv ?.
-helpOp = \u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1}
-helpPages = Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f:
-holeInFloor = Hul i gulv
-homeSet = \u00a77Hjem sat.
-homeSetToBed = \u00a77Dit hjem er nu sat til denne seng.
-homes = Homes: {0}
-hour = time
-hours = timer
-ignorePlayer = Du ignorere spiller {0} fra nu af.
-illegalDate = Ilegal dato format.
-infoChapter = V\u00e6lg kapitel:
-infoChapterPages = Kapitel {0}, side \u00a7c{1}\u00a7f af \u00a7c{2}\u00a7f:
-infoFileDoesNotExist = Fil info.txt eksisterer ikke. Laver en for dig.
-infoPages = Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f:
-infoUnknownChapter = Ukendt kapitel.
-invBigger = Den anden brugers inventory er st\u00f8rre end din.
-invRestored = Din inventory er blevet genoprettet.
-invSee = Du ser inventoryen af {0}.
-invSeeHelp = Brug /invsee for at genoprette din inventory.
-invalidCharge = \u00a7cUgyldig opladning.
-invalidMob = Ugyldig mob type.
-invalidServer = Ugyldig server!
-invalidSignLine = Linje {0} p\u00e5 skilt er ugyldig.
-invalidWorld = \u00a7cUgyldig verden.
-inventoryCleared = \u00a77Inventory ryddet.
-inventoryClearedOthers = \u00a77Inventory af \u00a7c{0}\u00a77 ryddet.
-is = er
-itemCannotBeSold = Det element kan ikke s\u00e6lges til serveren.
-itemMustBeStacked = Element skal handles i stakke. En m\u00e6ngde af 2s ville v\u00e6re to stakke, osv.
-itemNotEnough1 = \u00a7cDu har ikke nok af det element til at s\u00e6lge.
-itemNotEnough2 = \u00a77Hvis du ville have solgt alle dine elementer af den type, brug /sell elementnavn
-itemNotEnough3 = \u00a77/sell elementnavn -1 vil s\u00e6lge alle p\u00e5 n\u00e6r et element, osv.
-itemSellAir = Fors\u00f8gte du virkelig at s\u00e6lge luft? Kom et element i din h\u00e5nd.
-itemSold = \u00a77Solgte for \u00a7c{0} \u00a77({1} {2} elementer for {3} hver)
-itemSoldConsole = {0} solgte {1} for \u00a77{2} \u00a77({3} elementer for {4} hver)
-itemSpawn = \u00a77Giver {0} af {1}
-itemsCsvNotLoaded = Kunne ikke indl\u00e6se items.csv.
-jailAlreadyIncarcerated = \u00a7cPerson is already in jail: {0}
-jailMessage = \u00a7cBryd reglerne, og tag din straf.
-jailNotExist = Det f\u00e6ngsel eksisterer ikke.
-jailReleased = \u00a77Player \u00a7e{0}\u00a77 unjailed.
-jailReleasedPlayerNotify = \u00a77You have been released!
-jailSentenceExtended = Jail time extend to: {0)
-jailSet = \u00a77F\u00e6ngsel {0} er blevet sat
-jumpError = Det ville skade din computer''s hjerne.
-kickDefault = Kicket fra serveren
-kickExempt = \u00a77Du kan ikke sparke denne spiller.
-kill = \u00a77Dr\u00e6bte {0}.
-kitError = \u00a7cDer er ikke nogen gyldige pakker.
-kitError2 = \u00a7cDen pakke eksisterer ikke eller er forkert defineret.
-kitErrorHelp = \u00a7cM\u00e5ske mangler et element en m\u00e6ngde i konfigurationen?
-kitGive = \u00a77Giver pakke {0}.
-kitInvFull = \u00a7cDin inventory var fuld, placere pakken p\u00e5 gulvet
-kitTimed = \u00a7cDu kan ikke den pakke igen f\u00f8r om {0}.
-kits = \u00a77Pakker: {0}
-lightningSmited = \u00a77Du er blevet sl\u00e5et
-lightningUse = \u00a77Sl\u00e5r {0}
-loadWarpError = Kunne ikke indl\u00e6se warp {0}
-loadinfo = Indl\u00e6ste {0} byg {1} af {2}
-localFormat = Lokal: <{0}> {1}
-mailClear = \u00a7cFor at markere din post som l\u00e6st, skriv /mail clear
-mailCleared = \u00a77Post ryddet!
-mailSent = \u00a77Post sendt!
-markMailAsRead = \u00a7cTo marker din post som l\u00e6st, skriv /post ryd
-markedAsAway = \u00a77Du er nu markeret som v\u00e6k.
-markedAsNotAway = \u00a77Du er ikke l\u00e6ngere markeret som v\u00e6k.
-maxHomes=You cannot set more than {0} homes.
-mayNotJail = \u00a7cDu m\u00e5 ikke f\u00e6ngsle den person
-me = mig
-minute = minut
-minutes = minutter
-missingItems = Du har ikke {0}x {1}.
-missingPrefixSuffix = Mangler et pr\u00e6fiks eller suffiks for {0}
-mobSpawnError = Fejl ved \u00e6ndring af mob fremkalder.
-mobSpawnLimit = Mob m\u00e6ngde begr\u00e6nset til server gr\u00e6nse
-mobSpawnTarget = M\u00e5l blok skal v\u00e6re en mob fremkalder.
-moneyRecievedFrom = \u00a7a{0} er modtaget fra {1}
-moneySentTo = \u00a7a{0} er sendt til {1}
-moneyTaken = {0} taget fra din bank konto.
-month = m\u00e5ned
-months = m\u00e5neder
-moreThanZero = M\u00e6ngder skal v\u00e6re st\u00f8rre end 0.
-msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
-muteExempt = \u00a7cYou may not mute that player.
-mutedPlayer = Spiller {0} d\u00e6mpet.
-mutedPlayerFor = Spiller {0} d\u00e6mpet for {1}.
-mutedUserSpeaks = {0} pr\u00f8vede at snakke, men er muted.
-needTpohere = Du skal have adgang til /tpohere for at teleporter andre spillere.
-negativeBalanceError = Brugeren er ikke tilladt at have en negativ saldo.
-nickChanged = Kaldenavn \u00e6ndret.
-nickDisplayName=\u00a77You have to enable change-displayname in Essentials config.
-nickInUse = \u00a7cDet navn er allerede i brug.
-nickNamesAlpha = \u00a7cKaldenavne skal v\u00e6re alfanumeriske.
-nickNoMore = \u00a7Du har ikke l\u00e6ngere et kaldenavn.
-nickOthersPermission = \u00a7cDu har ikke tilladelse til at \u00e6ndre andres kaldenavn
-nickSet = \u00a77Dit kaldenavn er nu \u00a7c{0}
-noAccessCommand = \u00a7cDu har ikke adgang til den kommando.
-noAccessPermission = \u00a7cDu har ikke tilladelse til at f\u00e5 adgang til det {0}.
-noDestroyPermission = \u00a7cDu har ikke tilladelse til at \u00f8del\u00e6gge det {0}.
-noHelpFound = \u00a7cNo matching commands.
-noHomeSet = Du har sat et nyt hjem.
-noHomeSetPlayer = Spiller har ikke sat et hjem.
-noKitPermission = \u00a7cDu har brug for \u00a7c{0}\u00a7c tilladelsen for at bruge den pakke.
-noKits = \u00a77Der er ikke nogen pakker tilg\u00e6ngelig endnu
-noMail = Du har ikke noget post
-noMailSendPerm = \u00a7cDu har ikke \u00a7fessentials.mail.send\u00a7c tilladelsen.
-noMotd = \u00a7cDer er ikke nogen besked for dagen.
-noNewMail = \u00a77Du har ingen ny post.
-noPendingRequest = Du har ikke en ventende anmodning.
-noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
-noPowerTools= You have no power tools assigned.
-noRules = \u00a7cDer er ingen regler fastsat endnu.
-noWarpsDefined = Ingen warps defineret
-none = ingen
-notAllowedToQuestion = \u00a7cDu er ikke autoriseret til at bruge et sp\u00f8rgsm\u00e5l.
-notAllowedToShout = \u00a7cDu er ikke autoriseret til at r\u00e5be.
-notEnoughMoney = Du har ikke tilstr\u00e6kkelig penge.
-notRecommendedBukkit = Bukkit version er ikke den anbefalede byg for Essentials.
-notSupportedYet = Ikke underst\u00f8ttet endnu.
-now = nu
-numberRequired = Der skal v\u00e6re et nummer, fjolle.
-onlyDayNight = /time underst\u00f8tter kun day/night.
-onlyPlayers = Kun in-game spillere kan bruge {0}.
-onlySunStorm = /weather only supports sun/storm.
-pTimeCurrent = \u00a7e{0}''s\u00a7f time is {1}.
-pTimeCurrentFixed = \u00a7e{0}''s\u00a7f time is fixed to {1}.
-pTimeNormal = \u00a7e{0}''s\u00a7f time is normal and matches the server.
-pTimeOthersPermission = \u00a7cYou are not authorized to set other players'' time.
-pTimePlayers = These players have their own time:
-pTimeReset = Player time has been reset for: \u00a7e{0}
-pTimeSet = Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1}
-pTimeSetFixed = Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1}
-parseError = Fejl ved parsing {0} p\u00e5 linje {1}
-pendingTeleportCancelled = \u00a7cVentende teleportations anmodning aflyst.
-permissionsError = Mangler Permissions/GroupManager; chat pr\u00e6fikser/suffikser vil v\u00e6re sl\u00e5et fra.
-playerBanned = \u00a7cPlayer {0} banned {1} for {2}
-playerInJail = \u00a7cSpiller er allerede i f\u00e6ngsel {0}.
-playerJailed = \u00a77Spiller {0} f\u00e6ngslet.
-playerJailedFor = \u00a77Spiller {0} f\u00e6ngslet for {1}.
-playerKicked = \u00a7cPlayer {0} kicked {1} for {2}
-playerMuted = \u00a77You have been muted
-playerMutedFor = \u00a77You have been muted for {0}
-playerNeverOnServer = \u00a7cSpiller {0} var aldrig p\u00e5 denne server.
-playerNotFound = \u00a7cSpiller ikke fundet.
-playerUnmuted = \u00a77You have been unmuted
-pong = Pong!
-possibleWorlds = \u00a77Mulige verdener er numrene 0 igennem {0}.
-powerToolAir = Kommando kan ikke blive tildelt luft.
-powerToolAlreadySet = Command \u00a7c{0}\u00a7f is already assigned to {1}.
-powerToolAttach = \u00a7c{0}\u00a7f command assigned to {1}.
-powerToolClearAll = All powertool commands have been cleared.
-powerToolList = {1} has the following commands: \u00a7c{0}\u00a7f.
-powerToolListEmpty = {0} has no commands assigned.
-powerToolNoSuchCommandAssigned = Command \u00a7c{0}\u00a7f has not been assigned to {1}.
-powerToolRemove = Command \u00a7c{0}\u00a7f removed from {1}.
-powerToolRemoveAll = All commands removed from {0}.
-powerToolsEnabled= All of your power tools have been enabled.
-powerToolsDisabled= All of your power tools have been disabled.
-protectionOwner = \u00a76[EssentialsProtect] Beskyttelses ejer: {0}
-questionFormat = \u00a77[Sp\u00f8rgsm\u00e5l]\u00a7f {0}
-reloadAllPlugins = \u00a77Genindl\u00e6ste alle tilf\u00f8jelser.
-repair = You have successfully repaired your: \u00a7e{0}.
-repairAlreadyFixed = \u00a77This item does not need repairing.
-repairInvalidType = \u00a7cThis item cannot be repaired.
-repairNone = There were no items that needing repairing.
-requestAccepted = \u00a77Teleporterings anmodning n\u00e6gtet.
-requestAcceptedFrom = \u00a77{0} accepted your teleport request.
-requestDenied = \u00a77Teleporterings anmodning n\u00e6gtet.
-requestDeniedFrom = \u00a77{0} denied your teleport request.
-requestSent = \u00a77Anmodning sendt til {0}\u00a77.
-returnPlayerToJailError = En fejl opstod ved fors\u00f8g p\u00e5 at returnere spiller til f\u00e6ngsel.
-second = sekunde
-seconds = sekunder
-seenOffline = Spiller {0} er offline siden {1}
-seenOnline = Spiller {0} er online siden {1}
-serverFull = Server er fuld
-setSpawner = Changed spawner type to {0}
-sheepMalformedColor = Misdannet farve.
-shoutFormat = \u00a77[R\u00e5b]\u00a7f {0}
-signFormatFail = \u00a74[{0}]
-signFormatSuccess = \u00a71[{0}]
-signFormatTemplate = [{0}]
-signProtectInvalidLocation = \u00a74You are not allowed to create sign here.
-similarWarpExist = En warp med lignende tekst eksisterer allerede.
-slimeMalformedSize = Misdannet st\u00f8rrelse.
-soloMob = Den mob kan godt lide at v\u00e6re alene
-spawnSet = \u00a77Spawn placering sat for gruppe {0}.
-spawned = spawnet
-suicideMessage = \u00a77Farvel grusomme verden...
-suicideSuccess = \u00a77{0} tog sit eget liv
-takenFromAccount = \u00a7c{0} er taget fra din konto.
-takenFromOthersAccount = \u00a7c{0} er blevet taget fra {1} konto.
-teleportAAll = \u00a77Teleporting request sent to all players...
-teleportAll = \u00a77Teleportere alle spillere...
-teleportAtoB = \u00a77{0}\u00a77 teleporterede dig til {1}\u00a77.
-teleportDisabled = {0} har teleportation deaktiveret.
-teleportHereRequest = \u00a7c{0}\u00a7c har anmodet at du teleportere dig til ham/hende.
-teleportNewPlayerError = Failed ved teleportering af ny spiller
-teleportRequest = \u00a7c{0}\u00a7c har anmodet om at teleportere til dig.
-teleportTop = \u00a77Teleportere til toppen.
-teleportationCommencing = \u00a77Teleportering begynder...
-teleportationDisabled = \u00a77Teleportering deaktiveret.
-teleportationEnabled = \u00a77Teleportering aktiveret.
-teleporting = \u00a77Teleportere...
-teleportingPortal = \u00a77Teleporterede via portal.
-tempBanned = Midlertidigt bannet fra serveren for {0}
-tempbanExempt = \u00a77You may not tempban that player
-thunder = Du {0} torden i din verden
-thunderDuration = Du {0} torden i din verden i {1} sekunder.
-timeBeforeHeal = Tid inden n\u00e6ste helbredelse: {0}
-timeBeforeTeleport = Tid f\u00f8r n\u00e6ste teleportering: {0}
-timeFormat = \u00a73{0}\u00a7f or \u00a73{1}\u00a7f or \u00a73{2}\u00a7f
-timePattern = (?:([0-9]+)\\s*[a\u00e5y][a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[wu][a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[ht][a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
-timeSet = Tid er sat i alle verdener.
-timeSetPermission = \u00a7cYou are not authorized to set the time.
-timeWorldCurrent = The current time in {0} is \u00a73{1}
-timeWorldSet = The time was set to {0} in: \u00a7c{1}
-tradeCompleted = \u00a77Forhandling fuldf\u00f8rt.
-tradeSignEmpty = Forhandlings skiltet har ikke nok forsyning tilbage.
-tradeSignEmptyOwner = There is nothing to collect from this trade sign.
-treeFailure = \u00a7cTr\u00e6 genererings fejl. Pr\u00f8v igen p\u00e5 gr\u00e6s eller jord.
-treeSpawned = \u00a77Tr\u00e6 fremkaldt.
-typeTpaccept = \u00a77For at teleportere, skriv \u00a7c/tpaccept\u00a77.
-typeTpdeny = \u00a77For at n\u00e6gte denne anmodning, skriv \u00a7c/tpdeny\u00a77.
-typeWorldName = \u00a77Du kan ogs\u00e5 skrive nanvet p\u00e5 en specifik verden.
-unableToSpawnMob = Kunne ikke fremkalde mob.
-unbannedIP = Tilgav IP addresse, ikke l\u00e6ngere bannet.
-unbannedPlayer = Tilgav spiller, ikke l\u00e6ngere bannet.
-unignorePlayer = Du ignorere ikke spiller {0} mere.
-unknownItemId = Ukendt element id: {0}
-unknownItemInList = Ukendt element {0} i {1} liste.
-unknownItemName = Ukendt element navn: {0}
-unlimitedItemPermission = \u00a7cIngen tilladelse til ubegr\u00e6nset element {0}.
-unlimitedItems = Uendelige elementer:
-unmutedPlayer = Spiller {0} ikke-d\u00e6mpet.
-upgradingFilesError = Fejl under opgradering af filer
-userDoesNotExist = Brugeren {0} eksisterer ikke.
-userIsAway = {0} er nu AFK
-userIsNotAway = {0} er ikke l\u00e6ngere AFK
-userJailed = \u00a77Du er blevet f\u00e6ngslet
-userUsedPortal = {0} brugte en eksisterende udgangs portal.
-userdataMoveBackError = Kunne ikke flytte userdata/{0}.tmp til userdata/{1}
-userdataMoveError = Kunne ikke flytte userdata/{0} til userdata/{1}.tmp
-usingTempFolderForTesting = Bruger temp mappe for testing:
-versionMismatch = Version matcher ikke! Venligst opdater {0} til den nyeste version.
-versionMismatchAll = Version matcher ikke! Venligst opdater alle Essentials jar''er til samme version.
-voiceSilenced = \u00a77Din stemme er blevet d\u00e6mpet
-warpDeleteError = Problem ved sletning af warp filen.
-warpListPermission = \u00a7cDu har ikke tilladelse til at liste de warps.
-warpNotExist = Den warp eksisterer ikke.
-warpSet = \u00a77Warp {0} sat.
-warpUsePermission = \u00a7cDu har ikke tilladelse til at benytte den warp.
-warpingTo = \u00a77Warper til {0}.
-warpsCount = \u00a77There are {0} warps. Showing page {1} of {2}.
-weatherStorm = \u00a77Du har sat vejret til storm i {0}
-weatherStormFor = \u00a77Du har sat vejret til storm i {0} i {1} sekunder
-weatherSun = \u00a77Du har sat vejret til sol i {0}
-weatherSunFor = \u00a77Du har sat vejret til sol i {0} i {1} sekunder
-whoisGeoLocation = \u00a79 - Placering: {0}
-whoisHealth = \u00a79 - Helbred: {0}/20
-whoisIPAddress = \u00a79 - IP Addresse: {0}
-whoisIs = {0} er {1}
-whoisLocation = \u00a79 - Placering: ({0}, {1}, {2}, {3})
-whoisMoney = \u00a79 - Penge: {0}
-whoisStatusAvailable = \u00a79 - Status: Tilg\u00e6ngelig
-whoisStatusAway = \u00a79 - Status: \u00a7cV\u00e6k\u00a7f
-worth = \u00a77Stak af {0} v\u00e6rd \u00a7c{1}\u00a77 ({2} element(er) for {3} hver)
-worthMeta = \u00a77Stak af {0} med metadata af {1} v\u00e6rd \u00a7c{2}\u00a77 ({3} element(er) for {4} hver)
-worthSet = V\u00e6rd v\u00e6rdi sat
-year = \u00e5r
-years = \u00e5r
-youAreHealed = \u00a77Du er blevet helbredt.
-youHaveNewMail = \u00a7cDu har {0} beskeder!\u00a7f Type \u00a77/post l\u00e6s\u00a7f for at se din post.
-
-
+# by: Dysp, dysperen@gmail.com
+action=* {0} {1}
+addedToAccount=\u00a7a{0} er blevet tilf\u00f8jet til din konto.
+addedToOthersAccount=\u00a7a{0} er blevet tilf\u00f8jet til {1} konto.
+alertBroke=\u00f8delagde:
+alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} ved: {3}
+alertPlaced=placerede:
+alertUsed=brugte:
+autoAfkKickReason=Du er blevet kicked for at idle mere end {0} minutter.
+backAfterDeath=\u00a77Brug /back kommandoen for at teleportere til dit d\u00f8dspunkt.
+backUsageMsg=\u00a77Teleporterer til tidligere placering.
+backupFinished=Backup sluttet
+backupStarted=Backup startet
+balance=\u00a77Saldo: {0}
+balanceTop=\u00a77 Top saldoer ({0})
+banExempt=\u00a7cDu kan ikke banne den p\u00e5g\u00e6ldende spiller.
+banIpAddress=\u00a77Bannede IP addresse
+bannedIpsFileError=Fejl i afl\u00e6sning af banned-ips.txt
+bannedIpsFileNotFound=banned-ips.txt ikke fundet
+bannedPlayersFileError=Fejl i afl\u00e6sning af banned-players.txt
+bannedPlayersFileNotFound=banned-players.txt ikke fundet
+bigTreeFailure=\u00a7cFejl i generering af stort tr\u00e6. Pr\u00f8v igen p\u00e5 gr\u00e6s eller jord.
+bigTreeSuccess= \u00a77Stort tr\u00e6 bygget.
+blockList=Essentials relayed the following commands to another plugin:
+broadcast=[\u00a7cMeddelelse\u00a7f]\u00a7a {0}
+buildAlert=\u00a7cDu har ikke tilladelse til at bygge
+bukkitFormatChanged=Bukkit versionsformat er \u00e6ndret. Versionen er ikke checket.
+burnMsg=\u00a77Du satte ild til {0} i {1} sekunder.
+canTalkAgain=\u00a77Du kan nu snakke igen.
+cantFindGeoIpDB=Kan ikke finde GeoIP database!
+cantReadGeoIpDB=Fejl ved afl\u00e6sning af GeoIP database!
+cantSpawnItem=\u00a7cDu har ikke tilladelse til at skabe tingen.{0}
+commandFailed=Kommandoen {0} fejlede:
+commandHelpFailedForPlugin=Fejl ved hentning af hj\u00e6lp til: {0}
+commandNotLoaded=\u00a7cKommando {0} er ikke indl\u00e6st korrekt.
+compassBearing=\u00a77B\u00e6rer: {0} ({1} grader). (Oversat korrekt?)
+configFileMoveError=Kunne ikke flytte config.yml til backup placering.
+configFileRenameError=Kunne ikke omd\u00f8be temp fil til config.yml
+connectedPlayers=Tilsluttede spillere:
+connectionFailed=Kunne ikke \u00e5bne forbindelse.
+cooldownWithMessage=\u00a7cCooldown: {0}
+corruptNodeInConfig=\u00a74Notits: Din konfigurationsfil har en korrupt {0} linje.
+couldNotFindTemplate=Kunne ikke finde skabelon {0}
+creatingConfigFromTemplate=Opretter config fra skabelon: {0}
+creatingEmptyConfig=Opretter tom config: {0}
+creative=creative
+day=dag
+days=dage
+defaultBanReason=Banhammeren har talt!
+deleteFileError=Kunne ikke slette fil: {0}
+deleteHome=\u00a77Home {0} er blevet fjernet.
+deleteJail=\u00a77F\u00e6ngsel {0} er fjernet.
+deleteWarp=\u00a77Warp {0} er fjernet.
+deniedAccessCommand={0} blev n\u00e6gtet adgang til kommandoen.
+dependancyDownloaded=[Essentials] Dependancy {0} downloaded successfully.
+dependancyException=[Essentials] En fejl opstod ved fors\u00c3\u00b8g p\u00c3\u00a5 at downloade en N\u00c3\u0098DVENDIGHED?!
+dependancyNotFound=[Essentials] En p\u00c3\u00a5kr\u00c3\u00a6vet N\u00c3\u0098DVENDIGHED!? blev ikke fundet; downloader nu.
+depth=\u00a77Du er ved havoverfladen.
+depthAboveSea=\u00a77Du er {0} blok(ke) over havets overflade.
+depthBelowSea=\u00a77Du er {0} blok(ke) under havets overflade.
+destinationNotSet=Destination ikke sat
+disableUnlimited=\u00a77Deaktiverede ubergr\u00e6nset placering af {0} for {1}.
+disabled=deaktiveret
+disabledToSpawnMob=Skabelse af denne mob er deaktiveret i configfilen.
+dontMoveMessage=\u00a77Teleportering vil begynde om {0}. Bev\u00e6g dig ikke.
+downloadingGeoIp=Downloader GeoIP database... det her kan tage et stykke tid (land: 0.6 MB, by: 27MB)
+duplicatedUserdata=Duplikerede userdata: {0} og {1}
+enableUnlimited=\u00a77Giver ubegr\u00e6nset m\u00e6ngde af {0} til {1}.
+enabled=aktiveret
+enchantmentApplied = \u00a77Enchantment {0} er blevet tilf\u00c3\u00b8jet til tingen i din h\u00c3\u00a5nd.
+enchantmentNotFound = \u00a7cEnchantment ikke fundet.
+enchantmentPerm = \u00a7cDu har ikke tilladelse til at {0}
+enchantmentRemoved = \u00a77Cnchantment {0} er blevet fjernet fra tingen i din h\u00c3\u00a5nd.
+enchantments = \u00a77Enchantments: {0}
+errorCallingCommand=Fejl ved kald af kommando /{0}
+errorWithMessage=\u00a7cFejl: {0}
+essentialsHelp1=Denne fil er \u00c3\u00b8delagt og Essentials kan ikke \u00c3\u00a5bne den. Essentials er nu deaktiveret. Kan du ikke ordne denne fil selv, kan du f\u00c3\u00a5 hj\u00c3\u00a6lp p\u00c3\u00a5 http://tiny.cc/EssentialsChat
+essentialsHelp2=Filen er \u00c3\u00b8delagt og Essentials kan ikke \u00c3\u00a5bne den. Essentials er nu deaktiveret. Kan du ikke ordne denne fil selv, skriv enten /essentialshelp ingame eller f\u00c3\u00a5 hj\u00c3\u00a6lp p\u00c3\u00a5 http://tiny.cc/EssentialsChat
+essentialsReload=\u00a77Essentials Genindl\u00e6st {0}.
+extinguish=\u00a77Du slukkede ilden i dig selv.
+extinguishOthers=\u00a77Du slukkede ilden i {0}.
+failedToCloseConfig=Fejlede i at lukke config {0}
+failedToCreateConfig=Fejlede i oprettelse af config {0}
+failedToWriteConfig=Fejlede i at skrive til config {0}
+false=false
+feed=\u00a77Your appetite was sated.
+feedOther=\u00a77Satisfied {0}.
+fileRenameError=Omd\u00c3\u00b8bning af fil {0} fejlede.
+foreverAlone=\u00a7cDu har ingen til hvem du kan svare.
+freedMemory=Frigjorde {0} MB.
+gameMode=\u00a77Satte game mode {0} for {1}.
+gcchunks= chunks,
+gcentities= entities
+gcfree=Free memory: {0} MB
+gcmax=Maximum memory: {0} MB
+gctotal=Allocated memory: {0} MB
+geoIpUrlEmpty=GeoIP download url er tom.
+geoIpUrlInvalid=GeoIP download url er ugyldig.
+geoipJoinFormat=Spilleren {0} kommer fra {1}
+godDisabledFor=deaktiveret for {0}
+godEnabledFor=aktiveret for {0}
+godMode=\u00a77Gud mode {0}.
+haveBeenReleased=\u00a77Du er blevet l\u00f8sladt
+heal=\u00a77Du er blevet healed.
+healOther=\u00a77Healed {0}.
+helpConsole=For at se hj\u00e6lp fra konsolen, skriv ?.
+helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1}
+helpPages=Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f:
+holeInFloor=Hul i gulv
+homeSet=\u00a77Hjem sat.
+homeSetToBed=\u00a77Dit hjem er nu sat til denne seng.
+homes=Hjem: {0}
+hour=time
+hours=timer
+ignorePlayer=Du ignorerer spiller {0} fra nu af.
+illegalDate=Forkert datoformat.
+infoChapter=V\u00e6lg kapitel:
+infoChapterPages=Kapitel {0}, side \u00a7c{1}\u00a7f af \u00a7c{2}\u00a7f:
+infoFileDoesNotExist=Fil info.txt eksisterer ikke. Fixer liiige en for dig.
+infoPages=Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f:
+infoUnknownChapter=Ukendt kapitel.
+invBigger=Den anden brugers inventory er st\u00f8rre end din.
+invRestored=Din inventory er blevet genoprettet.
+invSee=Du ser {0}''s inventory.
+invSeeHelp=Brug /invsee for at genoprette din inventory.
+invalidCharge=\u00a7cUgyldig opladning (korrekt oversat?).
+invalidMob=Ugyldig mob type.
+invalidServer=Ugyldig server!
+invalidSignLine=Linje {0} p\u00e5 skilt er ugyldig.
+invalidWorld=\u00a7cUgyldig verden.
+inventoryCleared=\u00a77Inventory ryddet.
+inventoryClearedOthers=\u00a7c{0}\u00a77''s inventory ryddet.
+is=er
+itemCannotBeSold=Denne ting kan ikke s\u00e6lges til serveren.
+itemMustBeStacked=Tingen skal handles i stakke. En m\u00e6ngde af 2s ville v\u00e6re to stakke, osv.
+itemNotEnough1=\u00a7cDu har ikke nok af denne ting til at kunne s\u00e6lge.
+itemNotEnough2=\u00a77Hvis du mente, at du ville s\u00c3\u00a6lge alle ting af den type, brug da /sell tingens-navn
+itemNotEnough3=\u00a77/sell ting-navn -1 vil s\u00e6lge alle enheder, undtagen \u00c3\u00a9n, osv.
+itemSellAir=Fors\u00f8gte du virkelig at s\u00e6lge luft? Kom en ting i h\u00e5nden, hattemand.
+itemSold=\u00a77Solgte til \u00a7c{0} \u00a77({1} {2} ting for {3} pr. stk.)
+itemSoldConsole={0} solgte {1} til \u00a77{2} \u00a77({3} ting for {4} pr. stk.)
+itemSpawn=\u00a77Giver {0} af {1}
+itemsCsvNotLoaded=Kunne ikke loade items.csv.
+jailAlreadyIncarcerated=\u00a7cSpilleren er allerede i f\u00c3\u00a6ngsel: {0}
+jailMessage=\u00a7cDu bryder reglerne, du tager straffen.
+jailNotExist=Det f\u00e6ngsel eksisterer ikke.
+jailReleased=\u00a77Player \u00a7e{0}\u00a77 befriet fra f\u00c3\u00a6ngslet.
+jailReleasedPlayerNotify=\u00a77Du er blevet befriet fra f\u00c3\u00a6nglset!
+jailSentenceExtended=F\u00c3\u00a6ngselsdom forl\u00c3\u00a6nget til: {0)
+jailSet=\u00a77F\u00e6ngsel {0} er blevet sat.
+jumpError=Dette vil skade din computer''s hjerne.
+kickDefault=Kicked fra serveren.
+kickExempt=\u00a77Du kan ikke kicke denne spiller.
+kill=\u00a77dr\u00e6bte {0}.
+kitError2=\u00a7cDette kit eksisterer ikke eller er forkert defineret.
+kitError=\u00a7cDer er ikke nogen gyldige kits.
+kitErrorHelp=\u00a7cM\u00e5ske mangler en ting en m\u00e6ngde i konfigurationen? Eller m\u00c3\u00a5ske er der nisser p\u00c3\u00a5 spil?
+kitGive=\u00a77Giver kit til {0} (oversat korrekt?).
+kitInvFull=\u00a7cDin inventory er fuld, placerer kit p\u00e5 gulvet.
+kitTimed=\u00a7cDu kan ikke benytte dette kit igen i {0}.
+kits=\u00a77Kits: {0}
+lightningSmited=\u00a77Du er blevet ramt af Guds vrede (din admin)
+lightningUse=\u00a77Kaster lyn efter {0}
+listAfkTag = \u00a77[AFK]\u00a7f
+listAmount = \u00a79Der er \u00a7c{0}\u00a79 ud af maksimum\u00a7c{1}\u00a79 spillere online.
+listAmountHidden = \u00a79Der er \u00a7c{0}\u00a77/{1}\u00a79 ud af maksimum \u00a7c{2}\u00a79 spillere online.
+listHiddenTag = \u00a77[HIDDEN]\u00a7f
+loadWarpError=Kunne ikke l\u00c3\u00a6se warp {0}
+loadinfo=Loadede {0} build {1} af {2}
+localFormat=Local: <{0}> {1}
+mailClear=\u00a7cFor at markere din flaskepost som l\u00e6st, skriv /mail clear
+mailCleared=\u00a77Flaskepot ryddet!
+mailSent=\u00a77Flaskepot sendt!
+markMailAsRead=\u00a7cFor at markere din flaskepost som l\u00e6st, skriv /mail clear
+markedAsAway=\u00a77Du er nu markeret som v\u00c3\u00a6rende ikke tilstede.
+markedAsNotAway=\u00a77Du er ikke l\u00e6ngere markeret som v\u00c3\u00a6rende ikke tilstede.
+maxHomes=Du kan ikke have mere end {0} hjem.
+mayNotJail=\u00a7cDu kan ikke smide denne person i f\u00c3\u00a6ngsel.
+me=mig
+minute=minut
+minutes=minutter
+missingItems=Du har ikke {0}x {1}.
+missingPrefixSuffix=Mangler et pr\u00e6fiks eller suffiks for {0}
+mobSpawnError=Fejl ved \u00e6ndring af mob spawner.
+mobSpawnLimit=Mob m\u00e6ngde begr\u00e6nset til serverens fastsatte gr\u00e6nse.
+mobSpawnTarget=M\u00e5l blok skal v\u00e6re en mob spawner.
+mobsAvailable=\u00a77Mobs: {0}
+moneyRecievedFrom=\u00a7a{0} er modtaget fra {1}
+moneySentTo=\u00a7a{0} er sendt til {1}
+moneyTaken={0} blev taget fra din bankkonto.
+month=m\u00e5nede
+months=m\u00e5neder
+moreThanZero=M\u00e6ngder skal v\u00e6re st\u00f8rre end 0.
+msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
+muteExempt=\u00a7cDu kan ikke mute denne spiller.
+mutedPlayer=Spiller {0} muted.
+mutedPlayerFor=Spiller {0} muted i {1}.
+mutedUserSpeaks={0} pr\u00f8vede at snakke, men er muted.
+nearbyPlayers=Spillere i n\u00c3\u00a6rheden: {0}
+needTpohere=Du skal have adgang til /tpohere for at teleportere andre spillere.
+negativeBalanceError=Brugeren har ikke tilladelse til at have en negativ saldo.
+nickChanged=Nickname \u00e6ndret.
+nickDisplayName=\u00a77Du bliver n\u00c3\u00b8dt til at aktivere change-displayname i Essentials config.
+nickInUse=\u00a7cDet nickname er allerede i brug. Pr\u00c3\u00b8v Jens eller Harald. Det er gode navne.
+nickNamesAlpha=\u00a7cNicknames skal v\u00e6re alfanumeriske.
+nickNoMore=\u00a7Du har ikke l\u00e6ngere et nickname.
+nickOthersPermission=\u00a7cDu har ikke tilladelse til at \u00e6ndre en andens nickname.
+nickSet=\u00a77Dit nickname er nu \u00a7c{0}
+noAccessCommand=\u00a7cDu har ikke adgang til denne kommando.
+noAccessPermission=\u00a7cDu har ikke tilladelse til at f\u00e5 adgang til {0}.
+noDestroyPermission=\u00a7cDu har ikke tilladelse til at \u00f8del\u00e6gge {0}.
+noGodWorldWarning=\u00a7cAdvarsel! God mode er sl\u00c3\u00a5et fra i denne verden.
+noHelpFound=\u00a7cIngen matchende kommandoer.
+noHomeSet=Du har sat et nyt hjem.
+noHomeSetPlayer=Spilleren har ikke sat et hjem.
+noKitPermission=\u00a7cDu har brug for \u00a7c{0}\u00a7c permission for at bruge dette kit.
+noKits=\u00a77Der er ikke nogen kits tilg\u00e6ngelige endnu
+noMail=Du har ikke noget flaskepost.
+noMotd=\u00a7cDer er ingen Message of the day.
+noNewMail=\u00a77Du har ingen ny flaskepost.
+noPendingRequest=Du har ikke en ventende anmodning.
+noPerm=\u00a7cDu har ikke \u00a7f{0}\u00a7c permission.
+noPermToSpawnMob=\u00a7cDu har ikke tilladelse til at spawne denne mob.
+noPlacePermission=\u00a7cDu har ikke tiladelse til at placere en block n\u00c3\u00a6r det skilt.
+noPowerTools= Du har ingen power tools tilf\u00c3\u00b8jet.
+noRules=\u00a7cDer er ingen regler endnu. ANARKI!
+noWarpsDefined=Ingen warps er defineret
+none=ingen
+notAllowedToQuestion=\u00a7cDu har ikke tilladelse til at bruge sp\u00f8rgsm\u00e5l.
+notAllowedToShout=\u00a7cDu har ikke tilladelse til at r\u00e5be.
+notEnoughExperience=You do not have enough experience.
+notEnoughMoney=Du har ikke tilstr\u00e6kkeligt med penge.
+notRecommendedBukkit=* ! * Bukkit version er ikke den anbefalede build til Essentials.
+notSupportedYet=Ikke underst\u00f8ttet endnu.
+nothingInHand = \u00a7cDu har intet i din h\u00c3\u00a5nd.
+now=nu
+numberRequired=Et nummer skal v\u00e6re, din tardo.
+onlyDayNight=/time underst\u00f8tter kun day/night.
+onlyPlayers=Kun in-game spillere kan bruge {0}.
+onlySunStorm=/weather underst\u00c3\u00b8tter kun sun/storm.
+orderBalances=Tjekker saldoer af {0} spillere, vent venligst...
+pTimeCurrent=\u00a7e{0}''s\u00a7f Tiden er {1}.
+pTimeCurrentFixed=\u00a7e{0}''s\u00a7f Tiden er fastsat til {1}.
+pTimeNormal=\u00a7e{0}''s\u00a7f Tiden er normal og matcher serveren.
+pTimeOthersPermission=\u00a7cDu har ikke tilladelse til at \u00c3\u00a6ndre andre spilleres tid.
+pTimePlayers=Disse spillere har deres egen tid:
+pTimeReset=Spiler-tid er blevet nulstillet for: \u00a7e{0} (oversat korrekt?)
+pTimeSet=Spiller-tid er blevet sat til \u00a73{0}\u00a7f for: \u00a7e{1} (oversat korrekt?)
+pTimeSetFixed=Spiller-tid er fastsat til \u00a73{0}\u00a7f for: \u00a7e{1}
+parseError=Fejl ved parsing af {0} p\u00e5 linje {1}
+pendingTeleportCancelled=\u00a7cAnmodning om teleport er blevet afvist.
+permissionsError=Mangler Permissions/GroupManager; chat pr\u00e6fikser/suffikser vil v\u00e6re deaktiveret.
+playerBanned=\u00a7cSpilleren {0} banned i {1} for {2}
+playerInJail=\u00a7cSpilleren er allerede i f\u00e6ngsel {0}.
+playerJailed=\u00a77Spilleren {0} f\u00e6ngslet.
+playerJailedFor= \u00a77Spilleren {0} f\u00e6ngslet i {1}.
+playerKicked=\u00a7cSpiller {0} kicked {1} for {2}.
+playerMuted=\u00a77Du er blevet muted!
+playerMutedFor=\u00a77Du er blevet muted som f\u00c3\u00b8lge af: {0}
+playerNeverOnServer=\u00a7cSpilleren {0} har aldrig v\u00c3\u00a6ret p\u00e5 denne server.
+playerNotFound=\u00a7cSpilleren ikke fundet.
+playerUnmuted=\u00a77Du er blevet unmuted.
+pong=Pong!
+possibleWorlds=\u00a77Mulige verdener er numrene fra 0 til {0}.
+powerToolAir=Kommando kan ikke blive p\u00c3\u00a5lagt luft.
+powerToolAlreadySet=Kommandoen \u00a7c{0}\u00a7f er allerede p\u00c3\u00a5lagt {1}.
+powerToolAttach=\u00a7c{0}\u00a7f kommando p\u00c3\u00a5lagt {1}.
+powerToolClearAll=Alle powertool kommandoer er blevet nulstillet.
+powerToolList={1} har f\u00c3\u00b8lgende kommandoer: \u00a7c{0}\u00a7f.
+powerToolListEmpty={0} har ingen kommandoer p\u00c3\u00a5lagt.
+powerToolNoSuchCommandAssigned=Kommando \u00a7c{0}\u00a7f blev ikke p\u00c3\u00a5lagt {1}.
+powerToolRemove=Kommando \u00a7c{0}\u00a7f fjernet fra {1}.
+powerToolRemoveAll=Alle kommandoer fjernet fra {0}.
+powerToolsDisabled= Alle dine power tools er blevet deaktiveret.
+powerToolsEnabled= Alle dine power tools er blevet aktiveret.
+protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0}
+questionFormat=\u00a77[Sp\u00f8rgsm\u00e5l]\u00a7f {0}
+readNextPage=Skriv /{0} {1} for at l\u00c3\u00a6se n\u00c3\u00a6ste side.
+reloadAllPlugins=\u00a77Reload alle plugins.
+removed=\u00a77Removed {0} entities.
+repair=Du reparerede \u00a7e{0}. Du s\u00c3\u00a5'' dygtig!
+repairAlreadyFixed=\u00a77Denne ting har ikke brug for reparation.
+repairEnchanted=\u00a77Du har ikke tilladelse til at reparere enchantede ting.
+repairInvalidType=\u00a7cDenne ting kan ikke repareres.
+repairNone=Der var ingen ting der beh\u00c3\u00b8vede reparation.
+requestAccepted=\u00a77Anmodning om teleport accepteret! Sikke en guttermand.
+requestAcceptedFrom=\u00a77{0} accepterede din anmodning om teleport.
+requestDenied=\u00a77Anmodning om teleport afvist.
+requestDeniedFrom=\u00a77{0} afviste din anmodning om teleport.
+requestSent=\u00a77Anmodning sendt til {0}\u00a77.
+requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
+returnPlayerToJailError=En fejl opstod ved fors\u00f8g p\u00e5 at returnere spilleren til f\u00e6ngsel.
+second=sekund
+seconds=sekunder
+seenOffline=Spilleren {0} har v\u00c3\u00a6ret offline i {1}
+seenOnline=Spilleren {0} har v\u00c3\u00a6ret online i {1}
+serverFull=Serveren er sgu fuld. Den b\u00c3\u00b8r melde sig til AA.
+setSpawner=\u00c3\u0086ndrede spawner type til {0}
+sheepMalformedColor=Forkert farve. (Korrekt oversat?)
+shoutFormat=\u00a77[Shout]\u00a7f {0}
+signFormatFail=\u00a74[{0}]
+signFormatSuccess=\u00a71[{0}]
+signFormatTemplate=[{0}]
+signProtectInvalidLocation=\u00a74Du har ikke tilladelse til at lave et skilt her.
+similarWarpExist=En warp med dette navn eksisterer allerede.
+slimeMalformedSize=Forkert st\u00f8rrelse. (Korrekt oversat?)
+soloMob=Denne mob kan godt lide at v\u00e6re alene. Den hygger sig.
+spawnSet=\u00a77Spawnplacering fastsat for gruppe: {0}.
+spawned=spawnet
+suicideMessage=\u00a77Farvel grusomme verden...
+suicideSuccess= \u00a77{0} tog sit eget liv
+survival=survival
+takenFromAccount=\u00a7c{0} er blevet taget fra din konto.
+takenFromOthersAccount=\u00a7c{0} er blevet taget fra {1}''s konto.
+teleportAAll=\u00a77Anmodning om teleport er sendt til alle spillere.
+teleportAll=\u00a77Teleporterer alle spillere...
+teleportAtoB=\u00a77{0}\u00a77 teleporterede dig til {1}\u00a77.
+teleportDisabled={0} har ikke teleportation aktiveret.
+teleportHereRequest=\u00a7c{0}\u00a7c har anmodet om, at du teleporterer dig til ham/hende.
+teleportNewPlayerError=Fejlede ved teleportering af ny spiller
+teleportRequest=\u00a7c{0}\u00a7c har anmodet om at teleportere til dig.
+teleportTop=\u00a77Teleporterer til toppen.
+teleportationCommencing=\u00a77Teleport begynder...
+teleportationDisabled=\u00a77Teleport deaktiveret.
+teleportationEnabled=\u00a77Teleport aktiveret.
+teleporting=\u00a77Teleporterer...
+teleportingPortal=\u00a77Teleporterede via portal.
+tempBanned=Midlertidigt bannet fra serveren for {0}
+tempbanExempt=\u00a77Du m\u00c3\u00a5 ikke tempbanne denne spiller! Slemme, slemme du!
+thunder= Du har nu {0} torden i din verden
+thunderDuration=Du har nu {0} torden i din verden i {1} sekunder.
+timeBeforeHeal=Tid f\u00c3\u00b8r du kan heale igen: {0}
+timeBeforeTeleport=Tid f\u00f8r du kan teleportere igen: {0}
+timeFormat=\u00a73{0}\u00a7f or \u00a73{1}\u00a7f or \u00a73{2}\u00a7f
+timePattern=(?:([0-9]+)\\s*[a\u00e5y][a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[wu][a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[ht][a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
+timeSet=Tid \u00c3\u00a6ndret i alle verdener.
+timeSetPermission=\u00a7cDu har ikke tilladelse til at \u00c3\u00a6ndre tiden.
+timeWorldCurrent=Tiden p\u00c3\u00a5 nuv\u00c3\u00a6rende tidspunkt i {0} er \u00a73{1}
+timeWorldSet=Tiden blev \u00c3\u00a6ndret til {0} i: \u00a7c{1}
+tradeCompleted=\u00a77Handel gennemf\u00f8rt.
+tradeSignEmpty=Handelsskiltet har udsolgt!
+tradeSignEmptyOwner=Der er intet at hente ved dette handelsskilt.
+treeFailure=\u00a7cTr\u00e6 genereringsfejl. Pr\u00f8v igen p\u00e5 gr\u00e6s eller jord.
+treeSpawned=\u00a77Tr\u00e6 spawned.
+true=true
+typeTpaccept=\u00a77For at teleportere, skriv \u00a7c/tpaccept\u00a77.
+typeTpdeny=\u00a77For at n\u00e6gte denne anmodning om teleport, skriv \u00a7c/tpdeny\u00a77.
+typeWorldName=\u00a77Du kan ogs\u00e5 skrive navnet p\u00e5 en specifik verden.
+unableToSpawnMob=Kunne ikke spawne mob.
+unbannedIP=Tilgav IP addressen; er ikke l\u00e6ngere bannet.
+unbannedPlayer=Tilgav spilleren; er ikke l\u00e6ngere bannet.
+unignorePlayer=Du ignorerer ikke spiller {0} mere.
+unknownItemId=Ukendt ting id: {0}
+unknownItemInList=Ukendt ting {0} i {1} listen.
+unknownItemName=Ukendt ting navn: {0}
+unlimitedItemPermission=\u00a7cIngen tilladelse til ubegr\u00e6nset ting {0}.
+unlimitedItems=Ubegr\u00c3\u00a6nsede ting:
+unmutedPlayer=Spilleren {0} unmuted.
+upgradingFilesError=Fejl under opgradering af filerne.
+userDoesNotExist=Brugeren {0} eksisterer ikke.
+userIsAway={0} er nu AFK. Skub ham i havet eller bur ham inde!
+userIsNotAway={0} er ikke l\u00e6ngere AFK.
+userJailed=\u00a77Du er blevet f\u00e6ngslet.
+userUsedPortal={0} brugte en eksisterende udgangsportal.
+userdataMoveBackError=Kunne ikke flytte userdata/{0}.tmp til userdata/{1}
+userdataMoveError=Kunne ikke flytte userdata/{0} til userdata/{1}.tmp
+usingTempFolderForTesting=Bruger temp-mappe til testing:
+versionMismatch=Versioner matcher ikke! Opdater venligst {0} til den nyeste version.
+versionMismatchAll=Versioner matcher ikke! Opdater venligst alle Essentials jar-filer til samme version.
+voiceSilenced=\u00a77Din stemme er blevet gjort stille.
+warpDeleteError=Ah, shit; kunne sgu ikke fjerne warp-filen. Jeg giver en \u00c3\u00b8l i lufthavnen.
+warpListPermission=\u00a7cDu har ikke tilladelse til at vise listen over warps.
+warpNotExist=Den warp eksisterer ikke.
+warpSet=\u00a77Warp {0} sat.
+warpUsePermission=\u00a7cDu har ikke tilladelse til at benytte den warp.
+warpingTo=\u00a77Warper til {0}.
+warps=Warps: {0}
+warpsCount=\u00a77Der er {0} warps. Viser side {1} af {2}.
+weatherStorm=\u00a77Du har sat vejret til ''storm'' i {0}
+weatherStormFor=\u00a77Du har sat vejret til ''storm'' i {0} i {1} sekunder
+weatherSun=\u00a77Du har sat vejret til ''sol'' i {0}
+weatherSunFor=\u00a77Du har sat vejret til ''sol'' i {0} i {1} sekunder
+whoisBanned=\u00a79 - Banned: {0}
+whoisGamemode=\u00a79 - Gamemode: {0}
+whoisGeoLocation=\u00a79 - Placering: {0}
+whoisGod=\u00a79 - God mode: {0}
+whoisHealth=\u00a79 - Health: {0}/20
+whoisIPAddress=\u00a79 - IP-Adresse: {0}
+whoisIs={0} er {1}
+whoisLocation=\u00a79 - Placering: ({0}, {1}, {2}, {3})
+whoisMoney=\u00a79 - Saldo: {0}
+whoisOP=\u00a79 - OP: {0}
+whoisStatusAvailable=\u00a79 - Status: Tilg\u00e6ngelig
+whoisStatusAway=\u00a79 - Status: \u00a7cAFK\u00a7f
+worth=\u00a77Stack af {0} er v\u00e6rd \u00a7c{1}\u00a77 ({2} ting for {3} pr. stk.)
+worthMeta=\u00a77Stack af {0} med metadata af {1} er v\u00e6rd \u00a7c{2}\u00a77 ({3} ting for {4} pr. stk.)
+worthSet=V\u00e6rdi \u00c3\u00a6ndret.
+year=\u00e5r
+years=\u00e5r
+youAreHealed=\u00a77Du er blevet healed. Halleluja!
+youHaveNewMail=\u00a7cDu har {0} flaskeposter!\u00a7f Type \u00a77/mail read for at se din flaskepost.
+requestTimedOut=\u00a7cTeleport request has timed out
+teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties
index f0ec0f493..204625fd1 100644
--- a/Essentials/src/messages_de.properties
+++ b/Essentials/src/messages_de.properties
@@ -2,368 +2,405 @@
# Single quotes have to be doubled: ''
# Translations start here
# by:
-action = * {0} {1}
-addedToAccount = \u00a7a{0} wurden zu deiner Geldb\u00f6rse hinzugef\u00fcgt.
-addedToOthersAccount = \u00a7a{0} wurden zu {1}s Konto hinzugef\u00fcgt.
-alertBroke = zerst\u00f6rt:
-alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} bei: {3}
-alertPlaced = platziert:
-alertUsed = benutzt:
-autoAfkKickReason = Du wurdest gekickt, weil du f\u00fcr {0} Minuten inaktiv warst.
-backAfterDeath = \u00a77Benutze den Befehl /back um zu deinem Todespunkt zur\u00fcck zu kehren.
-backUsageMsg = \u00a77Kehre zur letzten Position zur\u00fcck.
-backupFinished = Backup beendet
-backupStarted = Backup gestartet
-balance = \u00a77Geldb\u00f6rse: {0}
-balanceTop = \u00a77 Top {0} Guthaben
-banExempt = \u00a7cDu kannst diesen Spieler nicht sperren.
-banIpAddress = \u00a77IP-Adresse gesperrt.
-bannedIpsFileError = Fehler beim Lesen von banned-ips.txt
-bannedIpsFileNotFound = banned-ips.txt nicht gefunden
-bannedPlayersFileError = Fehler beim Lesen von banned-players.txt
-bannedPlayersFileNotFound = banned-players.txt nicht gefunden
-bigTreeFailure = \u00a7cFehler beim Pflanzen eines grossen Baums. Versuch es auf Gras oder Dreck.
-bigTreeSuccess = \u00a77Grosser Baum gepflanzt.
-broadcast = [\u00a7cRundruf\u00a7f]\u00a7a {0}
-buildAlert = \u00a7cDu hast keine Rechte zum Bauen.
-bukkitFormatChanged = Bukkit-Versionsformat hat sich ge\u00e4ndert. Version nicht kontrolliert.
-burnMsg = \u00a77Du hast {0} f\u00fcr {1} Sekunden in Flammen gesetzt.
-canTalkAgain = \u00a77Du kannst wieder sprechen.
-cantFindGeoIpDB = Kann GeoIP-Datenbank nicht finden!
-cantReadGeoIpDB = Fehler beim Einlesen der GeoIP-Datenbank!
-cantSpawnItem = \u00a7cDu darfst {0} nicht erzeugen.
-commandFailed = Befehl {0} scheiterte:
-commandHelpFailedForPlugin=Fehler beim Abrufen der Hilfe f\u00fcr: {0}
-commandNotLoaded = \u00a7cBefehl {0} ist nicht richtig geladen.
-compassBearing = \u00a77Peilung: {0} ({1} Grad).
-configFileMoveError = Verschieben von config.yml in den Sicherheitskopien-Ordner gescheitert.
-configFileRenameError = Verschieben einer tempor\u00e4ren Datei nach config.yml gescheitert.
-connectedPlayers = Verbundene Spieler:
-connectionFailed = Fehler beim Verbindungsaufbau.
-cooldownWithMessage = \u00a7cBeschr\u00e4nkung: {0}
-corruptNodeInConfig = \u00a74Hinweis: Deine Konfigurationsdatei hat einen ung\u00fcltigen Knoten {0}.
-couldNotFindTemplate = Vorlage {0} konnte nicht gefunden werden.
-creatingConfigFromTemplate = Erstelle Konfiguration aus Vorlage: {0}
-creatingEmptyConfig = Erstelle leere Konfiguration: {0}
-day = Tag
-days = Tage
-defaultBanReason = Der Bann-Hammer hat gesprochen!
-deleteFileError = Konnte Datei nicht l\u00f6schen: {0}
-deleteHome = \u00a77Zuhause {0} wurde gel\u00f6scht.
-deleteJail = \u00a77Gef\u00e4ngnis {0} wurde gel\u00f6scht.
-deleteWarp = \u00a77Warp-Punkt {0} wurde gel\u00f6scht.
-deniedAccessCommand = {0} hat keinen Zugriff auf diesen Befehl.
-dependancyDownloaded = [Essentials] Abh\u00e4ngigkeit {0} erfolgreich runtergeladen.
-dependancyException = [Essentials] W\u00e4hrend dem Download von einer Abh\u00e4ngigkeit ist ein Fehler aufgetreten.
-dependancyNotFound = [Essentials] Eine erforderliche Abh\u00e4ngigkeit wurde nicht gefunde, Download startet jetzt..
-depth = \u00a77Du bist auf Meeresh\u00f6he.
-depthAboveSea = \u00a77Du bist {0} Bl\u00f6cke \u00fcber Meeresh\u00f6he.
-depthBelowSea = \u00a77Du bist {0} Bl\u00f6cke unter Meeresh\u00f6he.
-destinationNotSet = Ziel nicht gesetzt
-disableUnlimited = \u00a77Deaktiviere unendliches Platzieren von {0} f\u00fcr {1}.
-disabled = deaktiviert
-dontMoveMessage = \u00a77Teleportvorgang startet in {0}. Beweg dich nicht.
-downloadingGeoIp = Lade GeoIP-Datenbank ... dies kann etwas dauern (country: 0.6 MB, city: 20MB)
-duplicatedUserdata = Doppelte Datei in userdata: {0} und {1}
-enableUnlimited = \u00a77Gebe {1} unendliche Mengen von {0}.
-enabled = aktiviert
-errorCallingCommand = Fehler beim Aufrufen des Befehls /{0}
-errorWithMessage = \u00a7cFehler: {0}
-essentialsReload = \u00a77Essentials neu geladen {0}
-extinguish = \u00a77Du hast dich selbst gel\u00f6scht.
-extinguishOthers = \u00a77Du hast {0} gel\u00f6scht.
-failedToCloseConfig = Fehler beim Schliessen der Konfiguration {0}
-failedToCreateConfig = Fehler beim Erstellen der Konfiguration {0}
-failedToWriteConfig = Fehler beim Schreiben der Konfiguration {0}
-fileRenameError = Umbenennen von {0} gescheitert.
-foreverAlone = \u00a7cDu hast niemanden, dem du antworten kannst.
-freedMemory = {0} MB frei gemacht.
-gcchunks = Chunks,
-gcentities = Einheiten
-gcfree = Freier Speicher: {0} MB
-gcmax = Maximaler Speicher: {0} MB
-gctotal = Reservierter Speicher: {0} MB
-geoIpUrlEmpty = GeoIP Download-URL ist leer.
-geoIpUrlInvalid = GeoIP Download-URL ist ung\u00fcltig.
-geoipJoinFormat = Spieler {0} kommt aus {1}
-godDisabledFor = deaktiviert f\u00fcr {0}
-godEnabledFor = aktiviert f\u00fcr {0}
-godMode = \u00a77Unsterblichkeit {0}.
-haveBeenReleased = \u00a77Du wurdest frei gelassen.
-heal = \u00a77Du wurdest geheilt.
-healOther = \u00a77{0} geheilt.
-helpConsole = Um die Hilfe der Konsole zu sehen, schreibe ?.
-helpOp = \u00a7c[Hilfe]\u00a7f \u00a77{0}:\u00a7f {1}
-helpPages = Seite \u00a7c{0}\u00a7f von \u00a7c{1}\u00a7f:
-holeInFloor = Loch im Boden
-homeSet = \u00a77Zuhause gesetzt.
-homeSetToBed = \u00a77Dein Zuhause ist nun an diesem Bett.
-homes = Heime: {0}
-hour = Stunde
-hours = Stunden
-ignorePlayer = Du ignorierst ab jetzt Spieler {0}.
-illegalDate = Ung\u00fcltiges Datumsformat.
-infoChapter = W\u00e4hle Kapitel:
-infoChapterPages = Kapitel {0}, Seite \u00a7c{1}\u00a7f von \u00a7c{2}\u00a7f:
-infoFileDoesNotExist = Datei info.txt existiert nicht. Erzeuge eine neue Datei.
-infoPages = Seite \u00a7c{0}\u00a7f von \u00a7c{1}\u00a7f:
-infoUnknownChapter = Unbekanntes Kapitel:
-invBigger = Das andere Inventar ist gr\u00f6sser als deins.
-invRestored = Dein Inventar wurde wieder hergestellt.
-invSee = Du siehst das Inventar von {0}.
-invSeeHelp = Benutze /invsee um dein Inventar wiederherzustellen.
-invalidCharge = \u00a7cUng\u00fcltige Verf\u00fcgung.
-invalidMob = Ung\u00fcltiger Monstername.
-invalidServer = Ung\u00fcltiger Server!
-invalidSignLine = Die Zeile {0} auf dem Schild ist falsch.
-invalidWorld = \u00a7cUng\u00fcltige Welt.
-inventoryCleared = \u00a77Inventar geleert.
-inventoryClearedOthers = \u00a77Inventar von \u00a7c{0}\u00a77 geleert.
-is = ist
-itemCannotBeSold = Dieser Gegenstand kann nicht verkauft werden.
-itemMustBeStacked = Gegenstand muss als Stapel verkauft werden. Eine Anzahl von 2s verkauft 2 Stapel usw.
-itemNotEnough1 = \u00a7cDu hast nicht genug Gegenst\u00e4nde zum Verkaufen.
-itemNotEnough2 = \u00a77Wenn du alles verkaufen willst, nutze /sell itemname
-itemNotEnough3 = \u00a77/sell itemname -1 verkauft alles bis auf eins usw.
-itemSellAir = Du versuchst Luft zu verkaufen? Nimm einen Gegenstand in die Hand.
-itemSold = \u00a77Verkauft f\u00fcr \u00a7c{0}\u00a77 ({1} {2} Einheiten je {3})
-itemSoldConsole = {0} verkauft {1} f\u00fcr \u00a77{2}\u00a77 ({3} Einheiten je {4})
-itemSpawn = \u00a77Gebe {0}x {1}
-itemsCsvNotLoaded = Konnte items.csv nicht laden.
-jailAlreadyIncarcerated = \u00a7cPerson is already in jail: {0}
-jailMessage = \u00a7cDu hast ein Verbrechen begangen, also hast du Zeit.
-jailNotExist = Dieses Gef\u00e4ngnis existiert nicht.
-jailReleased = \u00a77Spieler \u00a7e{0}\u00a77 wurde freigelassen.
-jailReleasedPlayerNotify = \u00a77Du wurdest freigelassen!
-jailSentenceExtended = Gef\u00e4ngnisszeit erweitert auf: {0)
-jailSet = \u00a77Gef\u00e4ngnis {0} wurde erstellt.
-jumpError = Das w\u00fcrde deinen Computer \u00fcberlasten.
-kickDefault = Vom Server geworfen
-kickExempt = \u00a7cDu kannst diesen Spieler nicht rauswerfen.
-kill = \u00a77{0} get\u00f6tet.
-kitError = \u00a7cEs gibt keine g\u00fcltigen Ausr\u00fcstungen.
-kitError2 = \u00a7cDiese Ausr\u00fcstung existiert nicht oder ist ung\u00fcltig.
-kitErrorHelp = \u00a7cEventuell fehlt bei einem Gegenstand die Menge?
-kitGive = \u00a77Gebe Ausr\u00fcstung {0}.
-kitInvFull = \u00a7cDein Inventar ist voll, lege Ausr\u00fcstung auf den Boden
-kitTimed = \u00a7cDu kannst diese Ausr\u00fcstung nicht innerhalb von {0} anfordern.
-kits = \u00a77Ausr\u00fcstungen: {0}
-lightningSmited = \u00a77Du wurdest gepeinigt.
-lightningUse = \u00a77Peinige {0}
-loadWarpError = Fehler beim Laden von Warp-Punkt {0}
-loadinfo = Plugin {0} Version {1} geladen, erstellt von {2}, \u00fcbersetzt von snowleo
-localFormat = Lokal: <{0}> {1}
-mailClear = \u00a7cUm deine Nachrichten zu l\u00f6schen, schreibe /mail clear
-mailCleared = \u00a77Nachrichten gel\u00f6scht!
-mailSent = \u00a77Nachricht gesendet!
-markMailAsRead = \u00a7cUm deine Nachrichten zu l\u00f6schen, schreibe /mail clear
-markedAsAway = \u00a77Du wirst als abwesend angezeigt.
-markedAsNotAway = \u00a77Du wirst nicht mehr als abwesend angezeigt.
-maxHomes = Du kannst nicht mehr als {0} Zuhause setzen.
-mayNotJail = \u00a7cDu kannst diese Person nicht einsperren.
-me = mir
-minute = Minute
-minutes = Minuten
-missingItems = Du ben\u00f6tigst {0}x {1}.
-missingPrefixSuffix = Prefix/Suffix fehlt f\u00fcr {0}
-mobSpawnError = Fehler beim \u00e4ndern des Monster-Spawner.
-mobSpawnLimit = Anzahl an Monster auf Serverlimit beschr\u00e4nkt
-mobSpawnTarget = Zielblock, muss ein Monster-Spawner sein.
-moneyRecievedFrom = \u00a7a{1} hat dir {0} gegeben.
-moneySentTo = \u00a7aDu hast {1} {0} gegeben.
-moneyTaken = {0} wurde aus deiner Geldb\u00f6rse genommen.
-month = Monat
-months = Monate
-moreThanZero = Anzahl muss gr\u00f6sser als 0 sein.
-msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
-muteExempt = \u00a7cDu darfst diesen Spieler nicht stumm machen.
-mutedPlayer = Player {0} ist nun stumm.
-mutedPlayerFor = Player {0} ist nun stumm f\u00fcr {1}.
-mutedUserSpeaks = {0} versuchte zu sprechen, aber ist stumm geschaltet.
-needTpohere = Du brauchst Zugriff auf /tpohere um andere Spieler teleportieren zu k\u00f6nnen.
-negativeBalanceError = Spieler darf keine Schulden machen.
-nickChanged = Nickname ge\u00e4ndert.
+action=* {0} {1}
+addedToAccount=\u00a7a{0} wurden zu deiner Geldb\u00f6rse hinzugef\u00fcgt.
+addedToOthersAccount=\u00a7a{0} wurden zu {1}s Konto hinzugef\u00fcgt.
+alertBroke=zerst\u00f6rt:
+alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bei: {3}
+alertPlaced=platziert:
+alertUsed=benutzt:
+autoAfkKickReason=Du wurdest gekickt, weil du f\u00fcr {0} Minuten inaktiv warst.
+backAfterDeath=\u00a77Benutze den Befehl /back um zu deinem Todespunkt zur\u00fcck zu kehren.
+backUsageMsg=\u00a77Kehre zur letzten Position zur\u00fcck.
+backupFinished=Backup beendet
+backupStarted=Backup gestartet
+balance=\u00a77Geldb\u00f6rse: {0}
+balanceTop=\u00a77 Top Guthaben ({0})
+banExempt=\u00a7cDu kannst diesen Spieler nicht sperren.
+banIpAddress=\u00a77IP-Adresse gesperrt.
+bannedIpsFileError=Fehler beim Lesen von banned-ips.txt
+bannedIpsFileNotFound=banned-ips.txt nicht gefunden
+bannedPlayersFileError=Fehler beim Lesen von banned-players.txt
+bannedPlayersFileNotFound=banned-players.txt nicht gefunden
+bigTreeFailure=\u00a7cFehler beim Pflanzen eines grossen Baums. Versuch es auf Gras oder Dreck.
+bigTreeSuccess= \u00a77Grosser Baum gepflanzt.
+blockList=Essentials relayed the following commands to another plugin:
+broadcast=[\u00a7cRundruf\u00a7f]\u00a7a {0}
+buildAlert=\u00a7cDu hast keine Rechte zum Bauen.
+bukkitFormatChanged=Bukkit-Versionsformat hat sich ge\u00e4ndert. Version nicht kontrolliert.
+burnMsg=\u00a77Du hast {0} f\u00fcr {1} Sekunden in Flammen gesetzt.
+canTalkAgain=\u00a77Du kannst wieder sprechen.
+cantFindGeoIpDB=Kann GeoIP-Datenbank nicht finden!
+cantReadGeoIpDB=Fehler beim Einlesen der GeoIP-Datenbank!
+cantSpawnItem=\u00a7cDu darfst {0} nicht erzeugen.
+commandFailed=Befehl {0} scheiterte:
+commandHelpFailedForPlugin=Fehler beim Abrufen der Hilfe f\u00fcr: {0}
+commandNotLoaded=\u00a7cBefehl {0} ist nicht richtig geladen.
+compassBearing=\u00a77Peilung: {0} ({1} Grad).
+configFileMoveError=Verschieben von config.yml in den Sicherheitskopien-Ordner gescheitert.
+configFileRenameError=Verschieben einer tempor\u00e4ren Datei nach config.yml gescheitert.
+connectedPlayers=Verbundene Spieler:
+connectionFailed=Fehler beim Verbindungsaufbau.
+cooldownWithMessage=\u00a7cBeschr\u00e4nkung: {0}
+corruptNodeInConfig=\u00a74Hinweis: Deine Konfigurationsdatei hat einen ung\u00fcltigen Knoten {0}.
+couldNotFindTemplate=Vorlage {0} konnte nicht gefunden werden.
+creatingConfigFromTemplate=Erstelle Konfiguration aus Vorlage: {0}
+creatingEmptyConfig=Erstelle leere Konfiguration: {0}
+creative=creative
+day=Tag
+days=Tage
+defaultBanReason=Der Bann-Hammer hat gesprochen!
+deleteFileError=Konnte Datei nicht l\u00f6schen: {0}
+deleteHome=\u00a77Zuhause {0} wurde gel\u00f6scht.
+deleteJail=\u00a77Gef\u00e4ngnis {0} wurde gel\u00f6scht.
+deleteWarp=\u00a77Warp-Punkt {0} wurde gel\u00f6scht.
+deniedAccessCommand={0} hat keinen Zugriff auf diesen Befehl.
+dependancyDownloaded=[Essentials] Abh\u00e4ngigkeit {0} erfolgreich runtergeladen.
+dependancyException=[Essentials] W\u00e4hrend dem Download von einer Abh\u00e4ngigkeit ist ein Fehler aufgetreten.
+dependancyNotFound=[Essentials] Eine erforderliche Abh\u00e4ngigkeit wurde nicht gefunde, Download startet jetzt..
+depth=\u00a77Du bist auf Meeresh\u00f6he.
+depthAboveSea=\u00a77Du bist {0} Bl\u00f6cke \u00fcber Meeresh\u00f6he.
+depthBelowSea=\u00a77Du bist {0} Bl\u00f6cke unter Meeresh\u00f6he.
+destinationNotSet=Ziel nicht gesetzt
+disableUnlimited=\u00a77Deaktiviere unendliches Platzieren von {0} f\u00fcr {1}.
+disabled=deaktiviert
+disabledToSpawnMob=Spawning this mob was disabled in the config file.
+dontMoveMessage=\u00a77Teleportvorgang startet in {0}. Beweg dich nicht.
+downloadingGeoIp=Lade GeoIP-Datenbank ... dies kann etwas dauern (country: 0.6 MB, city: 20MB)
+duplicatedUserdata=Doppelte Datei in userdata: {0} und {1}
+enableUnlimited=\u00a77Gebe {1} unendliche Mengen von {0}.
+enabled=aktiviert
+enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand.
+enchantmentNotFound = \u00a7cEnchantment not found
+enchantmentPerm = \u00a7cYou do not have the permission for {0}
+enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item in hand.
+enchantments = \u00a77Enchantments: {0}
+errorCallingCommand=Fehler beim Aufrufen des Befehls /{0}
+errorWithMessage=\u00a7cFehler: {0}
+essentialsHelp1=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat
+essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat
+essentialsReload=\u00a77Essentials neu geladen {0}
+extinguish=\u00a77Du hast dich selbst gel\u00f6scht.
+extinguishOthers=\u00a77Du hast {0} gel\u00f6scht.
+failedToCloseConfig=Fehler beim Schliessen der Konfiguration {0}
+failedToCreateConfig=Fehler beim Erstellen der Konfiguration {0}
+failedToWriteConfig=Fehler beim Schreiben der Konfiguration {0}
+false=false
+feed=\u00a77Your appetite was sated.
+feedOther=\u00a77Satisfied {0}.
+fileRenameError=Umbenennen von {0} gescheitert.
+foreverAlone=\u00a7cDu hast niemanden, dem du antworten kannst.
+freedMemory={0} MB frei gemacht.
+gameMode=\u00a77Set game mode {0} for {1}.
+gcchunks= Chunks,
+gcentities= Einheiten
+gcfree=Freier Speicher: {0} MB
+gcmax=Maximaler Speicher: {0} MB
+gctotal=Reservierter Speicher: {0} MB
+geoIpUrlEmpty=GeoIP Download-URL ist leer.
+geoIpUrlInvalid=GeoIP Download-URL ist ung\u00fcltig.
+geoipJoinFormat=Spieler {0} kommt aus {1}
+godDisabledFor=deaktiviert f\u00fcr {0}
+godEnabledFor=aktiviert f\u00fcr {0}
+godMode=\u00a77Unsterblichkeit {0}.
+haveBeenReleased=\u00a77Du wurdest frei gelassen.
+heal=\u00a77Du wurdest geheilt.
+healOther=\u00a77{0} geheilt.
+helpConsole=Um die Hilfe der Konsole zu sehen, schreibe ?.
+helpOp=\u00a7c[Hilfe]\u00a7f \u00a77{0}:\u00a7f {1}
+helpPages=Seite \u00a7c{0}\u00a7f von \u00a7c{1}\u00a7f:
+holeInFloor=Loch im Boden
+homeSet=\u00a77Zuhause gesetzt.
+homeSetToBed=\u00a77Dein Zuhause ist nun an diesem Bett.
+homes=Heime: {0}
+hour=Stunde
+hours=Stunden
+ignorePlayer=Du ignorierst ab jetzt Spieler {0}.
+illegalDate=Ung\u00fcltiges Datumsformat.
+infoChapter=W\u00e4hle Kapitel:
+infoChapterPages=Kapitel {0}, Seite \u00a7c{1}\u00a7f von \u00a7c{2}\u00a7f:
+infoFileDoesNotExist=Datei info.txt existiert nicht. Erzeuge eine neue Datei.
+infoPages=Seite \u00a7c{0}\u00a7f von \u00a7c{1}\u00a7f:
+infoUnknownChapter=Unbekanntes Kapitel:
+invBigger=Das andere Inventar ist gr\u00f6sser als deins.
+invRestored=Dein Inventar wurde wieder hergestellt.
+invSee=Du siehst das Inventar von {0}.
+invSeeHelp=Benutze /invsee um dein Inventar wiederherzustellen.
+invalidCharge=\u00a7cUng\u00fcltige Verf\u00fcgung.
+invalidMob=Ung\u00fcltiger Monstername.
+invalidServer=Ung\u00fcltiger Server!
+invalidSignLine=Die Zeile {0} auf dem Schild ist falsch.
+invalidWorld=\u00a7cUng\u00fcltige Welt.
+inventoryCleared=\u00a77Inventar geleert.
+inventoryClearedOthers=\u00a77Inventar von \u00a7c{0}\u00a77 geleert.
+is=ist
+itemCannotBeSold=Dieser Gegenstand kann nicht verkauft werden.
+itemMustBeStacked=Gegenstand muss als Stapel verkauft werden. Eine Anzahl von 2s verkauft 2 Stapel usw.
+itemNotEnough1=\u00a7cDu hast nicht genug Gegenst\u00e4nde zum Verkaufen.
+itemNotEnough2=\u00a77Wenn du alles verkaufen willst, nutze /sell itemname
+itemNotEnough3=\u00a77/sell itemname -1 verkauft alles bis auf eins usw.
+itemSellAir=Du versuchst Luft zu verkaufen? Nimm einen Gegenstand in die Hand.
+itemSold=\u00a77Verkauft f\u00fcr \u00a7c{0}\u00a77 ({1} {2} Einheiten je {3})
+itemSoldConsole={0} verkauft {1} f\u00fcr \u00a77{2}\u00a77 ({3} Einheiten je {4})
+itemSpawn=\u00a77Gebe {0}x {1}
+itemsCsvNotLoaded=Konnte items.csv nicht laden.
+jailAlreadyIncarcerated=\u00a7cPerson is already in jail: {0}
+jailMessage=\u00a7cDu hast ein Verbrechen begangen, also hast du Zeit.
+jailNotExist=Dieses Gef\u00e4ngnis existiert nicht.
+jailReleased=\u00a77Spieler \u00a7e{0}\u00a77 wurde freigelassen.
+jailReleasedPlayerNotify=\u00a77Du wurdest freigelassen!
+jailSentenceExtended=Gef\u00e4ngnisszeit erweitert auf: {0)
+jailSet=\u00a77Gef\u00e4ngnis {0} wurde erstellt.
+jumpError=Das w\u00fcrde deinen Computer \u00fcberlasten.
+kickDefault=Vom Server geworfen
+kickExempt=\u00a7cDu kannst diesen Spieler nicht rauswerfen.
+kill=\u00a77{0} get\u00f6tet.
+kitError2=\u00a7cDiese Ausr\u00fcstung existiert nicht oder ist ung\u00fcltig.
+kitError=\u00a7cEs gibt keine g\u00fcltigen Ausr\u00fcstungen.
+kitErrorHelp=\u00a7cEventuell fehlt bei einem Gegenstand die Menge?
+kitGive=\u00a77Gebe Ausr\u00fcstung {0}.
+kitInvFull=\u00a7cDein Inventar ist voll, lege Ausr\u00fcstung auf den Boden
+kitTimed=\u00a7cDu kannst diese Ausr\u00fcstung nicht innerhalb von {0} anfordern.
+kits=\u00a77Ausr\u00fcstungen: {0}
+lightningSmited=\u00a77Du wurdest gepeinigt.
+lightningUse=\u00a77Peinige {0}
+listAfkTag = \u00a77[Inaktiv]\u00a7f
+listAmount = \u00a79Es sind \u00a7c{0}\u00a79 von maximal \u00a7c{1}\u00a79 Spielern online.
+listAmountHidden = \u00a79Es sind \u00a7c{0}\u00a77/{1}\u00a79 von maximal \u00a7c{2}\u00a79 Spielern online.
+listHiddenTag = \u00a77[Versteckt]\u00a7f
+loadWarpError=Fehler beim Laden von Warp-Punkt {0}
+loadinfo=Plugin {0} Version {1} geladen, erstellt von {2}, \u00fcbersetzt von snowleo
+localFormat=Lokal: <{0}> {1}
+mailClear=\u00a7cUm deine Nachrichten zu l\u00f6schen, schreibe /mail clear
+mailCleared=\u00a77Nachrichten gel\u00f6scht!
+mailSent=\u00a77Nachricht gesendet!
+markMailAsRead=\u00a7cUm deine Nachrichten zu l\u00f6schen, schreibe /mail clear
+markedAsAway=\u00a77Du wirst als abwesend angezeigt.
+markedAsNotAway=\u00a77Du wirst nicht mehr als abwesend angezeigt.
+maxHomes=Du kannst nicht mehr als {0} Zuhause setzen.
+mayNotJail=\u00a7cDu kannst diese Person nicht einsperren.
+me=mir
+minute=Minute
+minutes=Minuten
+missingItems=Du ben\u00f6tigst {0}x {1}.
+missingPrefixSuffix=Prefix/Suffix fehlt f\u00fcr {0}
+mobSpawnError=Fehler beim \u00e4ndern des Monster-Spawner.
+mobSpawnLimit=Anzahl an Monster auf Serverlimit beschr\u00e4nkt
+mobSpawnTarget=Zielblock, muss ein Monster-Spawner sein.
+mobsAvailable=\u00a77Mobs: {0}
+moneyRecievedFrom=\u00a7a{1} hat dir {0} gegeben.
+moneySentTo=\u00a7aDu hast {1} {0} gegeben.
+moneyTaken={0} wurde aus deiner Geldb\u00f6rse genommen.
+month=Monat
+months=Monate
+moreThanZero=Anzahl muss gr\u00f6sser als 0 sein.
+msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
+muteExempt=\u00a7cDu darfst diesen Spieler nicht stumm machen.
+mutedPlayer=Player {0} ist nun stumm.
+mutedPlayerFor=Player {0} ist nun stumm f\u00fcr {1}.
+mutedUserSpeaks={0} versuchte zu sprechen, aber ist stumm geschaltet.
+nearbyPlayers=Players nearby: {0}
+needTpohere=Du brauchst Zugriff auf /tpohere um andere Spieler teleportieren zu k\u00f6nnen.
+negativeBalanceError=Spieler darf keine Schulden machen.
+nickChanged=Nickname ge\u00e4ndert.
nickDisplayName=\u00a77Du musst \u00a7fchange-displayname\u00a7c in der Essentials-Config aktivieren.
-nickInUse = \u00a7cDieser Name wird bereits verwendet.
-nickNamesAlpha = \u00a7cNicknamen d\u00fcrfen nur alphanumerische Zeichen enthalten.
-nickNoMore = \u00a7Du hast keinen Nicknamen mehr.
-nickOthersPermission = \u00a7cDu hast keine Rechte um den Nicknamen von anderen zu \u00e4ndern.
-nickSet = \u00a77Dein Nickname ist nun \u00a7c{0}
-noAccessCommand = \u00a7cDu hast keinen Zugriff auf diesen Befehl.
-noAccessPermission = \u00a7cDu hast keine Rechte, den Block {0} zu \u00f6ffnen.
-noDestroyPermission = \u00a7cDu hast keine Rechte, den Block {0} zu zerst\u00f6ren.
-noHelpFound = \u00a7cKeine \u00fcbereinstimmenden Kommandos.
-noHomeSet = Du hast kein Zuhause gesetzt.
-noHomeSetPlayer = Spieler hat kein Zuhause gesetzt.
-noKitPermission = \u00a7cDu brauchst die Berechtigung \u00a7c{0}\u00a7c um diese Ausr\u00fcstung anzufordern.
-noKits = \u00a77Es sind keine Ausr\u00fcstungen verf\u00fcgbar.
-noMail = Du hast keine Nachrichten
-noMailSendPerm = \u00a7cDu hast die Rechte \u00a7fessentials.mail.send\u00a7c nicht.
-noMotd = \u00a7cEs existiert keine Willkommensnachricht.
-noNewMail = \u00a77Du hast keine Nachrichten.
-noPendingRequest = Du hast keine Teleportierungsanfragen.
-noPlacePermission = \u00a7cDu hast keine Rechte, einen Block in der N\u00e4he des Schildes zu platzieren.
-noPowerTools = Du hast keine Powertools zugewiesen.
-noRules = \u00a7cEs wurden keine Regeln definiert.
-noWarpsDefined = Keine Warp-Punkte erstellt.
-none = keine
-notAllowedToQuestion = \u00a7cDu bist nicht berechtigt zu fragen.
-notAllowedToShout = \u00a7cDu bist nicht berechtigt zu schreien.
-notEnoughMoney = Du hast nicht genug Geld.
-notRecommendedBukkit = Die verwendete Bukkit-Version ist nicht f\u00fcr Essentials empfohlen.
-notSupportedYet = Noch nicht verf\u00fcgbar.
-now = jetzt
-numberRequired = Ein Zahl wird ben\u00f6tigt.
-onlyDayNight = /time unterst\u00fctzt nur day und night.
-onlyPlayers = Nur Spieler k\u00f6nnen {0} benutzen.
-onlySunStorm = /weather unterst\u00fctzt nur sun und storm.
-pTimeCurrent = \u00a7e{0}''s\u00a7f time is {1}.
-pTimeCurrentFixed = \u00a7e{0}''s\u00a7f Zeit wurde zu {1} gesetzt.
-pTimeNormal = \u00a7e{0}''s\u00a7f Zeit ist normal und entspricht der Serverzeit.
-pTimeOthersPermission = \u00a7cDu hast keine Berechtigung die Zeit von anderen Spielern zu \u00e4ndern.
-pTimePlayers = Diese Spieler haben ihre eigene Zeit:
-pTimeReset = Zeit wurde zur\u00fcgesetzt f\u00fcr: \u00a7e{0}
-pTimeSet = Zeit wurde f\u00fcr \u00a7e{1}\u00a7f zu \u00a73{0}\u00a7f gesetzt.
-pTimeSetFixed = Spielerzeit ist festgesetzt zu \u00a73{0}\u00a7f f\u00fcr: \u00a7e{1}
-parseError = Fehler beim Parsen von {0} in Zeile {1}
-pendingTeleportCancelled = \u00a7cLaufende Teleportierung abgebrochen.
-permissionsError = Permissions/GroupManager fehlt; Chat-Prefixe/-Suffixe sind ausgeschaltet.
-playerBanned = \u00a7cSpieler {0} gesperrt: {1}
-playerInJail = \u00a7cSpieler ist bereits in Gef\u00e4ngnis {0}.
-playerJailed = \u00a77Spieler {0} eingesperrt.
-playerJailedFor = \u00a77Spieler {0} eingesperrt f\u00fcr {1}.
-playerKicked = \u00a7cSpieler {0} rausgeworfen: {1}
-playerMuted = \u00a77Du bist jetzt stumm.
-playerMutedFor = \u00a77Du bist jetzt stumm f\u00fcr {0}.
-playerNeverOnServer = \u00a7cSpieler {0} war niemals auf diesem Server.
-playerNotFound = \u00a7cSpieler nicht gefunden.
-playerUnmuted = \u00a77Du bist nicht mehr stumm.
-pong = Pong!
-possibleWorlds = \u00a77M\u00f6gliche Welten sind nummeriet von 0 bis {0}.
-powerToolAir = Befehl kann nicht mit Luft verbunden werden.
-powerToolAlreadySet = Befehl \u00a7c{0}\u00a7f ist bereits zu {1} hinzugef\u00fcgt.
-powerToolAttach = Befehl \u00a7c{0}\u00a7f erfolgreich zu {1} hinzugef\u00fcgt.
+nickInUse=\u00a7cDieser Name wird bereits verwendet.
+nickNamesAlpha=\u00a7cNicknamen d\u00fcrfen nur alphanumerische Zeichen enthalten.
+nickNoMore=\u00a7Du hast keinen Nicknamen mehr.
+nickOthersPermission=\u00a7cDu hast keine Rechte um den Nicknamen von anderen zu \u00e4ndern.
+nickSet=\u00a77Dein Nickname ist nun \u00a7c{0}
+noAccessCommand=\u00a7cDu hast keinen Zugriff auf diesen Befehl.
+noAccessPermission=\u00a7cDu hast keine Rechte, den Block {0} zu \u00f6ffnen.
+noDestroyPermission=\u00a7cDu hast keine Rechte, den Block {0} zu zerst\u00f6ren.
+noGodWorldWarning=\u00a7cWarning! God mode in this world disabled.
+noHelpFound=\u00a7cKeine \u00fcbereinstimmenden Kommandos.
+noHomeSet=Du hast kein Zuhause gesetzt.
+noHomeSetPlayer=Spieler hat kein Zuhause gesetzt.
+noKitPermission=\u00a7cDu brauchst die Berechtigung \u00a7c{0}\u00a7c um diese Ausr\u00fcstung anzufordern.
+noKits=\u00a77Es sind keine Ausr\u00fcstungen verf\u00fcgbar.
+noMail=Du hast keine Nachrichten
+noMotd=\u00a7cEs existiert keine Willkommensnachricht.
+noNewMail=\u00a77Du hast keine Nachrichten.
+noPendingRequest=Du hast keine Teleportierungsanfragen.
+noPerm=\u00a7cDu hast die Rechte \u00a7f{0}\u00a7c nicht.
+noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob.
+noPlacePermission=\u00a7cDu hast keine Rechte, einen Block in der N\u00e4he des Schildes zu platzieren.
+noPowerTools=Du hast keine Powertools zugewiesen.
+noRules=\u00a7cEs wurden keine Regeln definiert.
+noWarpsDefined=Keine Warp-Punkte erstellt.
+none=keine
+notAllowedToQuestion=\u00a7cDu bist nicht berechtigt zu fragen.
+notAllowedToShout=\u00a7cDu bist nicht berechtigt zu schreien.
+notEnoughExperience=You do not have enough experience.
+notEnoughMoney=Du hast nicht genug Geld.
+notRecommendedBukkit=* ! * Die verwendete Bukkit-Version ist nicht f\u00fcr Essentials empfohlen.
+notSupportedYet=Noch nicht verf\u00fcgbar.
+nothingInHand = \u00a7cYou have nothing in your hand.
+now=jetzt
+numberRequired=Ein Zahl wird ben\u00f6tigt.
+onlyDayNight=/time unterst\u00fctzt nur day und night.
+onlyPlayers=Nur Spieler k\u00f6nnen {0} benutzen.
+onlySunStorm=/weather unterst\u00fctzt nur sun und storm.
+orderBalances=Ordering balances of {0} users, please wait ...
+pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}.
+pTimeCurrentFixed=\u00a7e{0}''s\u00a7f Zeit wurde zu {1} gesetzt.
+pTimeNormal=\u00a7e{0}''s\u00a7f Zeit ist normal und entspricht der Serverzeit.
+pTimeOthersPermission=\u00a7cDu hast keine Berechtigung die Zeit von anderen Spielern zu \u00e4ndern.
+pTimePlayers=Diese Spieler haben ihre eigene Zeit:
+pTimeReset=Zeit wurde zur\u00fcgesetzt f\u00fcr: \u00a7e{0}
+pTimeSet=Zeit wurde f\u00fcr \u00a7e{1}\u00a7f zu \u00a73{0}\u00a7f gesetzt.
+pTimeSetFixed=Spielerzeit ist festgesetzt zu \u00a73{0}\u00a7f f\u00fcr: \u00a7e{1}
+parseError=Fehler beim Parsen von {0} in Zeile {1}
+pendingTeleportCancelled=\u00a7cLaufende Teleportierung abgebrochen.
+permissionsError=Permissions/GroupManager fehlt; Chat-Prefixe/-Suffixe sind ausgeschaltet.
+playerBanned=\u00a7cSpieler {0} gesperrt: {1}
+playerInJail=\u00a7cSpieler ist bereits in Gef\u00e4ngnis {0}.
+playerJailed=\u00a77Spieler {0} eingesperrt.
+playerJailedFor= \u00a77Spieler {0} eingesperrt f\u00fcr {1}.
+playerKicked=\u00a7cSpieler {0} rausgeworfen: {1}
+playerMuted=\u00a77Du bist jetzt stumm.
+playerMutedFor=\u00a77Du bist jetzt stumm f\u00fcr {0}.
+playerNeverOnServer=\u00a7cSpieler {0} war niemals auf diesem Server.
+playerNotFound=\u00a7cSpieler nicht gefunden.
+playerUnmuted=\u00a77Du bist nicht mehr stumm.
+pong=Pong!
+possibleWorlds=\u00a77M\u00f6gliche Welten sind nummeriet von 0 bis {0}.
+powerToolAir=Befehl kann nicht mit Luft verbunden werden.
+powerToolAlreadySet=Befehl \u00a7c{0}\u00a7f ist bereits zu {1} hinzugef\u00fcgt.
+powerToolAttach=Befehl \u00a7c{0}\u00a7f erfolgreich zu {1} hinzugef\u00fcgt.
powerToolClearAll= Alle Powertoolkommandos wurden entfernt.
-powerToolList = {1} hat die folgenden Befehle: \u00a7c{0}\u00a7f.
-powerToolListEmpty = {0} hat keinen Befehl.
-powerToolNoSuchCommandAssigned = Befehl \u00a7c{0}\u00a7f wurde nicht zu {1} hinzugef\u00fcgt.
-powerToolRemove = Befehl \u00a7c{0}\u00a7f erfolgreich von {1} entfernt.
-powerToolRemoveAll = Alle Befehle von {0} entfernt.
-powerToolsEnabled = Alle deine Powertools wurden aktiviert.
-powerToolsDisabled = Alle deine Powertools wurden deaktiviert.
-protectionOwner = \u00a76[EssentialsProtect] Besitzer dieses Blocks: {0}
-questionFormat = \u00a77[Frage]\u00a7f {0}
-reloadAllPlugins = \u00a77Alle plugins neu geladen.
-repair = Du hast erfolgreich deine {0} repariert.
-repairAlreadyFixed = \u00a77Dieser Gegenstand ben\u00f6tigt keine Reparatur.
-repairInvalidType = \u00a7cDieser Gegenstand kann nicht repariert werden.
-repairNone = Es sind keine Gegenst\u00e4nde vorhanden, die repariert werden k\u00f6nnen.
-requestAccepted = \u00a77Teleportierungsanfrage akzeptiert.
-requestAcceptedFrom = \u00a77{0} hat deine Teleportierungsanfrage angenommen.
-requestDenied = \u00a77Teleportierungsanfrage verweigert.
-requestDeniedFrom = \u00a77{0} hat deine Teleportierungsanfrage abgelehnt.
-requestSent = \u00a77Anfrage gesendet an {0}\u00a77.
-returnPlayerToJailError = Fehler beim Versuch, den Spieler ins Gef\u00e4ngnis zu teleportieren.
-second = Sekunde
-seconds = Sekunden
-seenOffline = Spieler {0} ist offline seit {1}
-seenOnline = Spieler {0} ist online seit {1}
-serverFull = Server ist voll
-setSpawner = \u00c4ndere Mob-Spawner zu {0}
-sheepMalformedColor = Ung\u00fcltige Farbe.
-shoutFormat = \u00a77[Schrei]\u00a7f {0}
-signFormatFail = \u00a74[{0}]
-signFormatSuccess = \u00a71[{0}]
-signFormatTemplate = [{0}]
-signProtectInvalidLocation = \u00a74Du bist nicht befugt ein Schild hierhin zu setzen.
-similarWarpExist = Ein Warp-Punkt mit einem \u00e4hnlichen Namen existiert bereits.
-slimeMalformedSize = Ung\u00fcltige Gr\u00f6sse.
-soloMob = Das Monster m\u00f6chte allein sein.
-spawnSet = \u00a77Spawn-Punkt gesetzt f\u00fcr Gruppe {0}.
-spawned = erzeugt
-suicideMessage = \u00a77Lebewohl grausame Welt...
-suicideSuccess = \u00a77{0} hat sich das Leben genommen.
-takenFromAccount = \u00a7c{0} wurden aus deiner Geldb\u00f6rse genommen.
-takenFromOthersAccount = \u00a7c{0} wurde von {1} wurde Rechnung getragen.
-teleportAAll = \u00a77Teleportierungsanfrage zu allen Spielern gesendet...
-teleportAll = \u00a77Teleportiere alle Spieler...
-teleportAtoB = \u00a77{0}\u00a77 teleportiert dich zu {1}\u00a77.
-teleportDisabled = {0} verweigert die Teleportierung.
-teleportHereRequest = \u00a7c{0}\u00a7c fragt, ob du dich zu ihm teleportierst.
-teleportNewPlayerError = Fehler beim Teleportieren eines neuen Spielers
-teleportRequest = \u00a7c{0}\u00a7c fragt, ob er sich zu dir teleportieren darf.
-teleportTop = \u00a77Teleportiere nach oben.
-teleportationCommencing = \u00a77Teleportierung gestartet...
-teleportationDisabled = \u00a77Teleportierung deaktiviert.
-teleportationEnabled = \u00a77Teleportierung aktiviert.
-teleporting = \u00a77Teleportiere...
-teleportingPortal = \u00a77Teleportiere durch Portal.
-tempBanned = Zeitlich gesperrt vom Server f\u00fcr {0}
-tempbanExempt = \u00a77Du kannst diesen Spieler nicht zeitlich sperren.
-thunder = Es donnert nun in deiner Welt {0}.
-thunderDuration = Es donnert nun f\u00fcr {1} Sekunden in deiner Welt {0}.
-timeBeforeHeal = Zeit bis zur n\u00e4chsten Heilung: {0}
-timeBeforeTeleport = Zeit bis zum n\u00e4chsten Teleport: {0}
-timeFormat = \u00a73{0}\u00a7f oder \u00a73{1}\u00a7f oder \u00a73{2}\u00a7f
-timePattern = (?:([0-9]+)\\s*[yj][a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[dt][a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:h|st)[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
-timeSet = Zeit in allen Welten gesetzt.
-timeSetPermission = \u00a7cDu hast keine Berechtigung die Zeit zu \u00e4ndern.
-timeWorldCurrent = Die momentane Zeit in {0} ist \u00a73{1}
-timeWorldSet = Die Zeit in \u00a7c{1}\u00a7f wurde zu {0} gesetzt.
-tradeCompleted = \u00a77Handel abgeschlossen.
-tradeSignEmpty = Der Bestand des Trade-Schild ist aufgebraucht.
-tradeSignEmptyOwner = Es gibt nichts mehr zu Sammeln von diesem Trade-Schild.
-treeFailure = \u00a7cBaumpflanzung gescheitert. Versuche es auf Gras oder Dreck.
-treeSpawned = \u00a77Baum gepflanzt.
-typeTpaccept = \u00a77Um zu teleportieren, schreibe \u00a7c/tpaccept\u00a77.
-typeTpdeny = \u00a77Um diese Anfrage abzulehnen, schreibe \u00a7c/tpdeny\u00a77.
-typeWorldName = \u00a77Du kannst auch den Namen der Welt eingeben.
-unableToSpawnMob = Fehler beim Erzeugen eines Monster.
-unbannedIP = Verbannung von IP-Adresse r\u00fcckg\u00e4ngig gemacht.
-unbannedPlayer = Verbannung von Spieler r\u00fcckg\u00e4ngig gemacht.
-unignorePlayer = Du ignorierst Spieler {0} nicht mehr.
-unknownItemId = Unbekannte Item-Id: {0}
-unknownItemInList = Unbekannter Gegenstand {0} in Liste {1}.
-unknownItemName = Unbekannter Gegenstand: {0}
-unlimitedItemPermission = \u00a7cDu hast keine Rechte f\u00fcr {0}.
-unlimitedItems = Unendliche Objekte:
-unmutedPlayer = Spieler {0} ist nicht mehr stumm.
-upgradingFilesError = Fehler beim Aktualisieren der Dateien
-userDoesNotExist = Spieler {0} existiert nicht.
-userIsAway = {0} ist abwesend.
-userIsNotAway = {0} ist wieder da.
-userJailed = \u00a77Du wurdest eingesperrt.
-userUsedPortal = {0} benutzt ein vorhandenes Ausgangsportal.
-userdataMoveBackError = Verschieben von userdata/{0}.tmp nach userdata/{1} gescheitert.
-userdataMoveError = Verschieben von userdata/{0} nach userdata/{1}.tmp gescheitert.
-usingTempFolderForTesting = Benutze tempor\u00e4ren Ordner zum Testen:
-versionMismatch = Versionen nicht identisch! Bitte aktualisiere {0}.
-versionMismatchAll = Versionen ungleich! Bitte aktualisiere alle Essentials jars auf die gleiche Version.
-voiceSilenced = \u00a77Du bist stumm
-warpDeleteError = Fehler beim L\u00f6schen der Warp-Datei.
-warpListPermission = \u00a7cDu hast keine Berechtigung, die Warp-Punkte anzuzeigen.
-warpNotExist = Warp-Punkt existiert nicht.
-warpSet = \u00a77Warp-Punkt {0} wurde erstellt.
-warpUsePermission = \u00a7cDu hast keinen Zugriff f\u00fcr diesen Warp-Punkt.
-warpingTo = \u00a77Teleportiere zu Warp-Punkt {0}.
-warpsCount = \u00a77Es gibt {0} Warp-Punkte. Zeige Seite {1} von {2}.
-weatherStorm = \u00a77In {0} st\u00fcrmt es nun.
-weatherStormFor = \u00a77In {0} st\u00fcrmt es nun f\u00fcr {1} Sekunden.
-weatherSun = \u00a77In {0} scheint nun die Sonne.
-weatherSunFor = \u00a77In {0} scheint nun f\u00fcr {1} Sekunden die Sonne.
-whoisGeoLocation = \u00a79 - Herkunft: {0}
-whoisHealth = \u00a79 - Gesundheit: {0}/20
-whoisIPAddress = \u00a79 - IP-Adresse: {0}
-whoisIs = {0} ist {1}
-whoisLocation = \u00a79 - Position: ({0}, {1}, {2}, {3})
-whoisMoney = \u00a79 - Geldb\u00f6rse: {0}
-whoisStatusAvailable = \u00a79 - Status: Anwesend
-whoisStatusAway = \u00a79 - Status: \u00a7cAbwesend\u00a7f
-worth = \u00a77Ein Stapel von {0} ist \u00a7c{1}\u00a77 wert ({2} Einheiten je {3})
-worthMeta = \u00a77Ein Stapel von {0} mit Metadaten {1} ist \u00a7c{2}\u00a77 wert. ({3} Einheiten je {4})
-worthSet = Wert des Gegenstands gesetzt.
-year = Jahr
-years = Jahre
-youAreHealed = \u00a77Du wurdest geheilt.
-youHaveNewMail = \u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen.
-
+powerToolList={1} hat die folgenden Befehle: \u00a7c{0}\u00a7f.
+powerToolListEmpty={0} hat keinen Befehl.
+powerToolNoSuchCommandAssigned=Befehl \u00a7c{0}\u00a7f wurde nicht zu {1} hinzugef\u00fcgt.
+powerToolRemove=Befehl \u00a7c{0}\u00a7f erfolgreich von {1} entfernt.
+powerToolRemoveAll=Alle Befehle von {0} entfernt.
+powerToolsDisabled=Alle deine Powertools wurden deaktiviert.
+powerToolsEnabled=Alle deine Powertools wurden aktiviert.
+protectionOwner=\u00a76[EssentialsProtect] Besitzer dieses Blocks: {0}
+questionFormat=\u00a77[Frage]\u00a7f {0}
+readNextPage=Type /{0} {1} to read the next page
+reloadAllPlugins=\u00a77Alle plugins neu geladen.
+removed=\u00a77Removed {0} entities.
+repair=Du hast erfolgreich deine {0} repariert.
+repairAlreadyFixed=\u00a77Dieser Gegenstand ben\u00f6tigt keine Reparatur.
+repairEnchanted=\u00a77You are not allowed to repair enchanted items.
+repairInvalidType=\u00a7cDieser Gegenstand kann nicht repariert werden.
+repairNone=Es sind keine Gegenst\u00e4nde vorhanden, die repariert werden k\u00f6nnen.
+requestAccepted=\u00a77Teleportierungsanfrage akzeptiert.
+requestAcceptedFrom=\u00a77{0} hat deine Teleportierungsanfrage angenommen.
+requestDenied=\u00a77Teleportierungsanfrage verweigert.
+requestDeniedFrom=\u00a77{0} hat deine Teleportierungsanfrage abgelehnt.
+requestSent=\u00a77Anfrage gesendet an {0}\u00a77.
+requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
+returnPlayerToJailError=Fehler beim Versuch, den Spieler ins Gef\u00e4ngnis zu teleportieren.
+second=Sekunde
+seconds=Sekunden
+seenOffline=Spieler {0} ist offline seit {1}
+seenOnline=Spieler {0} ist online seit {1}
+serverFull=Server ist voll
+setSpawner=\u00c4ndere Mob-Spawner zu {0}
+sheepMalformedColor=Ung\u00fcltige Farbe.
+shoutFormat=\u00a77[Schrei]\u00a7f {0}
+signFormatFail=\u00a74[{0}]
+signFormatSuccess=\u00a71[{0}]
+signFormatTemplate=[{0}]
+signProtectInvalidLocation=\u00a74Du bist nicht befugt ein Schild hierhin zu setzen.
+similarWarpExist=Ein Warp-Punkt mit einem \u00e4hnlichen Namen existiert bereits.
+slimeMalformedSize=Ung\u00fcltige Gr\u00f6sse.
+soloMob=Das Monster m\u00f6chte allein sein.
+spawnSet=\u00a77Spawn-Punkt gesetzt f\u00fcr Gruppe {0}.
+spawned=erzeugt
+suicideMessage=\u00a77Lebewohl grausame Welt...
+suicideSuccess= \u00a77{0} hat sich das Leben genommen.
+survival=survival
+takenFromAccount=\u00a7c{0} wurden aus deiner Geldb\u00f6rse genommen.
+takenFromOthersAccount=\u00a7c{0} wurde von {1} wurde Rechnung getragen.
+teleportAAll=\u00a77Teleportierungsanfrage zu allen Spielern gesendet...
+teleportAll=\u00a77Teleportiere alle Spieler...
+teleportAtoB=\u00a77{0}\u00a77 teleportiert dich zu {1}\u00a77.
+teleportDisabled={0} verweigert die Teleportierung.
+teleportHereRequest=\u00a7c{0}\u00a7c fragt, ob du dich zu ihm teleportierst.
+teleportNewPlayerError=Fehler beim Teleportieren eines neuen Spielers
+teleportRequest=\u00a7c{0}\u00a7c fragt, ob er sich zu dir teleportieren darf.
+teleportTop=\u00a77Teleportiere nach oben.
+teleportationCommencing=\u00a77Teleportierung gestartet...
+teleportationDisabled=\u00a77Teleportierung deaktiviert.
+teleportationEnabled=\u00a77Teleportierung aktiviert.
+teleporting=\u00a77Teleportiere...
+teleportingPortal=\u00a77Teleportiere durch Portal.
+tempBanned=Zeitlich gesperrt vom Server f\u00fcr {0}
+tempbanExempt=\u00a77Du kannst diesen Spieler nicht zeitlich sperren.
+thunder= Es donnert nun in deiner Welt {0}.
+thunderDuration=Es donnert nun f\u00fcr {1} Sekunden in deiner Welt {0}.
+timeBeforeHeal=Zeit bis zur n\u00e4chsten Heilung: {0}
+timeBeforeTeleport=Zeit bis zum n\u00e4chsten Teleport: {0}
+timeFormat=\u00a73{0}\u00a7f oder \u00a73{1}\u00a7f oder \u00a73{2}\u00a7f
+timePattern=(?:([0-9]+)\\s*[yj][a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[dt][a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:h|st)[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
+timeSet=Zeit in allen Welten gesetzt.
+timeSetPermission=\u00a7cDu hast keine Berechtigung die Zeit zu \u00e4ndern.
+timeWorldCurrent=Die momentane Zeit in {0} ist \u00a73{1}
+timeWorldSet=Die Zeit in \u00a7c{1}\u00a7f wurde zu {0} gesetzt.
+tradeCompleted=\u00a77Handel abgeschlossen.
+tradeSignEmpty=Der Bestand des Trade-Schild ist aufgebraucht.
+tradeSignEmptyOwner=Es gibt nichts mehr zu Sammeln von diesem Trade-Schild.
+treeFailure=\u00a7cBaumpflanzung gescheitert. Versuche es auf Gras oder Dreck.
+treeSpawned=\u00a77Baum gepflanzt.
+true=true
+typeTpaccept=\u00a77Um zu teleportieren, schreibe \u00a7c/tpaccept\u00a77.
+typeTpdeny=\u00a77Um diese Anfrage abzulehnen, schreibe \u00a7c/tpdeny\u00a77.
+typeWorldName=\u00a77Du kannst auch den Namen der Welt eingeben.
+unableToSpawnMob=Fehler beim Erzeugen eines Monster.
+unbannedIP=Verbannung von IP-Adresse r\u00fcckg\u00e4ngig gemacht.
+unbannedPlayer=Verbannung von Spieler r\u00fcckg\u00e4ngig gemacht.
+unignorePlayer=Du ignorierst Spieler {0} nicht mehr.
+unknownItemId=Unbekannte Item-Id: {0}
+unknownItemInList=Unbekannter Gegenstand {0} in Liste {1}.
+unknownItemName=Unbekannter Gegenstand: {0}
+unlimitedItemPermission=\u00a7cDu hast keine Rechte f\u00fcr {0}.
+unlimitedItems=Unendliche Objekte:
+unmutedPlayer=Spieler {0} ist nicht mehr stumm.
+upgradingFilesError=Fehler beim Aktualisieren der Dateien
+userDoesNotExist=Spieler {0} existiert nicht.
+userIsAway={0} ist abwesend.
+userIsNotAway={0} ist wieder da.
+userJailed=\u00a77Du wurdest eingesperrt.
+userUsedPortal={0} benutzt ein vorhandenes Ausgangsportal.
+userdataMoveBackError=Verschieben von userdata/{0}.tmp nach userdata/{1} gescheitert.
+userdataMoveError=Verschieben von userdata/{0} nach userdata/{1}.tmp gescheitert.
+usingTempFolderForTesting=Benutze tempor\u00e4ren Ordner zum Testen:
+versionMismatch=Versionen nicht identisch! Bitte aktualisiere {0}.
+versionMismatchAll=Versionen ungleich! Bitte aktualisiere alle Essentials jars auf die gleiche Version.
+voiceSilenced=\u00a77Du bist stumm
+warpDeleteError=Fehler beim L\u00f6schen der Warp-Datei.
+warpListPermission=\u00a7cDu hast keine Berechtigung, die Warp-Punkte anzuzeigen.
+warpNotExist=Warp-Punkt existiert nicht.
+warpSet=\u00a77Warp-Punkt {0} wurde erstellt.
+warpUsePermission=\u00a7cDu hast keinen Zugriff f\u00fcr diesen Warp-Punkt.
+warpingTo=\u00a77Teleportiere zu Warp-Punkt {0}.
+warps=Warps: {0}
+warpsCount=\u00a77Es gibt {0} Warp-Punkte. Zeige Seite {1} von {2}.
+weatherStorm=\u00a77In {0} st\u00fcrmt es nun.
+weatherStormFor=\u00a77In {0} st\u00fcrmt es nun f\u00fcr {1} Sekunden.
+weatherSun=\u00a77In {0} scheint nun die Sonne.
+weatherSunFor=\u00a77In {0} scheint nun f\u00fcr {1} Sekunden die Sonne.
+whoisBanned=\u00a79 - Banned: {0}
+whoisGamemode=\u00a79 - Gamemode: {0}
+whoisGeoLocation=\u00a79 - Herkunft: {0}
+whoisGod=\u00a79 - God mode: {0}
+whoisHealth=\u00a79 - Gesundheit: {0}/20
+whoisIPAddress=\u00a79 - IP-Adresse: {0}
+whoisIs={0} ist {1}
+whoisLocation=\u00a79 - Position: ({0}, {1}, {2}, {3})
+whoisMoney=\u00a79 - Geldb\u00f6rse: {0}
+whoisOP=\u00a79 - OP: {0}
+whoisStatusAvailable=\u00a79 - Status: Anwesend
+whoisStatusAway=\u00a79 - Status: \u00a7cAbwesend\u00a7f
+worth=\u00a77Ein Stapel von {0} ist \u00a7c{1}\u00a77 wert ({2} Einheiten je {3})
+worthMeta=\u00a77Ein Stapel von {0} mit Metadaten {1} ist \u00a7c{2}\u00a77 wert. ({3} Einheiten je {4})
+worthSet=Wert des Gegenstands gesetzt.
+year=Jahr
+years=Jahre
+youAreHealed=\u00a77Du wurdest geheilt.
+youHaveNewMail=\u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen.
+requestTimedOut=\u00a7cTeleport request has timed out
+teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties
index e4d40adf2..9476b8bcf 100644
--- a/Essentials/src/messages_en.properties
+++ b/Essentials/src/messages_en.properties
@@ -2,369 +2,405 @@
# Single quotes have to be doubled: ''
# Translations start here
# by:
-action = * {0} {1}
-addedToAccount = \u00a7a{0} has been added to your account.
-addedToOthersAccount = \u00a7a{0} has been added to {1} account.
-alertBroke = broke:
-alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3}
-alertPlaced = placed:
-alertUsed = used:
+action=* {0} {1}
+addedToAccount=\u00a7a{0} has been added to your account.
+addedToOthersAccount=\u00a7a{0} has been added to {1} account.
+alertBroke=broke:
+alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3}
+alertPlaced=placed:
+alertUsed=used:
autoAfkKickReason=You have been kicked for idling more than {0} minutes.
-backAfterDeath = \u00a77Use the /back command to return to your death point.
-backUsageMsg = \u00a77Returning to previous location.
-backupFinished = Backup finished
-backupStarted = Backup started
-balance = \u00a77Balance: {0}
-balanceTop = \u00a77 Top {0} balances
-banExempt = \u00a7cYou can not ban that player.
-banIpAddress = \u00a77Banned IP address
-bannedIpsFileError = Error reading banned-ips.txt
-bannedIpsFileNotFound = banned-ips.txt not found
-bannedPlayersFileError = Error reading banned-players.txt
-bannedPlayersFileNotFound = banned-players.txt not found
-bigTreeFailure = \u00a7cBig tree generation failure. Try again on grass or dirt.
-bigTreeSuccess = \u00a77Big tree spawned.
-broadcast = [\u00a7cBroadcast\u00a7f]\u00a7a {0}
-buildAlert = \u00a7cYou are not permitted to build
-bukkitFormatChanged = Bukkit version format changed. Version not checked.
-burnMsg = \u00a77You set {0} on fire for {1} seconds.
-canTalkAgain = \u00a77You can talk again
-cantFindGeoIpDB = Can''t find GeoIP database!
-cantReadGeoIpDB = Failed to read GeoIP database!
-cantSpawnItem = \u00a7cYou are not allowed to spawn the item {0}
-commandFailed = Command {0} failed:
-commandHelpFailedForPlugin=Error getting help for: {0}
-commandNotLoaded = \u00a7cCommand {0} is improperly loaded.
-compassBearing = \u00a77Bearing: {0} ({1} degrees).
-configFileMoveError = Failed to move config.yml to backup location.
-configFileRenameError = Failed to rename temp file to config.yml
-connectedPlayers = Connected players:
-connectionFailed = Failed to open connection.
-cooldownWithMessage = \u00a7cCooldown: {0}
-corruptNodeInConfig = \u00a74Notice: Your configuration file has a corrupt {0} node.
-couldNotFindTemplate = Could not find template {0}
-creatingConfigFromTemplate = Creating config from template: {0}
-creatingEmptyConfig = Creating empty config: {0}
-day = day
-days = days
-defaultBanReason = The Ban Hammer has spoken!
-deleteFileError = Could not delete file: {0}
-deleteHome = \u00a77Home {0} has been removed.
-deleteJail = \u00a77Jail {0} has been removed.
-deleteWarp = \u00a77Warp {0} has been removed.
-deniedAccessCommand = {0} was denied access to command.
-dependancyDownloaded = [Essentials] Dependancy {0} downloaded successfully.
-dependancyException = [Essentials] An error occurred when trying to download a dependacy
-dependancyNotFound = [Essentials] A required dependancy was not found, downloading now.
-depth = \u00a77You are at sea level.
-depthAboveSea = \u00a77You are {0} block(s) above sea level.
-depthBelowSea = \u00a77You are {0} block(s) below sea level.
-destinationNotSet = Destination not set
-disableUnlimited = \u00a77Disabled unlimited placing of {0} for {1}.
-disabled = disabled
-dontMoveMessage = \u00a77Teleportation will commence in {0}. Don''t move.
-downloadingGeoIp = Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB)
-duplicatedUserdata = Duplicated userdata: {0} and {1}
-enableUnlimited = \u00a77Giving unlimited amount of {0} to {1}.
-enabled = enabled
-errorCallingCommand = Error calling command /{0}
-errorWithMessage = \u00a7cError: {0}
-essentialsReload = \u00a77Essentials Reloaded {0}
-extinguish = \u00a77You extinguished yourself.
-extinguishOthers = \u00a77You extinguished {0}.
-failedToCloseConfig = Failed to close config {0}
-failedToCreateConfig = Failed to create config {0}
-failedToWriteConfig = Failed to write config {0}
-fileRenameError = Renaming file {0} failed
-foreverAlone = \u00a7cYou have nobody to whom you can reply.
-freedMemory = Freed {0} MB.
-gcchunks = chunks,
-gcentities = entities
-gcfree = Free memory: {0} MB
-gcmax = Maximum memory: {0} MB
-gctotal = Allocated memory: {0} MB
-geoIpUrlEmpty = GeoIP download url is empty.
-geoIpUrlInvalid = GeoIP download url is invalid.
-geoipJoinFormat = Player {0} comes from {1}
-godDisabledFor = disabled for {0}
-godEnabledFor = enabled for {0}
-godMode = \u00a77God mode {0}.
-haveBeenReleased = \u00a77You have been released
-heal = \u00a77You have been healed.
-healOther = \u00a77Healed {0}.
-helpConsole = To view help from the console, type ?.
-helpOp = \u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1}
-helpPages = Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f:
-holeInFloor = Hole in floor
-homeSet = \u00a77Home set.
-homeSetToBed = \u00a77Your home is now set to this bed.
-homes = Homes: {0}
-hour = hour
-hours = hours
-ignorePlayer = You ignore player {0} from now on.
-illegalDate = Illegal date format.
-infoChapter = Select chapter:
-infoChapterPages = Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f:
-infoFileDoesNotExist = File info.txt does not exist. Creating one for you.
-infoPages = Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f:
-infoUnknownChapter = Unknown chapter.
-invBigger = The other users inventory is bigger than yours.
-invRestored = Your inventory has been restored.
-invSee = You see the inventory of {0}.
-invSeeHelp = Use /invsee to restore your inventory.
-invalidCharge = \u00a7cInvalid charge.
-invalidMob = Invalid mob type.
-invalidServer = Invalid server!
-invalidSignLine = Line {0} on sign is invalid.
-invalidWorld = \u00a7cInvalid world.
-inventoryCleared = \u00a77Inventory Cleared.
-inventoryClearedOthers = \u00a77Inventory of \u00a7c{0}\u00a77 cleared.
-is = is
-itemCannotBeSold = That item cannot be sold to the server.
-itemMustBeStacked = Item must be traded in stacks. A quantity of 2s would be two stacks, etc.
-itemNotEnough1 = \u00a7cYou do not have enough of that item to sell.
-itemNotEnough2 = \u00a77If you meant to sell all of your items of that type, use /sell itemname
-itemNotEnough3 = \u00a77/sell itemname -1 will sell all but one item, etc.
-itemSellAir = You really tried to sell Air? Put an item in your hand.
-itemSold = \u00a77Sold for \u00a7c{0} \u00a77({1} {2} at {3} each)
-itemSoldConsole = {0} sold {1} for \u00a77{2} \u00a77({3} items at {4} each)
-itemSpawn = \u00a77Giving {0} of {1}
-itemsCsvNotLoaded = Could not load items.csv.
-jailAlreadyIncarcerated = \u00a7cPerson is already in jail: {0}
-jailMessage = \u00a7cYou do the crime, you do the time.
-jailNotExist = That jail does not exist.
-jailReleased = \u00a77Player \u00a7e{0}\u00a77 unjailed.
-jailReleasedPlayerNotify = \u00a77You have been released!
-jailSentenceExtended = Jail time extend to: {0)
-jailSet = \u00a77Jail {0} has been set
-jumpError = That would hurt your computer''s brain.
-kickDefault = Kicked from server
-kickExempt = \u00a7cYou can not kick that person.
-kill = \u00a77Killed {0}.
-kitError = \u00a7cThere are no valid kits.
-kitError2 = \u00a7cThat kit does not exist or is improperly defined.
-kitErrorHelp = \u00a7cPerhaps an item is missing a quantity in the configuration?
-kitGive = \u00a77Giving kit {0}.
-kitInvFull = \u00a7cYour inventory was full, placing kit on the floor
-kitTimed = \u00a7cYou can''t use that kit again for another {0}.
-kits = \u00a77Kits: {0}
-lightningSmited = \u00a77You have just been smited
-lightningUse = \u00a77Smiting {0}
-loadWarpError = Failed to load warp {0}
-loadinfo = Loaded {0} build {1} by: {2}
-localFormat = Local: <{0}> {1}
-mailClear = \u00a7cTo mark your mail as read, type /mail clear
-mailCleared = \u00a77Mail Cleared!
-mailSent = \u00a77Mail sent!
-markMailAsRead = \u00a7cTo mark your mail as read, type /mail clear
-markedAsAway = \u00a77You are now marked as away.
-markedAsNotAway = \u00a77You are no longer marked as away.
+backAfterDeath=\u00a77Use the /back command to return to your death point.
+backUsageMsg=\u00a77Returning to previous location.
+backupFinished=Backup finished
+backupStarted=Backup started
+balance=\u00a77Balance: {0}
+balanceTop=\u00a77 Top balances ({0})
+banExempt=\u00a7cYou can not ban that player.
+banIpAddress=\u00a77Banned IP address
+bannedIpsFileError=Error reading banned-ips.txt
+bannedIpsFileNotFound=banned-ips.txt not found
+bannedPlayersFileError=Error reading banned-players.txt
+bannedPlayersFileNotFound=banned-players.txt not found
+bigTreeFailure=\u00a7cBig tree generation failure. Try again on grass or dirt.
+bigTreeSuccess= \u00a77Big tree spawned.
+blockList=Essentials relayed the following commands to another plugin:
+broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0}
+buildAlert=\u00a7cYou are not permitted to build
+bukkitFormatChanged=Bukkit version format changed. Version not checked.
+burnMsg=\u00a77You set {0} on fire for {1} seconds.
+canTalkAgain=\u00a77You can talk again
+cantFindGeoIpDB=Can''t find GeoIP database!
+cantReadGeoIpDB=Failed to read GeoIP database!
+cantSpawnItem=\u00a7cYou are not allowed to spawn the item {0}
+commandFailed=Command {0} failed:
+commandHelpFailedForPlugin=Error getting help for: {0}
+commandNotLoaded=\u00a7cCommand {0} is improperly loaded.
+compassBearing=\u00a77Bearing: {0} ({1} degrees).
+configFileMoveError=Failed to move config.yml to backup location.
+configFileRenameError=Failed to rename temp file to config.yml
+connectedPlayers=Connected players:
+connectionFailed=Failed to open connection.
+cooldownWithMessage=\u00a7cCooldown: {0}
+corruptNodeInConfig=\u00a74Notice: Your configuration file has a corrupt {0} node.
+couldNotFindTemplate=Could not find template {0}
+creatingConfigFromTemplate=Creating config from template: {0}
+creatingEmptyConfig=Creating empty config: {0}
+creative=creative
+day=day
+days=days
+defaultBanReason=The Ban Hammer has spoken!
+deleteFileError=Could not delete file: {0}
+deleteHome=\u00a77Home {0} has been removed.
+deleteJail=\u00a77Jail {0} has been removed.
+deleteWarp=\u00a77Warp {0} has been removed.
+deniedAccessCommand={0} was denied access to command.
+dependancyDownloaded=[Essentials] Dependancy {0} downloaded successfully.
+dependancyException=[Essentials] An error occurred when trying to download a dependacy
+dependancyNotFound=[Essentials] A required dependancy was not found, downloading now.
+depth=\u00a77You are at sea level.
+depthAboveSea=\u00a77You are {0} block(s) above sea level.
+depthBelowSea=\u00a77You are {0} block(s) below sea level.
+destinationNotSet=Destination not set
+disableUnlimited=\u00a77Disabled unlimited placing of {0} for {1}.
+disabled=disabled
+disabledToSpawnMob=Spawning this mob was disabled in the config file.
+dontMoveMessage=\u00a77Teleportation will commence in {0}. Don''t move.
+downloadingGeoIp=Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB)
+duplicatedUserdata=Duplicated userdata: {0} and {1}
+enableUnlimited=\u00a77Giving unlimited amount of {0} to {1}.
+enabled=enabled
+enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand.
+enchantmentNotFound = \u00a7cEnchantment not found
+enchantmentPerm = \u00a7cYou do not have the permission for {0}
+enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item in hand.
+enchantments = \u00a77Enchantments: {0}
+errorCallingCommand=Error calling command /{0}
+errorWithMessage=\u00a7cError: {0}
+essentialsHelp1=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat
+essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat
+essentialsReload=\u00a77Essentials Reloaded {0}
+extinguish=\u00a77You extinguished yourself.
+extinguishOthers=\u00a77You extinguished {0}.
+failedToCloseConfig=Failed to close config {0}
+failedToCreateConfig=Failed to create config {0}
+failedToWriteConfig=Failed to write config {0}
+false=false
+feed=\u00a77Your appetite was sated.
+feedOther=\u00a77Satisfied {0}.
+fileRenameError=Renaming file {0} failed
+foreverAlone=\u00a7cYou have nobody to whom you can reply.
+freedMemory=Freed {0} MB.
+gameMode=\u00a77Set game mode {0} for {1}.
+gcchunks= chunks,
+gcentities= entities
+gcfree=Free memory: {0} MB
+gcmax=Maximum memory: {0} MB
+gctotal=Allocated memory: {0} MB
+geoIpUrlEmpty=GeoIP download url is empty.
+geoIpUrlInvalid=GeoIP download url is invalid.
+geoipJoinFormat=Player {0} comes from {1}
+godDisabledFor=disabled for {0}
+godEnabledFor=enabled for {0}
+godMode=\u00a77God mode {0}.
+haveBeenReleased=\u00a77You have been released
+heal=\u00a77You have been healed.
+healOther=\u00a77Healed {0}.
+helpConsole=To view help from the console, type ?.
+helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1}
+helpPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f:
+holeInFloor=Hole in floor
+homeSet=\u00a77Home set.
+homeSetToBed=\u00a77Your home is now set to this bed.
+homes=Homes: {0}
+hour=hour
+hours=hours
+ignorePlayer=You ignore player {0} from now on.
+illegalDate=Illegal date format.
+infoChapter=Select chapter:
+infoChapterPages=Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f:
+infoFileDoesNotExist=File info.txt does not exist. Creating one for you.
+infoPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f:
+infoUnknownChapter=Unknown chapter.
+invBigger=The other users inventory is bigger than yours.
+invRestored=Your inventory has been restored.
+invSee=You see the inventory of {0}.
+invSeeHelp=Use /invsee to restore your inventory.
+invalidCharge=\u00a7cInvalid charge.
+invalidMob=Invalid mob type.
+invalidServer=Invalid server!
+invalidSignLine=Line {0} on sign is invalid.
+invalidWorld=\u00a7cInvalid world.
+inventoryCleared=\u00a77Inventory Cleared.
+inventoryClearedOthers=\u00a77Inventory of \u00a7c{0}\u00a77 cleared.
+is=is
+itemCannotBeSold=That item cannot be sold to the server.
+itemMustBeStacked=Item must be traded in stacks. A quantity of 2s would be two stacks, etc.
+itemNotEnough1=\u00a7cYou do not have enough of that item to sell.
+itemNotEnough2=\u00a77If you meant to sell all of your items of that type, use /sell itemname
+itemNotEnough3=\u00a77/sell itemname -1 will sell all but one item, etc.
+itemSellAir=You really tried to sell Air? Put an item in your hand.
+itemSold=\u00a77Sold for \u00a7c{0} \u00a77({1} {2} at {3} each)
+itemSoldConsole={0} sold {1} for \u00a77{2} \u00a77({3} items at {4} each)
+itemSpawn=\u00a77Giving {0} of {1}
+itemsCsvNotLoaded=Could not load items.csv.
+jailAlreadyIncarcerated=\u00a7cPerson is already in jail: {0}
+jailMessage=\u00a7cYou do the crime, you do the time.
+jailNotExist=That jail does not exist.
+jailReleased=\u00a77Player \u00a7e{0}\u00a77 unjailed.
+jailReleasedPlayerNotify=\u00a77You have been released!
+jailSentenceExtended=Jail time extend to: {0)
+jailSet=\u00a77Jail {0} has been set
+jumpError=That would hurt your computer''s brain.
+kickDefault=Kicked from server
+kickExempt=\u00a7cYou can not kick that person.
+kill=\u00a77Killed {0}.
+kitError2=\u00a7cThat kit does not exist or is improperly defined.
+kitError=\u00a7cThere are no valid kits.
+kitErrorHelp=\u00a7cPerhaps an item is missing a quantity in the configuration?
+kitGive=\u00a77Giving kit {0}.
+kitInvFull=\u00a7cYour inventory was full, placing kit on the floor
+kitTimed=\u00a7cYou can''t use that kit again for another {0}.
+kits=\u00a77Kits: {0}
+lightningSmited=\u00a77You have just been smited
+lightningUse=\u00a77Smiting {0}
+listAfkTag = \u00a77[AFK]\u00a7f
+listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79 players online.
+listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online.
+listHiddenTag = \u00a77[HIDDEN]\u00a7f
+loadWarpError=Failed to load warp {0}
+loadinfo=Loaded {0} build {1} by: {2}
+localFormat=Local: <{0}> {1}
+mailClear=\u00a7cTo mark your mail as read, type /mail clear
+mailCleared=\u00a77Mail Cleared!
+mailSent=\u00a77Mail sent!
+markMailAsRead=\u00a7cTo mark your mail as read, type /mail clear
+markedAsAway=\u00a77You are now marked as away.
+markedAsNotAway=\u00a77You are no longer marked as away.
maxHomes=You cannot set more than {0} homes.
-mayNotJail = \u00a7cYou may not jail that person
-me = me
-minute = minute
-minutes = minutes
-missingItems = You do not have {0}x {1}.
-missingPrefixSuffix = Missing a prefix or suffix for {0}
-mobSpawnError = Error while changing mob spawner.
-mobSpawnLimit = Mob quantity limited to server limit
-mobSpawnTarget = Target block must be a mob spawner.
-moneyRecievedFrom = \u00a7a{0} has been received from {1}
-moneySentTo = \u00a7a{0} has been sent to {1}
-moneyTaken = {0} taken from your bank account.
-month = month
-months = months
-moreThanZero = Quantities must be greater than 0.
-msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
-muteExempt = \u00a7cYou may not mute that player.
-mutedPlayer = Player {0} muted.
-mutedPlayerFor = Player {0} muted for {1}.
-mutedUserSpeaks = {0} tried to speak, but is muted.
-needTpohere = You need access to /tpohere to teleport other players.
-negativeBalanceError = User is not allowed to have a negative balance.
-nickChanged = Nickname changed.
+mayNotJail=\u00a7cYou may not jail that person
+me=me
+minute=minute
+minutes=minutes
+missingItems=You do not have {0}x {1}.
+missingPrefixSuffix=Missing a prefix or suffix for {0}
+mobSpawnError=Error while changing mob spawner.
+mobSpawnLimit=Mob quantity limited to server limit
+mobSpawnTarget=Target block must be a mob spawner.
+mobsAvailable=\u00a77Mobs: {0}
+moneyRecievedFrom=\u00a7a{0} has been received from {1}
+moneySentTo=\u00a7a{0} has been sent to {1}
+moneyTaken={0} taken from your bank account.
+month=month
+months=months
+moreThanZero=Quantities must be greater than 0.
+msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
+muteExempt=\u00a7cYou may not mute that player.
+mutedPlayer=Player {0} muted.
+mutedPlayerFor=Player {0} muted for {1}.
+mutedUserSpeaks={0} tried to speak, but is muted.
+nearbyPlayers=Players nearby: {0}
+needTpohere=You need access to /tpohere to teleport other players.
+negativeBalanceError=User is not allowed to have a negative balance.
+nickChanged=Nickname changed.
nickDisplayName=\u00a77You have to enable change-displayname in Essentials config.
-nickInUse = \u00a7cThat name is already in use.
-nickNamesAlpha = \u00a7cNicknames must be alphanumeric.
-nickNoMore = \u00a77You no longer have a nickname.
-nickOthersPermission = \u00a7cYou do not have permission to change the nickname of others
-nickSet = \u00a77Your nickname is now \u00a7c{0}
-noAccessCommand = \u00a7cYou do not have access to that command.
-noAccessPermission = \u00a7cYou do not have permission to access that {0}.
-noDestroyPermission = \u00a7cYou do not have permission to destroy that {0}.
-noHelpFound = \u00a7cNo matching commands.
-noHomeSet = You have not set a home.
-noHomeSetPlayer = Player has not set a home.
-noKitPermission = \u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit.
-noKits = \u00a77There are no kits available yet
-noMail = You do not have any mail
-noMailSendPerm = \u00a7cYou do not have the \u00a7fessentials.mail.send\u00a7c permission.
-noMotd = \u00a7cThere is no message of the day.
-noNewMail = \u00a77You have no new mail.
-noPendingRequest = You do not have a pending request.
-noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
+nickInUse=\u00a7cThat name is already in use.
+nickNamesAlpha=\u00a7cNicknames must be alphanumeric.
+nickNoMore=\u00a77You no longer have a nickname.
+nickOthersPermission=\u00a7cYou do not have permission to change the nickname of others
+nickSet=\u00a77Your nickname is now \u00a7c{0}
+noAccessCommand=\u00a7cYou do not have access to that command.
+noAccessPermission=\u00a7cYou do not have permission to access that {0}.
+noDestroyPermission=\u00a7cYou do not have permission to destroy that {0}.
+noGodWorldWarning=\u00a7cWarning! God mode in this world disabled.
+noHelpFound=\u00a7cNo matching commands.
+noHomeSet=You have not set a home.
+noHomeSetPlayer=Player has not set a home.
+noKitPermission=\u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit.
+noKits=\u00a77There are no kits available yet
+noMail=You do not have any mail
+noMotd=\u00a7cThere is no message of the day.
+noNewMail=\u00a77You have no new mail.
+noPendingRequest=You do not have a pending request.
+noPerm=\u00a7cYou do not have the \u00a7f{0}\u00a7c permission.
+noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob.
+noPlacePermission=\u00a7cYou do not have permission to place a block near that sign.
noPowerTools=You have no power tools assigned.
-noRules = \u00a7cThere are no rules specified yet.
-noWarpsDefined = No warps defined
-none = none
-notAllowedToQuestion = \u00a7cYou are not authorized to use question.
-notAllowedToShout = \u00a7cYou are not authorized to shout.
-notEnoughMoney = You do not have sufficient funds.
-notRecommendedBukkit = Bukkit version is not the recommended build for Essentials.
-notSupportedYet = Not supported yet.
-now = now
-numberRequired = A number goes there, silly.
-onlyDayNight = /time only supports day/night.
-onlyPlayers = Only in-game players can use {0}.
-onlySunStorm = /weather only supports sun/storm.
-pTimeCurrent = \u00a7e{0}''s\u00a7f time is {1}.
-pTimeCurrentFixed = \u00a7e{0}''s\u00a7f time is fixed to {1}.
-pTimeNormal = \u00a7e{0}''s\u00a7f time is normal and matches the server.
-pTimeOthersPermission = \u00a7cYou are not authorized to set other players'' time.
-pTimePlayers = These players have their own time:
-pTimeReset = Player time has been reset for: \u00a7e{0}
-pTimeSet = Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1}
-pTimeSetFixed = Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1}
-parseError = Error parsing {0} on line {1}
-pendingTeleportCancelled = \u00a7cPending teleportation request cancelled.
-permissionsError = Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled.
-playerBanned = \u00a7cPlayer {0} banned {1} for {2}
-playerInJail = \u00a7cPlayer is already in jail {0}.
-playerJailed = \u00a77Player {0} jailed.
-playerJailedFor = \u00a77Player {0} jailed for {1}.
-playerKicked = \u00a7cPlayer {0} kicked {1} for {2}
-playerMuted = \u00a77You have been muted
-playerMutedFor = \u00a77You have been muted for {0}
-playerNeverOnServer = \u00a7cPlayer {0} was never on this server.
-playerNotFound = \u00a7cPlayer not found.
-playerUnmuted = \u00a77You have been unmuted
-pong = Pong!
-possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}.
-powerToolAir = Command can''t be attached to air.
-powerToolAlreadySet = Command \u00a7c{0}\u00a7f is already assigned to {1}.
-powerToolAttach = \u00a7c{0}\u00a7f command assigned to {1}.
-powerToolClearAll = All powertool commands have been cleared.
-powerToolList = {1} has the following commands: \u00a7c{0}\u00a7f.
-powerToolListEmpty = {0} has no commands assigned.
-powerToolNoSuchCommandAssigned = Command \u00a7c{0}\u00a7f has not been assigned to {1}.
-powerToolRemove = Command \u00a7c{0}\u00a7f removed from {1}.
-powerToolRemoveAll = All commands removed from {0}.
-powerToolsEnabled=All of your power tools have been enabled.
+noRules=\u00a7cThere are no rules specified yet.
+noWarpsDefined=No warps defined
+none=none
+notAllowedToQuestion=\u00a7cYou are not authorized to use question.
+notAllowedToShout=\u00a7cYou are not authorized to shout.
+notEnoughExperience=You do not have enough experience.
+notEnoughMoney=You do not have sufficient funds.
+notRecommendedBukkit=* ! * Bukkit version is not the recommended build for Essentials.
+notSupportedYet=Not supported yet.
+nothingInHand = \u00a7cYou have nothing in your hand.
+now=now
+numberRequired=A number goes there, silly.
+onlyDayNight=/time only supports day/night.
+onlyPlayers=Only in-game players can use {0}.
+onlySunStorm=/weather only supports sun/storm.
+orderBalances=Ordering balances of {0} users, please wait ...
+pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}.
+pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}.
+pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server.
+pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time.
+pTimePlayers=These players have their own time:
+pTimeReset=Player time has been reset for: \u00a7e{0}
+pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1}
+pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1}
+parseError=Error parsing {0} on line {1}
+pendingTeleportCancelled=\u00a7cPending teleportation request cancelled.
+permissionsError=Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled.
+playerBanned=\u00a7cPlayer {0} banned {1} for {2}
+playerInJail=\u00a7cPlayer is already in jail {0}.
+playerJailed=\u00a77Player {0} jailed.
+playerJailedFor= \u00a77Player {0} jailed for {1}.
+playerKicked=\u00a7cPlayer {0} kicked {1} for {2}
+playerMuted=\u00a77You have been muted
+playerMutedFor=\u00a77You have been muted for {0}
+playerNeverOnServer=\u00a7cPlayer {0} was never on this server.
+playerNotFound=\u00a7cPlayer not found.
+playerUnmuted=\u00a77You have been unmuted
+pong=Pong!
+possibleWorlds=\u00a77Possible worlds are the numbers 0 through {0}.
+powerToolAir=Command can''t be attached to air.
+powerToolAlreadySet=Command \u00a7c{0}\u00a7f is already assigned to {1}.
+powerToolAttach=\u00a7c{0}\u00a7f command assigned to {1}.
+powerToolClearAll=All powertool commands have been cleared.
+powerToolList={1} has the following commands: \u00a7c{0}\u00a7f.
+powerToolListEmpty={0} has no commands assigned.
+powerToolNoSuchCommandAssigned=Command \u00a7c{0}\u00a7f has not been assigned to {1}.
+powerToolRemove=Command \u00a7c{0}\u00a7f removed from {1}.
+powerToolRemoveAll=All commands removed from {0}.
powerToolsDisabled=All of your power tools have been enabled.
-protectionOwner = \u00a76[EssentialsProtect] Protection owner: {0}
-questionFormat = \u00a77[Question]\u00a7f {0}
-reloadAllPlugins = \u00a77Reloaded all plugins.
-repair = You have successfully repaired your: \u00a7e{0}.
-repairAlreadyFixed = \u00a77This item does not need repairing.
-repairInvalidType = \u00a7cThis item cannot be repaired.
-repairNone = There were no items that needing repairing.
-requestAccepted = \u00a77Teleport request accepted.
-requestAcceptedFrom = \u00a77{0} accepted your teleport request.
-requestDenied = \u00a77Teleport request denied.
-requestDeniedFrom = \u00a77{0} denied your teleport request
-requestSent = \u00a77Request sent to {0}\u00a77.
-returnPlayerToJailError = Error occurred when trying to return player to jail.
-second = second
-seconds = seconds
-seenOffline = Player {0} is offline since {1}
-seenOnline = Player {0} is online since {1}
-serverFull = Server is full
-setSpawner = Changed spawner type to {0}
-sheepMalformedColor = Malformed color.
-shoutFormat = \u00a77[Shout]\u00a7f {0}
-signFormatFail = \u00a74[{0}]
-signFormatSuccess = \u00a71[{0}]
-signFormatTemplate = [{0}]
-signProtectInvalidLocation = \u00a74You are not allowed to create sign here.
-similarWarpExist = A warp with a similar name already exists.
-slimeMalformedSize = Malformed size.
-soloMob = That mob likes to be alone
-spawnSet = \u00a77Spawn location set for group {0}.
-spawned = spawned
-suicideMessage = \u00a77Goodbye Cruel World...
-suicideSuccess = \u00a77{0} took their own life
-takenFromAccount = \u00a7c{0} has been taken from your account.
-takenFromOthersAccount = \u00a7c{0} has been taken from {1} account.
-teleportAAll = \u00a77Teleporting request sent to all players...
-teleportAll = \u00a77Teleporting all players...
-teleportAtoB = \u00a77{0}\u00a77 teleported you to {1}\u00a77.
-teleportDisabled = {0} has teleportation disabled.
-teleportHereRequest = \u00a7c{0}\u00a7c has requested that you teleport to them.
-teleportNewPlayerError = Failed to teleport new player
-teleportRequest = \u00a7c{0}\u00a7c has requested to teleport to you.
-teleportTop = \u00a77Teleporting to top.
-teleportationCommencing = \u00a77Teleportation commencing...
-teleportationDisabled = \u00a77Teleportation disabled.
-teleportationEnabled = \u00a77Teleportation enabled.
-teleporting = \u00a77Teleporting...
-teleportingPortal = \u00a77Teleporting via portal.
-tempBanned = Temporarily banned from server for {0}
-tempbanExempt = \u00a77You may not tempban that player
-thunder = You {0} thunder in your world
-thunderDuration = You {0} thunder in your world for {1} seconds.
-timeBeforeHeal = Time before next heal: {0}
-timeBeforeTeleport = Time before next teleport: {0}
-timeFormat = \u00a73{0}\u00a7f or \u00a73{1}\u00a7f or \u00a73{2}\u00a7f
-timePattern = (?:([0-9]+)\\s*y[a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
-timeSet = Time set in all worlds.
-timeSetPermission = \u00a7cYou are not authorized to set the time.
-timeWorldCurrent = The current time in {0} is \u00a73{1}
-timeWorldSet = The time was set to {0} in: \u00a7c{1}
-tradeCompleted = \u00a77Trade completed.
-tradeSignEmpty = The trade sign does not have enough supply left.
-tradeSignEmptyOwner = There is nothing to collect from this trade sign.
-treeFailure = \u00a7cTree generation failure. Try again on grass or dirt.
-treeSpawned = \u00a77Tree spawned.
-typeTpaccept = \u00a77To teleport, type \u00a7c/tpaccept\u00a77.
-typeTpdeny = \u00a77To deny this request, type \u00a7c/tpdeny\u00a77.
-typeWorldName = \u00a77You can also type the name of a specific world.
-unableToSpawnMob = Unable to spawn mob.
-unbannedIP = Unbanned IP address.
-unbannedPlayer = Unbanned player.
-unignorePlayer = You are not ignoring player {0} anymore.
-unknownItemId = Unknown item id: {0}
-unknownItemInList = Unknown item {0} in {1} list.
-unknownItemName = Unknown item name: {0}
-unlimitedItemPermission = \u00a7cNo permission for unlimited item {0}.
-unlimitedItems = Unlimited items:
-unmutedPlayer = Player {0} unmuted.
-upgradingFilesError = Error while upgrading the files
-userDoesNotExist = The user {0} does not exist.
-userIsAway = {0} is now AFK
-userIsNotAway = {0} is no longer AFK
-userJailed = \u00a77You have been jailed
-userUsedPortal = {0} used an existing exit portal.
-userdataMoveBackError = Failed to move userdata/{0}.tmp to userdata/{1}
-userdataMoveError = Failed to move userdata/{0} to userdata/{1}.tmp
-usingTempFolderForTesting = Using temp folder for testing:
-versionMismatch = Version mismatch! Please update {0} to the same version.
-versionMismatchAll = Version mismatch! Please update all Essentials jars to the same version.
-voiceSilenced = \u00a77Your voice has been silenced
-warpDeleteError = Problem deleting the warp file.
-warpListPermission = \u00a7cYou do not have Permission to list that warps.
-warpNotExist = That warp does not exist.
-warpSet = \u00a77Warp {0} set.
-warpUsePermission = \u00a7cYou do not have Permission to use that warp.
-warpingTo = \u00a77Warping to {0}.
-warpsCount = \u00a77There are {0} warps. Showing page {1} of {2}.
-weatherStorm = \u00a77You set the weather to storm in {0}
-weatherStormFor = \u00a77You set the weather to storm in {0} for {1} seconds
-weatherSun = \u00a77You set the weather to sun in {0}
-weatherSunFor = \u00a77You set the weather to sun in {0} for {1} seconds
-whoisGeoLocation = \u00a79 - Location: {0}
-whoisHealth = \u00a79 - Health: {0}/20
-whoisIPAddress = \u00a79 - IP Address: {0}
-whoisIs = {0} is {1}
-whoisLocation = \u00a79 - Location: ({0}, {1}, {2}, {3})
-whoisMoney = \u00a79 - Money: {0}
-whoisStatusAvailable = \u00a79 - Status: Available
-whoisStatusAway = \u00a79 - Status: \u00a7cAway\u00a7f
-worth = \u00a77Stack of {0} worth \u00a7c{1}\u00a77 ({2} item(s) at {3} each)
-worthMeta = \u00a77Stack of {0} with metadata of {1} worth \u00a7c{2}\u00a77 ({3} item(s) at {4} each)
-worthSet = Worth value set
-year = year
-years = years
-youAreHealed = \u00a77You have been healed.
-youHaveNewMail = \u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
-
-
+powerToolsEnabled=All of your power tools have been enabled.
+protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0}
+questionFormat=\u00a77[Question]\u00a7f {0}
+readNextPage=Type /{0} {1} to read the next page
+reloadAllPlugins=\u00a77Reloaded all plugins.
+removed=\u00a77Removed {0} entities.
+repair=You have successfully repaired your: \u00a7e{0}.
+repairAlreadyFixed=\u00a77This item does not need repairing.
+repairEnchanted=\u00a77You are not allowed to repair enchanted items.
+repairInvalidType=\u00a7cThis item cannot be repaired.
+repairNone=There were no items that needing repairing.
+requestAccepted=\u00a77Teleport request accepted.
+requestAcceptedFrom=\u00a77{0} accepted your teleport request.
+requestDenied=\u00a77Teleport request denied.
+requestDeniedFrom=\u00a77{0} denied your teleport request
+requestSent=\u00a77Request sent to {0}\u00a77.
+requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
+returnPlayerToJailError=Error occurred when trying to return player to jail.
+second=second
+seconds=seconds
+seenOffline=Player {0} is offline since {1}
+seenOnline=Player {0} is online since {1}
+serverFull=Server is full
+setSpawner=Changed spawner type to {0}
+sheepMalformedColor=Malformed color.
+shoutFormat=\u00a77[Shout]\u00a7f {0}
+signFormatFail=\u00a74[{0}]
+signFormatSuccess=\u00a71[{0}]
+signFormatTemplate=[{0}]
+signProtectInvalidLocation=\u00a74You are not allowed to create sign here.
+similarWarpExist=A warp with a similar name already exists.
+slimeMalformedSize=Malformed size.
+soloMob=That mob likes to be alone
+spawnSet=\u00a77Spawn location set for group {0}.
+spawned=spawned
+suicideMessage=\u00a77Goodbye Cruel World...
+suicideSuccess= \u00a77{0} took their own life
+survival=survival
+takenFromAccount=\u00a7c{0} has been taken from your account.
+takenFromOthersAccount=\u00a7c{0} has been taken from {1} account.
+teleportAAll=\u00a77Teleporting request sent to all players...
+teleportAll=\u00a77Teleporting all players...
+teleportAtoB=\u00a77{0}\u00a77 teleported you to {1}\u00a77.
+teleportDisabled={0} has teleportation disabled.
+teleportHereRequest=\u00a7c{0}\u00a7c has requested that you teleport to them.
+teleportNewPlayerError=Failed to teleport new player
+teleportRequest=\u00a7c{0}\u00a7c has requested to teleport to you.
+teleportTop=\u00a77Teleporting to top.
+teleportationCommencing=\u00a77Teleportation commencing...
+teleportationDisabled=\u00a77Teleportation disabled.
+teleportationEnabled=\u00a77Teleportation enabled.
+teleporting=\u00a77Teleporting...
+teleportingPortal=\u00a77Teleporting via portal.
+tempBanned=Temporarily banned from server for {0}
+tempbanExempt=\u00a77You may not tempban that player
+thunder= You {0} thunder in your world
+thunderDuration=You {0} thunder in your world for {1} seconds.
+timeBeforeHeal=Time before next heal: {0}
+timeBeforeTeleport=Time before next teleport: {0}
+timeFormat=\u00a73{0}\u00a7f or \u00a73{1}\u00a7f or \u00a73{2}\u00a7f
+timePattern=(?:([0-9]+)\\s*y[a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
+timeSet=Time set in all worlds.
+timeSetPermission=\u00a7cYou are not authorized to set the time.
+timeWorldCurrent=The current time in {0} is \u00a73{1}
+timeWorldSet=The time was set to {0} in: \u00a7c{1}
+tradeCompleted=\u00a77Trade completed.
+tradeSignEmpty=The trade sign does not have enough supply left.
+tradeSignEmptyOwner=There is nothing to collect from this trade sign.
+treeFailure=\u00a7cTree generation failure. Try again on grass or dirt.
+treeSpawned=\u00a77Tree spawned.
+true=true
+typeTpaccept=\u00a77To teleport, type \u00a7c/tpaccept\u00a77.
+typeTpdeny=\u00a77To deny this request, type \u00a7c/tpdeny\u00a77.
+typeWorldName=\u00a77You can also type the name of a specific world.
+unableToSpawnMob=Unable to spawn mob.
+unbannedIP=Unbanned IP address.
+unbannedPlayer=Unbanned player.
+unignorePlayer=You are not ignoring player {0} anymore.
+unknownItemId=Unknown item id: {0}
+unknownItemInList=Unknown item {0} in {1} list.
+unknownItemName=Unknown item name: {0}
+unlimitedItemPermission=\u00a7cNo permission for unlimited item {0}.
+unlimitedItems=Unlimited items:
+unmutedPlayer=Player {0} unmuted.
+upgradingFilesError=Error while upgrading the files
+userDoesNotExist=The user {0} does not exist.
+userIsAway={0} is now AFK
+userIsNotAway={0} is no longer AFK
+userJailed=\u00a77You have been jailed
+userUsedPortal={0} used an existing exit portal.
+userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1}
+userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp
+usingTempFolderForTesting=Using temp folder for testing:
+versionMismatch=Version mismatch! Please update {0} to the same version.
+versionMismatchAll=Version mismatch! Please update all Essentials jars to the same version.
+voiceSilenced=\u00a77Your voice has been silenced
+warpDeleteError=Problem deleting the warp file.
+warpListPermission=\u00a7cYou do not have Permission to list that warps.
+warpNotExist=That warp does not exist.
+warpSet=\u00a77Warp {0} set.
+warpUsePermission=\u00a7cYou do not have Permission to use that warp.
+warpingTo=\u00a77Warping to {0}.
+warps=Warps: {0}
+warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}.
+weatherStorm=\u00a77You set the weather to storm in {0}
+weatherStormFor=\u00a77You set the weather to storm in {0} for {1} seconds
+weatherSun=\u00a77You set the weather to sun in {0}
+weatherSunFor=\u00a77You set the weather to sun in {0} for {1} seconds
+whoisBanned=\u00a79 - Banned: {0}
+whoisGamemode=\u00a79 - Gamemode: {0}
+whoisGeoLocation=\u00a79 - Location: {0}
+whoisGod=\u00a79 - God mode: {0}
+whoisHealth=\u00a79 - Health: {0}/20
+whoisIPAddress=\u00a79 - IP Address: {0}
+whoisIs={0} is {1}
+whoisLocation=\u00a79 - Location: ({0}, {1}, {2}, {3})
+whoisMoney=\u00a79 - Money: {0}
+whoisOP=\u00a79 - OP: {0}
+whoisStatusAvailable=\u00a79 - Status: Available
+whoisStatusAway=\u00a79 - Status: \u00a7cAway\u00a7f
+worth=\u00a77Stack of {0} worth \u00a7c{1}\u00a77 ({2} item(s) at {3} each)
+worthMeta=\u00a77Stack of {0} with metadata of {1} worth \u00a7c{2}\u00a77 ({3} item(s) at {4} each)
+worthSet=Worth value set
+year=year
+years=years
+youAreHealed=\u00a77You have been healed.
+youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
+requestTimedOut=\u00a7cTeleport request has timed out
+teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties
new file mode 100644
index 000000000..def9d9fb1
--- /dev/null
+++ b/Essentials/src/messages_es.properties
@@ -0,0 +1,406 @@
+#version: TeamCity
+# Single quotes have to be doubled: ''
+# Translations start here
+# by:
+action=* {0} {1}
+addedToAccount=\u00a7a{0} ha sido agregado a tu cuenta.
+addedToOthersAccount=\u00a7a{0} ha sido agregado a la cuenta de {1}.
+alertBroke=roto:
+alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} en: {3}
+alertPlaced=situado:
+alertUsed=usado:
+autoAfkKickReason=Has sido echado por ausentarte mas de {0} minutos.
+backAfterDeath=\u00a77Usa el comando /back para volver al punto en el que moriste.
+backUsageMsg=\u00a77Volviendo a la localizacion anterior.
+backupFinished=Copia de seguridad completada
+backupStarted=Comenzando copia de seguridad
+balance=\u00a77Cantidad: {0}
+balanceTop=\u00a77Top cantidades ({0})
+banExempt=\u00a7cNo puedes banear a ese jugador
+banIpAddress=\u00a77Direccion IP baneada
+bannedIpsFileError=Error leyendo banned-ips.txt
+bannedIpsFileNotFound=banned-ips.txt no encontrado
+bannedPlayersFileError=Error leyendo banned-players.txt
+bannedPlayersFileNotFound=banned-players.txt no encontrado
+bigTreeFailure=\u00a7cBig Generacion de arbol fallida. Prueba de nuevo en hierba o arena.
+bigTreeSuccess= \u00a77Big Arbol generado.
+blockList=Essentials relayed the following commands to another plugin:
+broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0}
+buildAlert=\u00a7cNo tienes permisos para construir
+bukkitFormatChanged=Version de formato de Bukkit cambiado. Version no comprobada.
+burnMsg=\u00a77Has puesto {0} en fuego durante {1} segundos.
+canTalkAgain=\u00a77Ya puedes hablar de nuevo
+cantFindGeoIpDB=No se puede encontrar la bases de datos del Geo IP
+cantReadGeoIpDB=Error al intentar leer la base de datos del Geo IP
+cantSpawnItem=\u00a7cNo tienes acceso para producir este objeto {0}
+commandFailed=Command {0} fallado:
+commandHelpFailedForPlugin=Error obteniendo ayuda para: {0}
+commandNotLoaded=\u00a7cCommand {0} esta cargado incorrectamente.
+compassBearing=\u00a77Bearing: {0} ({1} grados).
+configFileMoveError=Error al mover config.yml para hacer una copia de seguridad de la localizacion.
+configFileRenameError=Error al renombrar archivo temp a config.yml
+connectedPlayers=Jugadores conectados:
+connectionFailed=Error al abrir conexion.
+cooldownWithMessage=\u00a7cCooldown: {0}
+corruptNodeInConfig=\u00a74Notice: Tu archivo de configuracion tiene un nodo {0} incorrecto.
+couldNotFindTemplate=No se puede encontrar el template {0}
+creatingConfigFromTemplate=Creando configuracion desde el template: {0}
+creatingEmptyConfig=Creando configuracion vacia: {0}
+creative=creative
+day=dia
+days=dias
+defaultBanReason=Baneado por incumplir las normas!
+deleteFileError=No se puede borrar el archivo: {0}
+deleteHome=\u00a77Home {0} ha sido borrado.
+deleteJail=\u00a77Jail {0} ha sido borrado.
+deleteWarp=\u00a77Warp {0} ha sido borrado.
+deniedAccessCommand={0} ha denegado el acceso al comando.
+dependancyDownloaded=[Essentials] Dependencia {0} descargada correctamente.
+dependancyException=[Essentials] Error al intentar descargar la dependencia.
+dependancyNotFound=[Essentials] La dependencia necesitada no se encontro, descargandola...
+depth=\u00a77Estas al nivel del mar.
+depthAboveSea=\u00a77Estas {0} bloque(s) por encima del mar.
+depthBelowSea=\u00a77Estas {0} bloque(s) por debajo del mar.
+destinationNotSet=Destino no establecido.
+disableUnlimited=\u00a77Desactivando colocacion ilimitada de {0} para {1}.
+disabled=desactivado
+disabledToSpawnMob=Spawning this mob was disabled in the config file.
+dontMoveMessage=\u00a77Teletransporte comenzara en {0}. No te muevas.
+downloadingGeoIp=Descargando base de datos de GeoIP ... puede llevar un tiempo (pais: 0.6 MB, ciudad: 20MB)
+duplicatedUserdata=Datos de usuario duplicados: {0} y {1}
+enableUnlimited=\u00a77Dando cantidad ilimitada de {0} a {1}.
+enabled=activado
+enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand.
+enchantmentNotFound = \u00a7cEnchantment not found
+enchantmentPerm = \u00a7cYou do not have the permission for {0}
+enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item in hand.
+enchantments = \u00a77Enchantments: {0}
+errorCallingCommand=Error al ejecutar el comando /{0}
+errorWithMessage=\u00a7cError: {0}
+essentialsHelp1=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat
+essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat
+essentialsReload=\u00a77Essentials Recargado {0}
+extinguish=\u00a77Te has suicidado.
+extinguishOthers=\u00a77Has matado a {0}.
+failedToCloseConfig=Error al cerrar configuracion {0}
+failedToCreateConfig=Error al crear configuracion {0}
+failedToWriteConfig=Error al escribir configuracion {0}
+false=false
+feed=\u00a77Your appetite was sated.
+feedOther=\u00a77Satisfied {0}.
+fileRenameError=Error al renombrar el archivo {0}
+foreverAlone=\u00a7cNo tienes nadie a quien puedas responder.
+freedMemory= {0} MB libres.
+gameMode=\u00a77Set game mode {0} for {1}.
+gcchunks= pixeles,
+gcentities= entidades
+gcfree=Memoria libre: {0} MB
+gcmax=Memoria maxima: {0} MB
+gctotal=Memoria localizada: {0} MB
+geoIpUrlEmpty=Link para descargar GeoIP esta vacio.
+geoIpUrlInvalid=Link para descargar GeoIP es invalido.
+geoipJoinFormat=El jugador {0} viene de {1}
+godDisabledFor=Desactivado para {0}
+godEnabledFor=Activado para {0}
+godMode=\u00a77Modo Dios {0}.
+haveBeenReleased=\u00a77Has sido liberado
+heal=\u00a77Has sido curado.
+healOther=\u00a77Has curado a {0}.
+helpConsole=Para obtener ayuda de la consola, escribe ?.
+helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1}
+helpPages=Pagina \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f:
+holeInFloor=Agujero en el suelo
+homeSet=\u00a77Hogar establecido.
+homeSetToBed=\u00a77Tu hogar esta ahora establecido a esta cama.
+homes=Hogares: {0}
+hour=hora
+hours=horas
+ignorePlayer=A partir de ahora ignoras al jugador {0}.
+illegalDate=Forma de fecha ilegal.
+infoChapter=Selecciona una seccion:
+infoChapterPages=Seccion {0}, pagina \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f:
+infoFileDoesNotExist=El archivo info.txt no existe. Creando uno para ti.
+infoPages=Pagina \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f:
+infoUnknownChapter=Seccion desconocida.
+invBigger=El inventario del otro usuario es mas grande que el tuyo
+invRestored=Tu inventario ha sido recuperado.
+invSee=Estas viendo el inventario de {0}.
+invSeeHelp=Usa /invsee para recuperar tu inventario.
+invalidCharge=\u00a7cCargo invalido.
+invalidMob=Mob invalido.
+invalidServer=Servidor invalido!
+invalidSignLine=Linea {0} en el signo es invalida.
+invalidWorld=\u00a7cMundo invalido.
+inventoryCleared=\u00a77Inventario limpiado.
+inventoryClearedOthers=\u00a77Inventario de \u00a7c{0}\u00a77 limpiado.
+is=es
+itemCannotBeSold=Ese objeto no puede ser vendido al servidor.
+itemMustBeStacked=El objeto tiene que ser intercambiado en pilas. Una cantidad de 2s seria de dos pilas, etc.
+itemNotEnough1=\u00a7cNo tienes suficientes ejemplares de ese objeto para venderlo.
+itemNotEnough2=\u00a77Si pensabas en vender todos tus objetos de ese tipo, usa /sell nombredeobjeto
+itemNotEnough3=\u00a77/sell nombredeobjeto -1 vendera todos excepto un objeto, etc.
+itemSellAir=Realmente has intentado vender Aire? Pon un objeto en tu mano!
+itemSold=\u00a77Vendido para \u00a7c {0} \u00a77 ({1} {2} a {3} cada uno)
+itemSoldConsole={0} Vendido {1} para\u00a77 {2} \u00a77({3} objetos a {4} cada uno)
+itemSpawn=\u00a77Dando {0} de {1}
+itemsCsvNotLoaded=Error al leer items.csv.
+jailAlreadyIncarcerated=\u00a7cLa persona ya esta en la carcel: {0}
+jailMessage=\u00a7cPor hacer el mal, tiempo en la carcel estaras.
+jailNotExist=Esa carcel no existe.
+jailReleased=\u00a77Player \u00a7e{0}\u00a77 liberado.
+jailReleasedPlayerNotify=\u00a77 Has sido liberado!!
+jailSentenceExtended=El tiempo en la carcel se alarga hasta: {0)
+jailSet=\u00a77Carcel {0} ha sido puesta
+jumpError=Eso es demasiado para tu ordenador!
+kickDefault=Echado del servidor.
+kickExempt=\u00a7cNo puedes echar a esa persona.
+kill=\u00a77ha matado a {0}.
+kitError2=\u00a7cEse kit no existe o esta mal escrito.
+kitError=\u00a7cNo hay ningun kit valido.
+kitErrorHelp=\u00a7cPerhaps an item is missing a quantity in the configuration?
+kitGive=\u00a77Dando kit a {0}.
+kitInvFull=\u00a7cTu inventario esta lleno, su kit se pondra en el suelo
+kitTimed=\u00a7c No puedes usar ese kit de nuevo para otro{0}.
+kits=\u00a77Kits: {0}
+lightningSmited=\u00a77Acabas de ser golpeado
+lightningUse=\u00a77Golpeando a {0}
+listAfkTag = \u00a77[AFK]\u00a7f
+listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79 players online.
+listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online.
+listHiddenTag = \u00a77[HIDDEN]\u00a7f
+loadWarpError=Error al cargar el tenetransporte {0}
+loadinfo=Cargado {0}, construido {1} por: {2}
+localFormat=Local: <{0}> {1}
+mailClear=\u00a7cPara marcar tu email como leido, escribe /mail clear
+mailCleared=\u00a77Email limpiado!
+mailSent=\u00a77Email enviado!!
+markMailAsRead=\u00a7cPara marcar tu email como leido, escribe /mail clear
+markedAsAway=\u00a77Has sido puesto como AFK.
+markedAsNotAway=\u00a77Ya no estas AFK.
+maxHomes=No puedes establecer mas de {0} hogares.
+mayNotJail=\u00a7cNo puedes encarcelar a esa persona
+me=yo
+minute=minuto
+minutes=minutos
+missingItems=No tienes {0}x de {1}.
+missingPrefixSuffix=Falta un prefijo o un sufijo para {0}
+mobSpawnError=Error al cambiar la localizacion para el nacimiento de los mobs.
+mobSpawnLimit=Cantidad de Mobs limitados al limite del server
+mobSpawnTarget=El block seleccionado sera el lugar donde van a nacer los mobs.
+mobsAvailable=\u00a77Mobs: {0}
+moneyRecievedFrom=\u00a7a{0} ha sido recivido de {1}
+moneySentTo=\u00a7a{0} ha sido enviado a {1}
+moneyTaken={0} han sido sacados de tu cuenta bancaria.
+month=mes
+months=meses
+moreThanZero=Las cantidades han de ser mayores que 0.
+msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
+muteExempt=\u00a7cNo puedes silenciar a ese jugador.
+mutedPlayer=Player {0} silenciado.
+mutedPlayerFor=Player {0} silenciado durante {1}.
+mutedUserSpeaks={0} intento hablar, pero esta silenciado.
+nearbyPlayers=Players nearby: {0}
+needTpohere=Necesitas acceso a /tpohere para teletransportar a otros jugadores.
+negativeBalanceError=El usuario no tiene permitido tener un saldo negativo.
+nickChanged=Nombre de jugador cambiado.
+nickDisplayName=\u00a77Tienes que habilitar cambio de nombre de usuario en la configuracion de Essentials.
+nickInUse=\u00a7cEse nombre ya esta en uso.
+nickNamesAlpha=\u00a7cLos nombres tienen que ser alfanumericos.
+nickNoMore=\u00a77Ya no tienes un nombre de usuario
+nickOthersPermission=\u00a7cNo tienes permiso para cambiar el nombre de usuario de otros.
+nickSet=\u00a77Tu nombre es ahora \u00a7c{0}
+noAccessCommand=\u00a7cNo tienes acceso a ese comando.
+noAccessPermission=\u00a7cNo tienes permisos para hacer eso {0}.
+noDestroyPermission=\u00a7cNo tienes permisos para destrozar eso {0}.
+noGodWorldWarning=\u00a7cWarning! God mode in this world disabled.
+noHelpFound=\u00a7cNo hay comandos relacionados.
+noHomeSet=No has establecido un hogar.
+noHomeSetPlayer=El jugador no ha establecido un hogar.
+noKitPermission=\u00a7cNecesitas los \u00a7c{0}\u00a7c permisos para usar ese kit.
+noKits=\u00a77No hay kits disponibles todavia
+noMail=No tienes ningun email recivido
+noMotd=\u00a7cNo hay ningun mensaje del dia.
+noNewMail=\u00a77No tienes ningun correo nuevo.
+noPendingRequest=No tienes ninguna peticion pendiente.
+noPerm=\u00a7cNo tienes el permiso de \u00a7f{0}\u00a7c.
+noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob.
+noPlacePermission=\u00a7cNo tienes permiso para situar ese bloque en ese lugar.
+noPowerTools=You have no power tools assigned.
+noRules=\u00a7cNo hay reglas especificadas todavia.
+noWarpsDefined=No hay teletransportes definidos aun
+none=ninguno
+notAllowedToQuestion=\u00a7cYou estas autorizado para usar las preguntas.
+notAllowedToShout=\u00a7cNo estas autorizado para gritar.
+notEnoughExperience=You do not have enough experience.
+notEnoughMoney=No tienes el dinero suficiente.
+notRecommendedBukkit=* ! * La version de bukkit no es la recomendada para esta version de Essentials.
+notSupportedYet=No esta soportado aun.
+nothingInHand = \u00a7cYou have nothing in your hand.
+now=ahora
+numberRequired=Un numero es necesario, amigo.
+onlyDayNight=/time solo soporta day/night. (dia/noche)
+onlyPlayers=Solo los jugadores conectados pueden usar {0}.
+onlySunStorm=/weather solo soporta sun/storm. (sol/tormenta)
+orderBalances=Ordering balances of {0} users, please wait ...
+pTimeCurrent=\u00a7e{0}''s\u00a7f la hora es {1}.
+pTimeCurrentFixed=\u00a7e{0}''s\u00a7f la hora ha sido cambiada a {1}.
+pTimeNormal=\u00a7e{0}''s\u00a7f el tiempo es normal y coincide con el servidor.
+pTimeOthersPermission=\u00a7cNo estas autorizado para especificar'' la hora de otros usuarios.
+pTimePlayers=Estos usuarios tienen su propia hora:
+pTimeReset=La hora del usuario ha sido reiniciada a las: \u00a7e{0}
+pTimeSet=La hora del jugador ha sido cambiada para las: \u00a73{0}\u00a7f for: \u00a7e{1}
+pTimeSetFixed=La hora del jugador ha sido arreglada para las: \u00a73{0}\u00a7f for: \u00a7e{1}
+parseError=error analizando {0} en la linea {1}
+pendingTeleportCancelled=\u00a7cPeticion de teletransporte pendiente cancelado.
+permissionsError=Falta el plugin Permissions/GroupManager; Los prefijos/sufijos de chat seran desactivados.
+playerBanned=\u00a7cEl jugador {0} ha baneado a {1} durante {2}
+playerInJail=\u00a7cEl jugador {0} ya esta en la carcel.
+playerJailed=\u00a77Jugador {0} encarcelado.
+playerJailedFor= \u00a77El jugador {0} ha sido encarcelado durante {1}.
+playerKicked=\u00a7cEl jugador {0} echo a {1} durante {2}
+playerMuted=\u00a77Has sido silenciado
+playerMutedFor=\u00a77Has sido silenciado durante {0}
+playerNeverOnServer=\u00a7cEl jugador {0} nunca estuvo en este servidor.
+playerNotFound=\u00a7cJugador no encontrado.
+playerUnmuted=\u00a77Has sido desmuteado.
+pong=Tkm mi ninio!
+possibleWorlds=\u00a77Los mundos posibles son desde el numero 0 hasta el {0}.
+powerToolAir=El comando no se puede ejecutar en el aire.
+powerToolAlreadySet=El comando \u00a7c{0}\u00a7f ya esta asignado a {1}.
+powerToolAttach=\u00a7c{0}\u00a7f comando asignado a {1}.
+powerToolClearAll=Todos los comandos de powertool han sido borrados.
+powerToolList={1} tiene los siguientes comandos: \u00a7c{0}\u00a7f.
+powerToolListEmpty={0} no tiene comandos asignados.
+powerToolNoSuchCommandAssigned=El comando \u00a7c{0}\u00a7f no ha sido asignado a {1}.
+powerToolRemove=Comando \u00a7c{0}\u00a7f borrado desde {1}.
+powerToolRemoveAll=Todos los comandos borrados desde {0}.
+powerToolsDisabled=All of your power tools have been disabled.
+powerToolsEnabled=All of your power tools have been enabled.
+protectionOwner=\u00a76[EssentialsProtect] Due&ntilde;o de la proteccion: {0}
+questionFormat=\u00a77[Pregunta]\u00a7f {0}
+readNextPage=Type /{0} {1} to read the next page
+reloadAllPlugins=\u00a77Todos los plugins recargados.
+removed=\u00a77Removed {0} entities.
+repair=Has reparado satisfactoriamente tu: \u00a7e{0}.
+repairAlreadyFixed=\u00a77Este objeto no necesita de reparado.
+repairEnchanted=\u00a77You are not allowed to repair enchanted items.
+repairInvalidType=\u00a7cEste objeto no puede ser reparado.
+repairNone=No habia objetos que necesitasen ser reparados.
+requestAccepted=\u00a77Peticion de teletransporte aceptada.
+requestAcceptedFrom=\u00a77{0} acepto tu peticion de teletransporte.
+requestDenied=\u00a77Peticion de teletransporte denegada.
+requestDeniedFrom=\u00a77{0} ha denegado tu peticion de teletransporte.
+requestSent=\u00a77Peticion enviada a {0}\u00a77.
+requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
+returnPlayerToJailError=Error al intentar quitar al jugador de la carcel.
+second=segundo
+seconds=segundos
+seenOffline=El jugador {0} esta desconectado desde {1}
+seenOnline=El jugador {0} lleva conectado desde {1}
+serverFull=Servidor lleno
+setSpawner=Cambiado tipo de lugar de nacimiento a {0}
+sheepMalformedColor=Color malformado.
+shoutFormat=\u00a77[Shout]\u00a7f {0}
+signFormatFail=\u00a74[{0}]
+signFormatSuccess=\u00a71[{0}]
+signFormatTemplate=[{0}]
+signProtectInvalidLocation=\u00a74No puedes poner carteles en ese sitio.
+similarWarpExist=Ya existe un teletransporte con ese nombre.
+slimeMalformedSize=Medidas malformadas.
+soloMob=A este mob le gusta estar solo
+spawnSet=\u00a77El lugar de nacimiento ha sido puesto para el grupo {0}.
+spawned=nacido
+suicideMessage=\u00a77Adios mundo cruel...
+suicideSuccess= \u00a77{0} se quito su propia vida
+survival=survival
+takenFromAccount=\u00a7c{0} ha sido sacado de tu cuenta.
+takenFromOthersAccount=\u00a7c{0} ha sido sacado de la cuenta de {1}.
+teleportAAll=\u00a77Peticion de teletransporte enviada a todos los jugadores...
+teleportAll=\u00a77Teletransportando a todos los jugadores...
+teleportAtoB=\u00a77{0}\u00a77 te teletransporto a {1}\u00a77.
+teleportDisabled={0} tiene desactivado los teletransportes.
+teleportHereRequest=\u00a7c{0}\u00a7c ha pedido que te teletransportes con el.
+teleportNewPlayerError=Error al teletransportar al nuevo jugador
+teleportRequest=\u00a7c{0}\u00a7c te ha pedido teletransportarse contigo.
+teleportTop=\u00a77Teletransportandote a la cima.
+teleportationCommencing=\u00a77Comenzando teletransporte...
+teleportationDisabled=\u00a77Teletransporte desactivado.
+teleportationEnabled=\u00a77Teletransporte activado.
+teleporting=\u00a77Teletransportando...
+teleportingPortal=\u00a77Teletransportando via portal.
+tempBanned=Baneado temporalmente del servidor por {0}
+tempbanExempt=\u00a77No puedes banear temporalmente a ese jugador
+thunder= Tu has {0} los truenos en tu mundo.
+thunderDuration=Tu has {0} los truenos en tu mundo durante {1} seconds.
+timeBeforeHeal=Tiempo antes de la siguiente curacion: {0}
+timeBeforeTeleport=Tiempo antes del proximo teletransporte: {0}
+timeFormat=\u00a73{0}\u00a7f or \u00a73{1}\u00a7f or \u00a73{2}\u00a7f
+timePattern=(?:([0-9]+)\\s*y[a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
+timeSet=Time establecido en todos los mundos.
+timeSetPermission=\u00a7cNo estas autorizado para establecer la hora.
+timeWorldCurrent=La hora actual en {0} es \u00a73{1}
+timeWorldSet=La hora ha sido establecido a {0} en: \u00a7c{1}
+tradeCompleted=\u00a77Intercambio completado.
+tradeSignEmpty=Esta tienda no tiene nada disponible para ti.
+tradeSignEmptyOwner=No hay nada que recojer de esta tienda.
+treeFailure=\u00a7cError al generar arbol. Prueba de nuevo en tierra o hierba.
+treeSpawned=\u00a77Arbol puesto.
+true=true
+typeTpaccept=\u00a77Para teletransportarte, escribe \u00a7c/tpaccept\u00a77.
+typeTpdeny=\u00a77Para denegar esta peticion, escribe \u00a7c/tpdeny\u00a77.
+typeWorldName=\u00a77Tu tambien puedes escribir el nombre de un mundo especifico.
+unableToSpawnMob=No se puede generar Mobs.
+unbannedIP=IP Adress desbaneada.
+unbannedPlayer=Jugador desbaneado.
+unignorePlayer=Ya no estas ignorando al jugador {0}.
+unknownItemId=ID de objeto desconocido: {0}
+unknownItemInList=Objeto desconocido {0} en {1} lista.
+unknownItemName=Nombre de objeto desconocido: {0}
+unlimitedItemPermission=\u00a7cNo tienes permiso para objetos ilimitados {0}.
+unlimitedItems=Objetos ilimitados.
+unmutedPlayer=Jugador {0} desmuteado.
+upgradingFilesError=Error mientras se actualizaban los archivos
+userDoesNotExist=El usuario {0} no existe
+userIsAway={0} esta ahora ausente!
+userIsNotAway={0} ya no esta ausente!
+userJailed=\u00a77Has sido encarcelado!
+userUsedPortal={0} uso un portal de salida existente.
+userdataMoveBackError=Error al mover userdata/{0}.tmp a userdata/{1}
+userdataMoveError=Error al mover userdata/{0} a userdata/{1}.tmp
+usingTempFolderForTesting=Usando carpeta temporal para pruebas:
+versionMismatch=La version no coincide! Por favor actualiza {0} a la misma version.
+versionMismatchAll=La version no coincide! Por favor actualiza todos los jars de Essentials a la misma version.
+voiceSilenced=\u00a77Tu voz ha sido silenciada
+warpDeleteError=Problema al borrar el archivo de teletransporte.
+warpListPermission=\u00a7cNo tienes permiso para listar esos teletransportes.
+warpNotExist=Ese teletransporte no existe.
+warpSet=\u00a77Teletransporte {0} establecido.
+warpUsePermission=\u00a7cNo tienes permisos para usar ese teletransporte.
+warpingTo=\u00a77Teletransportandote a {0}.
+warps=Warps: {0}
+warpsCount=\u00a77Hay {0} teletransportes. Mostrando pagina {1} de {2}.
+weatherStorm=\u00a77Has establecido el tiempo a tormenta en este mundo.
+weatherStormFor=\u00a77Has establecido el tiempo a tormenta en este {1} durante {0} segundos.
+weatherSun=\u00a77Has establecido el tiempo a sol en este mundo.
+weatherSunFor=\u00a77Has establecido el tiempo a sol en este {1} durante {0} segundos.
+whoisBanned=\u00a79 - Banned: {0}
+whoisGamemode=\u00a79 - Gamemode: {0}
+whoisGeoLocation=\u00a79 - Localizacion: {0}
+whoisGod=\u00a79 - God mode: {0}
+whoisHealth=\u00a79 - Salud: {0}/20
+whoisIPAddress=\u00a79 - Direccion IP: {0}
+whoisIs={0} es {1}
+whoisLocation=\u00a79 - Localizacion: ({0}, {1}, {2}, {3})
+whoisMoney=\u00a79 - Dinero: {0}
+whoisOP=\u00a79 - OP: {0}
+whoisStatusAvailable=\u00a79 - Estado: Disponible
+whoisStatusAway=\u00a79 - Status: \u00a7cAusente\u00a7f
+worth=\u00a77Pila de {0} con valor de \u00a7c{1}\u00a77 ({2} objeto(s) a {3} cada uno)
+worthMeta=\u00a77Pila de {0} con metadata de {1} , con valor de \u00a7c{2}\u00a77 ({3} objeto(s) a {4} cada uno)
+worthSet=Establecer el valor de un valor
+year=a&ntilde;o
+years=a&ntilde;os
+youAreHealed=\u00a77Has sido curado.
+youHaveNewMail=\u00a7cTienes {0} mensajes!\u00a7f Pon \u00a77/mail read\u00a7f para ver tus emails no leidos!.
+requestTimedOut=\u00a7cTeleport request has timed out
+teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties
index b96f48339..b73603e4f 100644
--- a/Essentials/src/messages_fr.properties
+++ b/Essentials/src/messages_fr.properties
@@ -2,369 +2,405 @@
# Single quotes have to be doubled: ''
# Translations start here
# by:
-action = * {0} {1}
-addedToAccount = \u00a7a{0} a \u00e9t\u00e9 rajout\u00e9 a votre compte.
-addedToOthersAccount = \u00a7a{0} a \u00e9t\u00e9 ajout\u00e9 \u00e0 {1} compte.
-alertBroke = a cass\u00e9:
-alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} \u00e0:{3}
-alertPlaced = a plac\u00e9:
-alertUsed = a utilis\u00e9:
-autoAfkKickReason=You have been kicked for idling more than {0} minutes.
-backAfterDeath = \u00a77Utilisez la commande /back pour retourner \u00e0 l''endroit ou vous \u00eates mort.
-backUsageMsg = \u00a77Retour a votre emplacement pr\u00e9c\u00e8dent.
-backupFinished = Backup termin\u00e9
-backupStarted = D\u00e9but du backup
-balance = \u00a77Solde: {0}
-balanceTop = \u00a77 Top {0} soldes
-banExempt = \u00a77Vous ne pouvez pas interdire ce joueur.
-banIpAddress = \u00a77Adresse IP banni
-bannedIpsFileError = Erreur de lecture de banned-ips.txt
-bannedIpsFileNotFound = Fichier banned-ips.txt introuvable
-bannedPlayersFileError = Erreur lors de la lecture de banned-players.txt
-bannedPlayersFileNotFound = banned-players.txt introuvable.
-bigTreeFailure = \u00a7c\u00c9chec de la g\u00e9n\u00e9ration du gros arbre. Essayez de nouveau sur de la terre ou de l''herbe.
-bigTreeSuccess = \u00a77Gros arbre cr\u00e9e.
-broadcast = [\u00a7cMessage\u00a7f]\u00a7a {0}
-buildAlert = \u00a7cVous n''avez pas la permission de construire.
-bukkitFormatChanged = Le format de la version de Bukkit a \u00e9t\u00e9 chang\u00e9. La version n''a pas \u00e9t\u00e9 v\u00e9rifi\u00e9e.
-burnMsg = \u00a77Vous avez enflamm\u00e9 {0} pour {1} seconde(s).
-canTalkAgain = \u00a77Vous pouvez de nouveau parler.
-cantFindGeoIpDB = N''arrive pas \u00e0 trouver la base de donn\u00e9es GeoIP!
-cantReadGeoIpDB = Echec de la lecture de la base de donn\u00e9s GeoIP!
-cantSpawnItem = \u00a7cVous n''avez pas le droit de faire apparaitre {0}
-commandFailed = \u00c9chec de la commande {0}:
-commandHelpFailedForPlugin=Erreur d'obtention d'aider \u00e0: {0}
-commandNotLoaded = \u00a7cLa commande {0} a \u00e9t\u00e9 mal charg\u00e9e.
-compassBearing = \u00a77Orientation: {0} ({1} degr\u00e9s).
-configFileMoveError = \u00c9chec du d\u00e9placement de config.yml vers l''emplacement de backup.
-configFileRenameError = \u00c9chec du changement de nom du fichier temp de config.yml
-connectedPlayers = Joueurs connect\u00e9s:
-connectionFailed = \u00c9chec de l''ouverture de la connexion.
-cooldownWithMessage = \u00a7cRefroidissement: {0}
-corruptNodeInConfig = \u00a74Annonce: Votre fichier de configuration a un {0} n\u0153ud corrompu.
-couldNotFindTemplate = Le mod\u00e8le {0} est introuvable
-creatingConfigFromTemplate = Cr\u00e9ation de la configuration \u00e0 partir du mod\u00e8le : {0}
-creatingEmptyConfig = Cr\u00e9ation d''une configuration vierge : {0}
-day = jour
-days = jours
-defaultBanReason = Le marteau du ban a frapp\u00e9!
-deleteFileError = Le fichier n''a pas pu \u00eatre supprim\u00e9: {0}
-deleteHome = \u00a77Home {0} has been removed.
-deleteJail = \u00a77La prison {0} a \u00e9t\u00e9 supprim\u00e9e.
-deleteWarp = \u00a77Warp {0} supprim\u00e9.
-deniedAccessCommand = L''acc\u00e8s \u00e0 la commande a \u00e9t\u00e9 refus\u00e9 pour {0}.
-dependancyDownloaded = [Essentials] Fichier {0} correctement t\u00e9l\u00e9charg\u00e9.
-dependancyException = [Essentials] Une erreur est survenue lors de la tentative de t\u00e9l\u00e9chargement
-dependancyNotFound = [Essentials] Une d\u00e9pendance requise n''a pas \u00e9t\u00e9 trouv\u00e9e, t\u00e9l\u00e9chargement en cours.
-depth = \u00a77Vous \u00eates au niveau de la mer.
-depthAboveSea = \u00a77Vous \u00eates \u00e0 {0} bloc(s) au-dessus du niveau de la mer.
-depthBelowSea = \u00a77Vous \u00eates \u00e0 {0} bloc(s) en-dessous du niveau de la mer.
-destinationNotSet = Destination non d\u00e9finie
-disableUnlimited = \u00a77D\u00e9sactivation du placement illimit\u00e9 de {0} pour {1}.
-disabled = d\u00e9sactiv\u00e9
-dontMoveMessage = \u00a77La t\u00e9l\u00e9portation commence dans {0}. Ne bougez pas.
-downloadingGeoIp = T\u00e9l\u00e9chargement de la base de donn\u00e9es GeoIP ... cela peut prendre un moment (campagne : 0.6 Mo, ville : 20Mo)
-duplicatedUserdata = Donn\u00e9e utilisateur dupliqu\u00e9e: {0} et {1}
-enableUnlimited = \u00a77Donner un nombre illimit\u00e9 de {0} \u00e0 {1}.
-enabled = activ\u00e9
-errorCallingCommand = Erreur en appelant la commande /{0}
-errorWithMessage = \u00a7cErreur: {0}
-essentialsReload = \u00a77Essentials Recharg\u00e9 {0}
-extinguish = \u00a77Vous vous \u00eates \u00e9teint.
-extinguishOthers = \u00a77Vous avez \u00e9teint {0}.
-failedToCloseConfig = Echec de la fermeture de la configuration {0}
-failedToCreateConfig = Echec de la cr\u00e9ation de la configuration {0}
-failedToWriteConfig = \u00c9chec de l''\u00e9criture de la configuration {0}
-fileRenameError = Echec du changement de nom de {0}.
-foreverAlone = \u00a7cVous n''avez personne \u00e0 qui r\u00e9pondre.
-freedMemory = A lib\u00e9r\u00e9 {0} Mo.
-gcchunks = chunks,
-gcentities = entit\u00e9s
-gcfree = Free memory: {0} Mo
-gcmax = M\u00e9moire maximale: {0} Mo
-gctotal = Allocated memory: {0} Mo
-geoIpUrlEmpty = L''url de t\u00e9l\u00e9chargement de GeoIP est vide.
-geoIpUrlInvalid = L''url de t\u00e9l\u00e9chargement de GeoIP est invalide.
-geoipJoinFormat = Joueur {0} vient de {1}
-godDisabledFor = d\u00e9sactive pour {0}
-godEnabledFor = activ\u00e9 pour {0}
-godMode = \u00a77Mode Dieu {0}.
-haveBeenReleased = \u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9
-heal = \u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
-healOther = \u00a77{0} a \u00e9t\u00e9 soign\u00e9.
-helpConsole = Pour voir l''aide tapez ?
-helpOp = \u00a7c[Aide Admin]\u00a7f \u00a77{0}:\u00a7f {1}
-helpPages = Page \u00a7c{0}\u00a7f sur \u00a7c{1}\u00a7f.
-holeInFloor = Trou dans le Sol.
-homeSet = \u00a77Home d\u00e9fini.
-homeSetToBed = \u00a77Votre home est d\u00e9sormais d\u00e9fini sur ce lit.
-homes = Homes: {0}
-hour = heure
-hours = heures
-ignorePlayer = Vous ignorez d\u00e9sormais {0}.
-illegalDate = Format de date ill\u00e9gal.
-infoChapter = S\u00e9lectionner le chapitre :
-infoChapterPages = Chapitre {0}, page \u00a7c{1}\u00a7f sur \u00a7c{2}\u00a7f:
-infoFileDoesNotExist = Le fichier info.txt n''existe pas. Le fichier est en cours de cr\u00e9ation pour vous.
-infoPages = Page \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f.
-infoUnknownChapter = Chapitre inconnu.
-invBigger = Les inventaires des autres joueurs sont plus gros que le v\u00f4tre.
-invRestored = Votre inventaire vous a \u00e9t\u00e9 rendu.
-invSee = Vous voyez l''inventaire de {0}.
-invSeeHelp = Utilisez /invsee pour voir l''inventaire de quelqu''un.
-invalidCharge = \u00a7cInvalide charge.
-invalidMob = Mauvias type de monstre.
-invalidServer = Serveur non valide.
-invalidSignLine = La ligne {0} du panneau est invalide.
-invalidWorld = \u00a7cMonde invalide.
-inventoryCleared = \u00a77Inventaire nettoy\u00e9.
-inventoryClearedOthers = \u00a77L''inventaire de \u00a7c{0}\u00a77 a \u00e9t\u00e9 nettoy\u00e9.
-is = est
-itemCannotBeSold = Cet objet ne peut \u00eatre vendu au serveur.
-itemMustBeStacked = Cet objet doit \u00eatre vendu par 64. Une quantit\u00e9 de 2 serait deux fois 64.
-itemNotEnough1 = \u00a7cVous n''avez pas assez de cet objet pour le vendre.
-itemNotEnough2 = \u00a77Si vous voulez vendre l''int\u00e9gralit\u00e9 de vos objets de ce type l\u00e0, utilisez /sell nomObjet
-itemNotEnough3 = \u00a77/sell nomObjet -1 vendra tout sauf un objet, etc.
-itemSellAir = Vous vouliez vraiment vendre de l''air? Mettez un objet dans votre main.
-itemSold = \u00a77Vendu pour \u00a7c{0} \u00a77({1} {2} \u00e0 {3} chacun)
-itemSoldConsole = {0} vendu {1} pour \u00a77{2} \u00a77({3} objet(s) \u00e0 {4} chacun)
-itemSpawn = \u00a77Donne {0} de {1}
-itemsCsvNotLoaded = N''a pas pu charger items.csv.
-jailAlreadyIncarcerated = \u00a7cPerson is already in jail: {0}
-jailMessage = \u00a7cVous avez commis un crime, vous en payez le prix.
-jailNotExist = Cette prison n''existe pas.
-jailReleased = \u00a77Player \u00a7e{0}\u00a77 unjailed.
-jailReleasedPlayerNotify = \u00a77You have been released!
-jailSentenceExtended = Jail time extend to: {0)
-jailSet = \u00a77La prison {0} a \u00e9t\u00e9 cr\u00e9\u00e9.
-jumpError = \u00c7a aurait pu faire mal au cerveau de votre ordinateur.
-kickDefault = Kick\u00e9 du serveur
-kickExempt = \u00a77Vous ne pouvez pas lancer ce joueur.
-kill = \u00a77Tu\u00e9 {0}.
-kitError = \u00a7cIl n''y a pas de kits valides.
-kitError2 = \u00a7cCe kit n''existe pas ou a \u00e9t\u00e9 mal d\u00e9fini.
-kitErrorHelp = \u00a7cPeut-\u00eatre qu''un objet manque d''une quantit\u00e9 dans la configuration?
-kitGive = \u00a77Donner le kit {0}.
-kitInvFull = \u00a7cVotre inventaire \u00e9tait plein, le kit est Parre-terre.
-kitTimed = \u00a7cVous ne pouvez pas utiliser ce kit pendant encore {0}.
-kits = \u00a77Kits:{0}
-lightningSmited = \u00a77Vous venez d''\u00eatre foudroy\u00e9
-lightningUse = \u00a77{0} a \u00e9t\u00e9 foudroy\u00e9
-loadWarpError = \u00c9chec du chargement du warp {0}
-loadinfo = {0} version {1} par {2} a \u00e9t\u00e9 charg\u00e9
-localFormat = Local:<{0}> {1}
-mailClear = \u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear
-mailCleared = \u00a77Mail supprim\u00e9 !
-mailSent = \u00a77Courrier envoy\u00e9 !
-markMailAsRead = \u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear
-markedAsAway = \u00a77Vous \u00eates d\u00e9sormais AFK.
-markedAsNotAway = \u00a77Vous n''\u00eates d\u00e9sormais plus AFK.
-maxHomes=You cannot set more than {0} homes.
-mayNotJail = \u00a7cVous ne pouvez pas emprisonner cette personne.
-me = moi
-minute = minute
-minutes = minutes
-missingItems = Vous n''avez pas {0} x {1}.
-missingPrefixSuffix = Pr\u00e9fixe ou Suffixe manquant pour {0}
-mobSpawnError = Erreur lors du changement du spawner de monstres.
-mobSpawnLimit = Quantit\u00e9 de monstres limit\u00e9 \u00e0 la limite du serveur.
-mobSpawnTarget = Le bloc cible doit \u00eatre un spawner de monstres.
-moneyRecievedFrom = \u00a7a{0} a \u00e9t\u00e9 re\u00e7u de {1}
-moneySentTo = \u00a7a{0} a \u00e9t\u00e9 envoy\u00e9 \u00e0 {1}
-moneyTaken = {0} pr\u00e9lev\u00e9(s) de votre compte bancaire.
-month = mois
-months = mois
-moreThanZero = Les Quantit\u00e9s doivent \u00eatre sup\u00e9rieures \u00e0 z\u00e9ro.
-msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
-muteExempt = \u00a7cYou may not mute that player.
-mutedPlayer = Le joueur {0} est d\u00e9sormais muet.
-mutedPlayerFor = {0} a \u00e9t\u00e9 mute pour {1}.
-mutedUserSpeaks = {0} a essay\u00e9 de parler mais est muet.
-needTpohere = Vous avez besoin de l''acc\u00e8s \u00e0 /tpohere pour t\u00e9l\u00e9porter d''autres joueurs.
-negativeBalanceError = L''utilisateur n''est pas autoris\u00e9 \u00e0 avoir un solde n\u00e9gatif.
-nickChanged = Pseudo modifi\u00e9.
-nickDisplayName=\u00a77You have to enable change-displayname in Essentials config.
-nickInUse = \u00a7cCe nom est d\u00e9j\u00e0 utilis\u00e9.
-nickNamesAlpha = \u00a7cLes pseudos doivent \u00eatre alphanum\u00e9riques.
-nickNoMore = \u00a7Vous n''avez plus de surnom.
-nickOthersPermission = \u00a7cVous n''avez pas la permission de changer le pseudo des autres.
-nickSet = \u00a77Votre pseudo est maintenant \u00a7c{0}
-noAccessCommand = \u00a7cVous n''avez pas acc\u00e8s \u00e0 cette commande.
-noAccessPermission = \u00a7cVous n''avez pas la permissions d''acc\u00e9der \u00e0 cette {0}
-noDestroyPermission = \u00a7cVous n''avez pas la permission de d\u00e9truire ce {0}.
-noHelpFound = \u00a7cNo matching commands.
-noHomeSet = Vous n''avez pas d\u00e9fini de home.
-noHomeSetPlayer = Le joueur n''a pas d\u00e9fini son home.
-noKitPermission = \u00a7cVous avez besoin de la permission \u00a7c{0}\u00a7c pour utiliser ce kit.
-noKits = \u00a77Il n''y a pas encore de kits disponibles.
-noMail = Vous n''avez pas de courrier
-noMailSendPerm = \u00a7cVous n''avez pas la permission \u00a7fessentials.mail.send\u00a7c.
-noMotd = \u00a7cIl n''y a pas de message su jour.
-noNewMail = \u00a77Vous n''avez pas de courrier.
-noPendingRequest = Vous n''avez pas de requ\u00eate non lue.
-noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
-noPowerTools=You have no power tools assigned.
-noRules = \u00a7cIl n''y a pas encore de r\u00e8gles d\u00e9finies.
-noWarpsDefined = Aucun warps d\u00e9finis.
-none = aucun
-notAllowedToQuestion = \u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 poser des questions.
-notAllowedToShout = \u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 crier.
-notEnoughMoney = Vous n''avez pas les fonds n\u00e9cessaires.
-notRecommendedBukkit = La version de Bukkit n''est pas celle qui est recommand\u00e9 pour cette version de Essentials.
-notSupportedYet = Pas encore pris en charge.
-now = maintenant
-numberRequired = On a besoin d''un nombre ici, idiot.
-onlyDayNight = /time ne supporte que (jour) day/night (nuit).
-onlyPlayers = Seulement les joueurs en jeu peuvent utiliser {0}.
-onlySunStorm = /weather only supports sun/storm.
-pTimeCurrent = \u00a7e{0}''s\u00a7f time is {1}.
-pTimeCurrentFixed = \u00a7e{0}''s\u00a7f time is fixed to {1}.
-pTimeNormal = \u00a7e{0}''s\u00a7f time is normal and matches the server.
-pTimeOthersPermission = \u00a7cYou are not authorized to set other players'' time.
-pTimePlayers = These players have their own time:
-pTimeReset = Player time has been reset for: \u00a7e{0}
-pTimeSet = Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1}
-pTimeSetFixed = Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1}
-parseError = Erreur de conversion {0} \u00e0 la ligne {1}
-pendingTeleportCancelled = \u00a7cRequete de t\u00e9l\u00e9portation annul\u00e9e.
-permissionsError = Permissions/GroupManager manquant, les pr\u00e9fixes et suffixes ne seront pas affich\u00e9s.
-playerBanned = \u00a7cPlayer {0} banned {1} for {2}
-playerInJail = \u00a7cLe joueur est d\u00e9j\u00e0 dans la prison {0}.
-playerJailed = \u00a77Le joueur {0} a \u00e9t\u00e9 emprisonn\u00e9.
-playerJailedFor = \u00a77{0} a \u00e9t\u00e9 emprisonn\u00e9 pour {1}.
-playerKicked = \u00a7cPlayer {0} kicked {1} for {2}
-playerMuted = \u00a77You have been muted
-playerMutedFor = \u00a77You have been muted for {0}
-playerNeverOnServer = \u00a7cLe joueur {0} n''a jamais \u00e9t\u00e9 sur le serveur.
-playerNotFound = \u00a7cLe joueur est introuvable.
-playerUnmuted = \u00a77You have been unmuted
-pong = Pong!
-possibleWorlds = \u00a77Les mondes possibles sont les nombres 0 par {0}.
-powerToolAir = La commande ne peut pas \u00eatre attach\u00e9e \u00e0 l''air.
-powerToolAlreadySet = Command \u00a7c{0}\u00a7f is already assigned to {1}.
-powerToolAttach = \u00a7c{0}\u00a7f command assigned to {1}.
-powerToolClearAll = All powertool commands have been cleared.
-powerToolList = {1} has the following commands: \u00a7c{0}\u00a7f.
-powerToolListEmpty = {0} has no commands assigned.
-powerToolNoSuchCommandAssigned = Command \u00a7c{0}\u00a7f has not been assigned to {1}.
-powerToolRemove = Command \u00a7c{0}\u00a7f removed from {1}.
-powerToolRemoveAll = All commands removed from {0}.
-powerToolsEnabled=All of your power tools have been enabled.
-powerToolsDisabled=All of your power tools have been disabled.
-protectionOwner = \u00a76[EssentialsProtect] Propri\u00e9taire de la protection : {0}
-questionFormat = \u00a77[Question]\u00a7f {0}
-reloadAllPlugins = \u00a77Tous les plugins ont \u00e9t\u00e9 recharg\u00e9s.
-repair = You have successfully repaired your: \u00a7e{0}.
-repairAlreadyFixed = \u00a77This item does not need repairing.
-repairInvalidType = \u00a7cThis item cannot be repaired.
-repairNone = There were no items that needing repairing.
-requestAccepted = \u00a77Demande de t\u00e9l\u00e9portation accept\u00e9e.
-requestAcceptedFrom = \u00a77{0} accepted your teleport request.
-requestDenied = \u00a77Demande de t\u00e9l\u00e9portation refus\u00e9e.
-requestDeniedFrom = \u00a77{0} denied your teleport request.
-requestSent = \u00a77Requ\u00eate envoy\u00e9e \u00e0 {0}\u00a77.
-returnPlayerToJailError = Erreur survenue lors de la tentative d''emprisonner de nouveau un joueur.
-second = seconde
-seconds = secondes
-seenOffline = Le joueur {0} est hors ligne depuis {1}
-seenOnline = Le joueur {0} est en ligne depuis {1}
-serverFull = Le serveur est plein.
-setSpawner = Changed spawner type to {0}
-sheepMalformedColor = Couleur mal form\u00e9e.
-shoutFormat = \u00a77[Crie]\u00a7f {0}
-signFormatFail = \u00a74[{0}]
-signFormatSuccess = \u00a71[{0}]
-signFormatTemplate = [{0}]
-signProtectInvalidLocation = \u00a74You are not allowed to create sign here.
-similarWarpExist = Un warp avec un nom similaire existe d\u00e9j\u00e0.
-slimeMalformedSize = Taille mal form\u00e9e.
-soloMob = Ce monstre aime \u00eatre seul.
-spawnSet = \u00a77Le point de spawn a \u00e9t\u00e9 d\u00e9fini pour le groupe {0}.
-spawned = spawn\u00e9
-suicideMessage = \u00a77Au revoir monde cruel...
-suicideSuccess = \u00a77{0} a pris sa propre vie.
-takenFromAccount = \u00a7c{0} ont \u00e9t\u00e9 pris de votre compte.
-takenFromOthersAccount = \u00a7c{0} a \u00e9t\u00e9 prise de {1} compte.
-teleportAAll = \u00a77Teleporting request sent to all players...
-teleportAll = \u00a77T\u00e9l\u00e9poration de tous les joueurs.
-teleportAtoB = \u00a77{0}\u00a77 vous a t\u00e9l\u00e9port\u00e9 \u00e0 {1}\u00a77.
-teleportDisabled = {0} a la t\u00e9l\u00e9portation d\u00e9sactiv\u00e9.
-teleportHereRequest = \u00a7c{0}\u00a7c Vous a demand\u00e9 de vous t\u00e9l\u00e9porter \u00e0 lui/elle.
-teleportNewPlayerError = \u00c9chec de la t\u00e9l\u00e9portation du nouveau joueur.
-teleportRequest = \u00a7c{0}\u00a7c vous demande s''il peut se t\u00e9l\u00e9porter sur vous.
-teleportTop = \u00a77T\u00e9l\u00e9portation vers le haut.
-teleportationCommencing = \u00a77D\u00e9but de la t\u00e9l\u00e9portation....
-teleportationDisabled = \u00a77T\u00e9l\u00e9poration d\u00e9sactiv\u00e9.
-teleportationEnabled = \u00a77T\u00e9l\u00e9portation activ\u00e9e.
-teleporting = \u00a77T\u00e9l\u00e9poration en cours...
-teleportingPortal = \u00a77T\u00e9l\u00e9portation via portail.
-tempBanned = Banni temporairement du serveur pour {0}
-tempbanExempt = \u00a77You may not tempban that player
-thunder = Vous avez {0} la foudre dans votre monde.
-thunderDuration = Vous avez {0} la foudre dans le serveur {1} secondes.
-timeBeforeHeal = Temps avant le prochain soin : {0}
-timeBeforeTeleport = Temps avant prochaine t\u00e9l\u00e9portation {0}
-timeFormat = \u00a73{0}\u00a7f or \u00a73{1}\u00a7f or \u00a73{2}\u00a7f
-timePattern = (?:([0-9]+)\\\\s*[ya][a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*mo[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*(?:sem|w)[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*[dj][a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*h[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*m[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*(?:s[a-z]*)?)?
-timeSet = Heure modifi\u00e9e dans tous les mondes.
-timeSetPermission = \u00a7cYou are not authorized to set the time.
-timeWorldCurrent = The current time in {0} is \u00a73{1}
-timeWorldSet = The time was set to {0} in: \u00a7c{1}
-tradeCompleted = \u00a77\u00c9change termin\u00e9.
-tradeSignEmpty = Le panneau de vente n''as pas encore assez de stock.
-tradeSignEmptyOwner = There is nothing to collect from this trade sign.
-treeFailure = \u00a7cEchec de la g\u00e9n\u00e9ration de l''arbre. Essayez de nouveau sur de l''herbe ou de la terre.
-treeSpawned = \u00a77Arbre cr\u00e9\u00e9.
-typeTpaccept = \u00a77Pour le t\u00e9l\u00e9porter, tapez \u00a7c/tpaccept\u00a77.
-typeTpdeny = \u00a77Pour d\u00e9cliner cette demande, entrez \u00a7c/tpdeny\u00a77.
-typeWorldName = \u00a77Vous pouvez aussi taper le nom d''un monde sp\u00e9cifique.
-unableToSpawnMob = Incapable de spawner un monstre.
-unbannedIP = Adresse IP d\u00e9banni.
-unbannedPlayer = Joueur d\u00e9banni.
-unignorePlayer = Vous n''ignorez plus {0}.
-unknownItemId = Num\u00e9ro d''objet inconnu : {0}
-unknownItemInList = L''objet {0} est inconnu dans la liste {1}.
-unknownItemName = Nom d''objet inconnu : {0}
-unlimitedItemPermission = \u00a7cPas de permission pour l''objet illimit\u00e9 {0}.
-unlimitedItems = Objets illimit\u00e9s:
-unmutedPlayer = Le joueur {0} n''est plus muet.
-upgradingFilesError = Erreur durant la mise \u00e0 jour des fichiers.
-userDoesNotExist = L''utilisateur {0} n''existe pas.
-userIsAway = {0} s''est mis en AFK
-userIsNotAway = {0} n''est plus inactif
-userJailed = \u00a77Vous avez \u00e9t\u00e9 emprisonn\u00e9
-userUsedPortal = {0} a utilis\u00e9 un portail existant.
-userdataMoveBackError = Echec du d\u00e9placement de userdata/{0}.tmp \u00e0 userdata/{1}
-userdataMoveError = Echec du d\u00e9placement de userdata/{0} \u00e0 userdata/{1}.tmp
-usingTempFolderForTesting = Utilise un fichier temporaire pour un test.
-versionMismatch = Versions diff\u00e9rentes! Mettez s''il vous pla\u00eet {0} \u00e0 la m\u00eame version.
-versionMismatchAll = Mauvaise version! S''il vous plait mettez des jars Essentiels de version identique.
-voiceSilenced = \u00a77Votre voix a \u00e9t\u00e9 r\u00e9duite au silence
-warpDeleteError = Probl\u00e8me concernant la suppression du fichier warp.
-warpListPermission = \u00a7cVous n''avez pas la permission d''afficher la liste des warps.
-warpNotExist = Ce warp n''existe pas.
-warpSet = \u00a77Le warp {0} a \u00e9t\u00e9 cr\u00e9\u00e9.
-warpUsePermission = \u00a7cVous n''avez pas la permission d''utiliser ce warp.
-warpingTo = \u00a77T\u00e9l\u00e9portation au warp {0}.
-warpsCount = \u00a77There are {0} warps. Showing page {1} of {2}.
-weatherStorm = \u00a77Vous avez d\u00e9fini l''orage dans {0}
-weatherStormFor = \u00a77Vous avez d\u00e9fini l''orage dans {0} pour {1} secondes.
-weatherSun = \u00a77Vous avez mis le beau temps dans {0}
-weatherSunFor = \u00a77Vous avez mis le beau temps dans {0} pour {1} secondes.
-whoisGeoLocation = \u00a79 - Emplacement: {0}
-whoisHealth = \u00a79 - Vie: {0} / 20
-whoisIPAddress = \u00a79 - Adresse IP: {0}
-whoisIs = {0} est {1}
-whoisLocation = \u00a79 - Emplacement: ({0}, {1}, {2}, {3})
-whoisMoney = \u00a79 - Argent: {0}
-whoisStatusAvailable = \u00a79 - Statut: Disponible
-whoisStatusAway = \u00a79 - Statut: \u00a7cAilleurs\u00a7f
-worth = \u00a77Un stack de {0} vaut \u00a7c{1}\u00a77 ({2} objet(s) \u00e0 {3} chacun)
-worthMeta = \u00a77Un stack de {0} avec la m\u00e9tadonn\u00e9e de {1} vaut \u00a7c{2}\u00a77 ({3} objet(s) \u00e0 {4} chacun)
-worthSet = Valeur cr\u00e9e
-year = ann\u00e9e
-years = ann\u00e9es
-youAreHealed = \u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
-youHaveNewMail = \u00a7cVous avez {0} messages! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier.
-
-
+action=* {0} {1}
+addedToAccount=\u00a7a{0} a \u00e9t\u00e9 rajout\u00e9 \u00e0 votre compte.
+addedToOthersAccount=\u00a7a{0} a \u00e9t\u00e9 ajout\u00e9 \u00e0 {1} compte.
+alertBroke=a cass\u00e9 :
+alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} \u00e0:{3}
+alertPlaced=a plac\u00e9 :
+alertUsed=a utilis\u00e9 :
+autoAfkKickReason=Vous avez \u00e9t\u00e9 \u00e9ject\u00e9 pour inactivit\u00e9e sup\u00e9rieure \u00e0 {0} minutes.
+backAfterDeath=\u00a77Utilisez la commande /back pour retourner \u00e0 l''endroit ou vous \u00eates mort.
+backUsageMsg=\u00a77Retour \u00e0 votre emplacement pr\u00e9c\u00c3\u00a8dent.
+backupFinished=Sauvegarde termin\u00e9
+backupStarted=D\u00e9but de la sauvegarde
+balance=\u00a77Solde : {0}
+balanceTop=\u00a77 Meilleurs soldes ({0})
+banExempt=\u00a77Vous ne pouvez pas bannir ce joueur.
+banIpAddress=\u00a77Adresse IP bannie
+bannedIpsFileError=Erreur de lecture de banned-ips.txt
+bannedIpsFileNotFound=Fichier banned-ips.txt introuvable
+bannedPlayersFileError=Erreur lors de la lecture de banned-players.txt
+bannedPlayersFileNotFound=banned-players.txt introuvable.
+bigTreeFailure=\u00a7c\u00c9chec de la g\u00e9n\u00e9ration du gros arbre. Essayez de nouveau sur de la terre ou de l''herbe.
+bigTreeSuccess=\u00a77Gros arbre cr\u00e9e.
+blockList=Essentials relayed the following commands to another plugin:
+broadcast=[\u00a7cMessage\u00a7f]\u00a7a {0}
+buildAlert=\u00a7cVous n''avez pas la permission de construire.
+bukkitFormatChanged=Le format de la version de Bukkit a \u00e9t\u00e9 chang\u00e9. La version n''a pas \u00e9t\u00e9 v\u00e9rifi\u00e9e.
+burnMsg=\u00a77Vous avez enflamm\u00e9 {0} pour {1} seconde(s).
+canTalkAgain=\u00a77Vous pouvez de nouveau parler.
+cantFindGeoIpDB=N''arrive pas \u00e0 trouver la base de donn\u00e9es GeoIP!
+cantReadGeoIpDB=Echec de la lecture de la base de donn\u00e9es GeoIP!
+cantSpawnItem=\u00a7cVous n''avez pas le droit de faire appara\u00c3\u00aetre {0}
+commandFailed=\u00c9chec de la commande {0} :
+commandHelpFailedForPlugin=Erreur d''obtention d''aide pour : {0}
+commandNotLoaded=\u00a7cLa commande {0} a \u00e9t\u00e9 mal charg\u00e9e.
+compassBearing=\u00a77Orientation : {0} ({1} degr\u00e9s).
+configFileMoveError=\u00c9chec du d\u00e9placement de config.yml vers l''emplacement de sauvegarde.
+configFileRenameError=\u00c9chec du changement de nom du fichier temporaire de config.yml
+connectedPlayers=Joueurs connect\u00e9s :
+connectionFailed=\u00c9chec de l''ouverture de la connexion.
+cooldownWithMessage=\u00a7cR\u00e9utilisation : {0}
+corruptNodeInConfig=\u00a74Annonce : Votre fichier de configuration a un {0} n\u0153ud corrompu.
+couldNotFindTemplate=Le mod\u00c3\u00a8le {0} est introuvable
+creatingConfigFromTemplate=Cr\u00e9ation de la configuration \u00e0 partir du mod\u00c3\u00a8le : {0}
+creatingEmptyConfig=Cr\u00e9ation d''une configuration vierge : {0}
+creative=cr\u00e9atif
+day=jour
+days=jours
+defaultBanReason=Le marteau du bannissement a frapp\u00e9 !
+deleteFileError=Le fichier {0} n''a pas pu \u00eatre supprim\u00e9
+deleteHome=\u00a77La r\u00e9sidence {0} a \u00e9t\u00e9 supprim\u00e9e.
+deleteJail=\u00a77La prison {0} a \u00e9t\u00e9 supprim\u00e9e.
+deleteWarp=\u00a77Warp {0} supprim\u00e9.
+deniedAccessCommand=L''acc\u00c3\u00a8s \u00e0 la commande a \u00e9t\u00e9 refus\u00e9 pour {0}.
+dependancyDownloaded=[Essentials] Fichier {0} correctement t\u00e9l\u00e9charg\u00e9.
+dependancyException=[Essentials] Une erreur est survenue lors de la tentative de t\u00e9l\u00e9chargement.
+dependancyNotFound=[Essentials] Une d\u00e9pendance requise n''a pas \u00e9t\u00e9 trouv\u00e9e, t\u00e9l\u00e9chargement en cours.
+depth=\u00a77Vous \u00eates au niveau de la mer.
+depthAboveSea=\u00a77Vous \u00eates \u00e0 {0} bloc(s) au-dessus du niveau de la mer.
+depthBelowSea=\u00a77Vous \u00eates \u00e0 {0} bloc(s) en-dessous du niveau de la mer.
+destinationNotSet=Destination non d\u00e9finie
+disableUnlimited=\u00a77D\u00e9sactivation du placement illimit\u00e9 de {0} pour {1}.
+disabled=d\u00e9sactiv\u00e9
+disabledToSpawnMob=Spawning this mob was disabled in the config file.
+dontMoveMessage=\u00a77La t\u00e9l\u00e9portation commence dans {0}. Ne bougez pas.
+downloadingGeoIp=T\u00e9l\u00e9chargement de la base de donn\u00e9es GeoIP ... Cela peut prendre un moment (campagne : 0.6 Mo, ville : 20Mo)
+duplicatedUserdata=Donn\u00e9e utilisateur dupliqu\u00e9e : {0} et {1}
+enableUnlimited=\u00a77Quantit\u00e9 illimit\u00e9e de {0} \u00e0 {1}.
+enabled=activ\u00e9
+enchantmentApplied = \u00a77L''enchantement {0} a \u00e9t\u00e9 appliqu\u00e9 \u00e0 l''objet dans votre main.
+enchantmentNotFound = \u00a7cEnchantement non-trouv\u00e9
+enchantmentPerm = \u00a7cVous n''avez pas les droits pour {0}.
+enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item in hand.
+enchantments = \u00a77Enchantments : {0}
+errorCallingCommand=Erreur en appelant la commande /{0}
+errorWithMessage=\u00a7cErreur : {0}
+essentialsHelp1=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat
+essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat
+essentialsReload=\u00a77Essentials Recharg\u00e9 {0}
+extinguish=\u00a77Vous cessez de br\u00fbler.
+extinguishOthers=\u00a77Vous avez \u00e9teint la combustion de {0}.
+failedToCloseConfig=Echec de la fermeture de la configuration {0}
+failedToCreateConfig=Echec de la cr\u00e9ation de la configuration {0}
+failedToWriteConfig=\u00c9chec de l''\u00e9criture de la configuration {0}
+false=faux
+feed=\u00a77Your appetite was sated.
+feedOther=\u00a77Satisfied {0}.
+fileRenameError=Echec du changement de nom de {0}
+foreverAlone=\u00a7cVous n''avez personne \u00e0 qui r\u00e9pondre
+freedMemory=A lib\u00e9r\u00e9 {0} Mo.
+gameMode=\u00a77Mode de jeu {0} pour {1}.
+gcchunks=portions,
+gcentities=entit\u00e9s
+gcfree=M\u00e9moire libre : {0} Mo
+gcmax=M\u00e9moire maximale : {0} Mo
+gctotal=M\u00e9moire utilis\u00e9e : {0} Mo
+geoIpUrlEmpty=L''URL de t\u00e9l\u00e9chargement de GeoIP est vide.
+geoIpUrlInvalid=L''URL de t\u00e9l\u00e9chargement de GeoIP est invalide.
+geoipJoinFormat=Joueur {0} vient de {1}
+godDisabledFor=d\u00e9sactiv\u00e9 pour {0}
+godEnabledFor=activ\u00e9 pour {0}
+godMode=\u00a77Mode Dieu {0}.
+haveBeenReleased=\u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9.
+heal=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
+healOther=\u00a77{0} a \u00e9t\u00e9 soign\u00e9.
+helpConsole=Pour voir l''aide tapez ?
+helpOp=\u00a7c[Aide Admin]\u00a7f \u00a77{0}:\u00a7f {1}
+helpPages=Page \u00a7c{0}\u00a7f sur \u00a7c{1}\u00a7f.
+holeInFloor=Trou dans le Sol.
+homeSet=\u00a77R\u00e9sidence d\u00e9finie.
+homeSetToBed=\u00a77Votre r\u00e9sidence est d\u00e9sormais li\u00e9e \u00e0 ce lit.
+homes=R\u00e9sidences : {0}
+hour=heure
+hours=heures
+ignorePlayer=Vous ignorez d\u00e9sormais {0}.
+illegalDate=Format de date ill\u00e9gal.
+infoChapter=S\u00e9lectionnez le chapitre :
+infoChapterPages=Chapitre {0}, page \u00a7c{1}\u00a7f sur \u00a7c{2}\u00a7f:
+infoFileDoesNotExist=Le fichier info.txt n''existe pas. Le fichier est en cours de cr\u00e9ation pour vous.
+infoPages=Page \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f.
+infoUnknownChapter=Chapitre inconnu.
+invBigger=Les inventaires des autres joueurs sont plus gros que le v\u00f4tre.
+invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu.
+invSee=Vous voyez l''inventaire de {0}.
+invSeeHelp=Utilisez /invsee pour voir l''inventaire de quelqu''un.
+invalidCharge=\u00a7cCharge invalide.
+invalidMob=Mauvias type de monstre.
+invalidServer=Serveur non valide.
+invalidSignLine=La ligne {0} du panneau est invalide.
+invalidWorld=\u00a7cMonde invalide.
+inventoryCleared=\u00a77Inventaire nettoy\u00e9.
+inventoryClearedOthers=\u00a77L''inventaire de \u00a7c{0}\u00a77 a \u00e9t\u00e9 nettoy\u00e9.
+is=est
+itemCannotBeSold=Cet objet ne peut \u00eatre vendu au serveur.
+itemMustBeStacked=Cet objet doit \u00eatre vendu par 64. Une quantit\u00e9 de 2 serait deux fois 64.
+itemNotEnough1=\u00a7cVous n''avez pas assez de cet objet pour le vendre.
+itemNotEnough2=\u00a77Si vous voulez vendre l''int\u00e9gralit\u00e9 de vos objets de ce type l\u00e0, utilisez /sell nomObjet
+itemNotEnough3=\u00a77/sell nomObjet -1 vendra tout sauf un objet, etc.
+itemSellAir=Vouliez-vous vraiment vendre de l''air ? Mettez un objet dans votre main.
+itemSold=\u00a77Vendu pour \u00a7c{0} \u00a77({1} {2} \u00e0 {3} chacun)
+itemSoldConsole={0} vendu {1} pour \u00a77{2} \u00a77({3} objet(s) \u00e0 {4} chacun)
+itemSpawn=\u00a77Donne {0} de {1}
+itemsCsvNotLoaded=N''a pas pu charger items.csv.
+jailAlreadyIncarcerated=\u00a7cJoueur d\u00e9j\u00e0 emprisonn\u00e9 : {0}
+jailMessage=\u00a7cVous avez commis un crime, vous en payez le prix.
+jailNotExist=Cette prison n''existe pas.
+jailReleased=\u00a77Joueur \u00a7e{0}\u00a77 lib\u00e9r\u00e9.
+jailReleasedPlayerNotify=\u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9 !
+jailSentenceExtended=Dur\u00e9e d''emprisonnement rallong\u00e9e de : {0)
+jailSet=\u00a77La prison {0} a \u00e9t\u00e9 cr\u00e9\u00e9.
+jumpError=\u00c7a aurait pu faire mal au cerveau de votre ordinateur.
+kickDefault=Kick\u00e9 du serveur
+kickExempt=\u00a77Vous ne pouvez pas lancer ce joueur.
+kill=\u00a77Tu\u00e9 {0}.
+kitError2=\u00a7cCe kit n''existe pas ou a \u00e9t\u00e9 mal d\u00e9fini.
+kitError=\u00a7cIl n''y a pas de kits valides.
+kitErrorHelp=\u00a7cPeut-\u00eatre qu''un objet manque d''une quantit\u00e9 dans la configuration ?
+kitGive=\u00a77Donner le kit {0}.
+kitInvFull=\u00a7cVotre inventaire \u00e9tait plein, le kit est parre-terre.
+kitTimed=\u00a7cVous ne pouvez pas utiliser ce kit pendant encore {0}.
+kits=\u00a77Kits :{0}
+lightningSmited=\u00a77Vous venez d''\u00eatre foudroy\u00e9.
+lightningUse=\u00a77{0} a \u00e9t\u00e9 foudroy\u00e9.
+listAfkTag = \u00a77[AFK]\u00a7f
+listAmount = \u00a79Il y a \u00a7c{0}\u00a79 joueurs en ligne sur \u00a7c{1}\u00a79 au total.
+listAmountHidden = \u00a79Il y a \u00a7c{0}\u00a77/{1}\u00a79 sur un maximum de \u00a7c{2}\u00a79 joueurs en ligne.
+listHiddenTag = \u00a77[MASQU\u00c9]\u00a7f
+loadWarpError=\u00c9chec du chargement du raccourci {0}
+loadinfo={0} version {1} par {2} a \u00e9t\u00e9 charg\u00e9
+localFormat=Locale :<{0}> {1}
+mailClear=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear
+mailCleared=\u00a77Courrier supprim\u00e9 !
+mailSent=\u00a77Courrier envoy\u00e9 !
+markMailAsRead=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear
+markedAsAway=\u00a77Vous \u00eates d\u00e9sormais AFK.
+markedAsNotAway=\u00a77Vous n''\u00eates d\u00e9sormais plus AFK.
+maxHomes=Vous ne pouvez pas cr\u00e9er plus de {0} r\u00e9sidences.
+mayNotJail=\u00a7cVous ne pouvez pas emprisonner cette personne.
+me=moi
+minute=minute
+minutes=minutes
+missingItems=Vous n''avez pas {0} x {1}.
+missingPrefixSuffix=Pr\u00e9fixe ou Suffixe manquant pour {0}
+mobSpawnError=Erreur lors du changement du g\u00e9n\u00e9rateur de monstres.
+mobSpawnLimit=Quantit\u00e9 de monstres limit\u00e9 \u00e0 au maximum du serveur.
+mobSpawnTarget=Le bloc cible doit \u00eatre un g\u00e9n\u00e9rateur de monstres.
+mobsAvailable=\u00a77Monstres : {0}
+moneyRecievedFrom=\u00a7a{0} a \u00e9t\u00e9 re\u00e7u de {1}
+moneySentTo=\u00a7a{0} a \u00e9t\u00e9 envoy\u00e9 \u00e0 {1}
+moneyTaken={0} pr\u00e9lev\u00e9(s) de votre compte bancaire.
+month=mois
+months=mois
+moreThanZero=Les Quantit\u00e9s doivent \u00eatre sup\u00e9rieures \u00e0 z\u00e9ro.
+msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
+muteExempt=\u00a7cVous ne pouvez pas r\u00e9duire ce joueur au silence.
+mutedPlayer=Le joueur {0} est d\u00e9sormais muet.
+mutedPlayerFor={0} a \u00e9t\u00e9 muet pour {1}.
+mutedUserSpeaks={0} a essay\u00e9 de parler mais est muet.
+nearbyPlayers=Players nearby: {0}
+needTpohere=Vous avez besoin de l''acc\u00c3\u00a8s \u00e0 /tpohere pour t\u00e9l\u00e9porter d''autres joueurs.
+negativeBalanceError=L''utilisateur n''est pas autoris\u00e9 \u00e0 avoir un solde n\u00e9gatif.
+nickChanged=surnom modifi\u00e9.
+nickDisplayName=\u00a77Vous devez activer change-displayname dans la configuration Essentials.
+nickInUse=\u00a7cCe nom est d\u00e9j\u00e0 utilis\u00e9.
+nickNamesAlpha=\u00a7cLes surnoms doivent \u00eatre alphanum\u00e9riques.
+nickNoMore=\u00a7Vous n''avez plus de surnom.
+nickOthersPermission=\u00a7cVous n''avez pas la permission de changer le surnom des autres.
+nickSet=\u00a77Votre surnom est maintenant \u00a7c{0}
+noAccessCommand=\u00a7cVous n''avez pas acc\u00c3\u00a8s \u00e0 cette commande.
+noAccessPermission=\u00a7cVous n''avez pas la permissions d''acc\u00e9der \u00e0 cette {0}
+noDestroyPermission=\u00a7cVous n''avez pas la permission de d\u00e9truire ce {0}.
+noGodWorldWarning=\u00a7cWarning! Le mode Dieu est d\u00e9sactiv\u00e9 dans ce monde.
+noHelpFound=\u00a7cAucune commande correspondante.
+noHomeSet=Vous n''avez pas d\u00e9fini de r\u00e9sidence.
+noHomeSetPlayer=Le joueur n''a pas d\u00e9fini sa r\u00e9sidence.
+noKitPermission=\u00a7cVous avez besoin de la permission \u00a7c{0}\u00a7c pour utiliser ce kit.
+noKits=\u00a77Il n''y a pas encore de kits disponibles.
+noMail=Vous n''avez pas de courrier
+noMotd=\u00a7cIl n''y a pas de message su jour.
+noNewMail=\u00a77Vous n''avez pas de courrier.
+noPendingRequest=Vous n''avez pas de requ\u00eate non lue.
+noPerm=\u00a7cVous n''avez pas la permission \u00a7f{0}\u00a7c.
+noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob.
+noPlacePermission=\u00a7cVous n''avez pas la permission de placer un bloc pr\u00c3\u00a8 de cette pancarte.
+noPowerTools=Vous n''avez pas d''outil automatique associ\u00e9.
+noRules=\u00a7cIl n''y a pas encore de r\u00c3\u00a8gles d\u00e9finies.
+noWarpsDefined=Aucun raccourci d\u00e9fini.
+none=aucun
+notAllowedToQuestion=\u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 poser des questions.
+notAllowedToShout=\u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 crier.
+notEnoughExperience=You do not have enough experience.
+notEnoughMoney=Vous n''avez pas les fonds n\u00e9cessaires.
+notRecommendedBukkit=* ! * La version de Bukkit n''est pas celle qui est recommand\u00e9 pour cette version de Essentials.
+notSupportedYet=Pas encore pris en charge.
+nothingInHand = \u00a7cVous n''avez rien en main.
+now=maintenant
+numberRequired=Il faut fournir un nombre ici.
+onlyDayNight=/time ne supporte que (jour) day/night (nuit).
+onlyPlayers=Seulement les joueurs en jeu peuvent utiliser {0}.
+onlySunStorm=/weather ne supporte que (soleil) sun/storm (temp\u00eate).
+orderBalances=Ordering balances of {0} users, please wait ...
+pTimeCurrent=\u00a7e{0}''s\u00a7f l''heure est {1}.
+pTimeCurrentFixed=\u00a7e{0}''s\u00a7f l''heure est fix\u00e9e \u00e0 {1}.
+pTimeNormal=\u00a7e{0}''s\u00a7f l''heure est normale et correspond au server.
+pTimeOthersPermission=\u00a7cVous n''etes pas autoris\u00e9 \u00e0 changer l''heure des autres joueurs.
+pTimePlayers=Ces joueurs ont leur propre horraire :
+pTimeReset=l''heure a \u00e9t\u00e9 r\u00e9initialis\u00e9e \u00e0 : \u00a7e{0}
+pTimeSet=l''heure du joueur a \u00e9t\u00e9 r\u00e9egl\u00e9ee \u00e0 \u00a73{0}\u00a7f pour : \u00a7e{1}
+pTimeSetFixed=l''heure du joueur a \u00e9t\u00e9 fix\u00e9e \u00e0 : \u00a7e{1}
+parseError=Erreur de conversion {0} \u00e0 la ligne {1}
+pendingTeleportCancelled=\u00a7cRequete de t\u00e9l\u00e9portation annul\u00e9e.
+permissionsError=Permissions/GroupManager manquant, les pr\u00e9fixes et suffixes ne seront pas affich\u00e9s.
+playerBanned=\u00a7cJoueur {0} banni {1} pour {2}
+playerInJail=\u00a7cLe joueur est d\u00e9j\u00e0 dans la prison {0}.
+playerJailed=\u00a77Le joueur {0} a \u00e9t\u00e9 emprisonn\u00e9.
+playerJailedFor=\u00a77{0} a \u00e9t\u00e9 emprisonn\u00e9 pour {1}.
+playerKicked=\u00a7cPlayer {0} kicked {1} for {2}
+playerMuted=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duis au silence.
+playerMutedFor=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duis au silence pour {0}
+playerNeverOnServer=\u00a7cLe joueur {0} n''a jamais \u00e9t\u00e9 sur le serveur.
+playerNotFound=\u00a7cLe joueur est introuvable.
+playerUnmuted=\u00a77Vous avez de nouveau la parole.
+pong=Pong !
+possibleWorlds=\u00a77Les mondes possibles sont les nombres de 0 \u00e0 {0}.
+powerToolAir=La commande ne peut pas \u00eatre assign\u00e9e \u00e0 l''air.
+powerToolAlreadySet=La commande \u00a7c{0}\u00a7f est d\u00e9j\u00e0 assign\u00e9e \u00e0 {1}.
+powerToolAttach=Commande \u00a7c{0}\u00a7f assign\u00e9e \u00e0 {1}.
+powerToolClearAll=Toutes les commandes assign\u00e9es ont \u00e9et\u00e9e retir\u00e9ees.
+powerToolList={1} assign\u00e9s aux commandes : \u00a7c{0}\u00a7f.
+powerToolListEmpty={0} n''a pas de commande assign\u00e9e.
+powerToolNoSuchCommandAssigned=La commande \u00a7c{0}\u00a7f n''a pas \u00e9t\u00e9 assign\u00e9e \u00e0 {1}.
+powerToolRemove=Command \u00a7c{0}\u00a7f retir\u00e9e de {1}.
+powerToolRemoveAll=Toutes les commandes retir\u00e9es de {0}.
+powerToolsDisabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 retir\u00e9es.
+powerToolsEnabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 activ\u00e9es.
+protectionOwner=\u00a76[EssentialsProtect] Propri\u00e9taire de la protection : {0}
+questionFormat=\u00a77[Question]\u00a7f {0}
+readNextPage=Type /{0} {1} to read the next page
+reloadAllPlugins=\u00a77Toutes les extensions ont \u00e9t\u00e9 recharg\u00e9es.
+removed=\u00a77Removed {0} entities.
+repair=Vous avez r\u00e9par\u00e9 votre : \u00a7e{0}.
+repairAlreadyFixed=\u00a77Cet objet n''a pas besoin de r\u00e9paration.
+repairEnchanted=\u00a77You are not allowed to repair enchanted items.
+repairInvalidType=\u00a7cCet objet ne peut \u00eatre r\u00e9par\u00e9.
+repairNone=Aucun objet n''a besoin d''\u00eatre r\u00e9par\u00e9.
+requestAccepted=\u00a77Demande de t\u00e9l\u00e9portation accept\u00e9e.
+requestAcceptedFrom=\u00a77{0} a accept\u00e9 votre demande de t\u00e9l\u00e9portation.
+requestDenied=\u00a77Demande de t\u00e9l\u00e9portation refus\u00e9e.
+requestDeniedFrom=\u00a77{0} a refus\u00e9 votre demande de t\u00e9l\u00e9portation.
+requestSent=\u00a77Requ\u00eate envoy\u00e9e \u00e0 {0}\u00a77.
+requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
+returnPlayerToJailError=Erreur survenue lors de la tentative d''emprisonner de nouveau un joueur.
+second=seconde
+seconds=secondes
+seenOffline=Le joueur {0} est hors ligne depuis {1}
+seenOnline=Le joueur {0} est en ligne depuis {1}
+serverFull=Le serveur est plein.
+setSpawner=Type de g\u00e9n\u00e9rateur chang\u00e9 en {0}
+sheepMalformedColor=Couleur mal form\u00e9e.
+shoutFormat=\u00a77[Crie]\u00a7f {0}
+signFormatFail=\u00a74[{0}]
+signFormatSuccess=\u00a71[{0}]
+signFormatTemplate=[{0}]
+signProtectInvalidLocation=\u00a74Vous n''avez pas l''autorisation de cr\u00e9er une pancarte ici.
+similarWarpExist=Un raccourci avec un nom similaire existe d\u00e9j\u00e0.
+slimeMalformedSize=Taille mal form\u00e9e.
+soloMob=Ce monstre aime \u00eatre seul.
+spawnSet=\u00a77Le point de spawn a \u00e9t\u00e9 d\u00e9fini pour le groupe {0}.
+spawned=invoqu\u00e9(s)
+suicideMessage=\u00a77Au revoir monde cruel...
+suicideSuccess=\u00a77{0} s''est suiscid\u00e9.
+survival=survie
+takenFromAccount=\u00a7c{0} ont \u00e9t\u00e9 retir\u00e9 de votre compte.
+takenFromOthersAccount=\u00a7c{0} a \u00e9t\u00e9 r\u00e9tir\u00e9 du compte de {1}.
+teleportAAll=\u00a77Demande de t\u00e9l\u00e9portation envoy\u00e9e \u00e0 tous les joueurs...
+teleportAll=\u00a77T\u00e9l\u00e9poration de tous les joueurs.
+teleportAtoB=\u00a77{0}\u00a77 vous a t\u00e9l\u00e9port\u00e9 \u00e0 {1}\u00a77.
+teleportDisabled={0} a la t\u00e9l\u00e9portation d\u00e9sactiv\u00e9.
+teleportHereRequest=\u00a7c{0}\u00a7c Vous a demand\u00e9 de vous t\u00e9l\u00e9porter \u00e0 lui/elle.
+teleportNewPlayerError=\u00c9chec de la t\u00e9l\u00e9portation du nouveau joueur.
+teleportRequest=\u00a7c{0}\u00a7c vous demande s''il peut se t\u00e9l\u00e9porter vers vous.
+teleportTop=\u00a77T\u00e9l\u00e9portation vers le haut.
+teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation...
+teleportationDisabled=\u00a77T\u00e9l\u00e9poration d\u00e9sactiv\u00e9.
+teleportationEnabled=\u00a77T\u00e9l\u00e9portation activ\u00e9e.
+teleporting=\u00a77T\u00e9l\u00e9poration en cours...
+teleportingPortal=\u00a77T\u00e9l\u00e9portation via portail.
+tempBanned=Banni temporairement du serveur pour {0}
+tempbanExempt=\u00a77Vous ne pouvez pas bannir temporairement ce joueur.
+thunder=Vous avez {0} la foudre dans votre monde.
+thunderDuration=Vous avez {0} la foudre dans le serveur pendant {1} secondes.
+timeBeforeHeal=Temps avant le prochain soin : {0}
+timeBeforeTeleport=Temps avant prochaine t\u00e9l\u00e9portation {0}
+timeFormat=\u00a73{0}\u00a7f ou \u00a73{1}\u00a7f ou \u00a73{2}\u00a7f
+timePattern=(?:([0-9]+)\\\\s*[ya][a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*mo[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*(?:sem|w)[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*[dj][a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*h[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*m[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*(?:s[a-z]*)?)?
+timeSet=Heure r\u00e9gl\u00e9e dans tous les mondes.
+timeSetPermission=\u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 r\u00e9gler l''heure.
+timeWorldCurrent=Il est \u00a73{1}\u00a77 dans \u00a7c{0}.
+timeWorldSet=L''heure a \u00e9t\u00e9 r\u00e9gl\u00e9e \u00e0 {0} dans : \u00a7c{1}
+tradeCompleted=\u00a77\u00c9change termin\u00e9.
+tradeSignEmpty=Le panneau de vente n''as pas encore assez de stock.
+tradeSignEmptyOwner=Il n''y a rien \u00e0 collecter de cette pancarte d''\u00e9change commercial.
+treeFailure=\u00a7cEchec de la g\u00e9n\u00e9ration de l''arbre. Essayez de nouveau sur de l''herbe ou de la terre.
+treeSpawned=\u00a77Arbre cr\u00e9\u00e9.
+true=vrai
+typeTpaccept=\u00a77Pour le t\u00e9l\u00e9porter, tapez \u00a7c/tpaccept\u00a77.
+typeTpdeny=\u00a77Pour d\u00e9cliner cette demande, entrez \u00a7c/tpdeny\u00a77.
+typeWorldName=\u00a77Vous pouvez aussi taper le nom d''un monde sp\u00e9cifique.
+unableToSpawnMob=Incapable d''invoquer un monstre.
+unbannedIP=Adresse IP d\u00e9bannie.
+unbannedPlayer=Joueur d\u00e9banni.
+unignorePlayer=Vous n''ignorez plus {0}.
+unknownItemId=Num\u00e9ro d''objet inconnu : {0}
+unknownItemInList=L''objet {0} est inconnu dans la liste {1}.
+unknownItemName=Nom d''objet inconnu : {0}
+unlimitedItemPermission=\u00a7cPas de permission pour l''objet illimit\u00e9 {0}.
+unlimitedItems=Objets illimit\u00e9s:
+unmutedPlayer=Le joueur {0} n''est plus muet.
+upgradingFilesError=Erreur durant la mise \u00e0 jour des fichiers.
+userDoesNotExist=L''utilisateur {0} n''existe pas.
+userIsAway={0} s''est mis en AFK
+userIsNotAway={0} n''est plus inactif
+userJailed=\u00a77Vous avez \u00e9t\u00e9 emprisonn\u00e9
+userUsedPortal={0} a utilis\u00e9 un portail existant.
+userdataMoveBackError=Echec du d\u00e9placement de userdata/{0}.tmp vers userdata/{1}
+userdataMoveError=Echec du d\u00e9placement de userdata/{0} vers userdata/{1}.tmp
+usingTempFolderForTesting=Utilise un fichier temporaire pour un test.
+versionMismatch=Versions diff\u00e9rentes ! Mettez s''il vous plait {0} \u00e0 la m\u00eame version.
+versionMismatchAll=Mauvaise version ! S''il vous plait mettez des jars Essentials de version identique.
+voiceSilenced=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duit au silence.
+warpDeleteError=Probl\u00c3\u00a8me concernant la suppression du fichier warp.
+warpListPermission=\u00a7cVous n''avez pas la permission d''afficher la liste des warps.
+warpNotExist=Ce raccourci n''existe pas.
+warpSet=\u00a77Le raccourci {0} a \u00e9t\u00e9 cr\u00e9\u00e9.
+warpUsePermission=\u00a7cVous n''avez pas la permission d''utiliser ce warp.
+warpingTo=\u00a77T\u00e9l\u00e9portation au warp {0}.
+warps=Raccourcis : {0}
+warpsCount=\u00a77Il y a {0} raccourcis. Page {1} sur {2}.
+weatherStorm=\u00a77Vous avez programm\u00e9 l''orage dans {0}
+weatherStormFor=\u00a77Vous avez programm\u00e9 l''orage dans {0} pour {1} secondes.
+weatherSun=\u00a77Vous avez programm\u00e9 le beau temps dans {0}
+weatherSunFor=\u00a77Vous avez programm\u00e9 le beau temps dans {0} pour {1} secondes.
+whoisBanned=\u00a79 - Banned: {0}
+whoisGamemode=\u00a79 - Mode de jeu : {0}
+whoisGeoLocation=\u00a79 - Emplacement : {0}
+whoisGod=\u00a79 - Mode Dieu : {0}
+whoisHealth=\u00a79 - Vie : {0} / 20
+whoisIPAddress=\u00a79 - Adresse IP : {0}
+whoisIs={0} est {1}
+whoisLocation=\u00a79 - Emplacement : ({0}, {1}, {2}, {3})
+whoisMoney=\u00a79 - Argent : {0}
+whoisOP=\u00a79 - OP : {0}
+whoisStatusAvailable=\u00a79 - Statut : Disponible
+whoisStatusAway=\u00a79 - Statut : \u00a7cAilleurs\u00a7f
+worth=\u00a77Une pile de {0} vaut \u00a7c{1}\u00a77 ({2} objet(s) \u00e0 {3} chacun)
+worthMeta=\u00a77Une pile de {0} avec la m\u00e9tadonn\u00e9e de {1} vaut \u00a7c{2}\u00a77 ({3} objet(s) \u00e0 {4} chacun)
+worthSet=Valeur cr\u00e9e
+year=ann\u00e9e
+years=ann\u00e9es
+youAreHealed=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
+youHaveNewMail=\u00a7cVous avez {0} messages ! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier.
+requestTimedOut=\u00a7cTeleport request has timed out
+teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties
index f5d9fdc70..546169060 100644
--- a/Essentials/src/messages_nl.properties
+++ b/Essentials/src/messages_nl.properties
@@ -2,369 +2,405 @@
# Single quotes have to be doubled: ''
# Translations start here
# by: Geertje123
-action = * {0} {1}
-addedToAccount = \u00a7a{0} is gestort op je account.
-addedToOthersAccount = \u00a7a{0} is overgemaakt naar {1}''s rekening
-alertBroke = gebroken:
-alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} bij: {3}
-alertPlaced = geplaatst:
-alertUsed = gebruikt:
+action=* {0} {1}
+addedToAccount=\u00a7a{0} is gestort op je account.
+addedToOthersAccount=\u00a7a{0} is overgemaakt naar {1}''s rekening
+alertBroke=gebroken:
+alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bij: {3}
+alertPlaced=geplaatst:
+alertUsed=gebruikt:
autoAfkKickReason=You have been kicked for idling more than {0} minutes.
-backAfterDeath = \u00a77Gebruik het /back command om terug te keren naar je sterfplaats.
-backUsageMsg = \u00a77Naar de vorige locatie aan het gaan.
-backupFinished = Backup voltooid
-backupStarted = Backup gestart
-balance = \u00a77Saldo: {0}
-balanceTop = \u00a77 Top {0} saldi
-banExempt = \u00a77Je kunt deze speler niet verbannen.
-banIpAddress = \u00a77Verbannen IP-adres
-bannedIpsFileError = Fout bij het lezen van banned-ips.txt
-bannedIpsFileNotFound = banned-ips.txt werd niet gevonden
-bannedPlayersFileError = Fout bij het lezen van banned-players.txt
-bannedPlayersFileNotFound = banned-players.txt werd niet gevonden
-bigTreeFailure = \u00a7cMaken van een grote boom is mislukt. Probeer het opnieuw op gras of dirt.
-bigTreeSuccess = \u00a77Grote boom gemaakt.
-broadcast = [\u00a7cBroadcast\u00a7f]\u00a7a {0}
-buildAlert = \u00a7cJe bent niet bevoegd om te bouwen
-bukkitFormatChanged = Bukkit versie formaat veranderd. Versie niet nagekeken.
-burnMsg = \u00a77Je hebt {0} voor {1} seconde(n) in de fik gezet.
-canTalkAgain = \u00a77Je kan weer praten.
-cantFindGeoIpDB = De GeoIP database kon niet gevonden worden!
-cantReadGeoIpDB = Fout bij het lezen van de GeoIP database!
-cantSpawnItem = \u00a7cJe bent niet bevoegd om {0} te spawnen.
-commandFailed = Opdracht {0} mislukt:
-commandHelpFailedForPlugin=Fout bij het \u200b\u200bkrijgen van hulp voor: {0}
-commandNotLoaded = \u00a7cOpdracht {0} is fout geladen.
-compassBearing = \u00a77Ligging: {0} ({1} graden).
-configFileMoveError = Het verplaatsen van config.yml naar de backup locatie is mislukt.
-configFileRenameError = Fout bij het hernoemen van de tijdelijke map naar config.yml
-connectedPlayers = Spelers online:
-connectionFailed = Fout bij het verbinden.
-cooldownWithMessage = \u00a7cAfkoeltijd: {0}
-corruptNodeInConfig = \u00a74Waarschuwing: Het configuratiebestand bevat een fout {0}.
-couldNotFindTemplate = Het sjabloon kon niet worden gevonden {0}
-creatingConfigFromTemplate = Bezig met aanmaken van een config vanaf sjabloon: {0}
-creatingEmptyConfig = Bezig met een lege config aanmaken: {0}
-day = dag
-days = dagen
-defaultBanReason = De Ban Hamer heeft gesproken!
-deleteFileError = Het bestand kon niet verwijderd worden: {0}
-deleteHome = \u00a77Home {0} has been removed.
-deleteJail = \u00a77Gevangenis {0} is verwijderd.
-deleteWarp = \u00a77Warp {0} is verwijderd.
-deniedAccessCommand = {0} was de toegang verboden tot het commando.
-dependancyDownloaded = [Essentials] Afhankelijkheid {0} succesvol gedownload.
-dependancyException = [Essentials] Er is een fout opgetreden bij het downloaden van de afhankelijkheid
-dependancyNotFound = [Essentials] Een afhankelijkheid is niet gevonden. Start downloaden.
-depth = \u00a77Je zit op zeeniveau.
-depthAboveSea = \u00a77Je zit {0} blok(ken) boven zeeniveau.
-depthBelowSea = \u00a77Je zit {0} blok(ken) onder zeeniveau.
-destinationNotSet = Bestemming niet ingesteld
-disableUnlimited = \u00a77Oneindig plaatsen van {0} uitgeschakeld voor {1}.
-disabled = uitgeschakeld
-dontMoveMessage = \u00a77Beginnen met teleporteren in {0}. Niet bewegen.
-downloadingGeoIp = Bezig met downloaden van GeoIP database ... Dit kan een tijdje duren (country: 0.6 MB, city: 20MB)
-duplicatedUserdata = Dubbele userdata: {0} en {1}.
-enableUnlimited = \u00a77Oneindig aantal {0} aan {1} gegeven.
-enabled = ingeschakeld
-errorCallingCommand = Fout bij het aanroepen van de opdracht /{0}
-errorWithMessage = \u00a7cFout: {0}
-essentialsReload = \u00a77Essentials is herladen {0}
-extinguish = \u00a77Je hebt jezelf geblust.
-extinguishOthers = \u00a77Je hebt {0} geblust.
-failedToCloseConfig = Fout bij het sluiten van config {0}
-failedToCreateConfig = Fout tijdens het aanmaken van config {0}
-failedToWriteConfig = Fout bij het cre\u00ebren van config {0}
-fileRenameError = Hernoemen van {0} mislukt
-foreverAlone = \u00a7cJe hebt niemand waarnaar je kan reageren.
-freedMemory = {0} MB gelost.
-gcchunks = chunks,
-gcentities = entities
-gcfree = Vrij geheugen: {0} MB
-gcmax = Maximaal geheugen: {0} MB
-gctotal = Gealloceerd geheugen: {0} MB
-geoIpUrlEmpty = GeoIP download url is leeg.
-geoIpUrlInvalid = GeoIP download url is ongeldig.
-geoipJoinFormat = Speler {0} komt uit {1}
-godDisabledFor = uitgeschakeld voor {0}
-godEnabledFor = ingeschakeld voor {0}
-godMode = \u00a77God mode {0}.
-haveBeenReleased = \u00a77Je bent bevrijdt
-heal = \u00a77Je bent genezen.
-healOther = \u00a77Je geneezde {0}.
-helpConsole = type ? om de consolehelp weer te geven.
-helpOp = \u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1}
-helpPages = Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f:
-holeInFloor = Gat in de vloer
-homeSet = \u00a77Home ingesteld.
-homeSetToBed = \u00a77Je home is is nu verplaatst naar dit bed.
-homes = Homes: {0}
-hour = uur
-hours = uren
-ignorePlayer = Je negeert {0} vanaf nu.
-illegalDate = Illegaal data formaat.
-infoChapter = Selecteer hoofdstuk:
-infoChapterPages = Hoofdstuk {0}, Pagina \u00a7c{1}\u00a7f van de \u00a7c{2}\u00a7f:
-infoFileDoesNotExist = Bestand info.txt bestaat niet. Bezig met aanmaken.
-infoPages = Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f:
-infoUnknownChapter = Onbekend hoofdstuk.
-invBigger = De inventory van de andere speler is groter dan die van jou.
-invRestored = Je inventory is hersteld.
-invSee = Je kijkt naar de inventory van {0}.
-invSeeHelp = Type /invsee om je inventory te herstellen.
-invalidCharge = \u00a7cOngeldig te laden.
-invalidMob = Ongeldig mob type.
-invalidServer = Ongeldige server!
-invalidSignLine = Regel {0} op het bordje is ongeldig.
-invalidWorld = \u00a7cOngeldige wereld.
-inventoryCleared = \u00a77inventory leeggemaakt.
-inventoryClearedOthers = \u00a77inventory van \u00a7c{0}\u00a77 leeggemaakt.
-is = is
-itemCannotBeSold = Dat voorwerp kan niet aan de server worden verkocht.
-itemMustBeStacked = Voorwerp moet geruild worden als stapel. Een hoeveelheid van 2 moet dus geruild worden als twee stapels, etc.
-itemNotEnough1 = \u00a7cJe hebt niet genoeg van dat voorwerp om te verkopen.
-itemNotEnough2 = \u00a77Type /sell itemname Als je alles daarvan wilt verkopen
-itemNotEnough3 = \u00a77/sell itemname -1 zorgt ervoor dat ze allemaal behalve 1 worden verkocht, etc.
-itemSellAir = Je wilde serieus lucht verkopen? Plaats een voorwerp in je hand.
-itemSold = \u00a77Verkocht voor \u00a7c{0} \u00a77({1} {2} voorwerpen voor {3} per stuk)
-itemSoldConsole = {0} verkocht {1} voor \u00a77{2} \u00a77({3} voorwerpen voor {4} per stuk)
-itemSpawn = \u00a77Geeft {0} {1}
-itemsCsvNotLoaded = De item kunnen niet geladen worden.csv.
-jailAlreadyIncarcerated = \u00a7cPerson is already in jail: {0}
-jailMessage = \u00a7cYou do the crime, you do the time.
-jailNotExist = Die gevangenis bestaat niet.
-jailReleased = \u00a77Player \u00a7e{0}\u00a77 unjailed.
-jailReleasedPlayerNotify = \u00a77You have been released!
-jailSentenceExtended = Jail time extend to: {0)
-jailSet = \u00a77Gevangenis {0} is ingesteld
-jumpError = Dat zou je computers hersenen beschadigen.
-kickDefault = Gekicked van de server
-kickExempt = \u00a77Je kunt die speler niet schoppen.
-kill = \u00a77Jij doodde {0}.
-kitError = \u00a7cEr zijn geen geldige kits.
-kitError2 = \u00a7cDie kit bestaat niet of is verkeerde beschreven.
-kitErrorHelp = \u00a7cMisschien mist er een hoeveelheid van het item in de configuratie?
-kitGive = \u00a77Kit {0} wordt gegeven.
-kitInvFull = \u00a7cJe inventory was vol, de kit wordt op de grond geplaatst
-kitTimed = \u00a7cJe kan die kit pas weer gebruiken over {0}.
-kits = \u00a77Kits: {0}
-lightningSmited = \u00a77Je bent zojuist verbrand
-lightningUse = \u00a77Brand {0}
-loadWarpError = Fout bij het laden van warp {0}
-loadinfo = Build {1} geladen {0} van {2}
-localFormat = Local: <{0}> {1}
-mailClear = \u00a7cType /mail clear, om ej berichten als gelezen te markeren.
-mailCleared = \u00a77Bericht geklaard!
-mailSent = \u00a77Bericht verzonden!
-markMailAsRead = \u00a7cType /mail clear, om je berichten als gelezen te markeren
-markedAsAway = \u00a77Je staat nu als afwezig gemeld.
-markedAsNotAway = \u00a77Je staat niet meer als afwezig gemeld.
+backAfterDeath=\u00a77Gebruik het /back command om terug te keren naar je sterfplaats.
+backUsageMsg=\u00a77Naar de vorige locatie aan het gaan.
+backupFinished=Backup voltooid
+backupStarted=Backup gestart
+balance=\u00a77Saldo: {0}
+balanceTop=\u00a77 Top saldi ({0})
+banExempt=\u00a77Je kunt deze speler niet verbannen.
+banIpAddress=\u00a77Verbannen IP-adres
+bannedIpsFileError=Fout bij het lezen van banned-ips.txt
+bannedIpsFileNotFound=banned-ips.txt werd niet gevonden
+bannedPlayersFileError=Fout bij het lezen van banned-players.txt
+bannedPlayersFileNotFound=banned-players.txt werd niet gevonden
+bigTreeFailure=\u00a7cMaken van een grote boom is mislukt. Probeer het opnieuw op gras of dirt.
+bigTreeSuccess= \u00a77Grote boom gemaakt.
+blockList=Essentials relayed the following commands to another plugin:
+broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0}
+buildAlert=\u00a7cJe bent niet bevoegd om te bouwen
+bukkitFormatChanged=Bukkit versie formaat veranderd. Versie niet nagekeken.
+burnMsg=\u00a77Je hebt {0} voor {1} seconde(n) in de fik gezet.
+canTalkAgain=\u00a77Je kan weer praten.
+cantFindGeoIpDB=De GeoIP database kon niet gevonden worden!
+cantReadGeoIpDB=Fout bij het lezen van de GeoIP database!
+cantSpawnItem=\u00a7cJe bent niet bevoegd om {0} te spawnen.
+commandFailed=Opdracht {0} mislukt:
+commandHelpFailedForPlugin=Fout bij het \u200b\u200bkrijgen van hulp voor: {0}
+commandNotLoaded=\u00a7cOpdracht {0} is fout geladen.
+compassBearing=\u00a77Ligging: {0} ({1} graden).
+configFileMoveError=Het verplaatsen van config.yml naar de backup locatie is mislukt.
+configFileRenameError=Fout bij het hernoemen van de tijdelijke map naar config.yml
+connectedPlayers=Spelers online:
+connectionFailed=Fout bij het verbinden.
+cooldownWithMessage=\u00a7cAfkoeltijd: {0}
+corruptNodeInConfig=\u00a74Waarschuwing: Het configuratiebestand bevat een fout {0}.
+couldNotFindTemplate=Het sjabloon kon niet worden gevonden {0}
+creatingConfigFromTemplate=Bezig met aanmaken van een config vanaf sjabloon: {0}
+creatingEmptyConfig=Bezig met een lege config aanmaken: {0}
+creative=creative
+day=dag
+days=dagen
+defaultBanReason=De Ban Hamer heeft gesproken!
+deleteFileError=Het bestand kon niet verwijderd worden: {0}
+deleteHome=\u00a77Home {0} has been removed.
+deleteJail=\u00a77Gevangenis {0} is verwijderd.
+deleteWarp=\u00a77Warp {0} is verwijderd.
+deniedAccessCommand={0} was de toegang verboden tot het commando.
+dependancyDownloaded=[Essentials] Afhankelijkheid {0} succesvol gedownload.
+dependancyException=[Essentials] Er is een fout opgetreden bij het downloaden van de afhankelijkheid
+dependancyNotFound=[Essentials] Een afhankelijkheid is niet gevonden. Start downloaden.
+depth=\u00a77Je zit op zeeniveau.
+depthAboveSea=\u00a77Je zit {0} blok(ken) boven zeeniveau.
+depthBelowSea=\u00a77Je zit {0} blok(ken) onder zeeniveau.
+destinationNotSet=Bestemming niet ingesteld
+disableUnlimited=\u00a77Oneindig plaatsen van {0} uitgeschakeld voor {1}.
+disabled=uitgeschakeld
+disabledToSpawnMob=Spawning this mob was disabled in the config file.
+dontMoveMessage=\u00a77Beginnen met teleporteren in {0}. Niet bewegen.
+downloadingGeoIp=Bezig met downloaden van GeoIP database ... Dit kan een tijdje duren (country: 0.6 MB, city: 20MB)
+duplicatedUserdata=Dubbele userdata: {0} en {1}.
+enableUnlimited=\u00a77Oneindig aantal {0} aan {1} gegeven.
+enabled=ingeschakeld
+enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand.
+enchantmentNotFound = \u00a7cEnchantment not found
+enchantmentPerm = \u00a7cYou do not have the permission for {0}
+enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item in hand.
+enchantments = \u00a77Enchantments: {0}
+errorCallingCommand=Fout bij het aanroepen van de opdracht /{0}
+errorWithMessage=\u00a7cFout: {0}
+essentialsHelp1=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat
+essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat
+essentialsReload=\u00a77Essentials is herladen {0}
+extinguish=\u00a77Je hebt jezelf geblust.
+extinguishOthers=\u00a77Je hebt {0} geblust.
+failedToCloseConfig=Fout bij het sluiten van config {0}
+failedToCreateConfig=Fout tijdens het aanmaken van config {0}
+failedToWriteConfig=Fout bij het cre\u00ebren van config {0}
+false=false
+feed=\u00a77Your appetite was sated.
+feedOther=\u00a77Satisfied {0}.
+fileRenameError=Hernoemen van {0} mislukt
+foreverAlone=\u00a7cJe hebt niemand waarnaar je kan reageren.
+freedMemory={0} MB gelost.
+gameMode=\u00a77Set game mode {0} for {1}.
+gcchunks= chunks,
+gcentities= entities
+gcfree=Vrij geheugen: {0} MB
+gcmax=Maximaal geheugen: {0} MB
+gctotal=Gealloceerd geheugen: {0} MB
+geoIpUrlEmpty=GeoIP download url is leeg.
+geoIpUrlInvalid=GeoIP download url is ongeldig.
+geoipJoinFormat=Speler {0} komt uit {1}
+godDisabledFor=uitgeschakeld voor {0}
+godEnabledFor=ingeschakeld voor {0}
+godMode=\u00a77God mode {0}.
+haveBeenReleased=\u00a77Je bent bevrijdt
+heal=\u00a77Je bent genezen.
+healOther=\u00a77Je geneezde {0}.
+helpConsole=type ? om de consolehelp weer te geven.
+helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1}
+helpPages=Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f:
+holeInFloor=Gat in de vloer
+homeSet=\u00a77Home ingesteld.
+homeSetToBed=\u00a77Je home is is nu verplaatst naar dit bed.
+homes=Homes: {0}
+hour=uur
+hours=uren
+ignorePlayer=Je negeert {0} vanaf nu.
+illegalDate=Illegaal data formaat.
+infoChapter=Selecteer hoofdstuk:
+infoChapterPages=Hoofdstuk {0}, Pagina \u00a7c{1}\u00a7f van de \u00a7c{2}\u00a7f:
+infoFileDoesNotExist=Bestand info.txt bestaat niet. Bezig met aanmaken.
+infoPages=Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f:
+infoUnknownChapter=Onbekend hoofdstuk.
+invBigger=De inventory van de andere speler is groter dan die van jou.
+invRestored=Je inventory is hersteld.
+invSee=Je kijkt naar de inventory van {0}.
+invSeeHelp=Type /invsee om je inventory te herstellen.
+invalidCharge=\u00a7cOngeldig te laden.
+invalidMob=Ongeldig mob type.
+invalidServer=Ongeldige server!
+invalidSignLine=Regel {0} op het bordje is ongeldig.
+invalidWorld=\u00a7cOngeldige wereld.
+inventoryCleared=\u00a77inventory leeggemaakt.
+inventoryClearedOthers=\u00a77inventory van \u00a7c{0}\u00a77 leeggemaakt.
+is=is
+itemCannotBeSold=Dat voorwerp kan niet aan de server worden verkocht.
+itemMustBeStacked=Voorwerp moet geruild worden als stapel. Een hoeveelheid van 2 moet dus geruild worden als twee stapels, etc.
+itemNotEnough1=\u00a7cJe hebt niet genoeg van dat voorwerp om te verkopen.
+itemNotEnough2=\u00a77Type /sell itemname Als je alles daarvan wilt verkopen
+itemNotEnough3=\u00a77/sell itemname -1 zorgt ervoor dat ze allemaal behalve 1 worden verkocht, etc.
+itemSellAir=Je wilde serieus lucht verkopen? Plaats een voorwerp in je hand.
+itemSold=\u00a77Verkocht voor \u00a7c{0} \u00a77({1} {2} voorwerpen voor {3} per stuk)
+itemSoldConsole={0} verkocht {1} voor \u00a77{2} \u00a77({3} voorwerpen voor {4} per stuk)
+itemSpawn=\u00a77Geeft {0} {1}
+itemsCsvNotLoaded=De item kunnen niet geladen worden.csv.
+jailAlreadyIncarcerated=\u00a7cPerson is already in jail: {0}
+jailMessage=\u00a7cYou do the crime, you do the time.
+jailNotExist=Die gevangenis bestaat niet.
+jailReleased=\u00a77Player \u00a7e{0}\u00a77 unjailed.
+jailReleasedPlayerNotify=\u00a77You have been released!
+jailSentenceExtended=Jail time extend to: {0)
+jailSet=\u00a77Gevangenis {0} is ingesteld
+jumpError=Dat zou je computers hersenen beschadigen.
+kickDefault=Gekicked van de server
+kickExempt=\u00a77Je kunt die speler niet schoppen.
+kill=\u00a77Jij doodde {0}.
+kitError2=\u00a7cDie kit bestaat niet of is verkeerde beschreven.
+kitError=\u00a7cEr zijn geen geldige kits.
+kitErrorHelp=\u00a7cMisschien mist er een hoeveelheid van het item in de configuratie?
+kitGive=\u00a77Kit {0} wordt gegeven.
+kitInvFull=\u00a7cJe inventory was vol, de kit wordt op de grond geplaatst
+kitTimed=\u00a7cJe kan die kit pas weer gebruiken over {0}.
+kits=\u00a77Kits: {0}
+lightningSmited=\u00a77Je bent zojuist verbrand
+lightningUse=\u00a77Brand {0}
+listAfkTag = \u00a77[AFK]\u00a7f
+listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79 players online.
+listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online.
+listHiddenTag = \u00a77[HIDDEN]\u00a7f
+loadWarpError=Fout bij het laden van warp {0}
+loadinfo=Build {1} geladen {0} van {2}
+localFormat=Local: <{0}> {1}
+mailClear=\u00a7cType /mail clear, om ej berichten als gelezen te markeren.
+mailCleared=\u00a77Bericht geklaard!
+mailSent=\u00a77Bericht verzonden!
+markMailAsRead=\u00a7cType /mail clear, om je berichten als gelezen te markeren
+markedAsAway=\u00a77Je staat nu als afwezig gemeld.
+markedAsNotAway=\u00a77Je staat niet meer als afwezig gemeld.
maxHomes=You cannot set more than {0} homes.
-mayNotJail = \u00a7cJe mag die speler niet in de gevangenis zetten.
-me = me
-minute = minuut
-minutes = minuten
-missingItems = Je hebt geen {0}x {1}.
-missingPrefixSuffix = Er mist een prefix of suffix voor {0}
-mobSpawnError = Fout bij het veranderen van de mob spawner.
-mobSpawnLimit = Grootte van de mob hang af van het server limiet
-mobSpawnTarget = Target blok moet een mob spawner zijn.
-moneyRecievedFrom = \u00a7a{0} is ontvangen van {1}
-moneySentTo = \u00a7a{0} is verzonden naar {1}
-moneyTaken = {0} van je bankrekening afgehaald.
-month = maand
-months = maanden
-moreThanZero = Het aantal moet groter zijn dan 0.
-msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
-muteExempt = \u00a7cJe kan deze speler niet muten.
-mutedPlayer = Speler {0} gemute.
-mutedPlayerFor = Speler {0} is gemute voor {1}.
-mutedUserSpeaks = {0} probeerde te praten, maar is gemute.
-needTpohere = Je moet toegang krijgen tot /tpohere om naar andere spelers te teleporteren.
-negativeBalanceError = Speler is niet toegestaan om een negatief saldo te hebben.
-nickChanged = Nickname veranderd.
+mayNotJail=\u00a7cJe mag die speler niet in de gevangenis zetten.
+me=me
+minute=minuut
+minutes=minuten
+missingItems=Je hebt geen {0}x {1}.
+missingPrefixSuffix=Er mist een prefix of suffix voor {0}
+mobSpawnError=Fout bij het veranderen van de mob spawner.
+mobSpawnLimit=Grootte van de mob hang af van het server limiet
+mobSpawnTarget=Target blok moet een mob spawner zijn.
+mobsAvailable=\u00a77Mobs: {0}
+moneyRecievedFrom=\u00a7a{0} is ontvangen van {1}
+moneySentTo=\u00a7a{0} is verzonden naar {1}
+moneyTaken={0} van je bankrekening afgehaald.
+month=maand
+months=maanden
+moreThanZero=Het aantal moet groter zijn dan 0.
+msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
+muteExempt=\u00a7cJe kan deze speler niet muten.
+mutedPlayer=Speler {0} gemute.
+mutedPlayerFor=Speler {0} is gemute voor {1}.
+mutedUserSpeaks={0} probeerde te praten, maar is gemute.
+nearbyPlayers=Players nearby: {0}
+needTpohere=Je moet toegang krijgen tot /tpohere om naar andere spelers te teleporteren.
+negativeBalanceError=Speler is niet toegestaan om een negatief saldo te hebben.
+nickChanged=Nickname veranderd.
nickDisplayName=\u00a77You have to enable change-displayname in Essentials config.
-nickInUse = \u00a7cDie naam is al in gebruik.
-nickNamesAlpha = \u00a7cNicknames moeten alfanumeriek zijn.
-nickNoMore = \u00a7Je hebt geen nickname meer.
-nickOthersPermission = \u00a7cJe hebt geen toestemming om de nickname van anderen te veranderen
-nickSet = \u00a77Je nickname is nu \u00a7c{0}
-noAccessCommand = \u00a7cJe hebt geen toegang tot die opdracht.
-noAccessPermission = \u00a7cJe hebt hier geen toegang voor {0}.
-noDestroyPermission = \u00a7cJe hebt geen toegang om dat te vernietigen {0}.
-noHelpFound = \u00a7cNo matching commands.
-noHomeSet = Je hebt geen home gemaakt.
-noHomeSetPlayer = Speler heeft geen home.
-noKitPermission = \u00a7cJe hebt de \u00a7c{0}\u00a7c toestemming nodig om die kit te gebruiken.
-noKits = \u00a77Er zijn nog geen kits beschikbaar
-noMail = Je hebt geen berichten
-noMailSendPerm = \u00a7cJe hebt de \u00a7fessentials.mail.send\u00a7c toestemming niet.
-noMotd = \u00a7cEr is geen bericht van de dag.
-noNewMail = \u00a77Je hebt geen nieuwe berichten.
-noPendingRequest = Je hebt geen aanvragen.
-noPlacePermission = \u00a7cJe hebt geen toestemming om een blok naast die sign te plaatsen.
+nickInUse=\u00a7cDie naam is al in gebruik.
+nickNamesAlpha=\u00a7cNicknames moeten alfanumeriek zijn.
+nickNoMore=\u00a7Je hebt geen nickname meer.
+nickOthersPermission=\u00a7cJe hebt geen toestemming om de nickname van anderen te veranderen
+nickSet=\u00a77Je nickname is nu \u00a7c{0}
+noAccessCommand=\u00a7cJe hebt geen toegang tot die opdracht.
+noAccessPermission=\u00a7cJe hebt hier geen toegang voor {0}.
+noDestroyPermission=\u00a7cJe hebt geen toegang om dat te vernietigen {0}.
+noGodWorldWarning=\u00a7cWarning! God mode in this world disabled.
+noHelpFound=\u00a7cNo matching commands.
+noHomeSet=Je hebt geen home gemaakt.
+noHomeSetPlayer=Speler heeft geen home.
+noKitPermission=\u00a7cJe hebt de \u00a7c{0}\u00a7c toestemming nodig om die kit te gebruiken.
+noKits=\u00a77Er zijn nog geen kits beschikbaar
+noMail=Je hebt geen berichten
+noMotd=\u00a7cEr is geen bericht van de dag.
+noNewMail=\u00a77Je hebt geen nieuwe berichten.
+noPendingRequest=Je hebt geen aanvragen.
+noPerm=\u00a7cJe hebt de \u00a7f{0}\u00a7c toestemming niet.
+noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob.
+noPlacePermission=\u00a7cJe hebt geen toestemming om een blok naast die sign te plaatsen.
noPowerTools=You have no power tools assigned.
-noRules = \u00a7cEr zijn nog geen regels gegeven.
-noWarpsDefined = Geen warps gedefinieerd
-none = geen
-notAllowedToQuestion = \u00a7cJe bent niet bevoegd om de vraag functie te gebruiken.
-notAllowedToShout = \u00a7cJe bent niet bevoegd om de roep functie te gebruiken.
-notEnoughMoney = Je hebt niet voldoende middelen.
-notRecommendedBukkit = De Bukkit versie is niet de aangeraden build voor Essentials.
-notSupportedYet = Nog niet ondersteund.
-now = nu
-numberRequired = Er moet daar een nummer, grapjas.
-onlyDayNight = /time ondersteund alleen day/night.
-onlyPlayers = Alleen in-game spelers kunnen {0} gebruiken.
-onlySunStorm = /weather only supports sun/storm.
-pTimeCurrent = \u00a7e{0}''s\u00a7f time is {1}.
-pTimeCurrentFixed = \u00a7e{0}''s\u00a7f time is fixed to {1}.
-pTimeNormal = \u00a7e{0}''s\u00a7f time is normal and matches the server.
-pTimeOthersPermission = \u00a7cYou are not authorized to set other players'' time.
-pTimePlayers = These players have their own time:
-pTimeReset = Player time has been reset for: \u00a7e{0}
-pTimeSet = Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1}
-pTimeSetFixed = Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1}
-parseError = Fout bij ontleding {0} op regel {1}
-pendingTeleportCancelled = \u00a7cAangevraagde teleportatie afgelast.
-permissionsError = Permissions/GroupManager ontbreekt; chat prefixes/suffixes worden uitgeschakeld.
-playerBanned = \u00a7cPlayer {0} banned {1} for {2}
-playerInJail = \u00a7cSpeler zit al in de gevangenis {0}.
-playerJailed = \u00a77Speler {0} is in de gevangenis gezet.
-playerJailedFor = \u00a77Speler {0} is in de gevangenis gezet voor {1}.
-playerKicked = \u00a7cPlayer {0} kicked {1} for {2}
-playerMuted = \u00a77Je kreeg het zwijgen opgelegd.
-playerMutedFor = \u00a77Je kreeg het zwijgen opgelegd voor {0}
-playerNeverOnServer = \u00a7cSpeler {0} is nooit op deze server geweest.
-playerNotFound = \u00a7cSpeler niet gevonden.
-playerUnmuted = \u00a77Speler mag weer praten
-pong = Pong!
-possibleWorlds = \u00a77Mogelijk zijn de werelden de nummer 0 tot en met {0}.
-powerToolAir = Command kan niet worden bevestigd aan lucht.
-powerToolAlreadySet = Command \u00a7c{0}\u00a7f is already assigned to {1}.
-powerToolAttach = \u00a7c{0}\u00a7f command assigned to {1}.
-powerToolClearAll = All powertool commands have been cleared.
-powerToolList = {1} has the following commands: \u00a7c{0}\u00a7f.
-powerToolListEmpty = {0} has no commands assigned.
-powerToolNoSuchCommandAssigned = Command \u00a7c{0}\u00a7f has not been assigned to {1}.
-powerToolRemove = Command \u00a7c{0}\u00a7f removed from {1}.
-powerToolRemoveAll = All commands removed from {0}.
-powerToolsEnabled=All of your power tools have been enabled.
+noRules=\u00a7cEr zijn nog geen regels gegeven.
+noWarpsDefined=Geen warps gedefinieerd
+none=geen
+notAllowedToQuestion=\u00a7cJe bent niet bevoegd om de vraag functie te gebruiken.
+notAllowedToShout=\u00a7cJe bent niet bevoegd om de roep functie te gebruiken.
+notEnoughExperience=You do not have enough experience.
+notEnoughMoney=Je hebt niet voldoende middelen.
+notRecommendedBukkit=* ! * De Bukkit versie is niet de aangeraden build voor Essentials.
+notSupportedYet=Nog niet ondersteund.
+nothingInHand = \u00a7cYou have nothing in your hand.
+now=nu
+numberRequired=Er moet daar een nummer, grapjas.
+onlyDayNight=/time ondersteund alleen day/night.
+onlyPlayers=Alleen in-game spelers kunnen {0} gebruiken.
+onlySunStorm=/weather only supports sun/storm.
+orderBalances=Ordering balances of {0} users, please wait ...
+pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}.
+pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}.
+pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server.
+pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time.
+pTimePlayers=These players have their own time:
+pTimeReset=Player time has been reset for: \u00a7e{0}
+pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1}
+pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1}
+parseError=Fout bij ontleding {0} op regel {1}
+pendingTeleportCancelled=\u00a7cAangevraagde teleportatie afgelast.
+permissionsError=Permissions/GroupManager ontbreekt; chat prefixes/suffixes worden uitgeschakeld.
+playerBanned=\u00a7cPlayer {0} banned {1} for {2}
+playerInJail=\u00a7cSpeler zit al in de gevangenis {0}.
+playerJailed=\u00a77Speler {0} is in de gevangenis gezet.
+playerJailedFor= \u00a77Speler {0} is in de gevangenis gezet voor {1}.
+playerKicked=\u00a7cPlayer {0} kicked {1} for {2}
+playerMuted=\u00a77Je kreeg het zwijgen opgelegd.
+playerMutedFor=\u00a77Je kreeg het zwijgen opgelegd voor {0}
+playerNeverOnServer=\u00a7cSpeler {0} is nooit op deze server geweest.
+playerNotFound=\u00a7cSpeler niet gevonden.
+playerUnmuted=\u00a77Speler mag weer praten
+pong=Pong!
+possibleWorlds=\u00a77Mogelijk zijn de werelden de nummer 0 tot en met {0}.
+powerToolAir=Command kan niet worden bevestigd aan lucht.
+powerToolAlreadySet=Command \u00a7c{0}\u00a7f is already assigned to {1}.
+powerToolAttach=\u00a7c{0}\u00a7f command assigned to {1}.
+powerToolClearAll=All powertool commands have been cleared.
+powerToolList={1} has the following commands: \u00a7c{0}\u00a7f.
+powerToolListEmpty={0} has no commands assigned.
+powerToolNoSuchCommandAssigned=Command \u00a7c{0}\u00a7f has not been assigned to {1}.
+powerToolRemove=Command \u00a7c{0}\u00a7f removed from {1}.
+powerToolRemoveAll=All commands removed from {0}.
powerToolsDisabled=All of your power tools have been disabled.
-protectionOwner = \u00a76[EssentialsProtect] Beschermingeigenaar: {0}
-questionFormat = \u00a77[Vraag]\u00a7f {0}
-reloadAllPlugins = \u00a77Alle plugins zijn herladen.
-repair = You have successfully repaired your: \u00a7e{0}.
-repairAlreadyFixed = \u00a77This item does not need repairing.
-repairInvalidType = \u00a7cThis item cannot be repaired.
-repairNone = There were no items that needing repairing.
-requestAccepted = \u00a77Teleporteer aanvraag geaccepteerd.
-requestAcceptedFrom = \u00a77{0} accepted your teleport request.
-requestDenied = \u00a77Teleporteer aanvraag geweigerd.
-requestDeniedFrom = \u00a77{0} denied your teleport request.
-requestSent = \u00a77Aanvraag verstuurd naar {0}\u00a77.
-returnPlayerToJailError = Fout opgetreden bij terugzetten van speler in gevangenis.
-second = seconde
-seconds = seconde
-seenOffline = Speler {0} is offline vanaf {1}
-seenOnline = Speler {0} is online vanaf {1}
-serverFull = Server is vol
-setSpawner = Changed spawner type to {0}
-sheepMalformedColor = Misvoormde kleur.
-shoutFormat = \u00a77[Shout]\u00a7f {0}
-signFormatFail = \u00a74[{0}]
-signFormatSuccess = \u00a71[{0}]
-signFormatTemplate = [{0}]
-signProtectInvalidLocation = \u00a74You are not allowed to create sign here.
-similarWarpExist = Er bestaat al een warp met dezelfde naam.
-slimeMalformedSize = Misvoormde grootte.
-soloMob = Die mob is liever in zijn eentje
-spawnSet = \u00a77Spawn locatie voor de groep {0} ingesteld.
-spawned = gespawned
-suicideMessage = \u00a77Vaarwel vreedzame wereld...
-suicideSuccess = \u00a77{0} pleegde zelfmoord
-takenFromAccount = \u00a7c{0} is van je bank rekening afgehaald.
-takenFromOthersAccount = \u00a7c{0} is overgenomen uit {1} account.
-teleportAAll = \u00a77Teleporting request sent to all players...
-teleportAll = \u00a77Bezig met teleporteren van alle spelers...
-teleportAtoB = \u00a77{0}\u00a77 is naar {1}\u00a77 geteleporteerd.
-teleportDisabled = {0} heeft teleporteren uit gezet.
-teleportHereRequest = \u00a7c{0}\u00a7c Heeft gevraagd of hij/zij naar jou mag teleporteren.
-teleportNewPlayerError = Fout bij het teleporteren van nieuwe speler.
-teleportRequest = \u00a7c{0}\u00a7c vraagt of hij jou kan teleporteren.
-teleportTop = \u00a77Bezig met teleporteren naar de top.
-teleportationCommencing = \u00a77Aan het beginnen met teleporteren...
-teleportationDisabled = \u00a77Teleportatie uitgeschakeld.
-teleportationEnabled = \u00a77Teleportatie ingeschakeld.
-teleporting = \u00a77Bezig met teleporteren...
-teleportingPortal = \u00a77Bezig met teleporteren via de portal.
-tempBanned = Tijdelijk geband voor {0}
-tempbanExempt = \u00a77Je mag deze speler niet een tempban geven
-thunder = Je {0} onweert de wereld
-thunderDuration = Je {0} onweert de wereld voor {1} seconde.
-timeBeforeHeal = Afkoeltijd tot de volgende heal: {0}
-timeBeforeTeleport = Afkoeltijd tot de volgende teleport: {0}
-timeFormat = \u00a73{0}\u00a7f or \u00a73{1}\u00a7f or \u00a73{2}\u00a7f
-timePattern = (?:([0-9]+)\\s*[yj][a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[oa][a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[hu][a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
-timeSet = Tijd ingesteld in alle werelden.
-timeSetPermission = \u00a7cYou are not authorized to set the time.
-timeWorldCurrent = The current time in {0} is \u00a73{1}
-timeWorldSet = The time was set to {0} in: \u00a7c{1}
-tradeCompleted = \u00a77Ruil verricht.
-tradeSignEmpty = Het handelsbordje heeft een te kleine voorraad.
-tradeSignEmptyOwner = There is nothing to collect from this trade sign.
-treeFailure = \u00a7cFout bij het genereren van boom. Pobeer het opnieuw op gras of dirt.
-treeSpawned = \u00a77Boom gespawned.
-typeTpaccept = \u00a77Om te teleporten, type \u00a7c/tpaccept\u00a77.
-typeTpdeny = \u00a77Om te weigeren, type \u00a7c/tpdeny\u00a77.
-typeWorldName = \u00a77Je kan ook de exacte naam van de wereld typen.
-unableToSpawnMob = De mob kan niet gespawned worden.
-unbannedIP = IP adres ontbannen.
-unbannedPlayer = Speler ontbannen.
-unignorePlayer = Je negeert {0} niet meer.
-unknownItemId = Onbekend voorwerp id: {0}
-unknownItemInList = Onbekend voorwerp {0} in {1} lijst.
-unknownItemName = Onbekende voorwerp naam: {0}
-unlimitedItemPermission = \u00a7cOnbevoegd om oneindig {0} te hebben.
-unlimitedItems = Oneindige voorwerpen:
-unmutedPlayer = Speler {0} mag weer spreken.
-upgradingFilesError = Fout tijdens het upgraden van de bestanden
-userDoesNotExist = Speler {0} bestaat niet.
-userIsAway = {0} is nu AFK
-userIsNotAway = {0} is niet meer AFK
-userJailed = \u00a77Je bent in de gevangenis gezet.
-userUsedPortal = {0} gebruikte een bestaande uitgangs portal.
-userdataMoveBackError = Fout bij het verplaasten van userdata/{0}.tmp naar userdata/{1}
-userdataMoveError = Fout bij het verplaasten van userdata/{0} naar userdata/{1}.tmp
-usingTempFolderForTesting = Tijdelijke map om te testen:
-versionMismatch = Verkeerde versie! Update {0} naar dezelfde versie.
-versionMismatchAll = Verkeerde versie! Update alle Essentials jars naar dezelfde versie.
-voiceSilenced = \u00a77Je kan niet meer praten
-warpDeleteError = Fout bij het verwijderen van het warp bestand.
-warpListPermission = \u00a7cJe hebt geen toegang om die warp te maken.
-warpNotExist = Die warp bestaat niet.
-warpSet = \u00a77Warp {0} ingesteld.
-warpUsePermission = \u00a7cOnbevoegd om die warp te gebruiken.
-warpingTo = \u00a77Aan het warpen naar {0}.
-warpsCount = \u00a77There are {0} warps. Showing page {1} of {2}.
-weatherStorm = \u00a77Je hebt het weer naar storm gezet in de {0}
-weatherStormFor = \u00a77Je hebt het weer in de {0} naar storm gezet voor {1} seconde
-weatherSun = \u00a77Je hebt het weer naar zon gezet in de {0}
-weatherSunFor = \u00a77Je hebt het weer in de {0} naar zon gezet voor {1} seconde
-whoisGeoLocation = \u00a79 - Locatie: {0}
-whoisHealth = \u00a79 - Levens: {0}/20
-whoisIPAddress = \u00a79 - IP Adres: {0}
-whoisIs = {0} is {1}
-whoisLocation = \u00a79 - Locatie: ({0}, {1}, {2}, {3})
-whoisMoney = \u00a79 - Geld: {0}
-whoisStatusAvailable = \u00a79 - Status: Beschikbaar
-whoisStatusAway = \u00a79 - Status: \u00a7cWeg\u00a7f
-worth = \u00a77Stapel {0} met waarde \u00a7c{1}\u00a77 ({2} voorwerp(en) voor {3} per stuk)
-worthMeta = \u00a77Stapel {0} met een metadata van {1} met waarde \u00a7c{2}\u00a77 ({3} voorwerp(en) voor {4} per stuk)
-worthSet = Waarde ingesteld
-year = jaar
-years = jaren
-youAreHealed = \u00a77Je bent genezen.
-youHaveNewMail = \u00a7cJe hebt {0} berichten!\u00a7f Type \u00a77/mail read\u00a7f om je berichten te bekijken.
-
-
+powerToolsEnabled=All of your power tools have been enabled.
+protectionOwner=\u00a76[EssentialsProtect] Beschermingeigenaar: {0}
+questionFormat=\u00a77[Vraag]\u00a7f {0}
+readNextPage=Type /{0} {1} to read the next page
+reloadAllPlugins=\u00a77Alle plugins zijn herladen.
+removed=\u00a77Removed {0} entities.
+repair=You have successfully repaired your: \u00a7e{0}.
+repairAlreadyFixed=\u00a77This item does not need repairing.
+repairEnchanted=\u00a77You are not allowed to repair enchanted items.
+repairInvalidType=\u00a7cThis item cannot be repaired.
+repairNone=There were no items that needing repairing.
+requestAccepted=\u00a77Teleporteer aanvraag geaccepteerd.
+requestAcceptedFrom=\u00a77{0} accepted your teleport request.
+requestDenied=\u00a77Teleporteer aanvraag geweigerd.
+requestDeniedFrom=\u00a77{0} denied your teleport request.
+requestSent=\u00a77Aanvraag verstuurd naar {0}\u00a77.
+requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org.
+returnPlayerToJailError=Fout opgetreden bij terugzetten van speler in gevangenis.
+second=seconde
+seconds=seconde
+seenOffline=Speler {0} is offline vanaf {1}
+seenOnline=Speler {0} is online vanaf {1}
+serverFull=Server is vol
+setSpawner=Changed spawner type to {0}
+sheepMalformedColor=Misvoormde kleur.
+shoutFormat=\u00a77[Shout]\u00a7f {0}
+signFormatFail=\u00a74[{0}]
+signFormatSuccess=\u00a71[{0}]
+signFormatTemplate=[{0}]
+signProtectInvalidLocation=\u00a74You are not allowed to create sign here.
+similarWarpExist=Er bestaat al een warp met dezelfde naam.
+slimeMalformedSize=Misvoormde grootte.
+soloMob=Die mob is liever in zijn eentje
+spawnSet=\u00a77Spawn locatie voor de groep {0} ingesteld.
+spawned=gespawned
+suicideMessage=\u00a77Vaarwel vreedzame wereld...
+suicideSuccess= \u00a77{0} pleegde zelfmoord
+survival=survival
+takenFromAccount=\u00a7c{0} is van je bank rekening afgehaald.
+takenFromOthersAccount=\u00a7c{0} is overgenomen uit {1} account.
+teleportAAll=\u00a77Teleporting request sent to all players...
+teleportAll=\u00a77Bezig met teleporteren van alle spelers...
+teleportAtoB=\u00a77{0}\u00a77 is naar {1}\u00a77 geteleporteerd.
+teleportDisabled={0} heeft teleporteren uit gezet.
+teleportHereRequest=\u00a7c{0}\u00a7c Heeft gevraagd of hij/zij naar jou mag teleporteren.
+teleportNewPlayerError=Fout bij het teleporteren van nieuwe speler.
+teleportRequest=\u00a7c{0}\u00a7c vraagt of hij jou kan teleporteren.
+teleportTop=\u00a77Bezig met teleporteren naar de top.
+teleportationCommencing=\u00a77Aan het beginnen met teleporteren...
+teleportationDisabled=\u00a77Teleportatie uitgeschakeld.
+teleportationEnabled=\u00a77Teleportatie ingeschakeld.
+teleporting=\u00a77Bezig met teleporteren...
+teleportingPortal=\u00a77Bezig met teleporteren via de portal.
+tempBanned=Tijdelijk geband voor {0}
+tempbanExempt=\u00a77Je mag deze speler niet een tempban geven
+thunder= Je {0} onweert de wereld
+thunderDuration=Je {0} onweert de wereld voor {1} seconde.
+timeBeforeHeal=Afkoeltijd tot de volgende heal: {0}
+timeBeforeTeleport=Afkoeltijd tot de volgende teleport: {0}
+timeFormat=\u00a73{0}\u00a7f or \u00a73{1}\u00a7f or \u00a73{2}\u00a7f
+timePattern=(?:([0-9]+)\\s*[yj][a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[oa][a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[hu][a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
+timeSet=Tijd ingesteld in alle werelden.
+timeSetPermission=\u00a7cYou are not authorized to set the time.
+timeWorldCurrent=The current time in {0} is \u00a73{1}
+timeWorldSet=The time was set to {0} in: \u00a7c{1}
+tradeCompleted=\u00a77Ruil verricht.
+tradeSignEmpty=Het handelsbordje heeft een te kleine voorraad.
+tradeSignEmptyOwner=There is nothing to collect from this trade sign.
+treeFailure=\u00a7cFout bij het genereren van boom. Pobeer het opnieuw op gras of dirt.
+treeSpawned=\u00a77Boom gespawned.
+true=true
+typeTpaccept=\u00a77Om te teleporten, type \u00a7c/tpaccept\u00a77.
+typeTpdeny=\u00a77Om te weigeren, type \u00a7c/tpdeny\u00a77.
+typeWorldName=\u00a77Je kan ook de exacte naam van de wereld typen.
+unableToSpawnMob=De mob kan niet gespawned worden.
+unbannedIP=IP adres ontbannen.
+unbannedPlayer=Speler ontbannen.
+unignorePlayer=Je negeert {0} niet meer.
+unknownItemId=Onbekend voorwerp id: {0}
+unknownItemInList=Onbekend voorwerp {0} in {1} lijst.
+unknownItemName=Onbekende voorwerp naam: {0}
+unlimitedItemPermission=\u00a7cOnbevoegd om oneindig {0} te hebben.
+unlimitedItems=Oneindige voorwerpen:
+unmutedPlayer=Speler {0} mag weer spreken.
+upgradingFilesError=Fout tijdens het upgraden van de bestanden
+userDoesNotExist=Speler {0} bestaat niet.
+userIsAway={0} is nu AFK
+userIsNotAway={0} is niet meer AFK
+userJailed=\u00a77Je bent in de gevangenis gezet.
+userUsedPortal={0} gebruikte een bestaande uitgangs portal.
+userdataMoveBackError=Fout bij het verplaasten van userdata/{0}.tmp naar userdata/{1}
+userdataMoveError=Fout bij het verplaasten van userdata/{0} naar userdata/{1}.tmp
+usingTempFolderForTesting=Tijdelijke map om te testen:
+versionMismatch=Verkeerde versie! Update {0} naar dezelfde versie.
+versionMismatchAll=Verkeerde versie! Update alle Essentials jars naar dezelfde versie.
+voiceSilenced=\u00a77Je kan niet meer praten
+warpDeleteError=Fout bij het verwijderen van het warp bestand.
+warpListPermission=\u00a7cJe hebt geen toegang om die warp te maken.
+warpNotExist=Die warp bestaat niet.
+warpSet=\u00a77Warp {0} ingesteld.
+warpUsePermission=\u00a7cOnbevoegd om die warp te gebruiken.
+warpingTo=\u00a77Aan het warpen naar {0}.
+warps=Warps: {0}
+warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}.
+weatherStorm=\u00a77Je hebt het weer naar storm gezet in de {0}
+weatherStormFor=\u00a77Je hebt het weer in de {0} naar storm gezet voor {1} seconde
+weatherSun=\u00a77Je hebt het weer naar zon gezet in de {0}
+weatherSunFor=\u00a77Je hebt het weer in de {0} naar zon gezet voor {1} seconde
+whoisBanned=\u00a79 - Banned: {0}
+whoisGamemode=\u00a79 - Gamemode: {0}
+whoisGeoLocation=\u00a79 - Locatie: {0}
+whoisGod=\u00a79 - God mode: {0}
+whoisHealth=\u00a79 - Levens: {0}/20
+whoisIPAddress=\u00a79 - IP Adres: {0}
+whoisIs={0} is {1}
+whoisLocation=\u00a79 - Locatie: ({0}, {1}, {2}, {3})
+whoisMoney=\u00a79 - Geld: {0}
+whoisOP=\u00a79 - OP: {0}
+whoisStatusAvailable=\u00a79 - Status: Beschikbaar
+whoisStatusAway=\u00a79 - Status: \u00a7cWeg\u00a7f
+worth=\u00a77Stapel {0} met waarde \u00a7c{1}\u00a77 ({2} voorwerp(en) voor {3} per stuk)
+worthMeta=\u00a77Stapel {0} met een metadata van {1} met waarde \u00a7c{2}\u00a77 ({3} voorwerp(en) voor {4} per stuk)
+worthSet=Waarde ingesteld
+year=jaar
+years=jaren
+youAreHealed=\u00a77Je bent genezen.
+youHaveNewMail=\u00a7cJe hebt {0} berichten!\u00a7f Type \u00a77/mail read\u00a7f om je berichten te bekijken.
+requestTimedOut=\u00a7cTeleport request has timed out
+teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds.
diff --git a/Essentials/src/motd.txt b/Essentials/src/motd.txt
new file mode 100644
index 000000000..224e452ef
--- /dev/null
+++ b/Essentials/src/motd.txt
@@ -0,0 +1,3 @@
+&cWelcome, {PLAYER}&c!
+&fType &c/help&f for a list of commands.
+Currently online: {PLAYERLIST} \ No newline at end of file
diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml
index 1240910ce..2cb225390 100644
--- a/Essentials/src/plugin.yml
+++ b/Essentials/src/plugin.yml
@@ -18,38 +18,42 @@ commands:
back:
description: Teleports you to your location prior to tp/spawn/warp.
usage: /<command>
- aliases: [eback]
+ aliases: [eback,return,ereturn]
backup:
description: Runs the backup if configured.
usage: /<command>
aliases: [ebackup]
balance:
description: States the current balance of a player.
- usage: /<command> <player>
+ usage: /<command> [player]
aliases: [bal,emoney,ebalance,ebal]
balancetop:
- description: Gets the top x balance values. (max 10)
- usage: /<command> <max>
+ description: Gets the top balance values.
+ usage: /<command> <page>
aliases: [baltop,ebaltop,ebalancetop]
ban:
description: Bans a player.
- usage: /<command> [player] <reason>
+ usage: /<command> <player> [reason]
aliases: [eban]
banip:
description: Bans an IP address.
- usage: /<command> [address]
+ usage: /<command> <address>
aliases: [ebanip]
+ break:
+ description: Breaks the block you are looking at.
+ usage: /<command>
+ aliases: [ebreak]
broadcast:
description: Broadcasts a message to the entire server.
- usage: /<command> [msg]
+ usage: /<command> <msg>
aliases: [ebroadcast,bcast,ebcast]
bigtree:
description: Spawn a big tree where you are looking.
- usage: /<command> [tree|redwood]
+ usage: /<command> <tree|redwood>
aliases: [ebigtree]
burn:
description: Set a player on fire.
- usage: /<command> [player] [seconds]
+ usage: /<command> <player> <seconds>
aliases: [eburn]
clearinventory:
description: Clear all items in your inventory.
@@ -65,11 +69,11 @@ commands:
aliases: [edelhome,remhome,rmhome,eremhome,ermhome]
deljail:
description: Removes a jail
- usage: /<command> [jailname]
+ usage: /<command> <jailname>
aliases: [edeljail]
delwarp:
description: Deletes the specified warp.
- usage: /<command> [warp]
+ usage: /<command> <warp>
aliases: [edelwarp,remwarp,rmwarp,eremwarp,ermwarp]
depth:
description: States current depth, relative to sea level.
@@ -77,38 +81,54 @@ commands:
aliases: [edepth]
eco:
description: Manages the server economy.
- usage: /<command> [give|take|reset] [player] [amount]
- aliases: [economy,emoney]
+ usage: /<command> <give|take|reset> <player> <amount>
+ aliases: [economy,eeco,eeconomy]
+ enchant:
+ description: Enchants the item the user is holding.
+ usage: /<command> <enchantmentname> [level]
+ aliases: [enchantment,eenchant,eenchantment]
essentials:
description: Reloads essentials.
usage: /<command>
ext:
description: Extinguish players.
- usage: /<command> <player>
+ usage: /<command> [player]
aliases: [extinguish,eext,eextinguish]
+ feed:
+ description: Satisfy the hunger.
+ usage: /<command> [player]
+ aliases: [efeed]
+ itemdb:
+ description: Searches for an item.
+ usage: /<command> <item>
+ aliases: [eitemdb]
fireball:
description: Throw a fireball.
- usage: /<command>
+ usage: /<command> [small]
aliases: [efireball]
+ gamemode:
+ description: Change player gamemode.
+ usage: /<command> [player]
+ aliases: [gm,creative,creativemode,egamemode,ecreative,ecreativemode,egm]
getpos:
- description: Get your current coordinates.
- usage: /<command>
- aliases: [coords,egetpos]
+ description: Get your current coordinates or those of a player.
+ usage: /<command> [player]
+ aliases: [coords,egetpos,whereami,ewhereami]
gc:
description: Reports garbage collection info; useful to developers.
usage: /<command>
aliases: [mem,memory,egc,emem,ememory]
give:
description: Give a player an item.
- usage: /<command> [player] [item|numeric] <amount>
+ usage: /<command> <player> <item|numeric> [amount <enchantmentname[:level]> ...]
aliases: [egive]
god:
description: Enables your godly powers.
- usage: /<command>
- aliases: [tgm,godmode,egod,egodmode,etgm]
+ usage: /<command> [player]
+ aliases: [tgm,godmode,egod,etgm,egodmode]
heal:
description: Heals you or the given player.
- usage: /<command> <player>
+ usage: /<command> [player]
aliases: [eheal]
help:
description: Views a list of available commands.
@@ -116,7 +136,7 @@ commands:
aliases: [ehelp]
helpop:
description: Request help from online operators.
- usage: /<command> [message]
+ usage: /<command> <message>
aliases: [ehelpop]
home:
description: Teleport to your home.
@@ -136,7 +156,7 @@ commands:
aliases: [einvsee]
item:
description: Spawn an item.
- usage: /<command> [item|numeric] <amount>
+ usage: /<command> <item|numeric> [amount <enchantmentname[:level]> ...]
aliases: [i,eitem]
jails:
description: List all jails.
@@ -148,36 +168,44 @@ commands:
aliases: [j,ejump]
kick:
description: Kicks a specified player with a reason.
- usage: /<command> <player> <reason>
+ usage: /<command> <player> [reason]
aliases: [ekick]
kickall:
description: Kicks all players off the server except the issuer.
- usage: /<command> <reason>
+ usage: /<command> [reason]
aliases: [ekickall]
kit:
description: Obtains the specified kit or views all available kits.
- usage: /<command> <kit>
+ usage: /<command> [kit]
aliases: [ekit,kits]
kill:
description: Kills specified player.
usage: /<command> <player>
aliases: [ekill]
+ killall:
+ description: Kill all mobs in a world.
+ usage: /<command> [mobType] [radius]
+ aliases: [ekillall,butcher,ebutcher]
list:
description: List all online players.
usage: /<command>
aliases: [playerlist,who,online,elist,ewho,eplayerlist,eonline]
lightning:
description: The power of Thor. Strike at cursor or player.
- usage: /<command> [player]
- aliases: [strike,smite,elightning,estrike,esmite]
+ usage: /<command> [player] [power]
+ aliases: [strike,smite,thor,shock,elightning,estrike,esmite,ethor,eshock]
mail:
description: Manages inter-player, intra-server mail.
usage: /<command> [read|clear|send [to] [message]]
aliases: [email]
me:
description: Describes an action in the context of the player.
- usage: /<command> [description]
- aliases: [eme]
+ usage: /<command> <description>
+ aliases: [action,describe,eme,eaction,edescribe]
+ more:
+ description: Fills the item stack in hand to maximum size.
+ usage: /<command>
+ aliases: [emore]
motd:
description: Views the Message Of The Day.
usage: /<command>
@@ -188,19 +216,23 @@ commands:
aliases: [m,t,emsg,tell,etell,whisper,ewhisper]
mute:
description: Mutes or unmutes a player.
- usage: /<command> [player] <datediff>
+ usage: /<command> <player> [datediff]
aliases: [emute]
+ near:
+ description: Lists the players near by or around a player
+ usage: /<command> [playername] [radius]
+ aliases: [nearby,enear,enearby]
nick:
description: Change your nickname or that of another player.
- usage: /<command> <player> [nickname|off]
+ usage: /<command> [player] <nickname|off>
aliases: [enick]
nuke:
description: May death rain upon them.
- usage: /<command> <player>
+ usage: /<command> [player]
aliases: [enuke]
pay:
description: Pays another player from your balance
- usage: /<command> [player] [amount]
+ usage: /<command> <player> <amount>
aliases: [epay]
ping:
description: Pong!
@@ -208,31 +240,31 @@ commands:
aliases: [pong,eping,epong]
powertool:
description: Assigns a command to the item in hand, {player} will be replaced by the name of the player that you click.
- usage: /<command> [l:|a:|r:][command] <arguments>
+ usage: /<command> [l:|a:|r:|c:|d:][command] [arguments]
aliases: [pt,epowertool,ept]
powertooltoggle:
description: Enables or disables all current powertools
- usage: /<command>
+ usage: /<command>
aliases: [ptt,epowertooltoggle,eptt]
ptime:
description: Adjust player's client time. Add @ prefix to fix.
- usage: /<command> [list|reset|day|night|dawn|17:30|4pm|4000ticks] <player|*>
+ usage: /<command> [list|reset|day|night|dawn|17:30|4pm|4000ticks] [player|*]
aliases: [playertime, eptime, eplayertime]
r:
description: Quickly reply to the last player to message you.
- usage: /<command> [message]
+ usage: /<command> <message>
aliases: [er,reply,ereply]
realname:
description: Displays the username of a user based on nickname.
- usage: /<command> [nickname]
+ usage: /<command> <nickname>
aliases: [erealname]
- reloadall:
- description: Reloads all plugins.
- usage: /<command>
- aliases: [rel,ereloadall,ereload,erel]
+ remove:
+ description: Removes entities in your world
+ usage: /<command> <drops|arrows|boats|minecarts|xp|paintings> [radius]
+ aliases: [eremove]
repair:
description: Repairs the durability of all or one item.
- usage: /<command> [hand|all]
+ usage: /<command> <hand|all>
aliases: [fix,erepair,efix]
rules:
description: Views the server rules.
@@ -240,11 +272,11 @@ commands:
aliases: [erules]
seen:
description: Shows the last logout time of a player
- usage: /<command> [playername]
+ usage: /<command> <playername>
aliases: [eseen]
sell:
description: Sells the item currently in your hand.
- usage: /<command> [itemname|id|hand|inventory|blocks] [-][amount]
+ usage: /<command> <itemname|id|hand|inventory|blocks> [-][amount]
aliases: [esell]
sethome:
description: Set your home to your current location.
@@ -252,15 +284,15 @@ commands:
aliases: [esethome]
setjail:
description: Creates a jail where you specified named [jailname]
- usage: /<command> [jailname]
+ usage: /<command> <jailname>
aliases: [esetjail]
setwarp:
description: Creates a new warp.
- usage: /<command> [warp]
+ usage: /<command> <warp>
aliases: [createwarp,esetwarp]
setworth:
description: Set the sell value of an item.
- usage: /<command> [itemname|id] [price]
+ usage: /<command> <itemname|id> <price>
aliases: [esetworth]
socialspy:
description: Toggles if you can see msg/mail commands in chat.
@@ -268,95 +300,107 @@ commands:
aliases: [esocialspy]
spawner:
description: Change the mob type of a spawner
- usage: /<command> [mob]
+ usage: /<command> <mob>
aliases: [espawner]
spawnmob:
description: Spawns a mob.
- usage: /<command> [mob]<:data><,mount<:data>> <amount>
+ usage: /<command> <mob>[:data][,<mount>[:data]] [amount] [player]
aliases: [espawnmob]
+ sudo:
+ description: Make another user perform a command.
+ usage: /<command> <player> <command [args]>
+ aliases: [esudo]
suicide:
description: Causes you to perish.
usage: /<command>
aliases: [esuicide]
tempban:
description: Temporary ban a user.
- usage: /<command> [playername] [datediff]
+ usage: /<command> <playername> <datediff>
aliases: [etempban]
thunder:
description: Enable/disable thunder.
usage: /<command> <true/false> [duration]
aliases: [ethunder]
time:
- description: Change the world time. Defaults to current world.
+ description: Display/Change the world time. Defaults to current world.
usage: /<command> [day|night|dawn|17:30|4pm|4000ticks] [worldname|all]
aliases: [etime, day, night]
togglejail:
- description: Prevents a player from interacting with the world and teleports him/her to the the jail specified
- usage: /<command> [player] [jailname] <datediff>
- aliases: [tjail,unjail,eunjail,etogglejail]
+ description: Prevents a player from interacting with the world and teleports him/her to the jail specified
+ usage: /<command> <player> <jailname> [datediff]
+ aliases: [tjail,jail,ejail,unjail,eunjail,etogglejail]
top:
description: Teleport to the highest block at your current position.
usage: /<command>
aliases: [etop]
tp:
description: Teleport to a player.
- usage: /<command> [player]
- aliases: [etp]
+ usage: /<command> <player> [otherplayer]
+ aliases: [tele,etele,etp,tp2p,etp2p]
tpa:
description: Request to teleport to the specified player.
usage: /<command> <player>
+ aliases: [call,etpa,ecall]
tpaall:
description: Requests all players online to teleport to you.
usage: /<command> <player>
+ aliases: [etpaall]
tpaccept:
description: Accepts a teleport request.
usage: /<command>
- aliases: [tpyes]
+ aliases: [tpyes,etpaccept,etpyes]
tpahere:
description: Request that the specified player teleport to you.
usage: /<command> <player>
+ aliases: [etpahere]
tpall:
description: Teleport all online players to another player.
usage: /<command> <player>
+ aliases: [etpall]
tpdeny:
description: Reject a teleport request.
usage: /<command>
- aliases: [tpno]
+ aliases: [tpno,etpdeny,etpno]
tphere:
description: Teleport a player to you.
- usage: /<command> [player]
- aliases: [s]
+ usage: /<command> <player>
+ aliases: [s,etphere]
tpo:
description: Teleport override for tptoggle.
usage: /<command> <player>
+ aliases: [etpo]
tpohere:
description: Teleport here override for tptoggle.
usage: /<command> <player>
+ aliases: [etpohere]
tppos:
description: Teleport to coordinates.
usage: /<command> <x> <y> <z> [yaw] [pitch]
+ aliases: [etppos]
tptoggle:
description: Blocks all forms of teleportation.
usage: /<command>
+ aliases: [etptoggle]
tree:
description: Spawn a tree where you are looking.
- usage: /<command> [tree|birch|redwood]
+ usage: /<command> <tree|birch|redwood>
aliases: [etree]
unban:
description: Unbans the specified player.
- usage: /<command> [player]
+ usage: /<command> <player>
aliases: [pardon,eunban]
unbanip:
description: Unbans the specified IP address.
- usage: /<command> [address]
+ usage: /<command> <address>
aliases: [eunbanip,pardonip]
unlimited:
description: Allows the unlimited placing of items.
- usage: /<command> [list|item] <player>
+ usage: /<command> <list|item|clear> [player]
aliases: [eunlimited,ul,unl,eul,eunl]
warp:
description: List all warps or warp to the specified location.
- usage: /<command> [pagenumber|warp] <player>
+ usage: /<command> <pagenumber|warp> [player]
aliases: [ewarp,warps]
weather:
description: Setting the weather.
@@ -364,7 +408,7 @@ commands:
aliases: [sky,sun,storm,eweather,esky,esun,estorm]
whois:
description: Determine the username behind a nickname.
- usage: /<command> [nickname]
+ usage: /<command> <nickname>
aliases: [ewhois]
world:
description: Switch between worlds.
@@ -372,5 +416,5 @@ commands:
aliases: [eworld]
worth:
description: Calculates the worth of items in hand or as specified.
- usage: /<command> <item> <amount>
- aliases: [eworth] \ No newline at end of file
+ usage: /<command> [item] [amount]
+ aliases: [eworth]
diff --git a/Essentials/src/rules.txt b/Essentials/src/rules.txt
new file mode 100644
index 000000000..486bfdf29
--- /dev/null
+++ b/Essentials/src/rules.txt
@@ -0,0 +1,3 @@
+[1] Be respectful
+[2] Be ethical
+[3] Use common sense \ No newline at end of file
diff --git a/Essentials/test/com/earth2me/essentials/FakeServer.java b/Essentials/test/com/earth2me/essentials/FakeServer.java
index 7f3fb9bf2..306f0d6a1 100644
--- a/Essentials/test/com/earth2me/essentials/FakeServer.java
+++ b/Essentials/test/com/earth2me/essentials/FakeServer.java
@@ -1,21 +1,14 @@
package com.earth2me.essentials;
+import com.earth2me.essentials.craftbukkit.FakeWorld;
import com.avaje.ebean.config.ServerConfig;
import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
+import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.logging.Logger;
-import org.bukkit.GameMode;
-import org.bukkit.Location;
-import org.bukkit.Server;
-import org.bukkit.World;
import org.bukkit.World.Environment;
-import org.bukkit.WorldCreator;
+import org.bukkit.*;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.command.PluginCommand;
@@ -36,9 +29,17 @@ public class FakeServer implements Server
private List<Player> players = new ArrayList<Player>();
private final List<World> worlds = new ArrayList<World>();
+ public FakeServer()
+ {
+ if (Bukkit.getServer() == null)
+ {
+ Bukkit.setServer(this);
+ }
+ }
+
public String getName()
{
- return "Test Server";
+ return "Essentials Fake Server";
}
public String getVersion()
@@ -469,8 +470,8 @@ public class FakeServer implements Server
@Override
public org.bukkit.OfflinePlayer getOfflinePlayer(final String string)
{
- return new org.bukkit.OfflinePlayer() {
-
+ return new org.bukkit.OfflinePlayer()
+ {
@Override
public boolean isOnline()
{
@@ -530,6 +531,24 @@ public class FakeServer implements Server
{
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ @Override
+ public long getFirstPlayed()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public long getLastPlayed()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean hasPlayedBefore()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
};
}
@@ -580,4 +599,28 @@ public class FakeServer implements Server
{
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ @Override
+ public String getBukkitVersion()
+ {
+ return "Essentials Fake-Server";
+ }
+
+ @Override
+ public File getWorldContainer()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public OfflinePlayer[] getOfflinePlayers()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean getAllowEnd()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}
diff --git a/Essentials/test/com/earth2me/essentials/StorageTest.java b/Essentials/test/com/earth2me/essentials/StorageTest.java
index 9ee5883e9..b7fe23433 100644
--- a/Essentials/test/com/earth2me/essentials/StorageTest.java
+++ b/Essentials/test/com/earth2me/essentials/StorageTest.java
@@ -1,37 +1,161 @@
package com.earth2me.essentials;
-import junit.framework.TestCase;
import com.earth2me.essentials.settings.Settings;
+import com.earth2me.essentials.storage.ObjectLoadException;
import com.earth2me.essentials.storage.StorageObject;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.Reader;
+import com.earth2me.essentials.storage.YamlStorageReader;
+import com.earth2me.essentials.storage.YamlStorageWriter;
+import java.io.*;
+import junit.framework.TestCase;
+import org.bukkit.Location;
+import org.bukkit.World;
+import org.bukkit.World.Environment;
+import org.bukkit.plugin.InvalidDescriptionException;
import org.junit.Test;
public class StorageTest extends TestCase
{
+ Essentials ess;
+ FakeServer server;
+ World world;
+
+ public StorageTest()
+ {
+ ess = new Essentials();
+ server = new FakeServer();
+ world = server.createWorld("testWorld", Environment.NORMAL);
+ try
+ {
+ ess.setupForTesting(server);
+ }
+ catch (InvalidDescriptionException ex)
+ {
+ fail("InvalidDescriptionException");
+ }
+ catch (IOException ex)
+ {
+ fail("IOException");
+ }
+ }
+
@Test
public void testSettings()
{
- assertTrue(StorageObject.class.isAssignableFrom(Settings.class));
- final ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
- final Reader reader = new InputStreamReader(bais);
- final Settings settings = StorageObject.load(Settings.class, reader);
- final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- final PrintWriter writer = new PrintWriter(baos);
- settings.save(writer);
- writer.close();
- byte[] written = baos.toByteArray();
- System.out.println(new String(written));
- final ByteArrayInputStream bais2 = new ByteArrayInputStream(written);
- final Reader reader2 = new InputStreamReader(bais2);
- final Settings settings2 = StorageObject.load(Settings.class, reader2);
- System.out.println(settings.toString());
- System.out.println(settings2.toString());
- //assertEquals("Default and rewritten config should be equal", settings, settings2);
- //that assertion fails, because empty list and maps return as null
+ try
+ {
+ assertTrue(StorageObject.class.isAssignableFrom(Settings.class));
+ ExecuteTimer ext = new ExecuteTimer();
+ ext.start();
+ final ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
+ final Reader reader = new InputStreamReader(bais);
+ final Settings settings = new YamlStorageReader(reader, null).load(Settings.class);
+ ext.mark("load empty settings");
+ final ByteArrayInputStream bais3 = new ByteArrayInputStream(new byte[0]);
+ final Reader reader3 = new InputStreamReader(bais3);
+ final Settings settings3 = new YamlStorageReader(reader3, null).load(Settings.class);
+ ext.mark("load empty settings (class cached)");
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final PrintWriter writer = new PrintWriter(baos);
+ new YamlStorageWriter(writer).save(settings);
+ writer.close();
+ ext.mark("write settings");
+ byte[] written = baos.toByteArray();
+ System.out.println(new String(written));
+ final ByteArrayInputStream bais2 = new ByteArrayInputStream(written);
+ final Reader reader2 = new InputStreamReader(bais2);
+ final Settings settings2 = new YamlStorageReader(reader2, null).load(Settings.class);
+ System.out.println(settings.toString());
+ System.out.println(settings2.toString());
+ ext.mark("reload settings");
+ System.out.println(ext.end());
+ //assertEquals("Default and rewritten config should be equal", settings, settings2);
+ //that assertion fails, because empty list and maps return as null
+ }
+ catch (ObjectLoadException ex)
+ {
+ fail(ex.getMessage());
+ }
+ }
+
+ @Test
+ public void testUserdata()
+ {
+ try
+ {
+ FakeServer server = new FakeServer();
+ World world = server.createWorld("testWorld", Environment.NORMAL);
+ ExecuteTimer ext = new ExecuteTimer();
+ ext.start();
+ final ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
+ final Reader reader = new InputStreamReader(bais);
+ final com.earth2me.essentials.user.UserData userdata = new YamlStorageReader(reader, null).load(com.earth2me.essentials.user.UserData.class);
+ ext.mark("load empty user");
+ final ByteArrayInputStream bais3 = new ByteArrayInputStream(new byte[0]);
+ final Reader reader3 = new InputStreamReader(bais3);
+ final com.earth2me.essentials.user.UserData userdata3 = new YamlStorageReader(reader3, null).load(com.earth2me.essentials.user.UserData.class);
+ ext.mark("load empty user (class cached)");
+
+ for (int j = 0; j < 10000; j++)
+ {
+ userdata.getHomes().put("home", new Location(world, j, j, j));
+ }
+ ext.mark("change home 10000 times");
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final PrintWriter writer = new PrintWriter(baos);
+ new YamlStorageWriter(writer).save(userdata);
+ writer.close();
+ ext.mark("write user");
+ final ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
+ final PrintWriter writer2 = new PrintWriter(baos2);
+ new YamlStorageWriter(writer2).save(userdata);
+ writer2.close();
+ ext.mark("write user (cached)");
+ byte[] written = baos.toByteArray();
+ System.out.println(new String(written));
+ ext.mark("debug output");
+ final ByteArrayInputStream bais2 = new ByteArrayInputStream(written);
+ final Reader reader2 = new InputStreamReader(bais2);
+ final com.earth2me.essentials.user.UserData userdata2 = new YamlStorageReader(reader2, null).load(com.earth2me.essentials.user.UserData.class);
+ ext.mark("reload file");
+ final ByteArrayInputStream bais4 = new ByteArrayInputStream(written);
+ final Reader reader4 = new InputStreamReader(bais4);
+ final com.earth2me.essentials.user.UserData userdata4 = new YamlStorageReader(reader4, null).load(com.earth2me.essentials.user.UserData.class);
+ ext.mark("reload file (cached)");
+ System.out.println(userdata.toString());
+ System.out.println(userdata2.toString());
+ System.out.println(ext.end());
+ }
+ catch (ObjectLoadException ex)
+ {
+ fail(ex.getMessage());
+ }
+
+ }
+
+ @Test
+ public void testOldUserdata()
+ {
+ ExecuteTimer ext = new ExecuteTimer();
+ ext.start();
+ OfflinePlayer base1 = server.createPlayer("testPlayer1", ess);
+ server.addPlayer(base1);
+ ext.mark("fake user created");
+ UserData user = (UserData)ess.getUser(base1);
+ ext.mark("load empty user");
+ for (int j = 0; j < 1; j++)
+ {
+ user.setHome("home", new Location(world, j, j, j));
+ }
+ ext.mark("change home 1 times");
+ user.save();
+ ext.mark("write user");
+ user.save();
+ ext.mark("write user (cached)");
+ user.reloadConfig();
+ ext.mark("reloaded file");
+ user.reloadConfig();
+ ext.mark("reloaded file (cached)");
+ System.out.println(ext.end());
}
}
diff --git a/Essentials/test/com/earth2me/essentials/UserTest.java b/Essentials/test/com/earth2me/essentials/UserTest.java
index 35244ac90..ef9ab515d 100644
--- a/Essentials/test/com/earth2me/essentials/UserTest.java
+++ b/Essentials/test/com/earth2me/essentials/UserTest.java
@@ -54,21 +54,15 @@ public class UserTest extends TestCase
user.setHome();
OfflinePlayer base2 = server.createPlayer(base1.getName(), ess);
User user2 = ess.getUser(base2);
- try
- {
- Location home = user2.getHome(loc);
- assertEquals(loc.getWorld().getName(), home.getWorld().getName());
- assertEquals(loc.getX(), home.getX());
- assertEquals(loc.getY(), home.getY());
- assertEquals(loc.getZ(), home.getZ());
- assertEquals(loc.getYaw(), home.getYaw());
- assertEquals(loc.getPitch(), home.getPitch());
- }
- catch (Exception ex)
- {
- fail("Exception");
- }
+ Location home = user2.getHome(loc);
+ assertNotNull(home);
+ assertEquals(loc.getWorld().getName(), home.getWorld().getName());
+ assertEquals(loc.getX(), home.getX());
+ assertEquals(loc.getY(), home.getY());
+ assertEquals(loc.getZ(), home.getZ());
+ assertEquals(loc.getYaw(), home.getYaw());
+ assertEquals(loc.getPitch(), home.getPitch());
}
public void testMoney()
diff --git a/Essentials/test/com/earth2me/essentials/UtilTest.java b/Essentials/test/com/earth2me/essentials/UtilTest.java
index 4772b4923..71282a18f 100644
--- a/Essentials/test/com/earth2me/essentials/UtilTest.java
+++ b/Essentials/test/com/earth2me/essentials/UtilTest.java
@@ -30,16 +30,17 @@ public class UtilTest extends TestCase
{
fail("IOException");
}
- Util.updateLocale("en_US", ess);
- }
-
- public void testFDDnow() {
+ }
+
+ public void testFDDnow()
+ {
Calendar c = new GregorianCalendar();
String resp = Util.formatDateDiff(c, c);
assertEquals(resp, "now");
}
-
- public void testFDDfuture() {
+
+ public void testFDDfuture()
+ {
Calendar a, b;
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
b = new GregorianCalendar(2010, 1, 1, 10, 0, 1);
@@ -105,8 +106,9 @@ public class UtilTest extends TestCase
b = new GregorianCalendar(2011, 4, 31, 10, 5, 0);
assertEquals(" 5 minutes", Util.formatDateDiff(a, b));
}
-
- public void testFDDpast() {
+
+ public void testFDDpast()
+ {
Calendar a, b;
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
b = new GregorianCalendar(2010, 1, 1, 9, 59, 59);
diff --git a/EssentialsChat/nbproject/build-impl.xml b/EssentialsChat/nbproject/build-impl.xml
index 4dc2d2659..80a5b5256 100644
--- a/EssentialsChat/nbproject/build-impl.xml
+++ b/EssentialsChat/nbproject/build-impl.xml
@@ -20,10 +20,10 @@ is divided into following sections:
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="EssentialsChat-impl">
- <fail message="Please build using Ant 1.7.1 or higher.">
+ <fail message="Please build using Ant 1.8.0 or higher.">
<condition>
<not>
- <antversion atleast="1.7.1"/>
+ <antversion atleast="1.8.0"/>
</not>
</condition>
</fail>
@@ -223,6 +223,7 @@ is divided into following sections:
<property name="javac.fork" value="${jdkBug6558476}"/>
<property name="jar.index" value="false"/>
<property name="jar.index.metainf" value="${jar.index}"/>
+ <property name="copylibs.rebase" value="true"/>
<available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
</target>
<target name="-post-init">
@@ -409,6 +410,7 @@ is divided into following sections:
<property environment="env"/>
<resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
<java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
@@ -539,7 +541,7 @@ is divided into following sections:
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
- <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+ <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
@@ -871,6 +873,14 @@ is divided into following sections:
-->
<target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
+ <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+ <and>
+ <isset property="endorsed.classpath.cmd.line.arg"/>
+ <not>
+ <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+ </not>
+ </and>
+ </condition>
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
<classpath>
<path path="${javac.classpath}"/>
@@ -882,6 +892,7 @@ is divided into following sections:
<include name="**/*.java"/>
<exclude name="*.java"/>
</fileset>
+ <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
</javadoc>
<copy todir="${dist.javadoc.dir}">
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
diff --git a/EssentialsChat/nbproject/genfiles.properties b/EssentialsChat/nbproject/genfiles.properties
index 95704bf4b..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=2447bdf5
-nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
+nbproject/build-impl.xml.script.CRC32=52184b61
+nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
diff --git a/EssentialsChat/nbproject/project.properties b/EssentialsChat/nbproject/project.properties
index 867228a92..8cf7e9081 100644
--- a/EssentialsChat/nbproject/project.properties
+++ b/EssentialsChat/nbproject/project.properties
@@ -28,6 +28,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blank
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=*
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE
@@ -36,6 +37,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.place
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
@@ -61,12 +63,12 @@ dist.jar=${dist.dir}/EssentialsChat.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
-file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar
+file.reference.bukkit.jar=../lib/bukkit.jar
includes=**
jar.compress=true
javac.classpath=\
${reference.Essentials.jar}:\
- ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}
+ ${file.reference.bukkit.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
@@ -77,8 +79,7 @@ javac.target=1.6
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
- ${libs.junit.classpath}:\
- ${libs.junit_4.classpath}
+ ${libs.junit_4.10.classpath}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java
index 7a10d9a92..25ce85cc8 100644
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java
@@ -1,13 +1,15 @@
package com.earth2me.essentials.chat;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.Util;
import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.ConcurrentSkipListMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.event.Event.Priority;
import org.bukkit.event.Event.Type;
+import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
@@ -15,34 +17,52 @@ import org.bukkit.plugin.java.JavaPlugin;
public class EssentialsChat extends JavaPlugin
{
private static final Logger LOGGER = Logger.getLogger("Minecraft");
- private Map<String, IEssentialsChatListener> chatListener;
+ private transient Map<String, IEssentialsChatListener> chatListener;
+
+ @Override
public void onEnable()
{
final PluginManager pluginManager = getServer().getPluginManager();
final IEssentials ess = (IEssentials)pluginManager.getPlugin("Essentials");
-
- chatListener = new HashMap<String, IEssentialsChatListener>();
-
- final EssentialsChatPlayerListener playerListener = new EssentialsChatPlayerListener(getServer(), ess, chatListener);
- pluginManager.registerEvent(Type.PLAYER_CHAT, playerListener, Priority.High, this);
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
{
- LOGGER.log(Level.WARNING, Util.i18n("versionMismatchAll"));
+ LOGGER.log(Level.WARNING, _("versionMismatchAll"));
}
- LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
+ if (!ess.isEnabled())
+ {
+ this.setEnabled(false);
+ return;
+ }
+
+ chatListener = new ConcurrentSkipListMap<String, IEssentialsChatListener>();
+ final Map<PlayerChatEvent, String> charges = new HashMap<PlayerChatEvent, String>();
+
+
+ final EssentialsChatPlayerListenerLowest playerListenerLowest = new EssentialsChatPlayerListenerLowest(getServer(), ess, chatListener);
+ final EssentialsChatPlayerListenerNormal playerListenerNormal = new EssentialsChatPlayerListenerNormal(getServer(), ess, chatListener, charges);
+ final EssentialsChatPlayerListenerHighest playerListenerHighest = new EssentialsChatPlayerListenerHighest(getServer(), ess, chatListener, charges);
+ pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerLowest, Priority.Lowest, this);
+ pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerNormal, Priority.Normal, this);
+ pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerHighest, Priority.Highest, this);
+
+ LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
}
+ @Override
public void onDisable()
{
- chatListener.clear();
+ if (chatListener != null)
+ {
+ chatListener.clear();
+ }
}
-
+
public void addEssentialsChatListener(final String plugin, final IEssentialsChatListener listener)
{
chatListener.put(plugin, listener);
}
-
+
public IEssentialsChatListener removeEssentialsChatListener(final String plugin)
{
return chatListener.remove(plugin);
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
new file mode 100644
index 000000000..432e2309c
--- /dev/null
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
@@ -0,0 +1,155 @@
+package com.earth2me.essentials.chat;
+
+import com.earth2me.essentials.ChargeException;
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.User;
+import java.util.Map;
+import java.util.logging.Logger;
+import org.bukkit.Location;
+import org.bukkit.Server;
+import org.bukkit.World;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+import org.bukkit.event.player.PlayerChatEvent;
+import org.bukkit.event.player.PlayerListener;
+
+//TODO: Translate the local/spy tags
+public abstract class EssentialsChatPlayer extends PlayerListener
+{
+ protected transient IEssentials ess;
+ protected final static Logger logger = Logger.getLogger("Minecraft");
+ protected final transient Map<String, IEssentialsChatListener> listeners;
+ protected final transient Server server;
+
+ public EssentialsChatPlayer(Server server, IEssentials ess, Map<String, IEssentialsChatListener> listeners)
+ {
+ this.ess = ess;
+ this.listeners = listeners;
+ this.server = server;
+ }
+
+ public void onPlayerChat(final PlayerChatEvent event)
+ {
+ }
+
+ public boolean isAborted(final PlayerChatEvent event)
+ {
+ return isAborted(event, "chat");
+ }
+
+ public boolean isAborted(final PlayerChatEvent event, final String command)
+ {
+ if (event.isCancelled())
+ {
+ return true;
+ }
+ for (IEssentialsChatListener listener : listeners.values())
+ {
+ if (listener.shouldHandleThisChat(event))
+ {
+ return true;
+ }
+ }
+
+ final User user = ess.getUser(event.getPlayer());
+ if (!isAffordableFor(user, command))
+ {
+ event.setCancelled(true);
+ return true;
+ }
+ return false;
+ }
+
+ public String getChatType(final String message)
+ {
+ switch (message.charAt(0))
+ {
+ case '!':
+ return "shout";
+ case '?':
+ return "question";
+ default:
+ return "";
+ }
+ }
+
+ protected void charge(final CommandSender sender, final String command) throws ChargeException
+ {
+ if (sender instanceof Player)
+ {
+ final Trade charge = new Trade(command, ess);
+ charge.charge(ess.getUser((Player)sender));
+ }
+ }
+
+ protected boolean isAffordableFor(final CommandSender sender, final String command)
+ {
+ if (sender instanceof Player)
+ {
+ try
+ {
+ final Trade charge = new Trade(command, ess);
+ charge.isAffordableFor(ess.getUser((Player)sender));
+ }
+ catch (ChargeException e)
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ protected void sendLocalChat(final User sender, final long radius, final PlayerChatEvent event)
+ {
+ event.setCancelled(true);
+ logger.info(_("localFormat", sender.getName(), event.getMessage()));
+ final Location loc = sender.getLocation();
+ final World world = loc.getWorld();
+
+ for (Player onlinePlayer : server.getOnlinePlayers())
+ {
+ String type = "[L]";
+ final User user = ess.getUser(onlinePlayer);
+ //TODO: remove reference to op
+ if (user.isIgnoredPlayer(sender.getName()) && !sender.isOp())
+ {
+ continue;
+ }
+ if (!user.equals(sender))
+ {
+ final Location playerLoc = user.getLocation();
+ if (playerLoc.getWorld() != world)
+ {
+ continue;
+ }
+ final double delta = playerLoc.distanceSquared(loc);
+
+ if (delta > radius)
+ {
+ if (user.isAuthorized("essentials.chat.spy"))
+ {
+ type = type.concat("[Spy]");
+ }
+ else
+ {
+ continue;
+ }
+ }
+ }
+
+ String message = String.format(event.getFormat(), type.concat(sender.getDisplayName()), event.getMessage());
+ for (IEssentialsChatListener listener : listeners.values())
+ {
+ message = listener.modifyMessage(event, onlinePlayer, message);
+ }
+ user.sendMessage(message);
+ }
+ }
+}
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java
deleted file mode 100644
index 85e821e7f..000000000
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package com.earth2me.essentials.chat;
-
-import com.earth2me.essentials.ChargeException;
-import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.Trade;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
-import java.util.Map;
-import java.util.logging.Logger;
-import org.bukkit.Location;
-import org.bukkit.Server;
-import org.bukkit.World;
-import org.bukkit.command.CommandSender;
-import org.bukkit.entity.Player;
-import org.bukkit.event.player.PlayerChatEvent;
-import org.bukkit.event.player.PlayerListener;
-
-
-public class EssentialsChatPlayerListener extends PlayerListener
-{
- private static final Logger LOGGER = Logger.getLogger("Minecraft");
- private final transient IEssentials ess;
- private final transient Server server;
- private final transient Map<String, IEssentialsChatListener> listeners;
-
- public EssentialsChatPlayerListener(final Server server, final IEssentials ess, final Map<String, IEssentialsChatListener> listeners)
- {
- this.server = server;
- this.ess = ess;
- this.listeners = listeners;
- }
-
- @Override
- public void onPlayerChat(final PlayerChatEvent event)
- {
- if (event.isCancelled())
- {
- return;
- }
-
- for (IEssentialsChatListener listener : listeners.values())
- {
- if (listener.shouldHandleThisChat(event))
- {
- return;
- }
- }
-
- final User user = ess.getUser(event.getPlayer());
-
- if (user.isAuthorized("essentials.chat.color"))
- {
- event.setMessage(event.getMessage().replaceAll("&([0-9a-f])", "§$1"));
- }
-
- event.setFormat(ess.getSettings().getChatFormat(user.getGroup()).replace('&', '§').replace("§§", "&").replace("{DISPLAYNAME}", "%1$s").replace("{GROUP}", user.getGroup()).replace("{MESSAGE}", "%2$s").replace("{WORLDNAME}", user.getWorld().getName()).replace("{SHORTWORLDNAME}", user.getWorld().getName().substring(0, 1).toUpperCase()));
-
- long radius = ess.getSettings().getChatRadius();
- if (radius < 1)
- {
- return;
- }
- radius *= radius;
-
- try {
- if (event.getMessage().startsWith("!") && event.getMessage().length() > 1)
- {
- if (user.isAuthorized("essentials.chat.shout"))
- {
- charge(user,"chat-shout");
- event.setMessage(event.getMessage().substring(1));
- event.setFormat(Util.format("shoutFormat", event.getFormat()));
- return;
- }
- user.sendMessage(Util.i18n("notAllowedToShout"));
- event.setCancelled(true);
- return;
- }
-
- if (event.getMessage().startsWith("?") && event.getMessage().length() > 1)
- {
- if (user.isAuthorized("essentials.chat.question"))
- {
- charge(user,"chat-question");
- event.setMessage(event.getMessage().substring(1));
- event.setFormat(Util.format("questionFormat", event.getFormat()));
- return;
- }
- user.sendMessage(Util.i18n("notAllowedToQuestion"));
- event.setCancelled(true);
- return;
- }
- }
- catch (ChargeException ex)
- {
- ess.showError(user, ex, "Shout");
- return;
- }
-
- event.setCancelled(true);
- LOGGER.info(Util.format("localFormat", user.getName(), event.getMessage()));
-
- final Location loc = user.getLocation();
- final World world = loc.getWorld();
- final int x = loc.getBlockX();
- final int y = loc.getBlockY();
- final int z = loc.getBlockZ();
-
- for (Player p : server.getOnlinePlayers())
- {
- final User u = ess.getUser(p);
- if (u.isIgnoredPlayer(user.getName()) && !user.isOp())
- {
- continue;
- }
- if (!u.equals(user) && !u.isAuthorized("essentials.chat.spy"))
- {
- final Location l = u.getLocation();
- final int dx = x - l.getBlockX();
- final int dy = y - l.getBlockY();
- final int dz = z - l.getBlockZ();
- final long delta = dx*dx + dy*dy + dz*dz;
- if (delta > radius || world != l.getWorld())
- {
- continue;
- }
- }
- String message = String.format(event.getFormat(), user.getDisplayName(), event.getMessage());
-
- for (IEssentialsChatListener listener : listeners.values())
- {
- message = listener.modifyMessage(event, p, message);
- }
-
- u.sendMessage(message);
- }
- }
- protected void charge(final CommandSender sender, final String command) throws ChargeException
- {
- if (sender instanceof Player)
- {
- final Trade charge = new Trade(command, ess);
- charge.charge(ess.getUser((Player)sender));
- }
- }
-}
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerHighest.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerHighest.java
new file mode 100644
index 000000000..22989d4f9
--- /dev/null
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerHighest.java
@@ -0,0 +1,53 @@
+package com.earth2me.essentials.chat;
+
+import com.earth2me.essentials.ChargeException;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import java.util.Map;
+import org.bukkit.Server;
+import org.bukkit.event.player.PlayerChatEvent;
+
+
+public class EssentialsChatPlayerListenerHighest extends EssentialsChatPlayer
+{
+ private final transient Map<PlayerChatEvent, String> charges;
+
+ public EssentialsChatPlayerListenerHighest(final Server server,
+ final IEssentials ess,
+ final Map<String, IEssentialsChatListener> listeners,
+ final Map<PlayerChatEvent, String> charges)
+ {
+ super(server, ess, listeners);
+ this.charges = charges;
+ }
+
+ @Override
+ public void onPlayerChat(final PlayerChatEvent event)
+ {
+ String charge = charges.remove(event);
+ if (charge == null)
+ {
+ charge = "chat";
+ }
+ if (isAborted(event))
+ {
+ return;
+ }
+
+ /**
+ * This file should handle charging the user for the action before returning control back
+ */
+ final User user = ess.getUser(event.getPlayer());
+
+ try
+ {
+ charge(user, charge);
+ }
+ catch (ChargeException e)
+ {
+ ess.showError(user, e, charge);
+ event.setCancelled(true);
+ return;
+ }
+ }
+}
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java
new file mode 100644
index 000000000..5c674d05d
--- /dev/null
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java
@@ -0,0 +1,41 @@
+package com.earth2me.essentials.chat;
+
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import java.util.Locale;
+import java.util.Map;
+import org.bukkit.Server;
+import org.bukkit.event.player.PlayerChatEvent;
+
+
+public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer
+{
+ public EssentialsChatPlayerListenerLowest(final Server server,
+ final IEssentials ess,
+ final Map<String, IEssentialsChatListener> listeners)
+ {
+ super(server, ess, listeners);
+ }
+
+ @Override
+ public void onPlayerChat(final PlayerChatEvent event)
+ {
+ if (isAborted(event))
+ {
+ return;
+ }
+
+ /**
+ * This listener should apply the general chat formatting only...then return control back the event handler
+ */
+ final User user = ess.getUser(event.getPlayer());
+ if (user.isAuthorized("essentials.chat.color"))
+ {
+ event.setMessage(event.getMessage().replaceAll("&([0-9a-fk])", "\u00a7$1"));
+ } else {
+ event.setMessage(Util.stripColor(event.getMessage()));
+ }
+ event.setFormat(ess.getSettings().getChatFormat(user.getGroup()).replace('&', '\u00a7').replace("\u00a7\u00a7", "&").replace("{DISPLAYNAME}", "%1$s").replace("{GROUP}", user.getGroup()).replace("{MESSAGE}", "%2$s").replace("{WORLDNAME}", user.getWorld().getName()).replace("{SHORTWORLDNAME}", user.getWorld().getName().substring(0, 1).toUpperCase(Locale.ENGLISH)));
+ }
+}
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java
new file mode 100644
index 000000000..4e3cbefc0
--- /dev/null
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java
@@ -0,0 +1,79 @@
+package com.earth2me.essentials.chat;
+
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import java.util.Locale;
+import java.util.Map;
+import org.bukkit.Server;
+import org.bukkit.event.player.PlayerChatEvent;
+
+
+public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer
+{
+ private final transient Map<PlayerChatEvent, String> charges;
+
+ public EssentialsChatPlayerListenerNormal(final Server server,
+ final IEssentials ess,
+ final Map<String, IEssentialsChatListener> listeners,
+ final Map<PlayerChatEvent, String> charges)
+ {
+ super(server, ess, listeners);
+ this.charges = charges;
+ }
+
+ @Override
+ public void onPlayerChat(final PlayerChatEvent event)
+ {
+ if (isAborted(event))
+ {
+ return;
+ }
+
+ /**
+ * This file should handle detection of the local chat features... if local chat is enabled, we need to handle
+ * it here
+ */
+ final String chatType = getChatType(event.getMessage());
+ final StringBuilder command = new StringBuilder();
+ command.append("chat");
+
+ if (chatType.length() > 0)
+ {
+ command.append("-").append(chatType);
+ }
+ long radius = ess.getSettings().getChatRadius();
+ if (radius < 1)
+ {
+ return;
+ }
+ radius *= radius;
+ final User user = ess.getUser(event.getPlayer());
+
+ if (event.getMessage().length() > 0 && chatType.length() > 0)
+ {
+ final StringBuilder permission = new StringBuilder();
+ permission.append("essentials.chat.").append(chatType);
+
+ final StringBuilder format = new StringBuilder();
+ format.append(chatType).append("Format");
+
+ final StringBuilder errorMsg = new StringBuilder();
+ errorMsg.append("notAllowedTo").append(chatType.substring(0, 1).toUpperCase(Locale.ENGLISH)).append(chatType.substring(1));
+
+ if (user.isAuthorized(permission.toString()))
+ {
+ event.setMessage(event.getMessage().substring(1));
+ event.setFormat(_(format.toString(), event.getFormat()));
+ charges.put(event, command.toString());
+ return;
+ }
+
+ user.sendMessage(_(errorMsg.toString()));
+ event.setCancelled(true);
+ return;
+ }
+
+ sendLocalChat(user, radius, event);
+ }
+}
diff --git a/EssentialsChat/src/plugin.yml b/EssentialsChat/src/plugin.yml
index d3f5d38df..cc129f825 100644
--- a/EssentialsChat/src/plugin.yml
+++ b/EssentialsChat/src/plugin.yml
@@ -5,6 +5,6 @@ main: com.earth2me.essentials.chat.EssentialsChat
version: TeamCity
website: http://www.earth2me.net:8001/
description: Provides chat control features for Essentials. Requires Permissions.
-authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
+authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits, Okamosy]
depend: [Essentials]
#softdepend: [Factions] \ No newline at end of file
diff --git a/EssentialsGeoIP/nbproject/build-impl.xml b/EssentialsGeoIP/nbproject/build-impl.xml
index 41af95ec2..4b4feb8d8 100644
--- a/EssentialsGeoIP/nbproject/build-impl.xml
+++ b/EssentialsGeoIP/nbproject/build-impl.xml
@@ -20,10 +20,10 @@ is divided into following sections:
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="EssentialsGeoIP-impl">
- <fail message="Please build using Ant 1.7.1 or higher.">
+ <fail message="Please build using Ant 1.8.0 or higher.">
<condition>
<not>
- <antversion atleast="1.7.1"/>
+ <antversion atleast="1.8.0"/>
</not>
</condition>
</fail>
@@ -223,6 +223,7 @@ is divided into following sections:
<property name="javac.fork" value="${jdkBug6558476}"/>
<property name="jar.index" value="false"/>
<property name="jar.index.metainf" value="${jar.index}"/>
+ <property name="copylibs.rebase" value="true"/>
<available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
</target>
<target name="-post-init">
@@ -409,6 +410,7 @@ is divided into following sections:
<property environment="env"/>
<resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
<java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
@@ -539,7 +541,7 @@ is divided into following sections:
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
- <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+ <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
@@ -871,6 +873,14 @@ is divided into following sections:
-->
<target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
+ <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+ <and>
+ <isset property="endorsed.classpath.cmd.line.arg"/>
+ <not>
+ <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+ </not>
+ </and>
+ </condition>
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
<classpath>
<path path="${javac.classpath}"/>
@@ -882,6 +892,7 @@ is divided into following sections:
<include name="**/*.java"/>
<exclude name="*.java"/>
</fileset>
+ <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
</javadoc>
<copy todir="${dist.javadoc.dir}">
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
diff --git a/EssentialsGeoIP/nbproject/genfiles.properties b/EssentialsGeoIP/nbproject/genfiles.properties
index 397a15928..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=e7684555
-nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
+nbproject/build-impl.xml.script.CRC32=db2bb7a7
+nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
diff --git a/EssentialsGeoIP/nbproject/project.properties b/EssentialsGeoIP/nbproject/project.properties
index 80cd8778f..cec81b0c2 100644
--- a/EssentialsGeoIP/nbproject/project.properties
+++ b/EssentialsGeoIP/nbproject/project.properties
@@ -28,6 +28,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blank
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=*
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE
@@ -36,6 +37,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.place
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
@@ -61,12 +63,12 @@ dist.jar=${dist.dir}/EssentialsGeoIP.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
-file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar
+file.reference.bukkit.jar=../lib/bukkit.jar
includes=**
jar.compress=true
javac.classpath=\
${reference.Essentials.jar}:\
- ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}
+ ${file.reference.bukkit.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
@@ -77,8 +79,7 @@ javac.target=1.6
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
- ${libs.junit.classpath}:\
- ${libs.junit_4.classpath}
+ ${libs.junit_4.10.classpath}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java
index aa919f44b..e0ca6cd7c 100644
--- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java
+++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java
@@ -1,8 +1,7 @@
package com.earth2me.essentials.geoip;
-import com.earth2me.essentials.Essentials;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.Util;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.event.Event.Priority;
@@ -29,14 +28,19 @@ public class EssentialsGeoIP extends JavaPlugin
{
final PluginManager pm = getServer().getPluginManager();
final IEssentials ess = (IEssentials)pm.getPlugin("Essentials");
+ if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
+ {
+ logger.log(Level.WARNING, _("versionMismatchAll"));
+ }
+ if (!ess.isEnabled()) {
+ this.setEnabled(false);
+ return;
+ }
final EssentialsGeoIPPlayerListener playerListener = new EssentialsGeoIPPlayerListener(getDataFolder(), ess);
pm.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this);
- if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) {
- logger.log(Level.WARNING, Util.i18n("versionMismatchAll"));
- }
- logger.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
-
+ logger.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
+
logger.log(Level.INFO, "This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/.");
}
}
diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
index 5a6553f0e..ee187c2aa 100644
--- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
+++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
@@ -1,18 +1,14 @@
package com.earth2me.essentials.geoip;
import com.earth2me.essentials.EssentialsConf;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IConf;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import com.maxmind.geoip.Location;
import com.maxmind.geoip.LookupService;
import com.maxmind.geoip.regionName;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.io.*;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
@@ -79,13 +75,14 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
{
u.setGeoLocation(sb.toString());
}
- if (config.getBoolean("show-on-login", true))
+ if (config.getBoolean("show-on-login", true) && !u.isHidden())
{
for (Player player : event.getPlayer().getServer().getOnlinePlayers())
{
User user = ess.getUser(player);
- if (user.isAuthorized("essentials.geoip.show")) {
- user.sendMessage(Util.format("geoipJoinFormat", u.getDisplayName(), sb.toString()));
+ if (user.isAuthorized("essentials.geoip.show"))
+ {
+ user.sendMessage(_("geoipJoinFormat", u.getDisplayName(), sb.toString()));
}
}
}
@@ -112,7 +109,7 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
}
else
{
- logger.log(Level.SEVERE, Util.i18n("cantFindGeoIpDB"));
+ logger.log(Level.SEVERE, _("cantFindGeoIpDB"));
return;
}
}
@@ -122,7 +119,7 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
}
catch (IOException ex)
{
- logger.log(Level.SEVERE, Util.i18n("cantReadGeoIpDB"), ex);
+ logger.log(Level.SEVERE, _("cantReadGeoIpDB"), ex);
}
}
@@ -141,10 +138,10 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
}
if (url == null || url.isEmpty())
{
- logger.log(Level.SEVERE, Util.i18n("geoIpUrlEmpty"));
+ logger.log(Level.SEVERE, _("geoIpUrlEmpty"));
return;
}
- logger.log(Level.INFO, Util.i18n("downloadingGeoIp"));
+ logger.log(Level.INFO, _("downloadingGeoIp"));
URL downloadUrl = new URL(url);
URLConnection conn = downloadUrl.openConnection();
conn.setConnectTimeout(10000);
@@ -167,12 +164,12 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
}
catch (MalformedURLException ex)
{
- logger.log(Level.SEVERE, Util.i18n("geoIpUrlInvalid"), ex);
+ logger.log(Level.SEVERE, _("geoIpUrlInvalid"), ex);
return;
}
catch (IOException ex)
{
- logger.log(Level.SEVERE, Util.i18n("connectionFailed"), ex);
+ logger.log(Level.SEVERE, _("connectionFailed"), ex);
}
}
}
diff --git a/EssentialsGeoIP/src/com/maxmind/geoip/DatabaseInfo.java b/EssentialsGeoIP/src/com/maxmind/geoip/DatabaseInfo.java
index dfed516a5..939259ebb 100644
--- a/EssentialsGeoIP/src/com/maxmind/geoip/DatabaseInfo.java
+++ b/EssentialsGeoIP/src/com/maxmind/geoip/DatabaseInfo.java
@@ -20,9 +20,9 @@
package com.maxmind.geoip;
-import java.util.Date;
-import java.text.SimpleDateFormat;
import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
/**
* Encapsulates metadata about the GeoIP database. The database has a date, is a premium or
diff --git a/EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java b/EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java
index 406cda004..19da6c8f5 100644
--- a/EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java
+++ b/EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java
@@ -20,16 +20,16 @@
package com.maxmind.geoip;
+
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
-import java.net.InetAddress;
import java.net.Inet6Address;
+import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.StringTokenizer;
-
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
diff --git a/EssentialsGroupBridge/nbproject/build-impl.xml b/EssentialsGroupBridge/nbproject/build-impl.xml
index c0958cd2d..97400aa02 100644
--- a/EssentialsGroupBridge/nbproject/build-impl.xml
+++ b/EssentialsGroupBridge/nbproject/build-impl.xml
@@ -20,10 +20,10 @@ is divided into following sections:
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="EssentialsGroupBridge-impl">
- <fail message="Please build using Ant 1.7.1 or higher.">
+ <fail message="Please build using Ant 1.8.0 or higher.">
<condition>
<not>
- <antversion atleast="1.7.1"/>
+ <antversion atleast="1.8.0"/>
</not>
</condition>
</fail>
@@ -198,6 +198,7 @@ is divided into following sections:
<property name="javac.fork" value="${jdkBug6558476}"/>
<property name="jar.index" value="false"/>
<property name="jar.index.metainf" value="${jar.index}"/>
+ <property name="copylibs.rebase" value="true"/>
<available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
</target>
<target name="-post-init">
@@ -384,6 +385,7 @@ is divided into following sections:
<property environment="env"/>
<resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
<java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
@@ -514,7 +516,7 @@ is divided into following sections:
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
- <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+ <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
@@ -846,6 +848,14 @@ is divided into following sections:
-->
<target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
+ <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+ <and>
+ <isset property="endorsed.classpath.cmd.line.arg"/>
+ <not>
+ <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+ </not>
+ </and>
+ </condition>
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
<classpath>
<path path="${javac.classpath}"/>
@@ -857,6 +867,7 @@ is divided into following sections:
<include name="**/*.java"/>
<exclude name="*.java"/>
</fileset>
+ <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
</javadoc>
<copy todir="${dist.javadoc.dir}">
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
diff --git a/EssentialsGroupBridge/nbproject/genfiles.properties b/EssentialsGroupBridge/nbproject/genfiles.properties
index e2ec78d4f..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=6ab1a006
-nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
+nbproject/build-impl.xml.script.CRC32=c7581402
+nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
diff --git a/EssentialsGroupBridge/nbproject/project.properties b/EssentialsGroupBridge/nbproject/project.properties
index 3a2d806fb..b114e24e3 100644
--- a/EssentialsGroupBridge/nbproject/project.properties
+++ b/EssentialsGroupBridge/nbproject/project.properties
@@ -39,14 +39,14 @@ dist.jar=${dist.dir}/EssentialsGroupBridge.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
-file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar
+file.reference.bukkit.jar=../lib/bukkit.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=true
jar.index=${jnlp.enabled}
javac.classpath=\
${reference.EssentialsGroupManager.jar}:\
- ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}
+ ${file.reference.bukkit.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
diff --git a/EssentialsGroupManager/.classpath b/EssentialsGroupManager/.classpath
index 3b9d29cbd..61f808b2d 100644
--- a/EssentialsGroupManager/.classpath
+++ b/EssentialsGroupManager/.classpath
@@ -2,7 +2,6 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="../lib/bukkit-1.0.0-R1-SNAPSHOT.jar"/>
- <classpathentry kind="lib" path="../lib/craftbukkit-1.0.0-SNAPSHOT.jar"/>
+ <classpathentry kind="lib" path="../lib/craftbukkit.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/EssentialsGroupManager/nbproject/build-impl.xml b/EssentialsGroupManager/nbproject/build-impl.xml
index 9382e257b..8939aa2fa 100644
--- a/EssentialsGroupManager/nbproject/build-impl.xml
+++ b/EssentialsGroupManager/nbproject/build-impl.xml
@@ -20,10 +20,10 @@ is divided into following sections:
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="EssentialsGroupManager-impl">
- <fail message="Please build using Ant 1.7.1 or higher.">
+ <fail message="Please build using Ant 1.8.0 or higher.">
<condition>
<not>
- <antversion atleast="1.7.1"/>
+ <antversion atleast="1.8.0"/>
</not>
</condition>
</fail>
@@ -198,6 +198,7 @@ is divided into following sections:
<property name="javac.fork" value="${jdkBug6558476}"/>
<property name="jar.index" value="false"/>
<property name="jar.index.metainf" value="${jar.index}"/>
+ <property name="copylibs.rebase" value="true"/>
<available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
</target>
<target name="-post-init">
@@ -384,6 +385,7 @@ is divided into following sections:
<property environment="env"/>
<resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
<java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
@@ -514,7 +516,7 @@ is divided into following sections:
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
- <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+ <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
@@ -839,6 +841,14 @@ is divided into following sections:
-->
<target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
+ <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+ <and>
+ <isset property="endorsed.classpath.cmd.line.arg"/>
+ <not>
+ <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+ </not>
+ </and>
+ </condition>
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
<classpath>
<path path="${javac.classpath}"/>
@@ -850,6 +860,7 @@ is divided into following sections:
<include name="**/*.java"/>
<exclude name="*.java"/>
</fileset>
+ <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
</javadoc>
<copy todir="${dist.javadoc.dir}">
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
diff --git a/EssentialsGroupManager/nbproject/genfiles.properties b/EssentialsGroupManager/nbproject/genfiles.properties
index d5696760f..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=4191e2b2
-nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
+nbproject/build-impl.xml.script.CRC32=fe0fea25
+nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
diff --git a/EssentialsGroupManager/nbproject/project.properties b/EssentialsGroupManager/nbproject/project.properties
index 760b4a41e..5b58a2c8c 100644
--- a/EssentialsGroupManager/nbproject/project.properties
+++ b/EssentialsGroupManager/nbproject/project.properties
@@ -39,11 +39,11 @@ dist.jar=${dist.dir}/EssentialsGroupManager.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
-file.reference.craftbukkit-1.0.0-SNAPSHOT.jar=..\\lib\\craftbukkit-1.0.0-SNAPSHOT.jar
+file.reference.craftbukkit.jar=../lib/craftbukkit.jar
includes=**
jar.compress=true
javac.classpath=\
- ${file.reference.craftbukkit-1.0.0-SNAPSHOT.jar}
+ ${file.reference.craftbukkit.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
diff --git a/EssentialsPermissionsCommands/build.xml b/EssentialsPermissionsCommands/build.xml
deleted file mode 100644
index 507230993..000000000
--- a/EssentialsPermissionsCommands/build.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- You may freely edit this file. See commented blocks below for -->
-<!-- some examples of how to customize the build. -->
-<!-- (If you delete it and reopen the project it will be recreated.) -->
-<!-- By default, only the Clean and Build commands use this build script. -->
-<!-- Commands such as Run, Debug, and Test only use this build script if -->
-<!-- the Compile on Save feature is turned off for the project. -->
-<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
-<!-- in the project's Project Properties dialog box.-->
-<project name="EssentialsPermissionsCommands" default="default" basedir=".">
- <description>Builds, tests, and runs the project EssentialsPermissionsCommands.</description>
- <import file="nbproject/build-impl.xml"/>
- <!--
-
- There exist several targets which are by default empty and which can be
- used for execution of your tasks. These targets are usually executed
- before and after some main targets. They are:
-
- -pre-init: called before initialization of project properties
- -post-init: called after initialization of project properties
- -pre-compile: called before javac compilation
- -post-compile: called after javac compilation
- -pre-compile-single: called before javac compilation of single file
- -post-compile-single: called after javac compilation of single file
- -pre-compile-test: called before javac compilation of JUnit tests
- -post-compile-test: called after javac compilation of JUnit tests
- -pre-compile-test-single: called before javac compilation of single JUnit test
- -post-compile-test-single: called after javac compilation of single JUunit test
- -pre-jar: called before JAR building
- -post-jar: called after JAR building
- -post-clean: called after cleaning build products
-
- (Targets beginning with '-' are not intended to be called on their own.)
-
- Example of inserting an obfuscator after compilation could look like this:
-
- <target name="-post-compile">
- <obfuscate>
- <fileset dir="${build.classes.dir}"/>
- </obfuscate>
- </target>
-
- For list of available properties check the imported
- nbproject/build-impl.xml file.
-
-
- Another way to customize the build is by overriding existing main targets.
- The targets of interest are:
-
- -init-macrodef-javac: defines macro for javac compilation
- -init-macrodef-junit: defines macro for junit execution
- -init-macrodef-debug: defines macro for class debugging
- -init-macrodef-java: defines macro for class execution
- -do-jar-with-manifest: JAR building (if you are using a manifest)
- -do-jar-without-manifest: JAR building (if you are not using a manifest)
- run: execution of project
- -javadoc-build: Javadoc generation
- test-report: JUnit report generation
-
- An example of overriding the target for project execution could look like this:
-
- <target name="run" depends="EssentialsPermissionsCommands-impl.jar">
- <exec dir="bin" executable="launcher.exe">
- <arg file="${dist.jar}"/>
- </exec>
- </target>
-
- Notice that the overridden target depends on the jar target and not only on
- the compile target as the regular run target does. Again, for a list of available
- properties which you can use, check the target you are overriding in the
- nbproject/build-impl.xml file.
-
- -->
-</project>
diff --git a/EssentialsPermissionsCommands/manifest.mf b/EssentialsPermissionsCommands/manifest.mf
deleted file mode 100644
index 328e8e5bc..000000000
--- a/EssentialsPermissionsCommands/manifest.mf
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-X-COMMENT: Main-Class will be added automatically by build
-
diff --git a/EssentialsPermissionsCommands/nbproject/build-impl.xml b/EssentialsPermissionsCommands/nbproject/build-impl.xml
deleted file mode 100644
index be53b45fd..000000000
--- a/EssentialsPermissionsCommands/nbproject/build-impl.xml
+++ /dev/null
@@ -1,1081 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-*** GENERATED FROM project.xml - DO NOT EDIT ***
-*** EDIT ../build.xml INSTEAD ***
-
-For the purpose of easier reading the script
-is divided into following sections:
-
- - initialization
- - compilation
- - jar
- - execution
- - debugging
- - javadoc
- - junit compilation
- - junit execution
- - junit debugging
- - applet
- - cleanup
-
- -->
-<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="EssentialsPermissionsCommands-impl">
- <fail message="Please build using Ant 1.7.1 or higher.">
- <condition>
- <not>
- <antversion atleast="1.7.1"/>
- </not>
- </condition>
- </fail>
- <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
- <!--
- ======================
- INITIALIZATION SECTION
- ======================
- -->
- <target name="-pre-init">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="-pre-init" name="-init-private">
- <property file="nbproject/private/config.properties"/>
- <property file="nbproject/private/configs/${config}.properties"/>
- <property file="nbproject/private/private.properties"/>
- </target>
- <target name="-pre-init-libraries">
- <property location="../lib/nblibraries.properties" name="libraries.path"/>
- <dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
- <pathconvert dirsep="/" property="libraries.dir">
- <path path="${libraries.dir.nativedirsep}"/>
- </pathconvert>
- <basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
- <available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
- </target>
- <target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
- <loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
- <filterchain>
- <replacestring from="$${base}" to="${libraries.dir}"/>
- <escapeunicode/>
- </filterchain>
- </loadproperties>
- </target>
- <target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
- <loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
- <filterchain>
- <replacestring from="$${base}" to="${libraries.dir}"/>
- <escapeunicode/>
- </filterchain>
- </loadproperties>
- </target>
- <target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
- <property file="${user.properties.file}"/>
- <!-- The two properties below are usually overridden -->
- <!-- by the active platform. Just a fallback. -->
- <property name="default.javac.source" value="1.4"/>
- <property name="default.javac.target" value="1.4"/>
- </target>
- <target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
- <property file="nbproject/configs/${config}.properties"/>
- <property file="nbproject/project.properties"/>
- </target>
- <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
- <available file="${manifest.file}" property="manifest.available"/>
- <condition property="splashscreen.available">
- <and>
- <not>
- <equals arg1="${application.splash}" arg2="" trim="true"/>
- </not>
- <available file="${application.splash}"/>
- </and>
- </condition>
- <condition property="main.class.available">
- <and>
- <isset property="main.class"/>
- <not>
- <equals arg1="${main.class}" arg2="" trim="true"/>
- </not>
- </and>
- </condition>
- <condition property="manifest.available+main.class">
- <and>
- <isset property="manifest.available"/>
- <isset property="main.class.available"/>
- </and>
- </condition>
- <condition property="do.archive">
- <not>
- <istrue value="${jar.archive.disabled}"/>
- </not>
- </condition>
- <condition property="do.mkdist">
- <and>
- <isset property="do.archive"/>
- <isset property="libs.CopyLibs.classpath"/>
- <not>
- <istrue value="${mkdist.disabled}"/>
- </not>
- </and>
- </condition>
- <condition property="manifest.available+main.class+mkdist.available">
- <and>
- <istrue value="${manifest.available+main.class}"/>
- <isset property="do.mkdist"/>
- </and>
- </condition>
- <condition property="do.archive+manifest.available">
- <and>
- <isset property="manifest.available"/>
- <istrue value="${do.archive}"/>
- </and>
- </condition>
- <condition property="do.archive+main.class.available">
- <and>
- <isset property="main.class.available"/>
- <istrue value="${do.archive}"/>
- </and>
- </condition>
- <condition property="do.archive+splashscreen.available">
- <and>
- <isset property="splashscreen.available"/>
- <istrue value="${do.archive}"/>
- </and>
- </condition>
- <condition property="do.archive+manifest.available+main.class">
- <and>
- <istrue value="${manifest.available+main.class}"/>
- <istrue value="${do.archive}"/>
- </and>
- </condition>
- <condition property="manifest.available-mkdist.available">
- <or>
- <istrue value="${manifest.available}"/>
- <isset property="do.mkdist"/>
- </or>
- </condition>
- <condition property="manifest.available+main.class-mkdist.available">
- <or>
- <istrue value="${manifest.available+main.class}"/>
- <isset property="do.mkdist"/>
- </or>
- </condition>
- <condition property="have.tests">
- <or>
- <available file="${test.src.dir}"/>
- </or>
- </condition>
- <condition property="have.sources">
- <or>
- <available file="${src.dir}"/>
- </or>
- </condition>
- <condition property="netbeans.home+have.tests">
- <and>
- <isset property="netbeans.home"/>
- <isset property="have.tests"/>
- </and>
- </condition>
- <condition property="no.javadoc.preview">
- <and>
- <isset property="javadoc.preview"/>
- <isfalse value="${javadoc.preview}"/>
- </and>
- </condition>
- <property name="run.jvmargs" value=""/>
- <property name="javac.compilerargs" value=""/>
- <property name="work.dir" value="${basedir}"/>
- <condition property="no.deps">
- <and>
- <istrue value="${no.dependencies}"/>
- </and>
- </condition>
- <property name="javac.debug" value="true"/>
- <property name="javadoc.preview" value="true"/>
- <property name="application.args" value=""/>
- <property name="source.encoding" value="${file.encoding}"/>
- <property name="runtime.encoding" value="${source.encoding}"/>
- <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
- <and>
- <isset property="javadoc.encoding"/>
- <not>
- <equals arg1="${javadoc.encoding}" arg2=""/>
- </not>
- </and>
- </condition>
- <property name="javadoc.encoding.used" value="${source.encoding}"/>
- <property name="includes" value="**"/>
- <property name="excludes" value=""/>
- <property name="do.depend" value="false"/>
- <condition property="do.depend.true">
- <istrue value="${do.depend}"/>
- </condition>
- <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
- <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
- <length length="0" string="${endorsed.classpath}" when="greater"/>
- </condition>
- <condition else="false" property="jdkBug6558476">
- <and>
- <matches pattern="1\.[56]" string="${java.specification.version}"/>
- <not>
- <os family="unix"/>
- </not>
- </and>
- </condition>
- <property name="javac.fork" value="${jdkBug6558476}"/>
- <property name="jar.index" value="false"/>
- <property name="jar.index.metainf" value="${jar.index}"/>
- <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
- </target>
- <target name="-post-init">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
- <fail unless="src.dir">Must set src.dir</fail>
- <fail unless="test.src.dir">Must set test.src.dir</fail>
- <fail unless="build.dir">Must set build.dir</fail>
- <fail unless="dist.dir">Must set dist.dir</fail>
- <fail unless="build.classes.dir">Must set build.classes.dir</fail>
- <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
- <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
- <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
- <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
- <fail unless="dist.jar">Must set dist.jar</fail>
- </target>
- <target name="-init-macrodef-property">
- <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute name="name"/>
- <attribute name="value"/>
- <sequential>
- <property name="@{name}" value="${@{value}}"/>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
- <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${src.dir}" name="srcdir"/>
- <attribute default="${build.classes.dir}" name="destdir"/>
- <attribute default="${javac.classpath}" name="classpath"/>
- <attribute default="${javac.processorpath}" name="processorpath"/>
- <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="${javac.debug}" name="debug"/>
- <attribute default="${empty.dir}" name="sourcepath"/>
- <attribute default="${empty.dir}" name="gensrcdir"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property location="${build.dir}/empty" name="empty.dir"/>
- <mkdir dir="${empty.dir}"/>
- <mkdir dir="@{apgeneratedsrcdir}"/>
- <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
- <src>
- <dirset dir="@{gensrcdir}" erroronmissingdir="false">
- <include name="*"/>
- </dirset>
- </src>
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
- <compilerarg line="${javac.compilerargs}"/>
- <compilerarg value="-processorpath"/>
- <compilerarg path="@{processorpath}:${empty.dir}"/>
- <compilerarg line="${ap.processors.internal}"/>
- <compilerarg line="${annotation.processing.processor.options}"/>
- <compilerarg value="-s"/>
- <compilerarg path="@{apgeneratedsrcdir}"/>
- <compilerarg line="${ap.proc.none.internal}"/>
- <customize/>
- </javac>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
- <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${src.dir}" name="srcdir"/>
- <attribute default="${build.classes.dir}" name="destdir"/>
- <attribute default="${javac.classpath}" name="classpath"/>
- <attribute default="${javac.processorpath}" name="processorpath"/>
- <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="${javac.debug}" name="debug"/>
- <attribute default="${empty.dir}" name="sourcepath"/>
- <attribute default="${empty.dir}" name="gensrcdir"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property location="${build.dir}/empty" name="empty.dir"/>
- <mkdir dir="${empty.dir}"/>
- <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
- <src>
- <dirset dir="@{gensrcdir}" erroronmissingdir="false">
- <include name="*"/>
- </dirset>
- </src>
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
- <compilerarg line="${javac.compilerargs}"/>
- <customize/>
- </javac>
- </sequential>
- </macrodef>
- </target>
- <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
- <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${src.dir}" name="srcdir"/>
- <attribute default="${build.classes.dir}" name="destdir"/>
- <attribute default="${javac.classpath}" name="classpath"/>
- <sequential>
- <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- </depend>
- </sequential>
- </macrodef>
- <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${build.classes.dir}" name="destdir"/>
- <sequential>
- <fail unless="javac.includes">Must set javac.includes</fail>
- <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
- <path>
- <filelist dir="@{destdir}" files="${javac.includes}"/>
- </path>
- <globmapper from="*.java" to="*.class"/>
- </pathconvert>
- <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
- <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
- <delete>
- <files includesfile="${javac.includesfile.binary}"/>
- </delete>
- <delete>
- <fileset file="${javac.includesfile.binary}"/>
- </delete>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-macrodef-junit">
- <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${includes}" name="includes"/>
- <attribute default="${excludes}" name="excludes"/>
- <attribute default="**" name="testincludes"/>
- <sequential>
- <property name="junit.forkmode" value="perTest"/>
- <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
- <batchtest todir="${build.test.results.dir}">
- <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
- <filename name="@{testincludes}"/>
- </fileset>
- </batchtest>
- <classpath>
- <path path="${run.test.classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <formatter type="brief" usefile="false"/>
- <formatter type="xml"/>
- <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
- <jvmarg value="-ea"/>
- <jvmarg line="${run.jvmargs}"/>
- </junit>
- </sequential>
- </macrodef>
- </target>
- <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
- <target name="-profile-pre-init">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target name="-profile-post-init">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target name="-profile-init-macrodef-profile">
- <macrodef name="resolve">
- <attribute name="name"/>
- <attribute name="value"/>
- <sequential>
- <property name="@{name}" value="${env.@{value}}"/>
- </sequential>
- </macrodef>
- <macrodef name="profile">
- <attribute default="${main.class}" name="classname"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property environment="env"/>
- <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
- <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
- <jvmarg value="${profiler.info.jvmargs.agent}"/>
- <jvmarg line="${profiler.info.jvmargs}"/>
- <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
- <arg line="${application.args}"/>
- <classpath>
- <path path="${run.classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="run-sys-prop."/>
- <mapper from="run-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <customize/>
- </java>
- </sequential>
- </macrodef>
- </target>
- <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
- <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
- <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
- </target>
- <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
- <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute default="${main.class}" name="name"/>
- <attribute default="${debug.classpath}" name="classpath"/>
- <attribute default="" name="stopclassname"/>
- <sequential>
- <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- </nbjpdastart>
- </sequential>
- </macrodef>
- <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute default="${build.classes.dir}" name="dir"/>
- <sequential>
- <nbjpdareload>
- <fileset dir="@{dir}" includes="${fix.classes}">
- <include name="${fix.includes}*.class"/>
- </fileset>
- </nbjpdareload>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-debug-args">
- <property name="version-output" value="java version &quot;${ant.java.version}"/>
- <condition property="have-jdk-older-than-1.4">
- <or>
- <contains string="${version-output}" substring="java version &quot;1.0"/>
- <contains string="${version-output}" substring="java version &quot;1.1"/>
- <contains string="${version-output}" substring="java version &quot;1.2"/>
- <contains string="${version-output}" substring="java version &quot;1.3"/>
- </or>
- </condition>
- <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
- <istrue value="${have-jdk-older-than-1.4}"/>
- </condition>
- <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
- <os family="windows"/>
- </condition>
- <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
- <isset property="debug.transport"/>
- </condition>
- </target>
- <target depends="-init-debug-args" name="-init-macrodef-debug">
- <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${main.class}" name="classname"/>
- <attribute default="${debug.classpath}" name="classpath"/>
- <element name="customize" optional="true"/>
- <sequential>
- <java classname="@{classname}" dir="${work.dir}" fork="true">
- <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
- <jvmarg line="${debug-args-line}"/>
- <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
- <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
- <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
- <jvmarg line="${run.jvmargs}"/>
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="run-sys-prop."/>
- <mapper from="run-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <customize/>
- </java>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-macrodef-java">
- <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
- <attribute default="${main.class}" name="classname"/>
- <attribute default="${run.classpath}" name="classpath"/>
- <element name="customize" optional="true"/>
- <sequential>
- <java classname="@{classname}" dir="${work.dir}" fork="true">
- <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
- <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
- <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
- <jvmarg line="${run.jvmargs}"/>
- <classpath>
- <path path="@{classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="run-sys-prop."/>
- <mapper from="run-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <customize/>
- </java>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-macrodef-copylibs">
- <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
- <attribute default="${manifest.file}" name="manifest"/>
- <element name="customize" optional="true"/>
- <sequential>
- <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
- <pathconvert property="run.classpath.without.build.classes.dir">
- <path path="${run.classpath}"/>
- <map from="${build.classes.dir.resolved}" to=""/>
- </pathconvert>
- <pathconvert pathsep=" " property="jar.classpath">
- <path path="${run.classpath.without.build.classes.dir}"/>
- <chainedmapper>
- <flattenmapper/>
- <globmapper from="*" to="lib/*"/>
- </chainedmapper>
- </pathconvert>
- <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
- <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
- <fileset dir="${build.classes.dir}"/>
- <manifest>
- <attribute name="Class-Path" value="${jar.classpath}"/>
- <customize/>
- </manifest>
- </copylibs>
- </sequential>
- </macrodef>
- </target>
- <target name="-init-presetdef-jar">
- <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
- <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
- <j2seproject1:fileset dir="${build.classes.dir}"/>
- </jar>
- </presetdef>
- </target>
- <target name="-init-ap-cmdline-properties">
- <property name="annotation.processing.enabled" value="true"/>
- <property name="annotation.processing.processors.list" value=""/>
- <property name="annotation.processing.processor.options" value=""/>
- <property name="annotation.processing.run.all.processors" value="true"/>
- <property name="javac.processorpath" value="${javac.classpath}"/>
- <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
- <condition property="ap.supported.internal" value="true">
- <not>
- <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
- </not>
- </condition>
- </target>
- <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
- <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
- <isfalse value="${annotation.processing.run.all.processors}"/>
- </condition>
- <condition else="" property="ap.proc.none.internal" value="-proc:none">
- <isfalse value="${annotation.processing.enabled}"/>
- </condition>
- </target>
- <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
- <property name="ap.cmd.line.internal" value=""/>
- </target>
- <target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
- <!--
- ===================
- COMPILATION SECTION
- ===================
- -->
- <target name="-deps-jar-init" unless="built-jar.properties">
- <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
- <delete file="${built-jar.properties}" quiet="true"/>
- </target>
- <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
- <echo level="warn" message="Cycle detected: EssentialsPermissionsCommands was already built"/>
- </target>
- <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
- <mkdir dir="${build.dir}"/>
- <touch file="${built-jar.properties}" verbose="false"/>
- <property file="${built-jar.properties}" prefix="already.built.jar."/>
- <antcall target="-warn-already-built-jar"/>
- <propertyfile file="${built-jar.properties}">
- <entry key="${basedir}" value=""/>
- </propertyfile>
- <antcall target="-maybe-call-dep">
- <param name="call.built.properties" value="${built-jar.properties}"/>
- <param location="${project.Essentials}" name="call.subproject"/>
- <param location="${project.Essentials}/build.xml" name="call.script"/>
- <param name="call.target" value="jar"/>
- <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
- </antcall>
- </target>
- <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
- <target depends="init" name="-check-automatic-build">
- <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
- </target>
- <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
- <antcall target="clean"/>
- </target>
- <target depends="init,deps-jar" name="-pre-pre-compile">
- <mkdir dir="${build.classes.dir}"/>
- </target>
- <target name="-pre-compile">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target if="do.depend.true" name="-compile-depend">
- <pathconvert property="build.generated.subdirs">
- <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
- <include name="*"/>
- </dirset>
- </pathconvert>
- <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
- </target>
- <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
- <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
- <copy todir="${build.classes.dir}">
- <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
- </copy>
- </target>
- <target if="has.persistence.xml" name="-copy-persistence-xml">
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <copy todir="${build.classes.dir}/META-INF">
- <fileset dir="${meta.inf.dir}" includes="persistence.xml"/>
- </copy>
- </target>
- <target name="-post-compile">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
- <target name="-pre-compile-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
- <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
- <j2seproject3:force-recompile/>
- <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
- </target>
- <target name="-post-compile-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
- <!--
- ====================
- JAR BUILDING SECTION
- ====================
- -->
- <target depends="init" name="-pre-pre-jar">
- <dirname file="${dist.jar}" property="dist.jar.dir"/>
- <mkdir dir="${dist.jar.dir}"/>
- </target>
- <target name="-pre-jar">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
- <j2seproject1:jar/>
- </target>
- <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
- <j2seproject1:jar manifest="${manifest.file}"/>
- </target>
- <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
- <j2seproject1:jar manifest="${manifest.file}">
- <j2seproject1:manifest>
- <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
- </j2seproject1:manifest>
- </j2seproject1:jar>
- <echo level="info">To run this application from the command line without Ant, try:</echo>
- <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
- <property location="${dist.jar}" name="dist.jar.resolved"/>
- <pathconvert property="run.classpath.with.dist.jar">
- <path path="${run.classpath}"/>
- <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
- </pathconvert>
- <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
- </target>
- <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
- <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
- <touch file="${tmp.manifest.file}" verbose="false"/>
- </target>
- <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
- <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
- <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
- </target>
- <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
- <manifest file="${tmp.manifest.file}" mode="update">
- <attribute name="Main-Class" value="${main.class}"/>
- </manifest>
- </target>
- <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
- <basename file="${application.splash}" property="splashscreen.basename"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
- <manifest file="${tmp.manifest.file}" mode="update">
- <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
- </manifest>
- </target>
- <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
- <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
- <echo level="info">To run this application from the command line without Ant, try:</echo>
- <property location="${dist.jar}" name="dist.jar.resolved"/>
- <echo level="info">java -jar "${dist.jar.resolved}"</echo>
- </target>
- <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
- <delete>
- <fileset file="${tmp.manifest.file}"/>
- </delete>
- </target>
- <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
- <target name="-post-jar">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
- <!--
- =================
- EXECUTION SECTION
- =================
- -->
- <target depends="init,compile" description="Run a main class." name="run">
- <j2seproject1:java>
- <customize>
- <arg line="${application.args}"/>
- </customize>
- </j2seproject1:java>
- </target>
- <target name="-do-not-recompile">
- <property name="javac.includes.binary" value=""/>
- </target>
- <target depends="init,compile-single" name="run-single">
- <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
- <j2seproject1:java classname="${run.class}"/>
- </target>
- <target depends="init,compile-test-single" name="run-test-with-main">
- <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
- <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
- </target>
- <!--
- =================
- DEBUGGING SECTION
- =================
- -->
- <target depends="init" if="netbeans.home" name="-debug-start-debugger">
- <j2seproject1:nbjpdastart name="${debug.class}"/>
- </target>
- <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
- <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
- </target>
- <target depends="init,compile" name="-debug-start-debuggee">
- <j2seproject3:debug>
- <customize>
- <arg line="${application.args}"/>
- </customize>
- </j2seproject3:debug>
- </target>
- <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
- <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
- <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
- </target>
- <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
- <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
- <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
- <j2seproject3:debug classname="${debug.class}"/>
- </target>
- <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
- <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
- <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
- <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
- </target>
- <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
- <target depends="init" name="-pre-debug-fix">
- <fail unless="fix.includes">Must set fix.includes</fail>
- <property name="javac.includes" value="${fix.includes}.java"/>
- </target>
- <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
- <j2seproject1:nbjpdareload/>
- </target>
- <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
- <!--
- =================
- PROFILING SECTION
- =================
- -->
- <target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
- <nbprofiledirect>
- <classpath>
- <path path="${run.classpath}"/>
- </classpath>
- </nbprofiledirect>
- <profile/>
- </target>
- <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
- <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
- <nbprofiledirect>
- <classpath>
- <path path="${run.classpath}"/>
- </classpath>
- </nbprofiledirect>
- <profile classname="${profile.class}"/>
- </target>
- <!--
- =========================
- APPLET PROFILING SECTION
- =========================
- -->
- <target depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
- <nbprofiledirect>
- <classpath>
- <path path="${run.classpath}"/>
- </classpath>
- </nbprofiledirect>
- <profile classname="sun.applet.AppletViewer">
- <customize>
- <arg value="${applet.url}"/>
- </customize>
- </profile>
- </target>
- <!--
- =========================
- TESTS PROFILING SECTION
- =========================
- -->
- <target depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
- <nbprofiledirect>
- <classpath>
- <path path="${run.test.classpath}"/>
- </classpath>
- </nbprofiledirect>
- <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
- <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
- <jvmarg value="${profiler.info.jvmargs.agent}"/>
- <jvmarg line="${profiler.info.jvmargs}"/>
- <test name="${profile.class}"/>
- <classpath>
- <path path="${run.test.classpath}"/>
- </classpath>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <formatter type="brief" usefile="false"/>
- <formatter type="xml"/>
- </junit>
- </target>
- <!--
- ===============
- JAVADOC SECTION
- ===============
- -->
- <target depends="init" if="have.sources" name="-javadoc-build">
- <mkdir dir="${dist.javadoc.dir}"/>
- <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
- <classpath>
- <path path="${javac.classpath}"/>
- </classpath>
- <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
- <filename name="**/*.java"/>
- </fileset>
- <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
- <include name="**/*.java"/>
- <exclude name="*.java"/>
- </fileset>
- </javadoc>
- <copy todir="${dist.javadoc.dir}">
- <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
- <filename name="**/doc-files/**"/>
- </fileset>
- <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
- <include name="**/doc-files/**"/>
- </fileset>
- </copy>
- </target>
- <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
- <nbbrowse file="${dist.javadoc.dir}/index.html"/>
- </target>
- <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
- <!--
- =========================
- JUNIT COMPILATION SECTION
- =========================
- -->
- <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
- <mkdir dir="${build.test.classes.dir}"/>
- </target>
- <target name="-pre-compile-test">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target if="do.depend.true" name="-compile-test-depend">
- <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
- </target>
- <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
- <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
- <copy todir="${build.test.classes.dir}">
- <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
- </copy>
- </target>
- <target name="-post-compile-test">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
- <target name="-pre-compile-test-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
- <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
- <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
- <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
- <copy todir="${build.test.classes.dir}">
- <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
- </copy>
- </target>
- <target name="-post-compile-test-single">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
- <!--
- =======================
- JUNIT EXECUTION SECTION
- =======================
- -->
- <target depends="init" if="have.tests" name="-pre-test-run">
- <mkdir dir="${build.test.results.dir}"/>
- </target>
- <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
- <j2seproject3:junit testincludes="**/*Test.java"/>
- </target>
- <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
- <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
- </target>
- <target depends="init" if="have.tests" name="test-report"/>
- <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
- <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
- <target depends="init" if="have.tests" name="-pre-test-run-single">
- <mkdir dir="${build.test.results.dir}"/>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
- <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
- <j2seproject3:junit excludes="" includes="${test.includes}"/>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
- <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
- </target>
- <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
- <!--
- =======================
- JUNIT DEBUGGING SECTION
- =======================
- -->
- <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
- <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
- <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
- <delete file="${test.report.file}"/>
- <mkdir dir="${build.test.results.dir}"/>
- <j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
- <customize>
- <syspropertyset>
- <propertyref prefix="test-sys-prop."/>
- <mapper from="test-sys-prop.*" to="*" type="glob"/>
- </syspropertyset>
- <arg value="${test.class}"/>
- <arg value="showoutput=true"/>
- <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
- <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
- </customize>
- </j2seproject3:debug>
- </target>
- <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
- <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
- </target>
- <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
- <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
- <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
- </target>
- <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
- <!--
- =========================
- APPLET EXECUTION SECTION
- =========================
- -->
- <target depends="init,compile-single" name="run-applet">
- <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
- <j2seproject1:java classname="sun.applet.AppletViewer">
- <customize>
- <arg value="${applet.url}"/>
- </customize>
- </j2seproject1:java>
- </target>
- <!--
- =========================
- APPLET DEBUGGING SECTION
- =========================
- -->
- <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
- <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
- <j2seproject3:debug classname="sun.applet.AppletViewer">
- <customize>
- <arg value="${applet.url}"/>
- </customize>
- </j2seproject3:debug>
- </target>
- <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
- <!--
- ===============
- CLEANUP SECTION
- ===============
- -->
- <target name="-deps-clean-init" unless="built-clean.properties">
- <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
- <delete file="${built-clean.properties}" quiet="true"/>
- </target>
- <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
- <echo level="warn" message="Cycle detected: EssentialsPermissionsCommands was already built"/>
- </target>
- <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
- <mkdir dir="${build.dir}"/>
- <touch file="${built-clean.properties}" verbose="false"/>
- <property file="${built-clean.properties}" prefix="already.built.clean."/>
- <antcall target="-warn-already-built-clean"/>
- <propertyfile file="${built-clean.properties}">
- <entry key="${basedir}" value=""/>
- </propertyfile>
- <antcall target="-maybe-call-dep">
- <param name="call.built.properties" value="${built-clean.properties}"/>
- <param location="${project.Essentials}" name="call.subproject"/>
- <param location="${project.Essentials}/build.xml" name="call.script"/>
- <param name="call.target" value="clean"/>
- <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
- </antcall>
- </target>
- <target depends="init" name="-do-clean">
- <delete dir="${build.dir}"/>
- <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
- </target>
- <target name="-post-clean">
- <!-- Empty placeholder for easier customization. -->
- <!-- You can override this target in the ../build.xml file. -->
- </target>
- <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
- <target name="-check-call-dep">
- <property file="${call.built.properties}" prefix="already.built."/>
- <condition property="should.call.dep">
- <not>
- <isset property="already.built.${call.subproject}"/>
- </not>
- </condition>
- </target>
- <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
- <ant antfile="${call.script}" inheritall="false" target="${call.target}">
- <propertyset>
- <propertyref prefix="transfer."/>
- <mapper from="transfer.*" to="*" type="glob"/>
- </propertyset>
- </ant>
- </target>
-</project>
diff --git a/EssentialsPermissionsCommands/nbproject/genfiles.properties b/EssentialsPermissionsCommands/nbproject/genfiles.properties
deleted file mode 100644
index f8c79511e..000000000
--- a/EssentialsPermissionsCommands/nbproject/genfiles.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-build.xml.data.CRC32=9c3a069f
-build.xml.script.CRC32=0a912bb3
-build.xml.stylesheet.CRC32=28e38971@1.43.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=9c3a069f
-nbproject/build-impl.xml.script.CRC32=2a10b0d4
-nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
diff --git a/EssentialsPermissionsCommands/nbproject/project.properties b/EssentialsPermissionsCommands/nbproject/project.properties
deleted file mode 100644
index 0a74a6dea..000000000
--- a/EssentialsPermissionsCommands/nbproject/project.properties
+++ /dev/null
@@ -1,125 +0,0 @@
-annotation.processing.enabled=true
-annotation.processing.enabled.in.editor=false
-annotation.processing.run.all.processors=true
-annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
-application.title=EssentialsPermissionsCommands
-application.vendor=
-auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=true
-auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=2
-auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=2
-auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=2
-auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=120
-auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none
-auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAnnotationArgs=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineArrayInit=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAssignment=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineBinaryOp=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineCallArgs=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineDisjunctiveCatchTypes=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineFor=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineImplements=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineMethodParams=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineParenthesized=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTernaryOp=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineThrows=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTryResources=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesAfterClassHeader=0
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement=NEW_LINE
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeCatchOnNewLine=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
-auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-# Uncomment to specify the preferred debugger connection transport:
-#debug.transport=dt_socket
-debug.classpath=\
- ${run.classpath}
-debug.test.classpath=\
- ${run.test.classpath}
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/EssentialsPermissionsCommands.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-endorsed.classpath=
-excludes=
-file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar
-file.reference.Permissions3.jar=../lib/Permissions3.jar
-includes=**
-jar.archive.disabled=${jnlp.enabled}
-jar.compress=true
-jar.index=${jnlp.enabled}
-javac.classpath=\
- ${reference.Essentials.jar}:\
- ${file.reference.Permissions3.jar}:\
- ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}
-# Space-separated list of extra javac options
-javac.compilerargs=
-javac.deprecation=false
-javac.processorpath=\
- ${javac.classpath}
-javac.source=1.6
-javac.target=1.6
-javac.test.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-javac.test.processorpath=\
- ${javac.test.classpath}
-javadoc.additionalparam=
-javadoc.author=false
-javadoc.encoding=${source.encoding}
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=true
-javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=
-jnlp.codebase.type=no.codebase
-jnlp.descriptor=application
-jnlp.enabled=false
-jnlp.mixed.code=default
-jnlp.offline-allowed=false
-jnlp.signed=false
-jnlp.signing=
-jnlp.signing.alias=
-jnlp.signing.keystore=
-main.class=
-manifest.file=manifest.mf
-meta.inf.dir=${src.dir}/META-INF
-mkdist.disabled=true
-platform.active=default_platform
-project.Essentials=../Essentials
-reference.Essentials.jar=${project.Essentials}/dist/Essentials.jar
-run.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-# Space-separated list of JVM arguments used when running the project
-# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
-# or test-sys-prop.name=value to set system properties for unit tests):
-run.jvmargs=
-run.test.classpath=\
- ${javac.test.classpath}:\
- ${build.test.classes.dir}
-source.encoding=UTF-8
-src.dir=src
-test.src.dir=test
diff --git a/EssentialsPermissionsCommands/nbproject/project.xml b/EssentialsPermissionsCommands/nbproject/project.xml
deleted file mode 100644
index 89e773c31..000000000
--- a/EssentialsPermissionsCommands/nbproject/project.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://www.netbeans.org/ns/project/1">
- <type>org.netbeans.modules.java.j2seproject</type>
- <configuration>
- <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
- <name>EssentialsPermissionsCommands</name>
- <source-roots>
- <root id="src.dir"/>
- </source-roots>
- <test-roots>
- <root id="test.src.dir"/>
- </test-roots>
- </data>
- <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
- <definitions>../lib/nblibraries.properties</definitions>
- </libraries>
- <references xmlns="http://www.netbeans.org/ns/ant-project-references/1">
- <reference>
- <foreign-project>Essentials</foreign-project>
- <artifact-type>jar</artifact-type>
- <script>build.xml</script>
- <target>jar</target>
- <clean-target>clean</clean-target>
- <id>jar</id>
- </reference>
- </references>
- </configuration>
-</project>
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangadd.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangadd.java
deleted file mode 100644
index 8c22dabdc..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangadd.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmangadd extends EssentialsCommand
-{
- public Commandmangadd()
- {
- super("mangadd");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 1)
- {
- throw new NotEnoughArgumentsException();
- }
- final String group = args[0];
- String command = "permissions g:" + group + " create";
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddi.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddi.java
deleted file mode 100644
index 760b5c81f..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddi.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmangaddi extends EssentialsCommand
-{
- public Commandmangaddi()
- {
- super("mangaddi");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 2)
- {
- throw new NotEnoughArgumentsException();
- }
- final String target = args[0];
- final String group = args[1];
- String command = "permissions g:"+target+" parents add "+group;
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddp.java
deleted file mode 100644
index e83de4e50..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddp.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmangaddp extends EssentialsCommand
-{
- public Commandmangaddp()
- {
- super("mangaddp");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 2)
- {
- throw new NotEnoughArgumentsException();
- }
- final String target = args[0];
- final String perm = args[1];
- String command = "permissions g:"+target+" perms add "+perm;
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangcheckp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangcheckp.java
deleted file mode 100644
index 1152d1a0b..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangcheckp.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmangcheckp extends EssentialsCommand
-{
- public Commandmangcheckp()
- {
- super("mangcheckp");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 2)
- {
- throw new NotEnoughArgumentsException();
- }
- final String target = args[0];
- final String perm = args[1];
- String command = "permissions g:"+target+" has "+perm;
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdel.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdel.java
deleted file mode 100644
index 24ffe2307..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdel.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmangdel extends EssentialsCommand
-{
- public Commandmangdel()
- {
- super("mangdel");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 1)
- {
- throw new NotEnoughArgumentsException();
- }
- final String group = args[0];
- String command = "permissions g:"+group+" delete";
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdeli.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdeli.java
deleted file mode 100644
index aea296735..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdeli.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmangdeli extends EssentialsCommand
-{
- public Commandmangdeli()
- {
- super("mangdeli");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 2)
- {
- throw new NotEnoughArgumentsException();
- }
- final String target = args[0];
- final String group = args[1];
- String command = "permissions g:"+target+" parents remove "+group;
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdelp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdelp.java
deleted file mode 100644
index ef1dd4207..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdelp.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmangdelp extends EssentialsCommand
-{
- public Commandmangdelp()
- {
- super("mangdelp");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 2)
- {
- throw new NotEnoughArgumentsException();
- }
- final String target = args[0];
- final String perm = args[1];
- String command = "permissions g:"+target+" perms remove "+perm;
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanglistp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanglistp.java
deleted file mode 100644
index 715f42774..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanglistp.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmanglistp extends EssentialsCommand
-{
- public Commandmanglistp()
- {
- super("manglistp");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 1)
- {
- throw new NotEnoughArgumentsException();
- }
- final String target = args[0];
- String command = "permissions g:"+target+" perms list";
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanload.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanload.java
deleted file mode 100644
index 390cb78eb..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanload.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmanload extends EssentialsCommand
-{
- public Commandmanload()
- {
- super("manload");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- String world = "all";
- if (args.length > 1)
- {
- world = args[0];
- }
- String command = "permissions -reload "+world;
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java
deleted file mode 100644
index a63a1a36b..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmanuadd extends EssentialsCommand
-{
- public Commandmanuadd()
- {
- super("manuadd");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 2)
- {
- throw new NotEnoughArgumentsException();
- }
- final String player = args[0];
- final String group = args[1];
- //TODO: Make this command add a player if it doesnt exist /permissions +player+ create
- String command = "permissions "+player+" parents add "+group;
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddp.java
deleted file mode 100644
index 3d3d67c72..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddp.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmanuaddp extends EssentialsCommand
-{
- public Commandmanuaddp()
- {
- super("manuaddp");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 2)
- {
- throw new NotEnoughArgumentsException();
- }
- final String player = args[0];
- final String perm = args[1];
- String command = "permissions "+player+" perms add "+perm;
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddsub.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddsub.java
deleted file mode 100644
index 60d1980af..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddsub.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmanuaddsub extends EssentialsCommand
-{
- public Commandmanuaddsub()
- {
- super("manuaddsub");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 2)
- {
- throw new NotEnoughArgumentsException();
- }
- final String player = args[0];
- final String group = args[1];
- String command = "permissions "+player+" parents add "+group;
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanucheckp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanucheckp.java
deleted file mode 100644
index 634b447c7..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanucheckp.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmanucheckp extends EssentialsCommand
-{
- public Commandmanucheckp()
- {
- super("manucheckp");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 2)
- {
- throw new NotEnoughArgumentsException();
- }
- final String player = args[0];
- final String perm = args[1];
- String command = "permissions "+player+" has "+perm;
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudel.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudel.java
deleted file mode 100644
index 72c8fc2af..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudel.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmanudel extends EssentialsCommand
-{
- public Commandmanudel()
- {
- super("manudel");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 1)
- {
- throw new NotEnoughArgumentsException();
- }
- final String player = args[0];
- String command = "permissions "+player+" delete";
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelp.java
deleted file mode 100644
index 01adf97b2..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelp.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmanudelp extends EssentialsCommand
-{
- public Commandmanudelp()
- {
- super("manudelp");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 2)
- {
- throw new NotEnoughArgumentsException();
- }
- final String player = args[0];
- final String perm = args[1];
- String command = "permissions "+player+" perms remove "+perm;
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelsub.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelsub.java
deleted file mode 100644
index 1a1ae2a6d..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelsub.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmanudelsub extends EssentialsCommand
-{
- public Commandmanudelsub()
- {
- super("manudelsub");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 2)
- {
- throw new NotEnoughArgumentsException();
- }
- final String player = args[0];
- final String group = args[1];
- String command = "permissions "+player+" parents remove "+group;
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanulistp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanulistp.java
deleted file mode 100644
index f809f3c61..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanulistp.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.commands.EssentialsCommand;
-import com.earth2me.essentials.commands.NotEnoughArgumentsException;
-import org.bukkit.Server;
-import org.bukkit.command.CommandSender;
-
-
-public class Commandmanulistp extends EssentialsCommand
-{
- public Commandmanulistp()
- {
- super("manulistp");
- }
-
- @Override
- protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
- {
- if (args.length < 1)
- {
- throw new NotEnoughArgumentsException();
- }
- final String player = args[0];
- String command = "permissions "+player+" perms list";
- sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
- ess.getServer().dispatchCommand(sender, command);
- }
-
-
-}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java
deleted file mode 100644
index 14e9a117c..000000000
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.earth2me.essentials.permissions;
-
-import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.Util;
-import com.nijiko.permissions.PermissionHandler;
-import com.nijikokun.bukkit.Permissions.Permissions;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.bukkit.command.Command;
-import org.bukkit.command.CommandSender;
-import org.bukkit.plugin.Plugin;
-import org.bukkit.plugin.PluginManager;
-import org.bukkit.plugin.java.JavaPlugin;
-
-
-public class EssentialsPermissionsCommands extends JavaPlugin
-{
- private static PermissionHandler permissionHandler = null;
- private static final Logger LOGGER = Logger.getLogger("Minecraft");
- private IEssentials ess;
-
- public static PermissionHandler getPermissionHandler()
- {
- return permissionHandler;
- }
-
- @Override
- public void onEnable()
- {
- final PluginManager pluginManager = getServer().getPluginManager();
- final Plugin permissionsPlugin = pluginManager.getPlugin("Permissions");
-
- if (permissionsPlugin != null
- && permissionsPlugin.getDescription().getVersion().charAt(0) == '3')
- {
- permissionHandler = ((Permissions)permissionsPlugin).getHandler();
- }
- ess = (IEssentials)pluginManager.getPlugin("Essentials");
-
- if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) {
- LOGGER.log(Level.WARNING, Util.i18n("versionMismatchAll"));
- }
- LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
-
- }
-
- @Override
- public boolean onCommand(final CommandSender sender, final Command command, final String label, final String[] args)
- {
- return ess.onCommandEssentials(sender, command, label, args, EssentialsPermissionsCommands.class.getClassLoader(), "com.earth2me.essentials.permissions.Command", "groupmanager.");
- }
-
- @Override
- public void onDisable()
- {
- }
-}
diff --git a/EssentialsPermissionsCommands/src/plugin.yml b/EssentialsPermissionsCommands/src/plugin.yml
deleted file mode 100644
index a13023a5c..000000000
--- a/EssentialsPermissionsCommands/src/plugin.yml
+++ /dev/null
@@ -1,166 +0,0 @@
-# This determines the command prefix when there are conflicts (/name:home, /name:help, etc.)
-name: EssentialsPermissionsCommands
-main: com.earth2me.essentials.permissions.EssentialsPermissionsCommands
-# Note to developers: This next line cannot change, or the automatic versioning system will break.
-version: TeamCity
-website: http://www.earth2me.net:8001/
-description: Adds commands aliases to Permissions 3
-authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
-depend: [Permissions, Essentials]
-commands:
- manuadd:
- description: Move a player to desired group.(Adds to the file if not exists)
- usage: /<command> <player> <group>
- permission: groupmanager.manuadd
- manudel:
- description: Remove any user specific configuration. Make him default group.
- usage: /<command> <player>
- permission: groupmanager.manudel
- manuaddsub:
- description: Add a group to a player's subgroup list.
- usage: /<command> <player> <group>
- permission: groupmanager.manuaddsub
- manudelsub:
- description: Remove a group to a player's subgroup list.
- usage: /<command> <player> <group>
- permission: groupmanager.manudelsub
- mangadd:
- description: Add group to the system.
- usage: /<command> <group>
- permission: groupmanager.mangadd
- mangdel:
- description: Removes group from the system(all it's users become default)
- usage: /<command> <group>
- permission: groupmanager.mangdel
- manuaddp:
- description: Add permission diretly to the player.
- usage: /<command> <player> <permission>
- permission: groupmanager.manuaddp
- manudelp:
- description: Removes permission diretly from the player.
- usage: /<command> <player> <permission>
- permission: groupmanager.manudelp
- manulistp:
- description: List all permissions from a player.
- usage: /<command> <player>
- permission: groupmanager.manulistp
- manucheckp:
- description: Verify if user has a permission, and where it comes from.
- usage: /<command> <player> <permission>
- permission: groupmanager.manucheckp
- mangaddp:
- description: Add permission to a group.
- usage: /<command> <group> <permission>
- permission: groupmanager.mangaddp
- mangdelp:
- description: Removes permission from a group.
- usage: /<command> <group> <permission>
- permission: groupmanager.mangdelp
- manglistp:
- description: Lists all permissions from a group.
- usage: /<command> <group>
- permission: groupmanager.manglistp
- mangcheckp:
- description: Check if group has a permission, and where it comes from.
- usage: /<command> <group> <permission>
- permission: groupmanager.mangcheckp
- mangaddi:
- description: Add a group to another group inheritance list.
- usage: /<command> <group1> <group2>
- permission: groupmanager.mangaddi
- mangdeli:
- description: Remove a group from another group inheritance list.
- usage: /<command> <group1> <group2>
- permission: groupmanager.mangdeli
- manuaddv:
- description: Add, or replaces, a variable to a user (like prefix or suffix).
- usage: /<command> <user> <variable> <value>
- permission: groupmanager.manuaddv
- manudelv:
- description: Remove a variable from a user.
- usage: /<command> <user> <variable>
- permission: groupmanager.manudelv
- manulistv:
- description: List variables a user has (like prefix or suffix).
- usage: /<command> <user>
- permission: groupmanager.manulistv
- manucheckv:
- description: Verify a value of a variable of user, and where it comes from.
- usage: /<command> <user> <variable>
- permission: groupmanager.manucheckv
- mangaddv:
- description: Add, or replaces, a variable to a group (like prefix or suffix).
- usage: /<command> <group> <variable> <value>
- permission: groupmanager.mangaddv
- mangdelv:
- description: Remove a variable from a group.
- usage: /<command> <group> <variable>
- permission: groupmanager.mangdelv
- manglistv:
- description: List variables a group has (like prefix or suffix).
- usage: /<command> <group>
- permission: groupmanager.manglistv
- mangcheckv:
- description: Verify a value of a variable of group, and where it comes from.
- usage: /<command> <group> <variable>
- permission: groupmanager.mangcheckv
- manwhois:
- description: Tell the group that user belongs.
- usage: /<command> <player>
- permission: groupmanager.manwhois
- tempadd:
- description: Creates a temporary permission copy for that user.
- usage: /<command> <player>
- permission: groupmanager.tempadd
- tempdel:
- description: Remove the temporary permission copy for player.
- usage: /<command> <player>
- permission: groupmanager.tempdel
- templist:
- description: List players in overload-permissions mode made by /tempadd.
- usage: /<command>
- permission: groupmanager.templist
- tempdelall:
- description: Remove all overrides made by command /tempadd.
- usage: /<command>
- permission: groupmanager.tempdelall
- mansave:
- description: Save all permissions on file.
- usage: /<command>
- permission: groupmanager.mansave
- manload:
- description: Reload current world and config.yml. Or load given world.
- usage: /<command> [world]
- permission: groupmanager.manload
- listgroups:
- description: List the groups available.
- usage: /<command>
- permission: groupmanager.listgroups
- manpromote:
- description: Promote a player in the same heritage line to a higher rank.
- usage: /<command> <player> <group>
- permission: groupmanager.manpromote
- mandemote:
- description: Demote a player in the same heritage line to a lower rank.
- usage: /<command> <player> <group>
- permission: groupmanager.mandemote
- mantogglevalidate:
- description: Toggle on/off the validating if player is online.
- usage: /<command>
- permission: groupmanager.mantogglevalidate
- mantogglesave:
- description: Toggle on/ff the autosave.
- usage: /<command>
- permission: groupmanager.mantogglesave
- manworld:
- description: Prints the selected world name
- usage: /<command>
- permission: groupmanager.manworld
- manselect:
- description: Select a world to work with next commands.
- usage: /<command> <world>
- permission: groupmanager.manselect
- manclear:
- description: Clear world selection. Next commands will work on your world.
- usage: /<command>
- permission: groupmanager.manclear
diff --git a/EssentialsProtect/MANIFEST.MF b/EssentialsProtect/MANIFEST.MF
index db70a3fda..9d885be53 100644
--- a/EssentialsProtect/MANIFEST.MF
+++ b/EssentialsProtect/MANIFEST.MF
@@ -1,2 +1 @@
Manifest-Version: 1.0
-Class-Path: ../lib/mysql.jar ../lib/sqlite.jar
diff --git a/EssentialsProtect/nbproject/build-impl.xml b/EssentialsProtect/nbproject/build-impl.xml
index 1c9bf07bf..8cfd93877 100644
--- a/EssentialsProtect/nbproject/build-impl.xml
+++ b/EssentialsProtect/nbproject/build-impl.xml
@@ -20,10 +20,10 @@ is divided into following sections:
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="EssentialsProtect-impl">
- <fail message="Please build using Ant 1.7.1 or higher.">
+ <fail message="Please build using Ant 1.8.0 or higher.">
<condition>
<not>
- <antversion atleast="1.7.1"/>
+ <antversion atleast="1.8.0"/>
</not>
</condition>
</fail>
@@ -223,6 +223,7 @@ is divided into following sections:
<property name="javac.fork" value="${jdkBug6558476}"/>
<property name="jar.index" value="false"/>
<property name="jar.index.metainf" value="${jar.index}"/>
+ <property name="copylibs.rebase" value="true"/>
<available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
</target>
<target name="-post-init">
@@ -409,6 +410,7 @@ is divided into following sections:
<property environment="env"/>
<resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
<java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
@@ -539,7 +541,7 @@ is divided into following sections:
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
- <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+ <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
@@ -871,6 +873,14 @@ is divided into following sections:
-->
<target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
+ <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+ <and>
+ <isset property="endorsed.classpath.cmd.line.arg"/>
+ <not>
+ <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+ </not>
+ </and>
+ </condition>
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
<classpath>
<path path="${javac.classpath}"/>
@@ -882,6 +892,7 @@ is divided into following sections:
<include name="**/*.java"/>
<exclude name="*.java"/>
</fileset>
+ <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
</javadoc>
<copy todir="${dist.javadoc.dir}">
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
diff --git a/EssentialsProtect/nbproject/genfiles.properties b/EssentialsProtect/nbproject/genfiles.properties
index 728aaf424..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=0e9dab07
-nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
+nbproject/build-impl.xml.script.CRC32=cdb3fc6f
+nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
diff --git a/EssentialsProtect/nbproject/project.properties b/EssentialsProtect/nbproject/project.properties
index dd5d0fd22..77c12c248 100644
--- a/EssentialsProtect/nbproject/project.properties
+++ b/EssentialsProtect/nbproject/project.properties
@@ -28,6 +28,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blank
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=*
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE
@@ -36,6 +37,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.place
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
@@ -61,16 +63,16 @@ dist.jar=${dist.dir}/original-EssentialsProtect.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
+file.reference.bukkit.jar=../lib/bukkit.jar
file.reference.c3p0-0.9.1.2.jar=..\\lib\\c3p0-0.9.1.2.jar
-file.reference.craftbukkit-0.0.1-SNAPSHOT.jar=..\\lib\\craftbukkit-0.0.1-SNAPSHOT.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=true
jar.index=${jnlp.enabled}
javac.classpath=\
${reference.Essentials.jar}:\
- ${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}:\
- ${file.reference.c3p0-0.9.1.2.jar}
+ ${file.reference.c3p0-0.9.1.2.jar}:\
+ ${file.reference.bukkit.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
@@ -81,8 +83,7 @@ javac.target=1.6
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
- ${libs.junit.classpath}:\
- ${libs.junit_4.classpath}
+ ${libs.junit_4.10.classpath}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyBlockListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyBlockListener.java
new file mode 100644
index 000000000..479d2eda6
--- /dev/null
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyBlockListener.java
@@ -0,0 +1,36 @@
+package com.earth2me.essentials.protect;
+
+import org.bukkit.event.block.BlockBreakEvent;
+import org.bukkit.event.block.BlockBurnEvent;
+import org.bukkit.event.block.BlockFromToEvent;
+import org.bukkit.event.block.BlockIgniteEvent;
+import org.bukkit.event.block.BlockListener;
+
+
+public class EmergencyBlockListener extends BlockListener
+{
+
+ @Override
+ public void onBlockBurn(final BlockBurnEvent event)
+ {
+ event.setCancelled(true);
+ }
+
+ @Override
+ public void onBlockIgnite(final BlockIgniteEvent event)
+ {
+ event.setCancelled(true);
+ }
+
+ @Override
+ public void onBlockFromTo(final BlockFromToEvent event)
+ {
+ event.setCancelled(true);
+ }
+
+ @Override
+ public void onBlockBreak(final BlockBreakEvent event)
+ {
+ event.setCancelled(true);
+ }
+}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyEntityListener.java
new file mode 100644
index 000000000..a220f07d5
--- /dev/null
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyEntityListener.java
@@ -0,0 +1,22 @@
+package com.earth2me.essentials.protect;
+
+import org.bukkit.event.entity.EntityDamageEvent;
+import org.bukkit.event.entity.EntityExplodeEvent;
+import org.bukkit.event.entity.EntityListener;
+
+
+public class EmergencyEntityListener extends EntityListener
+{
+
+ @Override
+ public void onEntityExplode(final EntityExplodeEvent event)
+ {
+ event.setCancelled(true);
+ }
+
+ @Override
+ public void onEntityDamage(final EntityDamageEvent event)
+ {
+ event.setCancelled(true);
+ }
+}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyPlayerListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyPlayerListener.java
new file mode 100644
index 000000000..e92325946
--- /dev/null
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EmergencyPlayerListener.java
@@ -0,0 +1,16 @@
+package com.earth2me.essentials.protect;
+
+import org.bukkit.event.player.PlayerJoinEvent;
+import org.bukkit.event.player.PlayerListener;
+
+
+public class EmergencyPlayerListener extends PlayerListener
+{
+
+ @Override
+ public void onPlayerJoin(PlayerJoinEvent event)
+ {
+ event.getPlayer().sendMessage("Essentials Protect is in emergency mode. Check your log for errors.");
+ }
+
+}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java
new file mode 100644
index 000000000..569123cd5
--- /dev/null
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java
@@ -0,0 +1,124 @@
+package com.earth2me.essentials.protect;
+
+import com.earth2me.essentials.IConf;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.protect.data.ProtectedBlockMemory;
+import com.earth2me.essentials.protect.data.ProtectedBlockMySQL;
+import com.earth2me.essentials.protect.data.ProtectedBlockSQLite;
+import java.beans.PropertyVetoException;
+import static com.earth2me.essentials.I18n._;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.bukkit.Location;
+import org.bukkit.entity.Player;
+import org.bukkit.plugin.Plugin;
+
+
+public class EssentialsConnect
+{
+ private static final Logger LOGGER = Logger.getLogger("Minecraft");
+ private final transient IEssentials ess;
+ private final transient IProtect protect;
+
+ public EssentialsConnect(Plugin essPlugin, Plugin essProtect)
+ {
+ if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion()))
+ {
+ LOGGER.log(Level.WARNING, _("versionMismatchAll"));
+ }
+ ess = (IEssentials)essPlugin;
+ protect = (IProtect)essProtect;
+ ProtectReloader pr = new ProtectReloader();
+ pr.reloadConfig();
+ ess.addReloadListener(pr);
+ LOGGER.info(_("loadinfo", essProtect.getDescription().getName(), essProtect.getDescription().getVersion(), "essentials team"));
+
+ }
+
+ public void onDisable()
+ {
+ }
+
+ public IEssentials getEssentials()
+ {
+ return ess;
+ }
+
+ public void alert(final User user, final String item, final String type)
+ {
+ final Location loc = user.getLocation();
+ final String warnMessage = _("alertFormat", user.getName(), type, item,
+ loc.getWorld().getName() + "," + loc.getBlockX() + ","
+ + loc.getBlockY() + "," + loc.getBlockZ());
+ LOGGER.log(Level.WARNING, warnMessage);
+ for (Player p : ess.getServer().getOnlinePlayers())
+ {
+ final User alertUser = ess.getUser(p);
+ if (alertUser.isAuthorized("essentials.protect.alerts"))
+ {
+ alertUser.sendMessage(warnMessage);
+ }
+ }
+ }
+
+
+ private class ProtectReloader implements IConf
+ {
+ @Override
+ public void reloadConfig()
+ {
+ if (protect.getStorage() != null)
+ {
+ protect.getStorage().onPluginDeactivation();
+ }
+ for (ProtectConfig protectConfig : ProtectConfig.values())
+ {
+ if (protectConfig.isList())
+ {
+ protect.getSettingsList().put(protectConfig, ess.getSettings().getProtectList(protectConfig.getConfigName()));
+ }
+ else if (protectConfig.isString())
+ {
+ protect.getSettingsString().put(protectConfig, ess.getSettings().getProtectString(protectConfig.getConfigName()));
+ }
+ else
+ {
+ protect.getSettingsBoolean().put(protectConfig, ess.getSettings().getProtectBoolean(protectConfig.getConfigName(), protectConfig.getDefaultValueBoolean()));
+ }
+
+ }
+
+ if (protect.getSettingString(ProtectConfig.datatype).equalsIgnoreCase("mysql"))
+ {
+ try
+ {
+ protect.setStorage(new ProtectedBlockMySQL(
+ protect.getSettingString(ProtectConfig.mysqlDB),
+ protect.getSettingString(ProtectConfig.dbUsername),
+ protect.getSettingString(ProtectConfig.dbPassword)));
+ }
+ catch (PropertyVetoException ex)
+ {
+ LOGGER.log(Level.SEVERE, null, ex);
+ }
+ }
+ else
+ {
+ try
+ {
+ protect.setStorage(new ProtectedBlockSQLite("jdbc:sqlite:plugins/Essentials/EssentialsProtect.db"));
+ }
+ catch (PropertyVetoException ex)
+ {
+ LOGGER.log(Level.SEVERE, null, ex);
+ }
+ }
+ if (protect.getSettingBool(ProtectConfig.memstore))
+ {
+ protect.setStorage(new ProtectedBlockMemory(protect.getStorage(), protect));
+ }
+
+ }
+ }
+}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java
index 98daf26cb..e313298cd 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java
@@ -1,14 +1,6 @@
package com.earth2me.essentials.protect;
-import com.earth2me.essentials.IConf;
-import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import com.earth2me.essentials.protect.data.IProtectedBlock;
-import com.earth2me.essentials.protect.data.ProtectedBlockMemory;
-import com.earth2me.essentials.protect.data.ProtectedBlockMySQL;
-import com.earth2me.essentials.protect.data.ProtectedBlockSQLite;
-import java.beans.PropertyVetoException;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
@@ -16,15 +8,15 @@ import java.util.logging.Filter;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
-import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.Event.Priority;
import org.bukkit.event.Event.Type;
+import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
-public class EssentialsProtect extends JavaPlugin implements IConf, IProtect
+public class EssentialsProtect extends JavaPlugin implements IProtect
{
private static final Logger LOGGER = Logger.getLogger("Minecraft");
private static com.mchange.v2.log.MLogger C3P0logger;
@@ -32,7 +24,7 @@ public class EssentialsProtect extends JavaPlugin implements IConf, IProtect
private final transient Map<ProtectConfig, String> settingsString = new EnumMap<ProtectConfig, String>(ProtectConfig.class);
private final transient Map<ProtectConfig, List<Integer>> settingsList = new EnumMap<ProtectConfig, List<Integer>>(ProtectConfig.class);
private transient IProtectedBlock storage = null;
- public transient IEssentials ess = null;
+ private transient EssentialsConnect ess = null;
@Override
public void onLoad()
@@ -50,7 +42,13 @@ public class EssentialsProtect extends JavaPlugin implements IConf, IProtect
public void onEnable()
{
final PluginManager pm = this.getServer().getPluginManager();
- ess = (IEssentials)pm.getPlugin("Essentials");
+ final Plugin essPlugin = pm.getPlugin("Essentials");
+ if (essPlugin == null || !essPlugin.isEnabled())
+ {
+ enableEmergencyMode(pm);
+ return;
+ }
+ ess = new EssentialsConnect(essPlugin, this);
final EssentialsProtectPlayerListener playerListener = new EssentialsProtectPlayerListener(this);
pm.registerEvent(Type.PLAYER_INTERACT, playerListener, Priority.Low, this);
@@ -76,14 +74,25 @@ public class EssentialsProtect extends JavaPlugin implements IConf, IProtect
pm.registerEvent(Type.LIGHTNING_STRIKE, weatherListener, Priority.Highest, this);
pm.registerEvent(Type.THUNDER_CHANGE, weatherListener, Priority.Highest, this);
pm.registerEvent(Type.WEATHER_CHANGE, weatherListener, Priority.Highest, this);
+ }
- reloadConfig();
- ess.addReloadListener(this);
- if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
+ private void enableEmergencyMode(final PluginManager pm)
+ {
+ final EmergencyBlockListener emBlockListener = new EmergencyBlockListener();
+ final EmergencyEntityListener emEntityListener = new EmergencyEntityListener();
+ final EmergencyPlayerListener emPlayerListener = new EmergencyPlayerListener();
+ pm.registerEvent(Type.PLAYER_JOIN, emPlayerListener, Priority.Low, this);
+ pm.registerEvent(Type.BLOCK_BURN, emBlockListener, Priority.Low, this);
+ pm.registerEvent(Type.BLOCK_IGNITE, emBlockListener, Priority.Low, this);
+ pm.registerEvent(Type.BLOCK_FROMTO, emBlockListener, Priority.Low, this);
+ pm.registerEvent(Type.BLOCK_BREAK, emBlockListener, Priority.Low, this);
+ pm.registerEvent(Type.ENTITY_DAMAGE, emEntityListener, Priority.Low, this);
+ pm.registerEvent(Type.ENTITY_EXPLODE, emEntityListener, Priority.Low, this);
+ for (Player player : getServer().getOnlinePlayers())
{
- LOGGER.log(Level.WARNING, Util.i18n("versionMismatchAll"));
+ player.sendMessage("Essentials Protect is in emergency mode. Check your log for errors.");
}
- LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
+ LOGGER.log(Level.SEVERE, "Essentials not installed or failed to load. Essenials Protect is in emergency mode now.");
}
@Override
@@ -94,81 +103,35 @@ public class EssentialsProtect extends JavaPlugin implements IConf, IProtect
}
@Override
- public void alert(final User user, final String item, final String type)
+ public IProtectedBlock getStorage()
{
- final Location loc = user.getLocation();
- final String warnMessage = Util.format("alertFormat", user.getName(), type, item,
- loc.getWorld().getName() + "," + loc.getBlockX() + ","
- + loc.getBlockY() + "," + loc.getBlockZ());
- LOGGER.log(Level.WARNING, warnMessage);
- for (Player p : this.getServer().getOnlinePlayers())
- {
- final User alertUser = ess.getUser(p);
- if (alertUser.isAuthorized("essentials.protect.alerts"))
- {
- alertUser.sendMessage(warnMessage);
- }
- }
+ return storage;
}
- public void reloadConfig()
+ @Override
+ public void setStorage(IProtectedBlock pb)
{
- if (storage != null)
- {
- storage.onPluginDeactivation();
- }
- for (ProtectConfig protectConfig : ProtectConfig.values())
- {
- if (protectConfig.isList())
- {
- settingsList.put(protectConfig, ess.getSettings().getProtectList(protectConfig.getConfigName()));
- }
- else if (protectConfig.isString())
- {
- settingsString.put(protectConfig, ess.getSettings().getProtectString(protectConfig.getConfigName()));
- }
- else
- {
- settingsBoolean.put(protectConfig, ess.getSettings().getProtectBoolean(protectConfig.getConfigName(), protectConfig.getDefaultValueBoolean()));
- }
+ storage = pb;
+ }
- }
+ public EssentialsConnect getEssentialsConnect()
+ {
+ return ess;
+ }
+
+ public Map<ProtectConfig, Boolean> getSettingsBoolean()
+ {
+ return settingsBoolean;
+ }
- if (getSettingString(ProtectConfig.datatype).equalsIgnoreCase("mysql"))
- {
- try
- {
- storage = new ProtectedBlockMySQL(
- getSettingString(ProtectConfig.mysqlDB),
- getSettingString(ProtectConfig.dbUsername),
- getSettingString(ProtectConfig.dbPassword));
- }
- catch (PropertyVetoException ex)
- {
- LOGGER.log(Level.SEVERE, null, ex);
- }
- }
- else
- {
- try
- {
- storage = new ProtectedBlockSQLite("jdbc:sqlite:plugins/Essentials/EssentialsProtect.db");
- }
- catch (PropertyVetoException ex)
- {
- LOGGER.log(Level.SEVERE, null, ex);
- }
- }
- if (getSettingBool(ProtectConfig.memstore))
- {
- storage = new ProtectedBlockMemory(storage, this);
- }
+ public Map<ProtectConfig, String> getSettingsString()
+ {
+ return settingsString;
}
- @Override
- public IProtectedBlock getStorage()
+ public Map<ProtectConfig, List<Integer>> getSettingsList()
{
- return storage;
+ return settingsList;
}
@Override
@@ -200,9 +163,4 @@ public class EssentialsProtect extends JavaPlugin implements IConf, IProtect
{
}
}
-
- public IEssentials getEssentials()
- {
- return ess;
- }
}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java
index 8717825b3..a1d16af25 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java
@@ -1,22 +1,15 @@
package com.earth2me.essentials.protect;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import com.earth2me.essentials.protect.data.IProtectedBlock;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
-import org.bukkit.event.block.BlockBreakEvent;
-import org.bukkit.event.block.BlockBurnEvent;
-import org.bukkit.event.block.BlockFromToEvent;
-import org.bukkit.event.block.BlockIgniteEvent;
-import org.bukkit.event.block.BlockListener;
-import org.bukkit.event.block.BlockPistonExtendEvent;
-import org.bukkit.event.block.BlockPistonRetractEvent;
-import org.bukkit.event.block.BlockPlaceEvent;
+import org.bukkit.event.block.*;
public class EssentialsProtectBlockListener extends BlockListener
@@ -27,7 +20,7 @@ public class EssentialsProtectBlockListener extends BlockListener
public EssentialsProtectBlockListener(final IProtect parent)
{
this.prot = parent;
- this.ess = prot.getEssentials();
+ this.ess = prot.getEssentialsConnect().getEssentials();
}
@Override
@@ -57,13 +50,13 @@ public class EssentialsProtectBlockListener extends BlockListener
if (prot.checkProtectionItems(ProtectConfig.alert_on_placement, id))
{
- prot.alert(user, blockPlaced.getType().toString(), Util.i18n("alertPlaced"));
+ prot.getEssentialsConnect().alert(user, blockPlaced.getType().toString(), _("alertPlaced"));
}
final Block below = blockPlaced.getRelative(BlockFace.DOWN);
if ((below.getType() == Material.RAILS || below.getType() == Material.POWERED_RAIL || below.getType() == Material.DETECTOR_RAIL)
&& prot.getSettingBool(ProtectConfig.prevent_block_on_rail)
- && prot.getStorage().isProtected(below, user.getName()))
+ && isProtected(below, user))
{
event.setCancelled(true);
return;
@@ -75,7 +68,8 @@ public class EssentialsProtectBlockListener extends BlockListener
&& user.isAuthorized("essentials.protect"))
{
protect.add(blockPlaced);
- if (prot.getSettingBool(ProtectConfig.protect_below_rails))
+ if (prot.getSettingBool(ProtectConfig.protect_below_rails)
+ && !isProtected(blockPlaced.getRelative(BlockFace.DOWN), user))
{
protect.add(blockPlaced.getRelative(BlockFace.DOWN));
}
@@ -85,7 +79,10 @@ public class EssentialsProtectBlockListener extends BlockListener
&& user.isAuthorized("essentials.protect"))
{
protect.add(blockPlaced);
- if (prot.getSettingBool(ProtectConfig.protect_against_signs))
+ if (prot.getSettingBool(ProtectConfig.protect_against_signs)
+ && event.getBlockAgainst().getType() != Material.SIGN_POST
+ && event.getBlockAgainst().getType() != Material.WALL_SIGN
+ && !isProtected(event.getBlockAgainst(), user))
{
protect.add(event.getBlockAgainst());
}
@@ -251,7 +248,7 @@ public class EssentialsProtectBlockListener extends BlockListener
if (prot.checkProtectionItems(ProtectConfig.alert_on_break, typeId))
{
- prot.alert(user, type.toString(), Util.i18n("alertBroke"));
+ prot.getEssentialsConnect().alert(user, type.toString(), _("alertBroke"));
}
final IProtectedBlock storage = prot.getStorage();
@@ -286,7 +283,7 @@ public class EssentialsProtectBlockListener extends BlockListener
else
{
- final boolean isProtected = storage.isProtected(block, user.getName());
+ final boolean isProtected = isProtected(block, user);
if (isProtected)
{
event.setCancelled(true);
@@ -425,4 +422,58 @@ public class EssentialsProtectBlockListener extends BlockListener
}
}
}
+
+ private boolean isProtected(final Block block, final User user)
+ {
+ final Material type = block.getType();
+ if (prot.getSettingBool(ProtectConfig.protect_signs))
+ {
+ if (type == Material.WALL_SIGN || type == Material.SIGN_POST)
+ {
+ return prot.getStorage().isProtected(block, user.getName());
+ }
+ if (prot.getSettingBool(ProtectConfig.protect_against_signs))
+ {
+ final Block up = block.getRelative(BlockFace.UP);
+ if (up != null && up.getType() == Material.SIGN_POST)
+ {
+ return prot.getStorage().isProtected(block, user.getName());
+ }
+ final BlockFace[] directions = new BlockFace[]
+ {
+ BlockFace.NORTH,
+ BlockFace.EAST,
+ BlockFace.SOUTH,
+ BlockFace.WEST
+ };
+ for (BlockFace blockFace : directions)
+ {
+ final Block signblock = block.getRelative(blockFace);
+ if (signblock.getType() == Material.WALL_SIGN)
+ {
+ final org.bukkit.material.Sign signMat = (org.bukkit.material.Sign)signblock.getState().getData();
+ if (signMat != null && signMat.getFacing() == blockFace)
+ {
+ return prot.getStorage().isProtected(block, user.getName());
+ }
+ }
+ }
+ }
+ }
+ if (prot.getSettingBool(ProtectConfig.protect_rails)) {
+ if (type == Material.RAILS || type == Material.POWERED_RAIL || type == Material.DETECTOR_RAIL)
+ {
+ return prot.getStorage().isProtected(block, user.getName());
+ }
+ if (prot.getSettingBool(ProtectConfig.protect_below_rails))
+ {
+ final Block up = block.getRelative(BlockFace.UP);
+ if (up != null && (type == Material.RAILS || type == Material.POWERED_RAIL || type == Material.DETECTOR_RAIL))
+ {
+ return prot.getStorage().isProtected(block, user.getName());
+ }
+ }
+ }
+ return false;
+ }
}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
index c0e568578..89167b2b9 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
@@ -2,49 +2,28 @@ package com.earth2me.essentials.protect;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import net.minecraft.server.ChunkPosition;
-import net.minecraft.server.Packet60Explosion;
-import org.bukkit.Location;
+import com.earth2me.essentials.craftbukkit.FakeExplosion;
+import java.util.Locale;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
-import org.bukkit.craftbukkit.CraftServer;
-import org.bukkit.craftbukkit.CraftWorld;
-import org.bukkit.entity.Creeper;
-import org.bukkit.entity.Entity;
-import org.bukkit.entity.Fireball;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.entity.Player;
-import org.bukkit.entity.Projectile;
-import org.bukkit.entity.TNTPrimed;
-import org.bukkit.event.entity.CreatureSpawnEvent;
-import org.bukkit.event.entity.EndermanPickupEvent;
-import org.bukkit.event.entity.EntityDamageByBlockEvent;
-import org.bukkit.event.entity.EntityDamageByEntityEvent;
-import org.bukkit.event.entity.EntityDamageEvent;
+import org.bukkit.entity.*;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
-import org.bukkit.event.entity.EntityExplodeEvent;
-import org.bukkit.event.entity.EntityListener;
-import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
-import org.bukkit.event.entity.ExplosionPrimeEvent;
+import org.bukkit.event.entity.*;
public class EssentialsProtectEntityListener extends EntityListener
{
private final transient IProtect prot;
private final transient IEssentials ess;
-
+
public EssentialsProtectEntityListener(final IProtect prot)
{
this.prot = prot;
- this.ess = prot.getEssentials();
+ this.ess = prot.getEssentialsConnect().getEssentials();
}
-
+
@Override
public void onEntityDamage(final EntityDamageEvent event)
{
@@ -53,11 +32,18 @@ public class EssentialsProtectEntityListener extends EntityListener
return;
}
final Entity target = event.getEntity();
+
+ if (target instanceof Villager && prot.getSettingBool(ProtectConfig.prevent_villager_death))
+ {
+ event.setCancelled(true);
+ return;
+ }
+
final User user = ess.getUser(target);
if (event instanceof EntityDamageByBlockEvent)
{
final DamageCause cause = event.getCause();
-
+
if (prot.getSettingBool(ProtectConfig.disable_contactdmg)
&& cause == DamageCause.CONTACT
&& !(target instanceof Player
@@ -86,7 +72,7 @@ public class EssentialsProtectEntityListener extends EntityListener
return;
}
}
-
+
if (event instanceof EntityDamageByEntityEvent)
{
final EntityDamageByEntityEvent edEvent = (EntityDamageByEntityEvent)event;
@@ -111,7 +97,7 @@ public class EssentialsProtectEntityListener extends EntityListener
event.setCancelled(true);
return;
}
-
+
if (eAttack instanceof Creeper && prot.getSettingBool(ProtectConfig.prevent_creeper_playerdmg)
&& !(target instanceof Player
&& user.isAuthorized("essentials.protect.damage.creeper")
@@ -120,8 +106,9 @@ public class EssentialsProtectEntityListener extends EntityListener
event.setCancelled(true);
return;
}
-
- if (eAttack instanceof Fireball && prot.getSettingBool(ProtectConfig.prevent_fireball_playerdmg)
+
+ if ((event.getEntity() instanceof Fireball || event.getEntity() instanceof SmallFireball)
+ && prot.getSettingBool(ProtectConfig.prevent_fireball_playerdmg)
&& !(target instanceof Player
&& user.isAuthorized("essentials.protect.damage.fireball")
&& !user.isAuthorized("essentials.protect.damage.disable")))
@@ -129,7 +116,7 @@ public class EssentialsProtectEntityListener extends EntityListener
event.setCancelled(true);
return;
}
-
+
if (eAttack instanceof TNTPrimed && prot.getSettingBool(ProtectConfig.prevent_tnt_playerdmg)
&& !(target instanceof Player
&& user.isAuthorized("essentials.protect.damage.tnt")
@@ -138,7 +125,7 @@ public class EssentialsProtectEntityListener extends EntityListener
event.setCancelled(true);
return;
}
-
+
if (edEvent.getDamager() instanceof Projectile
&& target instanceof Player
&& ((prot.getSettingBool(ProtectConfig.disable_projectiles)
@@ -153,7 +140,7 @@ public class EssentialsProtectEntityListener extends EntityListener
return;
}
}
-
+
final DamageCause cause = event.getCause();
if (target instanceof Player)
{
@@ -165,7 +152,7 @@ public class EssentialsProtectEntityListener extends EntityListener
event.setCancelled(true);
return;
}
-
+
if (cause == DamageCause.SUFFOCATION
&& prot.getSettingBool(ProtectConfig.disable_suffocate)
&& !(user.isAuthorized("essentials.protect.damage.suffocation")
@@ -201,7 +188,7 @@ public class EssentialsProtectEntityListener extends EntityListener
}
}
}
-
+
@Override
public void onEntityExplode(final EntityExplodeEvent event)
{
@@ -210,56 +197,34 @@ public class EssentialsProtectEntityListener extends EntityListener
return;
}
final int maxHeight = ess.getSettings().getProtectCreeperMaxHeight();
- //Nicccccccccce plaaacccccccccce..
- if (event.getEntity() instanceof LivingEntity
- && (prot.getSettingBool(ProtectConfig.prevent_creeper_explosion)
- || prot.getSettingBool(ProtectConfig.prevent_creeper_blockdmg)
- || (maxHeight >= 0 && event.getLocation().getBlockY() > maxHeight)))
+
+ if (event.getEntity() instanceof EnderDragon
+ && prot.getSettingBool(ProtectConfig.prevent_enderdragon_blockdmg))
{
- try
- {
- final Set<ChunkPosition> set = new HashSet<ChunkPosition>(event.blockList().size());
- final Player[] players = ess.getServer().getOnlinePlayers();
- final Set<ChunkPosition> blocksUnderPlayers = new HashSet<ChunkPosition>(players.length);
- final Location loc = event.getLocation();
- for (Player player : players)
- {
- if (player.getWorld().equals(loc.getWorld()))
- {
- blocksUnderPlayers.add(
- new ChunkPosition(
- player.getLocation().getBlockX(),
- player.getLocation().getBlockY() - 1,
- player.getLocation().getBlockZ()));
- }
- }
- ChunkPosition cp;
- for (Block block : event.blockList())
- {
- cp = new ChunkPosition(block.getX(), block.getY(), block.getZ());
- if (!blocksUnderPlayers.contains(cp))
- {
- set.add(cp);
- }
- }
-
- ((CraftServer)ess.getServer()).getHandle().sendPacketNearby(loc.getX(), loc.getY(), loc.getZ(), 64.0D, ((CraftWorld)loc.getWorld()).getHandle().worldProvider.dimension,
- new Packet60Explosion(loc.getX(), loc.getY(), loc.getZ(), 3.0f, set));
- }
- catch (Throwable ex)
+ if (prot.getSettingBool(ProtectConfig.enderdragon_fakeexplosions))
{
- Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
+ FakeExplosion.createExplosion(event, ess.getServer(), ess.getServer().getOnlinePlayers());
}
event.setCancelled(true);
return;
}
+ else if (event.getEntity() instanceof Creeper
+ && (prot.getSettingBool(ProtectConfig.prevent_creeper_explosion)
+ || prot.getSettingBool(ProtectConfig.prevent_creeper_blockdmg)
+ || (maxHeight >= 0 && event.getLocation().getBlockY() > maxHeight)))
+ {
+ //Nicccccccccce plaaacccccccccce..
+ FakeExplosion.createExplosion(event, ess.getServer(), ess.getServer().getOnlinePlayers());
+ event.setCancelled(true);
+ return;
+ }
else if (event.getEntity() instanceof TNTPrimed
&& prot.getSettingBool(ProtectConfig.prevent_tnt_explosion))
{
event.setCancelled(true);
return;
}
- else if (event.getEntity() instanceof Fireball
+ else if ((event.getEntity() instanceof Fireball || event.getEntity() instanceof SmallFireball)
&& prot.getSettingBool(ProtectConfig.prevent_fireball_explosion))
{
event.setCancelled(true);
@@ -295,7 +260,7 @@ public class EssentialsProtectEntityListener extends EntityListener
}
}
}
-
+
@Override
public void onCreatureSpawn(final CreatureSpawnEvent event)
{
@@ -307,7 +272,12 @@ public class EssentialsProtectEntityListener extends EntityListener
{
return;
}
- final String creatureName = event.getCreatureType().toString().toLowerCase();
+ final CreatureType creature = event.getCreatureType();
+ if (creature == null)
+ {
+ return;
+ }
+ final String creatureName = creature.toString().toLowerCase(Locale.ENGLISH);
if (creatureName == null || creatureName.isEmpty())
{
return;
@@ -317,7 +287,7 @@ public class EssentialsProtectEntityListener extends EntityListener
event.setCancelled(true);
}
}
-
+
@Override
public void onEntityTarget(final EntityTargetEvent event)
{
@@ -343,11 +313,11 @@ public class EssentialsProtectEntityListener extends EntityListener
return;
}
}
-
+
@Override
public void onExplosionPrime(ExplosionPrimeEvent event)
{
- if (event.getEntity() instanceof Fireball
+ if ((event.getEntity() instanceof Fireball || event.getEntity() instanceof SmallFireball)
&& prot.getSettingBool(ProtectConfig.prevent_fireball_fire))
{
event.setFire(false);
@@ -357,10 +327,12 @@ public class EssentialsProtectEntityListener extends EntityListener
@Override
public void onEndermanPickup(EndermanPickupEvent event)
{
- if (event.isCancelled()) {
+ if (event.isCancelled())
+ {
return;
}
- if (prot.getSettingBool(ProtectConfig.prevent_enderman_pickup)) {
+ if (prot.getSettingBool(ProtectConfig.prevent_enderman_pickup))
+ {
event.setCancelled(true);
return;
}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
index 7543a5244..ad7831a53 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
@@ -1,14 +1,14 @@
package com.earth2me.essentials.protect;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import org.bukkit.Material;
import org.bukkit.block.Block;
+import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerListener;
import org.bukkit.inventory.ItemStack;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
-import org.bukkit.Material;
-import org.bukkit.event.block.Action;
public class EssentialsProtectPlayerListener extends PlayerListener
@@ -19,16 +19,13 @@ public class EssentialsProtectPlayerListener extends PlayerListener
public EssentialsProtectPlayerListener(final IProtect prot)
{
this.prot = prot;
- this.ess = prot.getEssentials();
+ this.ess = prot.getEssentialsConnect().getEssentials();
}
@Override
public void onPlayerInteract(final PlayerInteractEvent event)
{
- if (event.isCancelled())
- {
- return;
- }
+ // Do not return if cancelled, because the interact event has 2 cancelled states.
final User user = ess.getUser(event.getPlayer());
if (event.hasItem()
@@ -38,7 +35,7 @@ public class EssentialsProtectPlayerListener extends PlayerListener
{
if (ess.getSettings().warnOnBuildDisallow())
{
- user.sendMessage(Util.i18n("buildAlert"));
+ user.sendMessage(_("buildAlert"));
}
event.setCancelled(true);
return;
@@ -48,7 +45,7 @@ public class EssentialsProtectPlayerListener extends PlayerListener
{
if (ess.getSettings().warnOnBuildDisallow())
{
- user.sendMessage(Util.i18n("buildAlert"));
+ user.sendMessage(_("buildAlert"));
}
event.setCancelled(true);
return;
@@ -80,13 +77,13 @@ public class EssentialsProtectPlayerListener extends PlayerListener
final String ownerNames = stringBuilder.toString();
if (ownerNames != null && !ownerNames.isEmpty())
{
- user.sendMessage(Util.format("protectionOwner", ownerNames));
+ user.sendMessage(_("protectionOwner", ownerNames));
}
}
if (item != null
&& prot.checkProtectionItems(ProtectConfig.alert_on_use, item.getTypeId()))
{
- prot.alert(user, item.getType().toString(), Util.i18n("alertUsed"));
+ prot.getEssentialsConnect().alert(user, item.getType().toString(), _("alertUsed"));
}
}
}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/IProtect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/IProtect.java
index ac095e33d..afcb6e8ce 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/IProtect.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/IProtect.java
@@ -1,14 +1,13 @@
package com.earth2me.essentials.protect;
-import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.User;
import com.earth2me.essentials.protect.data.IProtectedBlock;
+import java.util.List;
+import java.util.Map;
+import org.bukkit.plugin.Plugin;
-public interface IProtect
+public interface IProtect extends Plugin
{
- void alert(final User user, final String item, final String type);
-
boolean checkProtectionItems(final ProtectConfig list, final int id);
boolean getSettingBool(final ProtectConfig protectConfig);
@@ -17,5 +16,13 @@ public interface IProtect
IProtectedBlock getStorage();
- IEssentials getEssentials();
+ void setStorage(IProtectedBlock pb);
+
+ EssentialsConnect getEssentialsConnect();
+
+ Map<ProtectConfig, Boolean> getSettingsBoolean();
+
+ Map<ProtectConfig, String> getSettingsString();
+
+ Map<ProtectConfig, List<Integer>> getSettingsList();
}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java
index 5d93fe0ea..bee8d0f4d 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java
@@ -40,11 +40,14 @@ public enum ProtectConfig
prevent_creeper_playerdmg("protect.prevent.creeper-playerdamage", false),
prevent_creeper_blockdmg("protect.prevent.creeper-blockdamage", false),
prevent_enderman_pickup("protect.prevent.enderman-pickup", false),
+ prevent_villager_death("protect.prevent.villager-death", false),
+ prevent_enderdragon_blockdmg("protect.prevent.enderdragon-blockdamage", true),
prevent_entitytarget("protect.prevent.entitytarget", false),
protect_rails("protect.protect.rails", true),
protect_below_rails("protect.protect.block-below", true),
protect_signs("protect.protect.signs", true),
protect_against_signs("protect.protect.block-below", true),
+ enderdragon_fakeexplosions("protect.enderdragon-fakeexplosions", false),
alert_on_placement("protect.alert.on-placement"),
alert_on_use("protect.alert.on-use"),
alert_on_break("protect.alert.on-break"),
@@ -62,7 +65,7 @@ public enum ProtectConfig
{
this(configName, null, false, true, false);
}
-
+
private ProtectConfig(final String configName, final String defValueString)
{
this(configName, defValueString, false, false, true);
@@ -110,7 +113,7 @@ public enum ProtectConfig
{
return isString;
}
-
+
public boolean isList()
{
return isList;
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/IProtectedBlock.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/IProtectedBlock.java
index 271f1c464..755baface 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/IProtectedBlock.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/IProtectedBlock.java
@@ -3,13 +3,22 @@ package com.earth2me.essentials.protect.data;
import java.util.List;
import org.bukkit.block.Block;
-public interface IProtectedBlock {
+
+public interface IProtectedBlock
+{
public void clearProtections();
+
public void importProtections(List<OwnedBlock> blocks);
+
public List<OwnedBlock> exportProtections();
+
public void protectBlock(Block block, String playerName);
+
public boolean isProtected(Block block, String playerName);
+
public List<String> getOwners(Block block);
+
public int unprotectBlock(Block block);
+
public void onPluginDeactivation();
}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/OwnedBlock.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/OwnedBlock.java
index dea124b58..dc28feae8 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/OwnedBlock.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/OwnedBlock.java
@@ -1,6 +1,8 @@
package com.earth2me.essentials.protect.data;
-public class OwnedBlock {
+
+public class OwnedBlock
+{
final int x;
final int y;
final int z;
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java
index 1348b6bc8..876c8a575 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMemory.java
@@ -1,12 +1,7 @@
package com.earth2me.essentials.protect.data;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
import java.util.Map.Entry;
-import java.util.Set;
+import java.util.*;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.plugin.Plugin;
@@ -249,5 +244,5 @@ public class ProtectedBlockMemory implements IProtectedBlock
public void onPluginDeactivation()
{
storage.onPluginDeactivation();
- }
+ }
}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java
index 8e50ce248..2a0077698 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockMySQL.java
@@ -8,50 +8,59 @@ import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
-public class ProtectedBlockMySQL extends ProtectedBlockJDBC {
- public ProtectedBlockMySQL(String url, String username, String password) throws PropertyVetoException {
+public class ProtectedBlockMySQL extends ProtectedBlockJDBC
+{
+ public ProtectedBlockMySQL(String url, String username, String password) throws PropertyVetoException
+ {
super("com.mysql.jdbc.Driver", url, username, password);
}
-
private static final String QueryCreateTable =
- "CREATE TABLE IF NOT EXISTS `EssentialsProtect` ("
- + "`worldName` varchar(60) NOT NULL,"
- + "`x` int(11) NOT NULL, `y` int(11) NOT NULL, `z` int(11) NOT NULL,"
- + "`playerName` varchar(150) DEFAULT NULL,"
- + "KEY `pos` (`worldName`,`x`,`z`,`y`)"
- + ") ENGINE=MyISAM DEFAULT CHARSET=utf8";
+ "CREATE TABLE IF NOT EXISTS `EssentialsProtect` ("
+ + "`worldName` varchar(60) NOT NULL,"
+ + "`x` int(11) NOT NULL, `y` int(11) NOT NULL, `z` int(11) NOT NULL,"
+ + "`playerName` varchar(150) DEFAULT NULL,"
+ + "KEY `pos` (`worldName`,`x`,`z`,`y`)"
+ + ") ENGINE=MyISAM DEFAULT CHARSET=utf8";
@Override
- protected PreparedStatement getStatementCreateTable(Connection conn) throws SQLException {
+ protected PreparedStatement getStatementCreateTable(Connection conn) throws SQLException
+ {
return conn.prepareStatement(QueryCreateTable);
}
-
private static final String QueryUpdateFrom2_0TableCheck =
- "SHOW COLUMNS FROM `EssentialsProtect` LIKE 'id';";
+ "SHOW COLUMNS FROM `EssentialsProtect` LIKE 'id';";
private static final String QueryUpdateFrom2_0Table =
- "ALTER TABLE `EssentialsProtect` "
- + "CHARACTER SET = utf8, ENGINE = MyISAM,"
- + "DROP COLUMN `id`,"
- + "CHANGE COLUMN `playerName` `playerName` VARCHAR(150) NULL AFTER `z`,"
- + "CHANGE COLUMN `worldName` `worldName` VARCHAR(60) NOT NULL,"
- + "ADD INDEX `position` (`worldName` ASC, `x` ASC, `z` ASC, `y` ASC),"
- + "DROP PRIMARY KEY ;";
+ "ALTER TABLE `EssentialsProtect` "
+ + "CHARACTER SET = utf8, ENGINE = MyISAM,"
+ + "DROP COLUMN `id`,"
+ + "CHANGE COLUMN `playerName` `playerName` VARCHAR(150) NULL AFTER `z`,"
+ + "CHANGE COLUMN `worldName` `worldName` VARCHAR(60) NOT NULL,"
+ + "ADD INDEX `position` (`worldName` ASC, `x` ASC, `z` ASC, `y` ASC),"
+ + "DROP PRIMARY KEY ;";
@Override
- protected PreparedStatement getStatementUpdateFrom2_0Table(Connection conn) throws SQLException {
+ protected PreparedStatement getStatementUpdateFrom2_0Table(Connection conn) throws SQLException
+ {
PreparedStatement testPS = null;
ResultSet testRS = null;
- try {
+ try
+ {
testPS = conn.prepareStatement(QueryUpdateFrom2_0TableCheck);
testRS = testPS.executeQuery();
- if (testRS.first()) {
+ if (testRS.first())
+ {
return conn.prepareStatement(QueryUpdateFrom2_0Table);
- } else {
+ }
+ else
+ {
return conn.prepareStatement("SELECT 1;");
}
- } finally {
- if (testRS != null) {
+ }
+ finally
+ {
+ if (testRS != null)
+ {
try
{
testRS.close();
@@ -61,7 +70,8 @@ public class ProtectedBlockMySQL extends ProtectedBlockJDBC {
Logger.getLogger(ProtectedBlockMySQL.class.getName()).log(Level.SEVERE, null, ex);
}
}
- if (testPS != null) {
+ if (testPS != null)
+ {
try
{
testPS.close();
@@ -74,16 +84,18 @@ public class ProtectedBlockMySQL extends ProtectedBlockJDBC {
}
}
private static final String QueryDeleteAll = "DELETE FROM EssentialsProtect;";
-
+
@Override
- protected PreparedStatement getStatementDeleteAll(Connection conn) throws SQLException {
+ protected PreparedStatement getStatementDeleteAll(Connection conn) throws SQLException
+ {
return conn.prepareStatement(QueryDeleteAll);
}
private static final String QueryInsert =
- "INSERT INTO EssentialsProtect (worldName, x, y, z, playerName) VALUES (?, ?, ?, ?, ?);";
+ "INSERT INTO EssentialsProtect (worldName, x, y, z, playerName) VALUES (?, ?, ?, ?, ?);";
@Override
- protected PreparedStatement getStatementInsert(Connection conn, String world, int x, int y, int z, String playerName) throws SQLException {
+ protected PreparedStatement getStatementInsert(Connection conn, String world, int x, int y, int z, String playerName) throws SQLException
+ {
PreparedStatement ps = conn.prepareStatement(QueryInsert);
ps.setString(1, world);
ps.setInt(2, x);
@@ -93,11 +105,12 @@ public class ProtectedBlockMySQL extends ProtectedBlockJDBC {
return ps;
}
private static final String QueryCountByPlayer =
- "SELECT COUNT(playerName), SUM(playerName = ?) FROM EssentialsProtect "
- + "WHERE worldName = ? AND x = ? AND y = ? AND z = ? GROUP BY x;";
+ "SELECT COUNT(playerName), SUM(playerName = ?) FROM EssentialsProtect "
+ + "WHERE worldName = ? AND x = ? AND y = ? AND z = ? GROUP BY x;";
@Override
- protected PreparedStatement getStatementPlayerCountByLocation(Connection conn, String world, int x, int y, int z, String playerName) throws SQLException {
+ protected PreparedStatement getStatementPlayerCountByLocation(Connection conn, String world, int x, int y, int z, String playerName) throws SQLException
+ {
PreparedStatement ps = conn.prepareStatement(QueryCountByPlayer);
ps.setString(1, playerName);
ps.setString(2, world);
@@ -107,10 +120,11 @@ public class ProtectedBlockMySQL extends ProtectedBlockJDBC {
return ps;
}
private static final String QueryPlayersByLocation =
- "SELECT playerName FROM EssentialsProtect WHERE worldname = ? AND x = ? AND y = ? AND z = ?;";
+ "SELECT playerName FROM EssentialsProtect WHERE worldname = ? AND x = ? AND y = ? AND z = ?;";
@Override
- protected PreparedStatement getStatementPlayersByLocation(Connection conn, String world, int x, int y, int z) throws SQLException {
+ protected PreparedStatement getStatementPlayersByLocation(Connection conn, String world, int x, int y, int z) throws SQLException
+ {
PreparedStatement ps = conn.prepareStatement(QueryPlayersByLocation);
ps.setString(1, world);
ps.setInt(2, x);
@@ -119,10 +133,11 @@ public class ProtectedBlockMySQL extends ProtectedBlockJDBC {
return ps;
}
private static final String QueryDeleteByLocation =
- "DELETE FROM EssentialsProtect WHERE worldName = ? AND x = ? AND y = ? AND z = ?;";
+ "DELETE FROM EssentialsProtect WHERE worldName = ? AND x = ? AND y = ? AND z = ?;";
@Override
- protected PreparedStatement getStatementDeleteByLocation(Connection conn, String world, int x, int y, int z) throws SQLException {
+ protected PreparedStatement getStatementDeleteByLocation(Connection conn, String world, int x, int y, int z) throws SQLException
+ {
PreparedStatement ps = conn.prepareStatement(QueryDeleteByLocation);
ps.setString(1, world);
ps.setInt(2, x);
@@ -131,10 +146,11 @@ public class ProtectedBlockMySQL extends ProtectedBlockJDBC {
return ps;
}
private static final String QueryAllBlocks =
- "SELECT worldName, x, y, z, playerName FROM EssentialsProtect;";
+ "SELECT worldName, x, y, z, playerName FROM EssentialsProtect;";
@Override
- protected PreparedStatement getStatementAllBlocks(Connection conn) throws SQLException {
+ protected PreparedStatement getStatementAllBlocks(Connection conn) throws SQLException
+ {
return conn.prepareStatement(QueryAllBlocks);
}
}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockSQLite.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockSQLite.java
index 444c657eb..cf256f1ec 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockSQLite.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockSQLite.java
@@ -5,41 +5,45 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
-public class ProtectedBlockSQLite extends ProtectedBlockJDBC {
- public ProtectedBlockSQLite(String url) throws PropertyVetoException {
+public class ProtectedBlockSQLite extends ProtectedBlockJDBC
+{
+ public ProtectedBlockSQLite(String url) throws PropertyVetoException
+ {
super("org.sqlite.JDBC", url);
}
-
private static final String QueryCreateTable =
- "CREATE TABLE IF NOT EXISTS EssentialsProtect ("
- + "worldName TEXT ,playerName TEXT, "
- + "x NUMERIC, y NUMERIC, z NUMERIC)";
+ "CREATE TABLE IF NOT EXISTS EssentialsProtect ("
+ + "worldName TEXT ,playerName TEXT, "
+ + "x NUMERIC, y NUMERIC, z NUMERIC)";
@Override
- protected PreparedStatement getStatementCreateTable(Connection conn) throws SQLException {
+ protected PreparedStatement getStatementCreateTable(Connection conn) throws SQLException
+ {
return conn.prepareStatement(QueryCreateTable);
}
-
private static final String QueryUpdateFrom2_0Table =
- "CREATE INDEX IF NOT EXISTS position ON EssentialsProtect ("
- + "worldName, x, z, y)";
+ "CREATE INDEX IF NOT EXISTS position ON EssentialsProtect ("
+ + "worldName, x, z, y)";
@Override
- protected PreparedStatement getStatementUpdateFrom2_0Table(Connection conn) throws SQLException {
+ protected PreparedStatement getStatementUpdateFrom2_0Table(Connection conn) throws SQLException
+ {
return conn.prepareStatement(QueryUpdateFrom2_0Table);
}
private static final String QueryDeleteAll = "DELETE FROM EssentialsProtect;";
@Override
- protected PreparedStatement getStatementDeleteAll(Connection conn) throws SQLException {
+ protected PreparedStatement getStatementDeleteAll(Connection conn) throws SQLException
+ {
return conn.prepareStatement(QueryDeleteAll);
}
private static final String QueryInsert =
- "INSERT INTO EssentialsProtect (worldName, x, y, z, playerName) VALUES (?, ?, ?, ?, ?);";
+ "INSERT INTO EssentialsProtect (worldName, x, y, z, playerName) VALUES (?, ?, ?, ?, ?);";
@Override
- protected PreparedStatement getStatementInsert(Connection conn, String world, int x, int y, int z, String playerName) throws SQLException {
+ protected PreparedStatement getStatementInsert(Connection conn, String world, int x, int y, int z, String playerName) throws SQLException
+ {
PreparedStatement ps = conn.prepareStatement(QueryInsert);
ps.setString(1, world);
ps.setInt(2, x);
@@ -49,11 +53,12 @@ public class ProtectedBlockSQLite extends ProtectedBlockJDBC {
return ps;
}
private static final String QueryPlayerCountByLocation =
- "SELECT COUNT(playerName), SUM(playerName = ?) FROM EssentialsProtect "
- + "WHERE worldName = ? AND x = ? AND y = ? AND z = ? GROUP BY x;";
+ "SELECT COUNT(playerName), SUM(playerName = ?) FROM EssentialsProtect "
+ + "WHERE worldName = ? AND x = ? AND y = ? AND z = ? GROUP BY x;";
@Override
- protected PreparedStatement getStatementPlayerCountByLocation(Connection conn, String world, int x, int y, int z, String playerName) throws SQLException {
+ protected PreparedStatement getStatementPlayerCountByLocation(Connection conn, String world, int x, int y, int z, String playerName) throws SQLException
+ {
PreparedStatement ps = conn.prepareStatement(QueryPlayerCountByLocation);
ps.setString(1, playerName);
ps.setString(2, world);
@@ -63,10 +68,11 @@ public class ProtectedBlockSQLite extends ProtectedBlockJDBC {
return ps;
}
private static final String QueryPlayersByLocation =
- "SELECT playerName FROM EssentialsProtect WHERE worldname = ? AND x = ? AND y = ? AND z = ?;";
+ "SELECT playerName FROM EssentialsProtect WHERE worldname = ? AND x = ? AND y = ? AND z = ?;";
@Override
- protected PreparedStatement getStatementPlayersByLocation(Connection conn, String world, int x, int y, int z) throws SQLException {
+ protected PreparedStatement getStatementPlayersByLocation(Connection conn, String world, int x, int y, int z) throws SQLException
+ {
PreparedStatement ps = conn.prepareStatement(QueryPlayersByLocation);
ps.setString(1, world);
ps.setInt(2, x);
@@ -75,10 +81,11 @@ public class ProtectedBlockSQLite extends ProtectedBlockJDBC {
return ps;
}
private static final String QueryDeleteByLocation =
- "DELETE FROM EssentialsProtect WHERE worldName = ? AND x = ? AND y = ? AND z = ?;";
+ "DELETE FROM EssentialsProtect WHERE worldName = ? AND x = ? AND y = ? AND z = ?;";
@Override
- protected PreparedStatement getStatementDeleteByLocation(Connection conn, String world, int x, int y, int z) throws SQLException {
+ protected PreparedStatement getStatementDeleteByLocation(Connection conn, String world, int x, int y, int z) throws SQLException
+ {
PreparedStatement ps = conn.prepareStatement(QueryDeleteByLocation);
ps.setString(1, world);
ps.setInt(2, x);
@@ -87,10 +94,11 @@ public class ProtectedBlockSQLite extends ProtectedBlockJDBC {
return ps;
}
private static final String QueryAllBlocks =
- "SELECT worldName, x, y, z, playerName FROM EssentialsProtect;";
+ "SELECT worldName, x, y, z, playerName FROM EssentialsProtect;";
@Override
- protected PreparedStatement getStatementAllBlocks(Connection conn) throws SQLException {
+ protected PreparedStatement getStatementAllBlocks(Connection conn) throws SQLException
+ {
return conn.prepareStatement(QueryAllBlocks);
}
}
diff --git a/EssentialsProtect/src/plugin.yml b/EssentialsProtect/src/plugin.yml
index 31fc1ae99..6407c45ee 100644
--- a/EssentialsProtect/src/plugin.yml
+++ b/EssentialsProtect/src/plugin.yml
@@ -5,5 +5,5 @@ main: com.earth2me.essentials.protect.EssentialsProtect
version: TeamCity
website: http://www.earth2me.net:8001/
description: Provides protection for various parts of the world.
-authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
-depend: [Essentials] \ No newline at end of file
+authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits]
+softdepend: [Essentials] \ No newline at end of file
diff --git a/EssentialsSpawn/nbproject/build-impl.xml b/EssentialsSpawn/nbproject/build-impl.xml
index 1f4e8e9fb..cf349590c 100644
--- a/EssentialsSpawn/nbproject/build-impl.xml
+++ b/EssentialsSpawn/nbproject/build-impl.xml
@@ -20,10 +20,10 @@ is divided into following sections:
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="EssentialsSpawn-impl">
- <fail message="Please build using Ant 1.7.1 or higher.">
+ <fail message="Please build using Ant 1.8.0 or higher.">
<condition>
<not>
- <antversion atleast="1.7.1"/>
+ <antversion atleast="1.8.0"/>
</not>
</condition>
</fail>
@@ -223,6 +223,7 @@ is divided into following sections:
<property name="javac.fork" value="${jdkBug6558476}"/>
<property name="jar.index" value="false"/>
<property name="jar.index.metainf" value="${jar.index}"/>
+ <property name="copylibs.rebase" value="true"/>
<available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
</target>
<target name="-post-init">
@@ -409,6 +410,7 @@ is divided into following sections:
<property environment="env"/>
<resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
<java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
@@ -539,7 +541,7 @@ is divided into following sections:
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
- <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+ <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
@@ -871,6 +873,14 @@ is divided into following sections:
-->
<target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
+ <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+ <and>
+ <isset property="endorsed.classpath.cmd.line.arg"/>
+ <not>
+ <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+ </not>
+ </and>
+ </condition>
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
<classpath>
<path path="${javac.classpath}"/>
@@ -882,6 +892,7 @@ is divided into following sections:
<include name="**/*.java"/>
<exclude name="*.java"/>
</fileset>
+ <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
</javadoc>
<copy todir="${dist.javadoc.dir}">
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
diff --git a/EssentialsSpawn/nbproject/genfiles.properties b/EssentialsSpawn/nbproject/genfiles.properties
index bf3a6888d..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=fd1c94f8
-nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
+nbproject/build-impl.xml.script.CRC32=f45f4172
+nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
diff --git a/EssentialsSpawn/nbproject/pmd.settings b/EssentialsSpawn/nbproject/pmd.settings
new file mode 100644
index 000000000..6a34e356c
--- /dev/null
+++ b/EssentialsSpawn/nbproject/pmd.settings
@@ -0,0 +1 @@
+DoNotUseThreads
diff --git a/EssentialsSpawn/nbproject/project.properties b/EssentialsSpawn/nbproject/project.properties
index 27fa91493..f78c2be3d 100644
--- a/EssentialsSpawn/nbproject/project.properties
+++ b/EssentialsSpawn/nbproject/project.properties
@@ -28,6 +28,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blank
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=*
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE
@@ -36,6 +37,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.place
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
@@ -61,12 +63,12 @@ dist.jar=${dist.dir}/EssentialsSpawn.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
-file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar
+file.reference.bukkit.jar=../lib/bukkit.jar
includes=**
jar.compress=true
javac.classpath=\
${reference.Essentials.jar}:\
- ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}
+ ${file.reference.bukkit.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
@@ -77,8 +79,7 @@ javac.target=1.6
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
- ${libs.junit.classpath}:\
- ${libs.junit_4.classpath}
+ ${libs.junit_4.10.classpath}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java
index 9ffc1c3f0..c6c89a20d 100644
--- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java
+++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java
@@ -1,9 +1,9 @@
package com.earth2me.essentials.spawn;
-import org.bukkit.Server;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import com.earth2me.essentials.commands.EssentialsCommand;
+import org.bukkit.Server;
public class Commandsetspawn extends EssentialsCommand
@@ -14,10 +14,10 @@ public class Commandsetspawn extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
final String group = args.length > 0 ? getFinalArg(args, 0) : "default";
- ess.getSpawn().setSpawn(user.getLocation(), group);
- user.sendMessage(Util.format("spawnSet", group));
+ ((SpawnStorage)module).setSpawn(user.getLocation(), group);
+ user.sendMessage(_("spawnSet", group));
}
}
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java
index b3ade7634..6335d6c69 100644
--- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java
+++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java
@@ -1,9 +1,14 @@
package com.earth2me.essentials.spawn;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Trade;
-import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Location;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Commandspawn extends EssentialsCommand
@@ -14,10 +19,42 @@ public class Commandspawn extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
- {
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
+ {
final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
- user.getTeleport().respawn(ess.getSpawn(), charge);
+ if (args.length > 0 && user.isAuthorized("essentials.spawn.others"))
+ {
+ final User otherUser = getPlayer(server, args, 0);
+ respawn(otherUser, null);
+ if (!otherUser.equals(user))
+ {
+ otherUser.sendMessage(_("teleportAtoB", user.getDisplayName(), "spawn"));
+ user.sendMessage(_("teleporting"));
+ }
+ }
+ else
+ {
+ respawn(user, null);
+ }
+ }
+
+ @Override
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
+ if (args.length < 1)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final User user = getPlayer(server, args, 0);
+ respawn(user, null);
+ user.sendMessage(_("teleportAtoB", user.getDisplayName(), "spawn"));
+ sender.sendMessage(_("teleporting"));
+ }
+
+ private void respawn (final User user, final Trade charge) throws Exception {
+ final SpawnStorage spawns = (SpawnStorage)this.module;
+ final Location spawn = spawns.getSpawn(user.getGroup());
+ user.getTeleport().teleport(spawn, charge, TeleportCause.COMMAND);
}
}
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java
index 1bae3fed3..813220a16 100644
--- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java
+++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java
@@ -1,10 +1,11 @@
package com.earth2me.essentials.spawn;
-
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
-import com.earth2me.essentials.Util;
+import com.earth2me.essentials.IEssentialsModule;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Event.Priority;
@@ -15,23 +16,32 @@ import org.bukkit.plugin.java.JavaPlugin;
public class EssentialsSpawn extends JavaPlugin
{
- private static final Logger LOGGER = Logger.getLogger("Minecraft");
+ private static final Logger LOGGER = Bukkit.getLogger();
private transient IEssentials ess;
+ private transient SpawnStorage spawns;
public void onEnable()
{
final PluginManager pluginManager = getServer().getPluginManager();
ess = (IEssentials)pluginManager.getPlugin("Essentials");
- final EssentialsSpawnPlayerListener playerListener = new EssentialsSpawnPlayerListener(ess);
- pluginManager.registerEvent(Type.PLAYER_RESPAWN, playerListener, Priority.Low, this);
- pluginManager.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Low, this);
-
-
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
{
- LOGGER.log(Level.WARNING, Util.i18n("versionMismatchAll"));
+ LOGGER.log(Level.WARNING, _("versionMismatchAll"));
+ }
+ if (!ess.isEnabled())
+ {
+ this.setEnabled(false);
+ return;
}
- LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
+
+ spawns = new SpawnStorage(ess);
+ ess.addReloadListener(spawns);
+
+ final EssentialsSpawnPlayerListener playerListener = new EssentialsSpawnPlayerListener(ess, spawns);
+ pluginManager.registerEvent(Type.PLAYER_RESPAWN, playerListener, ess.getSettings().getRespawnPriority(), this);
+ pluginManager.registerEvent(Type.PLAYER_JOIN, playerListener, ess.getSettings().getRespawnPriority(), this);
+
+ LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
}
public void onDisable()
@@ -39,8 +49,9 @@ public class EssentialsSpawn extends JavaPlugin
}
@Override
- public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args)
+ public boolean onCommand(final CommandSender sender, final Command command,
+ final String commandLabel, final String[] args)
{
- return ess.onCommandEssentials(sender, command, commandLabel, args, EssentialsSpawn.class.getClassLoader(), "com.earth2me.essentials.spawn.Command", "essentials.");
+ return ess.onCommandEssentials(sender, command, commandLabel, args, EssentialsSpawn.class.getClassLoader(), "com.earth2me.essentials.spawn.Command", "essentials.", spawns);
}
}
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
index 459eee60a..81e8f6e9e 100644
--- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
+++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
@@ -1,52 +1,54 @@
package com.earth2me.essentials.spawn;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerListener;
import org.bukkit.event.player.PlayerRespawnEvent;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class EssentialsSpawnPlayerListener extends PlayerListener
{
private final transient IEssentials ess;
+ private final transient SpawnStorage spawns;
+ private static final Logger LOGGER = Bukkit.getLogger();
- public EssentialsSpawnPlayerListener(IEssentials ess)
+ public EssentialsSpawnPlayerListener(final IEssentials ess, final SpawnStorage spawns)
{
+ super();
this.ess = ess;
+ this.spawns = spawns;
}
@Override
public void onPlayerRespawn(final PlayerRespawnEvent event)
- {
+ {
final User user = ess.getUser(event.getPlayer());
- try
+ if (ess.getSettings().getRespawnAtHome())
{
- if (ess.getSettings().getRespawnAtHome())
+ Location home = user.getHome(user.getLocation());
+ if (home == null)
+ {
+ home = user.getBedSpawnLocation();
+ }
+ if (home != null)
{
- Location home = user.getHome(user.getLocation());
- if (home == null)
- {
- throw new Exception();
- }
event.setRespawnLocation(home);
return;
}
}
- catch (Throwable ex)
- {
- }
- Location spawn = ess.getSpawn().getSpawn(user.getGroup());
- if (spawn == null)
+ final Location spawn = spawns.getSpawn(user.getGroup());
+ if (spawn != null)
{
- return;
+ event.setRespawnLocation(spawn);
}
- event.setRespawnLocation(spawn);
}
@Override
@@ -54,32 +56,49 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
{
final User user = ess.getUser(event.getPlayer());
- if (!user.isNew())
+ if (user.hasPlayedBefore())
{
+ LOGGER.log(Level.FINE, "Old player join");
return;
- }
- user.setNew(false);
+ }
if (!"none".equalsIgnoreCase(ess.getSettings().getNewbieSpawn()))
{
- ess.scheduleSyncDelayedTask(new Runnable()
- {
- public void run()
- {
- try
- {
- user.getTeleport().now(ess.getSpawn().getSpawn(ess.getSettings().getNewbieSpawn()));
- }
- catch (Exception ex)
- {
- Logger.getLogger("Minecraft").log(Level.WARNING, Util.i18n("teleportNewPlayerError"), ex);
- }
- }
- });
+ ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user), 1L);
}
if (ess.getSettings().getAnnounceNewPlayers())
{
ess.broadcastMessage(user, ess.getSettings().getAnnounceNewPlayerFormat(user));
}
+
+ LOGGER.log(Level.FINE, "New player join");
+ }
+
+
+ private class NewPlayerTeleport implements Runnable
+ {
+ private final transient User user;
+
+ public NewPlayerTeleport(final User user)
+ {
+ this.user = user;
+ }
+
+ @Override
+ public void run()
+ {
+ try
+ {
+ Location spawn = spawns.getSpawn(ess.getSettings().getNewbieSpawn());
+ if (spawn != null)
+ {
+ user.getTeleport().now(spawn, false, TeleportCause.PLUGIN);
+ }
+ }
+ catch (Exception ex)
+ {
+ Bukkit.getLogger().log(Level.WARNING, _("teleportNewPlayerError"), ex);
+ }
+ }
}
}
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/SpawnStorage.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/SpawnStorage.java
new file mode 100644
index 000000000..088ee9052
--- /dev/null
+++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/SpawnStorage.java
@@ -0,0 +1,90 @@
+package com.earth2me.essentials.spawn;
+
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.IEssentialsModule;
+import com.earth2me.essentials.settings.Spawns;
+import com.earth2me.essentials.storage.AsyncStorageObjectHolder;
+import java.io.File;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import org.bukkit.Location;
+import org.bukkit.World;
+
+
+public class SpawnStorage extends AsyncStorageObjectHolder<Spawns> implements IEssentialsModule
+{
+ public SpawnStorage(final IEssentials ess)
+ {
+ super(ess, Spawns.class);
+ reloadConfig();
+ }
+
+ @Override
+ public File getStorageFile()
+ {
+ return new File(ess.getDataFolder(), "spawn.yml");
+ }
+
+ public void setSpawn(final Location loc, final String group)
+ {
+ acquireWriteLock();
+ try
+ {
+ if (getData().getSpawns() == null)
+ {
+ getData().setSpawns(new HashMap<String, Location>());
+ }
+ getData().getSpawns().put(group.toLowerCase(Locale.ENGLISH), loc);
+ }
+ finally
+ {
+ unlock();
+ }
+
+ if ("default".equalsIgnoreCase(group))
+ {
+ loc.getWorld().setSpawnLocation(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
+ }
+ }
+
+ public Location getSpawn(final String group)
+ {
+ acquireReadLock();
+ try
+ {
+ if (getData().getSpawns() == null || group == null)
+ {
+ return getWorldSpawn();
+ }
+ final Map<String, Location> spawnMap = getData().getSpawns();
+ String groupName = group.toLowerCase(Locale.ENGLISH);
+ if (!spawnMap.containsKey(groupName))
+ {
+ groupName = "default";
+ }
+ if (!spawnMap.containsKey(groupName))
+ {
+ return getWorldSpawn();
+ }
+ return spawnMap.get(groupName);
+ }
+ finally
+ {
+ unlock();
+ }
+ }
+
+ private Location getWorldSpawn()
+ {
+ for (World world : ess.getServer().getWorlds())
+ {
+ if (world.getEnvironment() != World.Environment.NORMAL)
+ {
+ continue;
+ }
+ return world.getSpawnLocation();
+ }
+ return ess.getServer().getWorlds().get(0).getSpawnLocation();
+ }
+}
diff --git a/EssentialsSpawn/src/plugin.yml b/EssentialsSpawn/src/plugin.yml
index 1e01eebd9..a91031fbe 100644
--- a/EssentialsSpawn/src/plugin.yml
+++ b/EssentialsSpawn/src/plugin.yml
@@ -5,7 +5,7 @@ main: com.earth2me.essentials.spawn.EssentialsSpawn
version: TeamCity
website: http://www.earth2me.net:8001/
description: Provides spawn control commands, utilizing Essentials.
-authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
+authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits]
depend: [Essentials]
commands:
setspawn:
@@ -13,4 +13,4 @@ commands:
usage: /<command> <group>
spawn:
description: Teleport to the spawnpoint.
- usage: /<command> \ No newline at end of file
+ usage: /<command> [player] \ No newline at end of file
diff --git a/EssentialsUpdate/nbproject/build-impl.xml b/EssentialsUpdate/nbproject/build-impl.xml
index 7a38ac1d4..2f8555c4c 100644
--- a/EssentialsUpdate/nbproject/build-impl.xml
+++ b/EssentialsUpdate/nbproject/build-impl.xml
@@ -20,10 +20,10 @@ is divided into following sections:
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="EssentialsUpdate-impl">
- <fail message="Please build using Ant 1.7.1 or higher.">
+ <fail message="Please build using Ant 1.8.0 or higher.">
<condition>
<not>
- <antversion atleast="1.7.1"/>
+ <antversion atleast="1.8.0"/>
</not>
</condition>
</fail>
@@ -223,6 +223,7 @@ is divided into following sections:
<property name="javac.fork" value="${jdkBug6558476}"/>
<property name="jar.index" value="false"/>
<property name="jar.index.metainf" value="${jar.index}"/>
+ <property name="copylibs.rebase" value="true"/>
<available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
</target>
<target name="-post-init">
@@ -409,6 +410,7 @@ is divided into following sections:
<property environment="env"/>
<resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
<java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
@@ -539,7 +541,7 @@ is divided into following sections:
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
- <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+ <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
@@ -864,6 +866,14 @@ is divided into following sections:
-->
<target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
+ <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+ <and>
+ <isset property="endorsed.classpath.cmd.line.arg"/>
+ <not>
+ <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+ </not>
+ </and>
+ </condition>
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
<classpath>
<path path="${javac.classpath}"/>
@@ -875,6 +885,7 @@ is divided into following sections:
<include name="**/*.java"/>
<exclude name="*.java"/>
</fileset>
+ <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
</javadoc>
<copy todir="${dist.javadoc.dir}">
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
diff --git a/EssentialsUpdate/nbproject/genfiles.properties b/EssentialsUpdate/nbproject/genfiles.properties
index 992379672..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=1cab9494
-nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
+nbproject/build-impl.xml.script.CRC32=94e69885
+nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
diff --git a/EssentialsUpdate/nbproject/project.properties b/EssentialsUpdate/nbproject/project.properties
index fadaa4839..88315dfa0 100644
--- a/EssentialsUpdate/nbproject/project.properties
+++ b/EssentialsUpdate/nbproject/project.properties
@@ -4,6 +4,43 @@ annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
application.title=EssentialsUpdate
application.vendor=essentialsteam
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=true
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=2
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=2
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=2
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=120
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none
+auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAnnotationArgs=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineArrayInit=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineAssignment=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineBinaryOp=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineCallArgs=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineDisjunctiveCatchTypes=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineFor=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineImplements=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineMethodParams=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineParenthesized=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTernaryOp=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineThrows=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.alignMultilineTryResources=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesAfterClassHeader=0
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=*
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.otherBracePlacement=NEW_LINE
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeCatchOnNewLine=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups=false
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
@@ -26,12 +63,11 @@ dist.jar=${dist.dir}/EssentialsUpdate.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
-file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar
+file.reference.bukkit.jar=../lib/bukkit.jar
includes=**
jar.compress=true
javac.classpath=\
- ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}:\
- ${libs.junit_4.classpath}
+ ${file.reference.bukkit.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
@@ -41,7 +77,8 @@ javac.source=1.6
javac.target=1.6
javac.test.classpath=\
${javac.classpath}:\
- ${build.classes.dir}
+ ${build.classes.dir}:\
+ ${libs.junit_4.10.classpath}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/AbstractWorkListener.java b/EssentialsUpdate/src/com/earth2me/essentials/update/AbstractWorkListener.java
index 487e372c8..d2cbb8a64 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/AbstractWorkListener.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/AbstractWorkListener.java
@@ -13,13 +13,15 @@ public abstract class AbstractWorkListener
private final transient Plugin plugin;
private final transient VersionInfo newVersionInfo;
- public final void onWorkAbort() {
+ public final void onWorkAbort()
+ {
onWorkAbort(null);
}
-
+
public abstract void onWorkAbort(String message);
-
- public final void onWorkDone() {
+
+ public final void onWorkDone()
+ {
onWorkDone(null);
}
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsHelp.java b/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsHelp.java
index ec62566ca..4ed1df602 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsHelp.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsHelp.java
@@ -1,13 +1,6 @@
package com.earth2me.essentials.update;
-import com.earth2me.essentials.update.chat.Command;
-import com.earth2me.essentials.update.chat.ConfigCommand;
-import com.earth2me.essentials.update.chat.ErrorsCommand;
-import com.earth2me.essentials.update.chat.HelpCommand;
-import com.earth2me.essentials.update.chat.IrcBot;
-import com.earth2me.essentials.update.chat.ListCommand;
-import com.earth2me.essentials.update.chat.StartupCommand;
-import com.earth2me.essentials.update.chat.UsernameUtil;
+import com.earth2me.essentials.update.chat.*;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsUpdate.java b/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsUpdate.java
index 98dbeb2ef..be6e42ce9 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsUpdate.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/EssentialsUpdate.java
@@ -1,6 +1,5 @@
package com.earth2me.essentials.update;
-import com.earth2me.essentials.update.UpdateCheck.CheckResult;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
@@ -16,7 +15,8 @@ public class EssentialsUpdate extends JavaPlugin
@Override
public void onEnable()
{
- if (!getDataFolder().exists() && !getDataFolder().mkdirs() ) {
+ if (!getDataFolder().exists() && !getDataFolder().mkdirs())
+ {
Bukkit.getLogger().log(Level.SEVERE, "Could not create data folder: {0}", getDataFolder().getPath());
}
essentialsHelp = new EssentialsHelp(this);
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/GetFile.java b/EssentialsUpdate/src/com/earth2me/essentials/update/GetFile.java
index b48d95dd2..06b414e93 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/GetFile.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/GetFile.java
@@ -1,10 +1,6 @@
package com.earth2me.essentials.update;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
+import java.io.*;
import java.math.BigInteger;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateFile.java b/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateFile.java
index 95ef5e64e..3d465e2e8 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateFile.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/UpdateFile.java
@@ -15,8 +15,8 @@ import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
-import org.bukkit.plugin.Plugin;
import org.bukkit.configuration.file.YamlConfiguration;
+import org.bukkit.plugin.Plugin;
public class UpdateFile
@@ -66,7 +66,7 @@ public class UpdateFile
getFile = new GetFile(UPDATE_URL);
getFile.saveTo(file);
plugin.getConfig().set("lastupdate", System.currentTimeMillis());
- plugin.getConfig().save(new File(plugin.getDataFolder(),"config.yml"));
+ plugin.getConfig().save(new File(plugin.getDataFolder(), "config.yml"));
return true;
}
catch (IOException ex)
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java b/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java
index c34e40ae5..b9cddc38c 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java
@@ -1,10 +1,10 @@
package com.earth2me.essentials.update;
-import org.bukkit.configuration.Configuration;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.bukkit.configuration.Configuration;
public class VersionInfo
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/chat/AbstractFileCommand.java b/EssentialsUpdate/src/com/earth2me/essentials/update/chat/AbstractFileCommand.java
index 824383285..7c99d28f6 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/chat/AbstractFileCommand.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/chat/AbstractFileCommand.java
@@ -1,11 +1,7 @@
package com.earth2me.essentials.update.chat;
import com.earth2me.essentials.update.PastieUpload;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
+import java.io.*;
import java.nio.charset.Charset;
import org.bukkit.plugin.Plugin;
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/chat/ConfigCommand.java b/EssentialsUpdate/src/com/earth2me/essentials/update/chat/ConfigCommand.java
index 5fda07106..de2c6a830 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/chat/ConfigCommand.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/chat/ConfigCommand.java
@@ -26,12 +26,16 @@ public class ConfigCommand extends AbstractFileCommand implements Command
do
{
final String line = page.readLine();
- if (line == null) {
+ if (line == null)
+ {
break;
- } else {
+ }
+ else
+ {
input.append(line).append("\n");
}
- } while (true);
+ }
+ while (true);
page.close();
final String message = "Essentials config.yml: " + uploadToPastie(input);
player.sendMessage("§6" + ircBot.getNick() + ": §7" + message);
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/AbstractState.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/AbstractState.java
index 7478d81b7..2c85c39fd 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/AbstractState.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/AbstractState.java
@@ -26,9 +26,8 @@ public abstract class AbstractState
catch (Exception ex)
{
/*
- * This should never happen.
- * All states that are added to the map automatically,
- * have to have a Constructor that accepts the StateMap.
+ * This should never happen. All states, that are added to the map automatically, have to have a
+ * Constructor that accepts the StateMap.
*/
throw new RuntimeException(ex);
}
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java
index cb88cc642..930a31bda 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java
@@ -8,5 +8,5 @@ public class InstallationFinishedEvent extends Event
public InstallationFinishedEvent()
{
super(Type.CUSTOM_EVENT);
- }
+ }
}
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java
index 6db8734e7..6ce926f92 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/StateMachine.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.update.states;
-import com.earth2me.essentials.update.UpdateCheck;
import com.earth2me.essentials.update.AbstractWorkListener;
+import com.earth2me.essentials.update.UpdateCheck;
import java.util.Iterator;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/UpdateOrInstallation.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/UpdateOrInstallation.java
index 5671275f0..6b48f90be 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/UpdateOrInstallation.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/UpdateOrInstallation.java
@@ -8,17 +8,18 @@ public class UpdateOrInstallation extends AbstractState
{
private final transient UpdateCheck updateCheck;
private transient boolean update = false;
-
+
public UpdateOrInstallation(final StateMap stateMap, final UpdateCheck updateCheck)
{
super(stateMap);
this.updateCheck = updateCheck;
}
-
+
@Override
public boolean guessAnswer()
{
- if (getUpdateCheck().isEssentialsInstalled()) {
+ if (getUpdateCheck().isEssentialsInstalled())
+ {
update = true;
}
return update;
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/InstallModule.java b/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/InstallModule.java
index 66eeb380d..778f5172f 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/InstallModule.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/InstallModule.java
@@ -1,9 +1,9 @@
package com.earth2me.essentials.update.tasks;
+import com.earth2me.essentials.update.AbstractWorkListener;
import com.earth2me.essentials.update.GetFile;
import com.earth2me.essentials.update.ModuleInfo;
import com.earth2me.essentials.update.VersionInfo;
-import com.earth2me.essentials.update.AbstractWorkListener;
import java.io.File;
import java.net.URL;
import java.util.logging.Level;
diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/SelfUpdate.java b/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/SelfUpdate.java
index 777e42517..3baf86be7 100644
--- a/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/SelfUpdate.java
+++ b/EssentialsUpdate/src/com/earth2me/essentials/update/tasks/SelfUpdate.java
@@ -43,8 +43,8 @@ public class SelfUpdate extends AbstractWorkListener implements Task, Runnable
@Override
public void run()
{
- Bukkit.getScheduler().scheduleAsyncDelayedTask(getPlugin(), new Runnable() {
-
+ Bukkit.getScheduler().scheduleAsyncDelayedTask(getPlugin(), new Runnable()
+ {
@Override
public void run()
{
@@ -52,6 +52,4 @@ public class SelfUpdate extends AbstractWorkListener implements Task, Runnable
}
});
}
-
-
}
diff --git a/EssentialsUpdate/src/org/jibble/pircbot/InputThread.java b/EssentialsUpdate/src/org/jibble/pircbot/InputThread.java
index 1c30ad815..a24815210 100755
--- a/EssentialsUpdate/src/org/jibble/pircbot/InputThread.java
+++ b/EssentialsUpdate/src/org/jibble/pircbot/InputThread.java
@@ -15,8 +15,8 @@ found at http://www.jibble.org/licenses/
package org.jibble.pircbot;
import java.io.*;
-import java.net.*;
-import java.util.*;
+import java.net.Socket;
+import java.util.StringTokenizer;
/**
* A Thread which reads lines from the IRC server. It then
diff --git a/EssentialsUpdate/src/org/jibble/pircbot/OutputThread.java b/EssentialsUpdate/src/org/jibble/pircbot/OutputThread.java
index 86ac404d2..7eddee873 100755
--- a/EssentialsUpdate/src/org/jibble/pircbot/OutputThread.java
+++ b/EssentialsUpdate/src/org/jibble/pircbot/OutputThread.java
@@ -14,8 +14,7 @@ found at http://www.jibble.org/licenses/
package org.jibble.pircbot;
-import java.io.*;
-import java.net.*;
+import java.io.BufferedWriter;
/**
* A Thread which is responsible for sending messages to the IRC server.
diff --git a/EssentialsUpdate/src/org/jibble/pircbot/PircBot.java b/EssentialsUpdate/src/org/jibble/pircbot/PircBot.java
index a5f049cde..28148075f 100755
--- a/EssentialsUpdate/src/org/jibble/pircbot/PircBot.java
+++ b/EssentialsUpdate/src/org/jibble/pircbot/PircBot.java
@@ -15,7 +15,8 @@ found at http://www.jibble.org/licenses/
package org.jibble.pircbot;
import java.io.*;
-import java.net.*;
+import java.net.InetAddress;
+import java.net.Socket;
import java.util.*;
/**
@@ -773,7 +774,7 @@ public abstract class PircBot implements ReplyConstants {
}
}
- command = command.toUpperCase();
+ command = command.toUpperCase(Locale.ENGLISH);
if (sourceNick.startsWith(":")) {
sourceNick = sourceNick.substring(1);
}
@@ -2558,7 +2559,7 @@ public abstract class PircBot implements ReplyConstants {
* @see #onUserList(String,User[]) onUserList
*/
public final User[] getUsers(String channel) {
- channel = channel.toLowerCase();
+ channel = channel.toLowerCase(Locale.ENGLISH);
User[] userArray = new User[0];
synchronized (_channels) {
Hashtable users = (Hashtable) _channels.get(channel);
@@ -2631,7 +2632,7 @@ public abstract class PircBot implements ReplyConstants {
* Overwrite the existing entry if it exists.
*/
private final void addUser(String channel, User user) {
- channel = channel.toLowerCase();
+ channel = channel.toLowerCase(Locale.ENGLISH);
synchronized (_channels) {
Hashtable users = (Hashtable) _channels.get(channel);
if (users == null) {
@@ -2647,7 +2648,7 @@ public abstract class PircBot implements ReplyConstants {
* Remove a user from the specified channel in our memory.
*/
private final User removeUser(String channel, String nick) {
- channel = channel.toLowerCase();
+ channel = channel.toLowerCase(Locale.ENGLISH);
User user = new User("", nick);
synchronized (_channels) {
Hashtable users = (Hashtable) _channels.get(channel);
@@ -2695,7 +2696,7 @@ public abstract class PircBot implements ReplyConstants {
* Removes an entire channel from our memory of users.
*/
private final void removeChannel(String channel) {
- channel = channel.toLowerCase();
+ channel = channel.toLowerCase(Locale.ENGLISH);
synchronized (_channels) {
_channels.remove(channel);
}
@@ -2713,7 +2714,7 @@ public abstract class PircBot implements ReplyConstants {
private final void updateUser(String channel, int userMode, String nick) {
- channel = channel.toLowerCase();
+ channel = channel.toLowerCase(Locale.ENGLISH);
synchronized (_channels) {
Hashtable users = (Hashtable) _channels.get(channel);
User newUser = null;
diff --git a/EssentialsUpdate/src/org/jibble/pircbot/User.java b/EssentialsUpdate/src/org/jibble/pircbot/User.java
index cb2bfa051..37f981b19 100755
--- a/EssentialsUpdate/src/org/jibble/pircbot/User.java
+++ b/EssentialsUpdate/src/org/jibble/pircbot/User.java
@@ -13,6 +13,8 @@ found at http://www.jibble.org/licenses/
package org.jibble.pircbot;
+import java.util.Locale;
+
/**
* This class is used to represent a user on an IRC server.
* Instances of this class are returned by the getUsers method
@@ -38,7 +40,7 @@ public class User {
User(String prefix, String nick) {
_prefix = prefix;
_nick = nick;
- _lowerNick = nick.toLowerCase();
+ _lowerNick = nick.toLowerCase(Locale.ENGLISH);
}
@@ -109,7 +111,7 @@ public class User {
* @return true if the nicks are identical (case insensitive).
*/
public boolean equals(String nick) {
- return nick.toLowerCase().equals(_lowerNick);
+ return nick.toLowerCase(Locale.ENGLISH).equals(_lowerNick);
}
diff --git a/EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java b/EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java
index 92faade26..024f2248b 100644
--- a/EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java
+++ b/EssentialsUpdate/test/com/earth2me/essentials/update/VersionTest.java
@@ -4,7 +4,6 @@ import com.earth2me.essentials.update.Version.Type;
import java.util.TreeSet;
import junit.framework.TestCase;
import org.junit.Test;
-import static org.junit.Assert.*;
public class VersionTest extends TestCase
diff --git a/EssentialsXMPP/build.xml b/EssentialsXMPP/build.xml
index 1edb37153..2e92ef710 100644
--- a/EssentialsXMPP/build.xml
+++ b/EssentialsXMPP/build.xml
@@ -74,7 +74,7 @@
<target name="-post-jar">
<jar jarfile="${dist.dir}/EssentialsXMPP.jar">
<zipfileset src="${dist.jar}" excludes="META-INF/*" />
- <zipfileset src="../lib/smack-3.2.0.jar" excludes="META-INF/*" />
+ <zipfileset src="../lib/smack-3.2.1.jar" excludes="META-INF/*" />
<manifest>
<attribute name="Classpath" value="Essentials.jar"/>
</manifest>
diff --git a/EssentialsXMPP/nbproject/build-impl.xml b/EssentialsXMPP/nbproject/build-impl.xml
index 08076c6cb..3293bd709 100644
--- a/EssentialsXMPP/nbproject/build-impl.xml
+++ b/EssentialsXMPP/nbproject/build-impl.xml
@@ -20,10 +20,10 @@ is divided into following sections:
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="EssentialsXMPP-impl">
- <fail message="Please build using Ant 1.7.1 or higher.">
+ <fail message="Please build using Ant 1.8.0 or higher.">
<condition>
<not>
- <antversion atleast="1.7.1"/>
+ <antversion atleast="1.8.0"/>
</not>
</condition>
</fail>
@@ -223,6 +223,7 @@ is divided into following sections:
<property name="javac.fork" value="${jdkBug6558476}"/>
<property name="jar.index" value="false"/>
<property name="jar.index.metainf" value="${jar.index}"/>
+ <property name="copylibs.rebase" value="true"/>
<available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
</target>
<target name="-post-init">
@@ -409,6 +410,7 @@ is divided into following sections:
<property environment="env"/>
<resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
<java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
@@ -539,7 +541,7 @@ is divided into following sections:
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
- <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+ <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
@@ -871,6 +873,14 @@ is divided into following sections:
-->
<target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
+ <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+ <and>
+ <isset property="endorsed.classpath.cmd.line.arg"/>
+ <not>
+ <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+ </not>
+ </and>
+ </condition>
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
<classpath>
<path path="${javac.classpath}"/>
@@ -882,6 +892,7 @@ is divided into following sections:
<include name="**/*.java"/>
<exclude name="*.java"/>
</fileset>
+ <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
</javadoc>
<copy todir="${dist.javadoc.dir}">
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
diff --git a/EssentialsXMPP/nbproject/genfiles.properties b/EssentialsXMPP/nbproject/genfiles.properties
index 3df7372ea..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=6ad41b28
-nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.1.45
+nbproject/build-impl.xml.script.CRC32=8cccbe45
+nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
diff --git a/EssentialsXMPP/nbproject/project.properties b/EssentialsXMPP/nbproject/project.properties
index d2ed6daf3..66d780451 100644
--- a/EssentialsXMPP/nbproject/project.properties
+++ b/EssentialsXMPP/nbproject/project.properties
@@ -28,6 +28,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blank
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.blankLinesBeforeClass=2
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=false
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.importGroupsOrder=*
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indentCasesFromSwitch=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.methodDeclBracePlacement=NEW_LINE
@@ -36,6 +37,7 @@ auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.place
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeElseOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeFinallyOnNewLine=true
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.placeWhileOnNewLine=true
+auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.separateImportGroups=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaceAfterTypeCast=false
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab=4
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size=4
@@ -61,16 +63,16 @@ dist.jar=${dist.dir}/original-EssentialsXMPP.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
-file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar
-file.reference.smack-3.2.0.jar=../lib/smack-3.2.0.jar
+file.reference.bukkit.jar=../lib/bukkit.jar
+file.reference.smack-3.2.1.jar=../lib/smack-3.2.1.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=true
jar.index=${jnlp.enabled}
javac.classpath=\
${reference.Essentials.jar}:\
- ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}:\
- ${file.reference.smack-3.2.0.jar}
+ ${file.reference.smack-3.2.1.jar}:\
+ ${file.reference.bukkit.jar}
# Space-separated list of extra javac options
javac.compilerargs=-Xlint:unchecked
javac.deprecation=false
@@ -81,8 +83,7 @@ javac.target=1.6
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
- ${libs.junit.classpath}:\
- ${libs.junit_4.classpath}
+ ${libs.junit_4.10.classpath}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandsetxmpp.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandsetxmpp.java
index 4a14ef730..e0bf9827c 100644
--- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandsetxmpp.java
+++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandsetxmpp.java
@@ -22,6 +22,6 @@ public class Commandsetxmpp extends EssentialsCommand
}
EssentialsXMPP.getInstance().setAddress(user, args[0]);
- user.sendMessage("XMPP address set to "+args[0]);
+ user.sendMessage("XMPP address set to " + args[0]);
}
}
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java
index 632505670..e7dd01670 100644
--- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java
+++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java
@@ -33,7 +33,8 @@ public class Commandxmpp extends EssentialsCommand
final String message = getFinalArg(args, 1);
final String senderName = sender instanceof Player ? ess.getUser(sender).getDisplayName() : Console.NAME;
sender.sendMessage("[" + senderName + ">" + address + "] " + message);
- if (!EssentialsXMPP.getInstance().sendMessage(address, "[" + senderName + "] " + message)) {
+ if (!EssentialsXMPP.getInstance().sendMessage(address, "[" + senderName + "] " + message))
+ {
sender.sendMessage("§cError sending message.");
}
}
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java
index 631d1b21b..bcbbfa17d 100644
--- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java
+++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java
@@ -1,9 +1,10 @@
package com.earth2me.essentials.xmpp;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.IUser;
-import com.earth2me.essentials.Util;
import java.util.List;
+import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.command.Command;
@@ -22,7 +23,7 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
private transient UserManager users;
private transient XMPPManager xmpp;
private transient IEssentials ess;
-
+
public static IEssentialsXMPP getInstance()
{
return instance;
@@ -35,11 +36,16 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
final PluginManager pluginManager = getServer().getPluginManager();
ess = (IEssentials)pluginManager.getPlugin("Essentials");
- if (ess == null)
+ if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
{
- LOGGER.log(Level.SEVERE, "Failed to load Essentials before EssentialsXMPP");
+ LOGGER.log(Level.WARNING, _("versionMismatchAll"));
}
-
+ if (!ess.isEnabled())
+ {
+ this.setEnabled(false);
+ return;
+ }
+
final EssentialsXMPPPlayerListener playerListener = new EssentialsXMPPPlayerListener(ess);
pluginManager.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this);
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListener, Priority.Monitor, this);
@@ -51,29 +57,29 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
ess.addReloadListener(users);
ess.addReloadListener(xmpp);
- if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
- {
- LOGGER.log(Level.WARNING, Util.i18n("versionMismatchAll"));
- }
- LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
+ LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
}
@Override
public void onDisable()
{
- xmpp.disconnect();
+ if (xmpp != null)
+ {
+ xmpp.disconnect();
+ }
+ instance = null;
}
@Override
public boolean onCommand(final CommandSender sender, final Command command, final String commandLabel, final String[] args)
{
- return ess.onCommandEssentials(sender, command, commandLabel, args, EssentialsXMPP.class.getClassLoader(), "com.earth2me.essentials.xmpp.Command", "essentials.");
+ return ess.onCommandEssentials(sender, command, commandLabel, args, EssentialsXMPP.class.getClassLoader(), "com.earth2me.essentials.xmpp.Command", "essentials.", null);
}
@Override
public void setAddress(final Player user, final String address)
{
- final String username = user.getName().toLowerCase();
+ final String username = user.getName().toLowerCase(Locale.ENGLISH);
instance.users.setAddress(username, address);
}
@@ -93,7 +99,7 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
@Override
public boolean toggleSpy(final Player user)
{
- final String username = user.getName().toLowerCase();
+ final String username = user.getName().toLowerCase(Locale.ENGLISH);
final boolean spy = !instance.users.isSpy(username);
instance.users.setSpy(username, spy);
return spy;
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/UserManager.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/UserManager.java
index 9734444ad..85ef50949 100644
--- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/UserManager.java
+++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/UserManager.java
@@ -3,10 +3,7 @@ package com.earth2me.essentials.xmpp;
import com.earth2me.essentials.EssentialsConf;
import com.earth2me.essentials.IConf;
import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
public class UserManager implements IConf
@@ -24,26 +21,27 @@ public class UserManager implements IConf
public final boolean isSpy(final String username)
{
- return users.getBoolean(username.toLowerCase() + "." + SPY, false);
+ return users.getBoolean(username.toLowerCase(Locale.ENGLISH) + "." + SPY, false);
}
public void setSpy(final String username, final boolean spy)
{
- setUser(username.toLowerCase(), getAddress(username), spy);
+ setUser(username.toLowerCase(Locale.ENGLISH), getAddress(username), spy);
}
public final String getAddress(final String username)
{
- return users.getString(username.toLowerCase() + "." + ADDRESS, null);
+ return users.getString(username.toLowerCase(Locale.ENGLISH) + "." + ADDRESS, null);
}
-
+
public final String getUserByAddress(final String search)
{
final List<String> usernames = users.getKeys(null);
for (String username : usernames)
{
final String address = users.getString(username + "." + ADDRESS, null);
- if (address != null && search.equalsIgnoreCase(address)) {
+ if (address != null && search.equalsIgnoreCase(address))
+ {
return username;
}
}
@@ -52,7 +50,7 @@ public class UserManager implements IConf
public void setAddress(final String username, final String address)
{
- setUser(username.toLowerCase(), address, isSpy(username));
+ setUser(username.toLowerCase(Locale.ENGLISH), address, isSpy(username));
}
public List<String> getSpyUsers()
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java
index cbe89f9d6..72bdb113d 100644
--- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java
+++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java
@@ -5,27 +5,14 @@ import com.earth2me.essentials.EssentialsConf;
import com.earth2me.essentials.IConf;
import com.earth2me.essentials.IUser;
import java.io.File;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import org.bukkit.entity.Player;
-import org.bukkit.plugin.java.JavaPlugin;
-import org.jivesoftware.smack.Chat;
-import org.jivesoftware.smack.ChatManager;
-import org.jivesoftware.smack.ChatManagerListener;
-import org.jivesoftware.smack.ConnectionConfiguration;
-import org.jivesoftware.smack.MessageListener;
import org.jivesoftware.smack.Roster.SubscriptionMode;
-import org.jivesoftware.smack.XMPPConnection;
-import org.jivesoftware.smack.XMPPException;
+import org.jivesoftware.smack.*;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.util.StringUtils;
@@ -69,7 +56,8 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager
}
if (chat != null)
{
- if (!connection.isConnected()) {
+ if (!connection.isConnected())
+ {
disconnect();
connect();
}
@@ -103,7 +91,7 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager
break;
default:
final IUser sender = parent.getUserByAddress(StringUtils.parseBareAddress(chat.getParticipant()));
- parent.broadcastMessage(sender, "="+sender.getDisplayName()+": "+ message, StringUtils.parseBareAddress(chat.getParticipant()));
+ parent.broadcastMessage(sender, "=" + sender.getDisplayName() + ": " + message, StringUtils.parseBareAddress(chat.getParticipant()));
}
}
}
@@ -199,7 +187,7 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager
final String level = config.getString("log-level", "info");
try
{
- logLevel = Level.parse(level.toUpperCase());
+ logLevel = Level.parse(level.toUpperCase(Locale.ENGLISH));
}
catch (IllegalArgumentException e)
{
diff --git a/README.markdown b/README.markdown
index 616a76185..1913e1ba1 100644
--- a/README.markdown
+++ b/README.markdown
@@ -11,7 +11,7 @@ Recommended NetBeans plugins:
* Git
* PMD & FindBugs ( http://kenai.com/projects/sqe/pages/Home )
-You don't need to import settings.zip anymore, since the format guidelines have been added to the project properties.
+Please follow the format guidelines that are saved in the project properties.
Windows users, please read this: http://help.github.com/line-endings/
The default line ending is LF.
diff --git a/WebPush/index.php b/WebPush/index.php
index ab018bf27..56193ebf7 100644
--- a/WebPush/index.php
+++ b/WebPush/index.php
@@ -22,14 +22,15 @@ $build = $_GET['buildid'];
$branch = $_GET['branch'];
$version = $_GET['version'];
-if ($build == "" || $branch == "" || $version == "")
-{
- die();
+include('../build/function.php');
+updateval($branch);
+
+if ($build == "" || $branch == "" || $version == "") {
+ die('Invalid');
}
//Don't upload dev builds atm.
-if ($branch == "bt2")
-{
+if ($branch == "bt2") {
die();
}
@@ -37,16 +38,22 @@ sleep(60);
$changes = getChanges($build, $branch);
-uploadit($build, $branch, 'Essentials.jar', $version, $changes);
-sleep(1);
-uploadit($build, $branch, 'EssentialsChat.jar', $version, $changes);
-sleep(1);
-uploadit($build, $branch, 'EssentialsSpawn.jar', $version, $changes);
+//uploadit($build, $branch, 'Essentials.jar', $version, $changes);
+//sleep(1);
+//uploadit($build, $branch, 'EssentialsChat.jar', $version, $changes);
+//sleep(1);
+//uploadit($build, $branch, 'EssentialsSpawn.jar', $version, $changes);
+//sleep(1);
+//uploadit($build, $branch, 'EssentialsProtect.jar', $version, $changes);
+//sleep(1);
+//uploadit($build, $branch, 'EssentialsXMPP.jar', $version, $changes);
+//sleep(1);
+//uploadit($build, $branch, 'EssentialsGeoIP.jar', $version, $changes);
+
+uploadit($build, $branch, 'Essentials.zip', $version, $changes);
sleep(1);
-uploadit($build, $branch, 'EssentialsProtect.jar', $version, $changes);
-sleep(1);
-uploadit($build, $branch, 'EssentialsXMPP.jar', $version, $changes);
-sleep(1);
-uploadit($build, $branch, 'EssentialsGeoIP.jar', $version, $changes);
+uploadit($build, $branch, 'Essentials-extra.zip', $version, $changes);
+
+
?>
diff --git a/WebPush/upload.php b/WebPush/upload.php
index cf5c2112e..f971062ed 100644
--- a/WebPush/upload.php
+++ b/WebPush/upload.php
@@ -1,35 +1,32 @@
<?php
+
include_once('simple_html_dom.php');
-function uploadit($build, $branch, $file, $version, $changes)
-{
+function uploadit($build, $branch, $file, $version, $changes) {
file_put_contents('status.log', "\nUploading file $file to devbukkit! ", FILE_APPEND);
$slug = "essentials";
$plugin = "Essentials";
$url = "http://ci.earth2me.net/guestAuth/repository/download/$branch/$build:id/$file";
$filename = explode('.', $file);
$request_url = "http://dev.bukkit.org/server-mods/$slug/upload-file.json";
-
+
include ('apikey.php');
-
+
$params['name'] = $filename[0] . '-' . $version;
$params['game_versions'] = 176;
$params['change_log'] = $changes;
$params['change_markup_type'] = "html";
$params['fileurl'] = $url;
-
- if (stripos($version, 'Dev') !== false)
- {
+
+ if (stripos($version, 'Dev') !== false) {
$params['file_type'] = "a";
}
- elseif (stripos($version, 'Pre') !== false)
- {
+ elseif (stripos($version, 'Pre') !== false) {
$params['file_type'] = "b";
}
- else
- {
+ else {
$params['file_type'] = "r";
- }
+ }
$content = file_get_contents($url);
file_put_contents($file, $content);
@@ -42,13 +39,11 @@ function uploadit($build, $branch, $file, $version, $changes)
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$result = curl_exec($ch);
-
- if ($result === false)
- {
+
+ if ($result === false) {
$result = curl_error($ch);
}
- elseif ($result == "")
- {
+ elseif ($result == "") {
$result = "Success uploading $file - $version";
}
curl_close($ch);
@@ -57,8 +52,7 @@ function uploadit($build, $branch, $file, $version, $changes)
return true;
}
-function getChanges($job, $project)
-{
+function getChanges($job, $project) {
$commitblacklist = array(
'Merge branch',
'Merge pull',
@@ -72,20 +66,15 @@ function getChanges($job, $project)
$html->load_file($url);
$output = "Change Log:<ul>";
- foreach ($html->find('.changelist') as $list)
- {
- foreach ($list->find('.comment') as $comment)
- {
+ foreach ($html->find('.changelist') as $list) {
+ foreach ($list->find('.comment') as $comment) {
$text = $comment->innertext;
- foreach ($commitblacklist as $matchtext)
- {
- if (stripos($text, $matchtext) !== FALSE)
- {
+ foreach ($commitblacklist as $matchtext) {
+ if (stripos($text, $matchtext) !== FALSE) {
$text = "";
}
}
- if ($text != "")
- {
+ if ($text != "") {
$output .= "<li>$text</li>\n";
}
}
diff --git a/build.xml b/build.xml
index 6d99694fb..c69c0f075 100644
--- a/build.xml
+++ b/build.xml
@@ -2,6 +2,7 @@
<project default="collect">
<target name="setversion">
<replace dir="." includes="**/src/plugin.yml" token="version: TeamCity" value="version: ${build.number}"/>
+ <replace dir="." includes="**/src/plugin.yml" token="version: GMBuildVer" value="version: ${GMVer} (${build.number})"/>
<replace dir="." includes="**/src/messages*.properties" token="version: TeamCity" value="version: ${build.number}"/>
<replace dir="." includes="**/src/items.csv" token="version: TeamCity" value="version: ${build.number}"/>
</target>
diff --git a/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar b/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
index 5ee71d2e3..01aed63a2 100644
--- a/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
+++ b/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
Binary files differ
diff --git a/lib/EssentialsiConomyBridge.jar b/lib/EssentialsiConomyBridge.jar
deleted file mode 100644
index e847bdf81..000000000
--- a/lib/EssentialsiConomyBridge.jar
+++ /dev/null
Binary files differ
diff --git a/lib/VanishNoPickup.jar b/lib/VanishNoPickup.jar
deleted file mode 100644
index 4acf777ec..000000000
--- a/lib/VanishNoPickup.jar
+++ /dev/null
Binary files differ
diff --git a/lib/Vault.jar b/lib/Vault.jar
new file mode 100644
index 000000000..96b1625c4
--- /dev/null
+++ b/lib/Vault.jar
Binary files differ
diff --git a/lib/bukkit-0.0.1-SNAPSHOT.jar b/lib/bukkit-0.0.1-SNAPSHOT.jar
deleted file mode 100644
index 1551ebdd5..000000000
--- a/lib/bukkit-0.0.1-SNAPSHOT.jar
+++ /dev/null
Binary files differ
diff --git a/lib/bukkit-1.0.0-R1-SNAPSHOT.jar b/lib/bukkit.jar
index fd962b2ac..0dbb054f0 100644
--- a/lib/bukkit-1.0.0-R1-SNAPSHOT.jar
+++ b/lib/bukkit.jar
Binary files differ
diff --git a/lib/craftbukkit-0.0.1-SNAPSHOT.jar b/lib/craftbukkit-0.0.1-SNAPSHOT.jar
deleted file mode 100644
index d6d49561d..000000000
--- a/lib/craftbukkit-0.0.1-SNAPSHOT.jar
+++ /dev/null
Binary files differ
diff --git a/lib/craftbukkit-1.0.0-SNAPSHOT.jar b/lib/craftbukkit.jar
index 9a88b574a..7aac44932 100644
--- a/lib/craftbukkit-1.0.0-SNAPSHOT.jar
+++ b/lib/craftbukkit.jar
Binary files differ
diff --git a/lib/gson.jar b/lib/gson.jar
deleted file mode 100644
index 4f7970541..000000000
--- a/lib/gson.jar
+++ /dev/null
Binary files differ
diff --git a/lib/junit/junit-3.8.2-api.zip b/lib/junit/junit-3.8.2-api.zip
deleted file mode 100644
index 6d792fdaa..000000000
--- a/lib/junit/junit-3.8.2-api.zip
+++ /dev/null
Binary files differ
diff --git a/lib/junit/junit-3.8.2.jar b/lib/junit/junit-3.8.2.jar
deleted file mode 100644
index d83587261..000000000
--- a/lib/junit/junit-3.8.2.jar
+++ /dev/null
Binary files differ
diff --git a/lib/junit_4.10/junit-4.10-src.jar b/lib/junit_4.10/junit-4.10-src.jar
new file mode 100644
index 000000000..458b63c7e
--- /dev/null
+++ b/lib/junit_4.10/junit-4.10-src.jar
Binary files differ
diff --git a/lib/junit_4.10/junit-4.10.jar b/lib/junit_4.10/junit-4.10.jar
new file mode 100644
index 000000000..bf5c0b9c6
--- /dev/null
+++ b/lib/junit_4.10/junit-4.10.jar
Binary files differ
diff --git a/lib/junit_4/junit-4.5-api.zip b/lib/junit_4/junit-4.5-api.zip
deleted file mode 100644
index 5748c444d..000000000
--- a/lib/junit_4/junit-4.5-api.zip
+++ /dev/null
Binary files differ
diff --git a/lib/junit_4/junit-4.5-src.jar b/lib/junit_4/junit-4.5-src.jar
deleted file mode 100644
index 18774a573..000000000
--- a/lib/junit_4/junit-4.5-src.jar
+++ /dev/null
Binary files differ
diff --git a/lib/junit_4/junit-4.5.jar b/lib/junit_4/junit-4.5.jar
deleted file mode 100644
index 83f8bc793..000000000
--- a/lib/junit_4/junit-4.5.jar
+++ /dev/null
Binary files differ
diff --git a/lib/mysql.jar b/lib/mysql.jar
deleted file mode 100644
index 0539039f7..000000000
--- a/lib/mysql.jar
+++ /dev/null
Binary files differ
diff --git a/lib/nblibraries.properties b/lib/nblibraries.properties
index 6c4ff50b3..0380a6c75 100644
--- a/lib/nblibraries.properties
+++ b/lib/nblibraries.properties
@@ -1,13 +1,7 @@
libs.CopyLibs.classpath=\
${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
-libs.junit.classpath=\
- ${base}/junit/junit-3.8.2.jar
-libs.junit.javadoc=\
- ${base}/junit/junit-3.8.2-api.zip
-libs.junit_4.classpath=\
- ${base}/junit_4/junit-4.5.jar
-libs.junit_4.javadoc=\
- ${base}/junit_4/junit-4.5-api.zip
-libs.junit_4.src=\
- ${base}/junit_4/junit-4.5-src.jar
+libs.junit_4.10.classpath=\
+ ${base}/junit_4.10/junit-4.10.jar
+libs.junit_4.10.src=\
+ ${base}/junit_4.10/junit-4.10-src.jar
project.EssentialsGroupManager=../EssentialsGroupManager
diff --git a/lib/smack-3.2.0.jar b/lib/smack-3.2.1.jar
index 22b9780dd..3c09c9f6c 100644
--- a/lib/smack-3.2.0.jar
+++ b/lib/smack-3.2.1.jar
Binary files differ
diff --git a/lib/sqlite.jar b/lib/sqlite.jar
deleted file mode 100644
index 0b47e2cf9..000000000
--- a/lib/sqlite.jar
+++ /dev/null
Binary files differ
diff --git a/settings.zip b/settings.zip
deleted file mode 100644
index 33660fcdc..000000000
--- a/settings.zip
+++ /dev/null
Binary files differ