From d86a69c738d7cf566d59979bd7162f924503c8ea Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Dec 2011 04:39:51 +0100 Subject: Updated items.csv by michaelwm from ecocitycraft.com --- Essentials/src/items.csv | 174 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 172 insertions(+), 2 deletions(-) diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index 3803cb6fe..a29b4b1dc 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -1341,18 +1341,105 @@ 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 brewingstand,117,0 +brewer,117,0 +potionstand,117,0 +potionbrewer,117,0 +pstand,117,0 +bstand,117,0 +pbrewer,117,0 +bbrewer,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 @@ -2224,19 +2311,100 @@ epearl,368,0 bluepearl,368,0 endergem,368,0 blazerod,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 -brewingsstanditem,379,0 +goldcream,378,0 +blazecream,378,0 +mcream,378,0 +gcream,378,0 +bcream,378,0 +combinedcream,378,0 +ccream,378,0 +brewingstanditem,379,0 +potionstanditem,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 goldmusicrecord,2256,0 goldmusicdisk,2256,0 goldmusiccd,2256,0 @@ -2255,6 +2423,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 @@ -2273,6 +2442,7 @@ greencd,2257,0 grrecord,2257,0 grdisk,2257,0 grcd,2257,0 +record2,2257,0 record3,2258,0 record4,2259,0 record5,2260,0 @@ -2281,4 +2451,4 @@ record7,2262,0 record8,2263,0 record9,2264,0 record10,2265,0 -record11,2266,0 +record11,2266,0 \ No newline at end of file -- cgit v1.2.3 From db9df1823151a35d0aaff3fb5926587dc7162f91 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Dec 2011 04:46:43 +0100 Subject: minor changes to items.csv --- Essentials/src/items.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index a29b4b1dc..b7fffd973 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -1410,7 +1410,6 @@ potionbrewer,117,0 pstand,117,0 bstand,117,0 pbrewer,117,0 -bbrewer,117,0 cauldron,118,0 steelcauldron,118,0 ironcauldron,118,0 @@ -2311,6 +2310,7 @@ epearl,368,0 bluepearl,368,0 endergem,368,0 blazerod,369,0 +goldenrod,369,0 goldrod,369,0 blazestick,369,0 goldstick,369,0 @@ -2451,4 +2451,4 @@ record7,2262,0 record8,2263,0 record9,2264,0 record10,2265,0 -record11,2266,0 \ No newline at end of file +record11,2266,0 -- cgit v1.2.3 From 9a172c79f18bb2ae1aa340c59f76a2c36578672e Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 1 Dec 2011 13:42:39 +0000 Subject: Command Cleanup --- .../src/com/earth2me/essentials/EssentialsConf.java | 1 - .../earth2me/essentials/EssentialsPlayerListener.java | 2 +- .../src/com/earth2me/essentials/OfflinePlayer.java | 1 - Essentials/src/com/earth2me/essentials/Settings.java | 8 +------- Essentials/src/com/earth2me/essentials/UserMap.java | 2 -- .../com/earth2me/essentials/commands/Commandenchant.java | 8 ++------ .../src/com/earth2me/essentials/commands/Commandr.java | 16 ++++++++-------- .../earth2me/essentials/commands/Commandrealname.java | 6 +++--- .../com/earth2me/essentials/commands/Commandrules.java | 2 +- .../com/earth2me/essentials/commands/Commandseen.java | 2 +- .../com/earth2me/essentials/commands/Commandsell.java | 2 +- .../com/earth2me/essentials/commands/Commandsethome.java | 2 +- .../com/earth2me/essentials/commands/Commandsetjail.java | 2 +- .../com/earth2me/essentials/commands/Commandsetwarp.java | 4 ++-- .../earth2me/essentials/commands/Commandsetworth.java | 2 +- .../earth2me/essentials/commands/Commandsocialspy.java | 2 +- .../com/earth2me/essentials/commands/Commandspawner.java | 3 +-- .../earth2me/essentials/commands/Commandspawnmob.java | 10 +++++----- .../earth2me/essentials/storage/BukkitConstructor.java | 6 +----- .../earth2me/essentials/storage/YamlStorageReader.java | 1 + .../earth2me/essentials/storage/YamlStorageWriter.java | 1 + .../src/com/earth2me/essentials/userdata/UserData.java | 7 +------ 22 files changed, 34 insertions(+), 56 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsConf.java b/Essentials/src/com/earth2me/essentials/EssentialsConf.java index 8b8b79279..c47161135 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsConf.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsConf.java @@ -2,7 +2,6 @@ package com.earth2me.essentials; import static com.earth2me.essentials.I18n._; import java.io.*; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index ad7a396d7..f4b3a595a 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -1,8 +1,8 @@ package com.earth2me.essentials; +import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.craftbukkit.EnchantmentFix; import com.earth2me.essentials.craftbukkit.SetBed; -import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.textreader.IText; import com.earth2me.essentials.textreader.KeywordReplacer; import com.earth2me.essentials.textreader.TextInput; diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index deccf6516..d8c871b5b 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -4,7 +4,6 @@ import static com.earth2me.essentials.I18n._; import java.net.InetSocketAddress; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set; import java.util.UUID; import lombok.Delegate; diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 42f6764b3..ac74329ec 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -3,13 +3,7 @@ package com.earth2me.essentials; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.commands.IEssentialsCommand; import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.ChatColor; diff --git a/Essentials/src/com/earth2me/essentials/UserMap.java b/Essentials/src/com/earth2me/essentials/UserMap.java index 708494296..25f8c0c0e 100644 --- a/Essentials/src/com/earth2me/essentials/UserMap.java +++ b/Essentials/src/com/earth2me/essentials/UserMap.java @@ -10,8 +10,6 @@ import java.util.Collections; import java.util.Locale; import java.util.Set; import java.util.concurrent.ExecutionException; -import java.util.logging.Level; -import java.util.logging.Logger; import org.bukkit.entity.Player; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java b/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java index 3ef886347..22462cea0 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java @@ -1,18 +1,14 @@ package com.earth2me.essentials.commands; +import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; import com.earth2me.essentials.craftbukkit.EnchantmentFix; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; +import java.util.*; import java.util.regex.Pattern; import org.bukkit.Server; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; -import static com.earth2me.essentials.I18n._; public class Commandenchant extends EssentialsCommand diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandr.java b/Essentials/src/com/earth2me/essentials/commands/Commandr.java index c53ef1bf0..1da198444 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandr.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandr.java @@ -17,18 +17,18 @@ 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) { throw new NotEnoughArgumentsException(); } - 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; + final String message = getFinalArg(args, 0); + final IReplyTo replyTo = sender instanceof Player ? ess.getUser((Player)sender) : Console.getConsoleReplyTo(); + final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME; + final CommandSender target = replyTo.getReplyTo(); + final String targetName = target instanceof Player ? ((Player)target).getDisplayName() : Console.NAME; if (target == null) { @@ -38,8 +38,8 @@ public class Commandr extends EssentialsCommand 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; } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java index d3d82860d..6266b5178 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java @@ -17,16 +17,16 @@ 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(Locale.ENGLISH); - for (Player p : server.getOnlinePlayers()) + for (Player onlinePlayer : server.getOnlinePlayers()) { - final User u = ess.getUser(p); + final User u = ess.getUser(onlinePlayer); if (u.isHidden()) { continue; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrules.java b/Essentials/src/com/earth2me/essentials/commands/Commandrules.java index a981fb2f1..d87c4f41b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrules.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrules.java @@ -16,7 +16,7 @@ public class Commandrules extends EssentialsCommand } @Override - public void run(final Server server, final CommandSender sender, final String commandLabel, String[] args) throws Exception + public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { final IText input = new TextInput(sender, "rules", true, ess); final IText output = new KeywordReplacer(input, sender, ess); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index 391ed36b3..49e39876e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -15,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) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java index 554bb4a2e..f0e1cb150 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java @@ -20,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) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java index 6d05e4e3e..e7687fcfd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java @@ -14,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) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java index 506829ad9..a4d6c4ba7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java @@ -13,7 +13,7 @@ public class Commandsetjail 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) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java index 77bbee7c0..bf5c11abe 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java @@ -14,14 +14,14 @@ 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(); } - Location loc = user.getLocation(); + final Location loc = user.getLocation(); ess.getWarps().setWarp(args[0], loc); 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 3f80fddf1..1d236b70a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java @@ -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) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java b/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java index b7ce4edcb..6080642a1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java @@ -13,7 +13,7 @@ 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() ? _("enabled") : _("disabled"))); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java index e3b1ef366..73c86eba4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java @@ -8,7 +8,6 @@ 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; @@ -20,7 +19,7 @@ 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) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index d42437368..2c1466167 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -22,7 +22,7 @@ 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) { @@ -30,7 +30,7 @@ public class Commandspawnmob extends EssentialsCommand } - String[] mountparts = args[0].split(","); + final String[] mountparts = args[0].split(","); String[] parts = mountparts[0].split(":"); String mobType = parts[0]; String mobData = null; @@ -76,8 +76,8 @@ public class Commandspawnmob extends EssentialsCommand { throw new Exception(_("unableToSpawnMob")); } - Location loc = block.getLocation(); - Location sloc = Util.getSafeDestination(loc); + final Location loc = block.getLocation(); + final Location sloc = Util.getSafeDestination(loc); try { spawnedMob = mob.spawn(user, server, sloc); @@ -179,7 +179,7 @@ public class Commandspawnmob extends EssentialsCommand } } - private void changeMobData(CreatureType 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 (type == CreatureType.SLIME || type == CreatureType.MAGMA_CUBE) { diff --git a/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java b/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java index 7ed12b6d5..c3cd9a022 100644 --- a/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java +++ b/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java @@ -10,11 +10,7 @@ import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import org.bukkit.material.MaterialData; import org.yaml.snakeyaml.constructor.Constructor; -import org.yaml.snakeyaml.nodes.MappingNode; -import org.yaml.snakeyaml.nodes.Node; -import org.yaml.snakeyaml.nodes.NodeId; -import org.yaml.snakeyaml.nodes.NodeTuple; -import org.yaml.snakeyaml.nodes.ScalarNode; +import org.yaml.snakeyaml.nodes.*; public class BukkitConstructor extends Constructor diff --git a/Essentials/src/com/earth2me/essentials/storage/YamlStorageReader.java b/Essentials/src/com/earth2me/essentials/storage/YamlStorageReader.java index 2881c1f18..321f5fc3c 100644 --- a/Essentials/src/com/earth2me/essentials/storage/YamlStorageReader.java +++ b/Essentials/src/com/earth2me/essentials/storage/YamlStorageReader.java @@ -22,6 +22,7 @@ public class YamlStorageReader implements IStorageReader this.reader = reader; } + @Override public T load(final Class clazz) { Yaml yaml = preparedYamls.get(clazz); diff --git a/Essentials/src/com/earth2me/essentials/storage/YamlStorageWriter.java b/Essentials/src/com/earth2me/essentials/storage/YamlStorageWriter.java index 48540483d..fd1f0f863 100644 --- a/Essentials/src/com/earth2me/essentials/storage/YamlStorageWriter.java +++ b/Essentials/src/com/earth2me/essentials/storage/YamlStorageWriter.java @@ -30,6 +30,7 @@ public class YamlStorageWriter implements IStorageWriter this.writer = writer; } + @Override public void save(final StorageObject object) { try diff --git a/Essentials/src/com/earth2me/essentials/userdata/UserData.java b/Essentials/src/com/earth2me/essentials/userdata/UserData.java index bce62f5fa..fe537cae8 100644 --- a/Essentials/src/com/earth2me/essentials/userdata/UserData.java +++ b/Essentials/src/com/earth2me/essentials/userdata/UserData.java @@ -4,12 +4,7 @@ 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.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 lombok.Data; import lombok.EqualsAndHashCode; import org.bukkit.Location; -- cgit v1.2.3 From 028aa6be674e834a05bdf151cb5fd01ed562b92d Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 1 Dec 2011 14:43:00 +0000 Subject: Fixing spawnmob errors to say the right thing. --- .../src/com/earth2me/essentials/commands/Commandessentials.java | 2 +- .../src/com/earth2me/essentials/commands/Commandspawnmob.java | 8 ++++---- Essentials/src/messages.properties | 8 ++++++-- Essentials/src/messages_da.properties | 8 ++++++-- Essentials/src/messages_de.properties | 6 +++++- Essentials/src/messages_en.properties | 6 +++++- Essentials/src/messages_es.properties | 6 +++++- Essentials/src/messages_fr.properties | 8 ++++++-- Essentials/src/messages_nl.properties | 6 +++++- 9 files changed, 43 insertions(+), 15 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index 507298a0b..14bbf5e02 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -44,7 +44,7 @@ public class Commandessentials extends EssentialsCommand { sender.sendMessage("Essentials " + ess.getDescription().getVersion()); sender.sendMessage("/ "); - sender.sendMessage("Essentials blocked the following commands, due to command conflicts:"); + sender.sendMessage(_("blockList")); final StringBuilder disabledCommands = new StringBuilder(); for (Map.Entry entry : ess.getAlternativeCommandsHandler().disabledCommands().entrySet()) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 2c1466167..60b99b217 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -64,11 +64,11 @@ public class Commandspawnmob extends EssentialsCommand if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH))) { - throw new Exception(_("unableToSpawnMob")); + throw new Exception(_("disabledToSpawnMob")); } if (!user.isAuthorized("essentials.spawnmob." + mob.name.toLowerCase())) { - throw new Exception(_("unableToSpawnMob")); + throw new Exception(_("noPermToSpawnMob")); } final Block block = Util.getTarget(user).getBlock(); @@ -98,11 +98,11 @@ public class Commandspawnmob extends EssentialsCommand if (ess.getSettings().getProtectPreventSpawn(mobMount.getType().toString().toLowerCase(Locale.ENGLISH))) { - throw new Exception(_("unableToSpawnMob")); + throw new Exception(_("disabledToSpawnMob")); } if (!user.isAuthorized("essentials.spawnmob." + mobMount.name.toLowerCase())) { - throw new Exception(_("unableToSpawnMob")); + throw new Exception(_("noPermToSpawnMob")); } try { diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 22881e5a1..2c1b754ec 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -24,6 +24,7 @@ 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 blocked the following commands, due to command conflicts: broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0} buildAlert=\u00a7cYou are not permitted to build bukkitFormatChanged=Bukkit version format changed. Version not checked. @@ -63,6 +64,7 @@ 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} @@ -151,8 +153,8 @@ 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. +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 @@ -195,6 +197,7 @@ 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. @@ -218,6 +221,7 @@ noMailSendPerm=\u00a7cYou do not have the \u00a7fessentials.mail.send\u00a7c per noMotd=\u00a7cThere is no message of the day. noNewMail=\u00a77You have no new mail. noPendingRequest=You do not have a pending request. +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. @@ -363,7 +367,7 @@ 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. +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. diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index c7cccbb00..16e57fbf0 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -24,6 +24,7 @@ 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. +blockList=Essentials blocked the following commands, due to command conflicts: broadcast=[\u00a7cMeddelelse\u00a7f]\u00a7a {0} buildAlert=\u00a7cDu er ikke tilladt at bygge! bukkitFormatChanged=Bukkit version format \u00e6ndret. Version er ikke checket. @@ -63,6 +64,7 @@ depthBelowSea=\u00a77Du er {0} blok(ke) under havoverfladen. destinationNotSet=Destination er ikke sat disableUnlimited=\u00a77Deaktiverede ubergr\u00e6nset placering af {0} for {1}. disabled=deaktiveret +disabledToSpawnMob=Spawning this mob was disabled in the config file. 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} @@ -151,8 +153,8 @@ 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. +kitError=\u00a7cDer er ikke nogen gyldige pakker. 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 @@ -195,6 +197,7 @@ 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. +nearbyPlayers=Players nearby: {0} 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. @@ -207,8 +210,8 @@ 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. noGodWorldWarning=\u00a7cWarning! God mode in this world disabled. +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. @@ -218,6 +221,7 @@ 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. +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=\u00a7cDer er ingen regler fastsat endnu. diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 01a328774..0865a4b37 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -24,6 +24,7 @@ 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 blocked the following commands, due to command conflicts: broadcast=[\u00a7cRundruf\u00a7f]\u00a7a {0} buildAlert=\u00a7cDu hast keine Rechte zum Bauen. bukkitFormatChanged=Bukkit-Versionsformat hat sich ge\u00e4ndert. Version nicht kontrolliert. @@ -63,6 +64,7 @@ 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} @@ -151,8 +153,8 @@ 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. +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 @@ -195,6 +197,7 @@ 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. @@ -218,6 +221,7 @@ noMailSendPerm=\u00a7cDu hast die Rechte \u00a7fessentials.mail.send\u00a7c nich noMotd=\u00a7cEs existiert keine Willkommensnachricht. noNewMail=\u00a77Du hast keine Nachrichten. noPendingRequest=Du hast keine Teleportierungsanfragen. +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. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 4045b70e5..373aa6129 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -24,6 +24,7 @@ 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 blocked the following commands, due to command conflicts: broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0} buildAlert=\u00a7cYou are not permitted to build bukkitFormatChanged=Bukkit version format changed. Version not checked. @@ -63,6 +64,7 @@ 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} @@ -151,8 +153,8 @@ 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. +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 @@ -195,6 +197,7 @@ 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. @@ -218,6 +221,7 @@ noMailSendPerm=\u00a7cYou do not have the \u00a7fessentials.mail.send\u00a7c per noMotd=\u00a7cThere is no message of the day. noNewMail=\u00a77You have no new mail. noPendingRequest=You do not have a pending request. +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. diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 8fdb84408..3955f9f2a 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -24,6 +24,7 @@ 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 blocked the following commands, due to command conflicts: broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0} buildAlert=\u00a7cNo tienes permisos para construir bukkitFormatChanged=Version de formato de Bukkit cambiado. Version no comprobada. @@ -63,6 +64,7 @@ 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} @@ -151,8 +153,8 @@ jumpError=Eso es demasiado para tu ordenador! kickDefault=Echado del servidor. kickExempt=\u00a7cNo puedes echar a esa persona. kill=\u00a77ha matado a {0}. -kitError=\u00a7cNo hay ningun kit valido. 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 @@ -195,6 +197,7 @@ 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. @@ -218,6 +221,7 @@ noMailSendPerm=\u00a7cNo tienes el permiso de \u00a7fessentials.mail.send\u00a7c noMotd=\u00a7cNo hay ningun mensaje del dia. noNewMail=\u00a77No tienes ningun correo nuevo. noPendingRequest=No tienes ninguna peticion pendiente. +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. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 28b0edc1c..a25da6368 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -24,6 +24,7 @@ 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 blocked the following commands, due to command conflicts: 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. @@ -63,6 +64,7 @@ depthBelowSea=\u00a77Vous \u00eates \u00e0 {0} bloc(s) en-dessous du niveau de l 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} @@ -151,8 +153,8 @@ 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. +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. @@ -195,6 +197,7 @@ 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. @@ -218,6 +221,7 @@ noMailSendPerm=\u00a7cVous n''avez pas la permission \u00a7fessentials.mail.send 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. +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. @@ -391,4 +395,4 @@ 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. \ No newline at end of file +youHaveNewMail=\u00a7cVous avez {0} messages ! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier. diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 0f083e0fe..ab5a93928 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -24,6 +24,7 @@ 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 blocked the following commands, due to command conflicts: broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0} buildAlert=\u00a7cJe bent niet bevoegd om te bouwen bukkitFormatChanged=Bukkit versie formaat veranderd. Versie niet nagekeken. @@ -63,6 +64,7 @@ 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}. @@ -151,8 +153,8 @@ 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. +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 @@ -195,6 +197,7 @@ 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. @@ -218,6 +221,7 @@ noMailSendPerm=\u00a7cJe hebt de \u00a7fessentials.mail.send\u00a7c toestemming noMotd=\u00a7cEr is geen bericht van de dag. noNewMail=\u00a77Je hebt geen nieuwe berichten. noPendingRequest=Je hebt geen aanvragen. +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. -- cgit v1.2.3 From 34a2e03df74f6cf007b42c917f6f5e9400a8ec92 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 1 Dec 2011 14:43:16 +0000 Subject: Command: /near --- .../earth2me/essentials/commands/Commandnear.java | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Essentials/src/com/earth2me/essentials/commands/Commandnear.java 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..4df3598da --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnear.java @@ -0,0 +1,68 @@ +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.entity.Player; + + +public class Commandnear extends EssentialsCommand +{ + public Commandnear() + { + super("near"); + } + + //Todo Translate + @Override + protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception + { + long radius = 100; + if (args.length > 0) + { + try + { + radius = Long.parseLong(args[0]); + } + catch (NumberFormatException e) + { + } + } + user.sendMessage(_("nearbyPlayers", getLocal(server, user, radius))); + } + + private String getLocal(final Server server, final User user, final long radius) + { + 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(); + final StringBuilder output = new StringBuilder(); + + for (Player onlinePlayer : server.getOnlinePlayers()) + { + final User player = ess.getUser(onlinePlayer); + if (!player.equals(user) && !player.isHidden()) + { + final Location l = player.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()) + { + if (output.length() > 0) + { + output.append(", "); + } + output.append(user.getDisplayName()).append("&f(&4").append(delta).append("m&f)"); + } + } + } + return output.length() > 1 ? output.toString() : _("none"); + } +} -- cgit v1.2.3 From e7ea30c5177140000d3deb2aaafaca5e73f958a6 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 1 Dec 2011 15:15:45 +0000 Subject: Better distance checking. --- .../earth2me/essentials/commands/Commandnear.java | 20 +++++------- Essentials/src/messages.properties | 2 +- Essentials/src/messages_da.properties | 2 +- Essentials/src/messages_de.properties | 2 +- Essentials/src/messages_en.properties | 2 +- Essentials/src/messages_es.properties | 2 +- Essentials/src/messages_fr.properties | 2 +- Essentials/src/messages_nl.properties | 2 +- .../essentials/chat/EssentialsChatPlayer.java | 37 ++++++++++------------ 9 files changed, 32 insertions(+), 39 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnear.java b/Essentials/src/com/earth2me/essentials/commands/Commandnear.java index 4df3598da..cfb8d671b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnear.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnear.java @@ -16,7 +16,6 @@ public class Commandnear extends EssentialsCommand super("near"); } - //Todo Translate @Override protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { @@ -34,26 +33,23 @@ public class Commandnear extends EssentialsCommand user.sendMessage(_("nearbyPlayers", getLocal(server, user, radius))); } - private String getLocal(final Server server, final User user, final long radius) + private String getLocal(final Server server, final User user, long radius) { 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(); + final World world = loc.getWorld(); final StringBuilder output = new StringBuilder(); + radius *= radius; for (Player onlinePlayer : server.getOnlinePlayers()) { final User player = ess.getUser(onlinePlayer); if (!player.equals(user) && !player.isHidden()) { - final Location l = player.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()) + final Location playerLoc = player.getLocation(); + if (playerLoc.getWorld() != world) { continue; } + + final double delta = playerLoc.distanceSquared(loc); + if (delta > radius) { if (output.length() > 0) { diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 2c1b754ec..5d1efdf65 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -221,7 +221,7 @@ noMailSendPerm=\u00a7cYou do not have the \u00a7fessentials.mail.send\u00a7c per noMotd=\u00a7cThere is no message of the day. noNewMail=\u00a77You have no new mail. noPendingRequest=You do not have a pending request. -noPermToSpawnMob=\u00a7cYou don't have permission to spawn this mob. +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. diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 16e57fbf0..c5d9dc411 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -221,7 +221,7 @@ 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. -noPermToSpawnMob=\u00a7cYou don't have permission to spawn this mob. +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=\u00a7cDer er ingen regler fastsat endnu. diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 0865a4b37..75510937f 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -221,7 +221,7 @@ noMailSendPerm=\u00a7cDu hast die Rechte \u00a7fessentials.mail.send\u00a7c nich noMotd=\u00a7cEs existiert keine Willkommensnachricht. noNewMail=\u00a77Du hast keine Nachrichten. noPendingRequest=Du hast keine Teleportierungsanfragen. -noPermToSpawnMob=\u00a7cYou don't have permission to spawn this mob. +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. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 373aa6129..28e7bd99f 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -221,7 +221,7 @@ noMailSendPerm=\u00a7cYou do not have the \u00a7fessentials.mail.send\u00a7c per noMotd=\u00a7cThere is no message of the day. noNewMail=\u00a77You have no new mail. noPendingRequest=You do not have a pending request. -noPermToSpawnMob=\u00a7cYou don't have permission to spawn this mob. +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. diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 3955f9f2a..b4fc3afb9 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -221,7 +221,7 @@ noMailSendPerm=\u00a7cNo tienes el permiso de \u00a7fessentials.mail.send\u00a7c noMotd=\u00a7cNo hay ningun mensaje del dia. noNewMail=\u00a77No tienes ningun correo nuevo. noPendingRequest=No tienes ninguna peticion pendiente. -noPermToSpawnMob=\u00a7cYou don't have permission to spawn this mob. +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. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index a25da6368..ef72f4f8b 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -221,7 +221,7 @@ noMailSendPerm=\u00a7cVous n''avez pas la permission \u00a7fessentials.mail.send 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. -noPermToSpawnMob=\u00a7cYou don't have permission to spawn this mob. +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. diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index ab5a93928..c101cc0be 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -221,7 +221,7 @@ noMailSendPerm=\u00a7cJe hebt de \u00a7fessentials.mail.send\u00a7c toestemming noMotd=\u00a7cEr is geen bericht van de dag. noNewMail=\u00a77Je hebt geen nieuwe berichten. noPendingRequest=Je hebt geen aanvragen. -noPermToSpawnMob=\u00a7cYou don't have permission to spawn this mob. +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. diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java index 305e13e8a..2d6e1ae4e 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java @@ -15,7 +15,7 @@ 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; @@ -112,34 +112,31 @@ public abstract class EssentialsChatPlayer extends PlayerListener logger.info(_("localFormat", sender.getName(), event.getMessage())); final Location loc = sender.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()) + + for (Player onlinePlayer : server.getOnlinePlayers()) { String type = "[L]"; - final User u = ess.getUser(p); + final User user = ess.getUser(onlinePlayer); //TODO: remove reference to op - if (u.isIgnoredPlayer(sender.getName()) && !sender.isOp()) + if (user.isIgnoredPlayer(sender.getName()) && !sender.isOp()) { continue; } - if (!u.equals(sender)) - { - 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()) + if (!user.equals(sender)) + { + final Location playerLoc = user.getLocation(); + if (playerLoc.getWorld() != world) { continue; } + final double delta = playerLoc.distanceSquared(loc); + + if (delta > radius) { - if (!u.isAuthorized("essentials.chat.spy")) + if (user.isAuthorized("essentials.chat.spy")) { - continue; + type = type.concat("[Spy]"); } else { - type = type.concat("[Spy]"); + continue; } } } @@ -147,9 +144,9 @@ public abstract class EssentialsChatPlayer extends PlayerListener String message = String.format(event.getFormat(), type.concat(sender.getDisplayName()), event.getMessage()); for (IEssentialsChatListener listener : listeners.values()) { - message = listener.modifyMessage(event, p, message); + message = listener.modifyMessage(event, onlinePlayer, message); } - u.sendMessage(message); + user.sendMessage(message); } } } -- cgit v1.2.3 From 748d388705164cb18aee1cdcdd66d33e855779ab Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 1 Dec 2011 15:31:53 +0000 Subject: Fixing near output. --- Essentials/src/com/earth2me/essentials/commands/Commandnear.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnear.java b/Essentials/src/com/earth2me/essentials/commands/Commandnear.java index cfb8d671b..95d3ce808 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnear.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnear.java @@ -49,13 +49,13 @@ public class Commandnear extends EssentialsCommand if (playerLoc.getWorld() != world) { continue; } final double delta = playerLoc.distanceSquared(loc); - if (delta > radius) + if (delta < radius) { if (output.length() > 0) { output.append(", "); } - output.append(user.getDisplayName()).append("&f(&4").append(delta).append("m&f)"); + output.append(player.getDisplayName()).append("&f(&4").append(delta).append("m&f)"); } } } -- cgit v1.2.3 From 854df233896cd58fab71d607445d06b007a2ec18 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 1 Dec 2011 15:58:25 +0000 Subject: Show how far away each player is. --- Essentials/src/com/earth2me/essentials/commands/Commandnear.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnear.java b/Essentials/src/com/earth2me/essentials/commands/Commandnear.java index 95d3ce808..2730256ef 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnear.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnear.java @@ -48,14 +48,14 @@ public class Commandnear extends EssentialsCommand final Location playerLoc = player.getLocation(); if (playerLoc.getWorld() != world) { continue; } - final double delta = playerLoc.distanceSquared(loc); + final long delta = (long)playerLoc.distanceSquared(loc); if (delta < radius) { if (output.length() > 0) { output.append(", "); } - output.append(player.getDisplayName()).append("&f(&4").append(delta).append("m&f)"); + output.append(player.getDisplayName()).append("§f(§4").append(Math.sqrt(delta)).append("m§f)"); } } } -- cgit v1.2.3 From 97d174ba21f89ff655eba1a06ed804a00f8fd495 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 1 Dec 2011 16:20:53 +0000 Subject: CB#1538 b#1050 --- Essentials/src/com/earth2me/essentials/Essentials.java | 2 +- .../src/com/earth2me/essentials/OfflinePlayer.java | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 80fbd7265..431824d0b 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -61,7 +61,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 1534; + public static final int BUKKIT_VERSION = 1538; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index d8c871b5b..09ba91f96 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -784,4 +784,22 @@ public class OfflinePlayer implements Player { 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."); + } } -- cgit v1.2.3 From 3f56bde72fd2ed3ec9135b45c1416c45e7e64d6b Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 1 Dec 2011 17:25:46 +0000 Subject: Missing aliases --- Essentials/src/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 444a88335..6063b3955 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -82,7 +82,7 @@ commands: enchant: description: Enchants the item the user is holding. usage: / [level] - aliases: [enchantment] + aliases: [enchantment,eenchant,eenchantment] essentials: description: Reloads essentials. usage: / -- cgit v1.2.3 From 8e4bddba2afed1bb4001b014f1437f4c13b73841 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 1 Dec 2011 17:32:48 +0000 Subject: Missing command aliases. --- Essentials/src/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 6063b3955..f4805324c 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -313,7 +313,7 @@ commands: tp: description: Teleport to a player. usage: / [otherplayer] - aliases: [etp] + aliases: [tele,etele,etp,tp2p,etp2p] tpa: description: Request to teleport to the specified player. usage: / -- cgit v1.2.3 From 2f0d5f88dec465d11d8a6f78a4682f7a1f1ee830 Mon Sep 17 00:00:00 2001 From: Khyperia Date: Thu, 1 Dec 2011 10:02:57 +0800 Subject: Added {DATE} and {TIME} to motd --- .../src/com/earth2me/essentials/textreader/KeywordReplacer.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java index 29e44a682..84cd63f68 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java +++ b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java @@ -2,6 +2,8 @@ package com.earth2me.essentials.textreader; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.User; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.List; import java.util.Map; import org.bukkit.World; @@ -24,7 +26,7 @@ public class KeywordReplacer implements IText private void replaceKeywords(final CommandSender sender) { String displayName, ipAddress, balance, mails, world; - String worlds, online, unique, playerlist; + String worlds, online, unique, playerlist, date, time; if (sender instanceof Player) { final User user = ess.getUser(sender); @@ -75,6 +77,9 @@ public class KeywordReplacer implements IText playerlistBuilder.append(p.getDisplayName()); } playerlist = playerlistBuilder.toString(); + + date = new SimpleDateFormat("MMMM/dd/yyyy").format(new Date()); + time = new SimpleDateFormat("hh:mm:ss").format(new Date()); for (int i = 0; i < input.getLines().size(); i++) { @@ -88,6 +93,8 @@ public class KeywordReplacer implements IText 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); input.getLines().set(i, line); } } -- cgit v1.2.3 From 726d26865de5904458b1ae6933c19c5e38dd2397 Mon Sep 17 00:00:00 2001 From: Khyperia Date: Fri, 2 Dec 2011 08:37:12 +0800 Subject: Added many new MOTD possibilities + getI18n() to Essentials.java --- .../src/com/earth2me/essentials/Essentials.java | 6 +++++ .../src/com/earth2me/essentials/IEssentials.java | 2 ++ .../essentials/textreader/KeywordReplacer.java | 31 ++++++++++++++++++---- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 431824d0b..ca86b2b2a 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -597,4 +597,10 @@ public class Essentials extends JavaPlugin implements IEssentials { return userMap; } + + @Override + public I18n getI18n() + { + return i18n; + } } diff --git a/Essentials/src/com/earth2me/essentials/IEssentials.java b/Essentials/src/com/earth2me/essentials/IEssentials.java index ef54b0776..a56fc790c 100644 --- a/Essentials/src/com/earth2me/essentials/IEssentials.java +++ b/Essentials/src/com/earth2me/essentials/IEssentials.java @@ -18,6 +18,8 @@ public interface IEssentials extends Plugin boolean onCommandEssentials(CommandSender sender, Command command, String commandLabel, String[] args, ClassLoader classLoader, String commandPath, String permissionPrefix); User getUser(Object base); + + I18n getI18n(); User getOfflineUser(String name); diff --git a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java index 84cd63f68..79710a822 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java +++ b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java @@ -1,14 +1,16 @@ package com.earth2me.essentials.textreader; +import com.earth2me.essentials.DescParseTickFormat; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.User; -import java.text.SimpleDateFormat; +import java.text.DateFormat; 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 @@ -27,6 +29,7 @@ public class KeywordReplacer implements IText { String displayName, ipAddress, balance, mails, world; String worlds, online, unique, playerlist, date, time; + String worldTime12, worldTime24, worldDate, plugins; if (sender instanceof Player) { final User user = ess.getUser(sender); @@ -35,10 +38,13 @@ public class KeywordReplacer implements IText 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().getTime())); } else { - displayName = ipAddress = balance = mails = world = ""; + displayName = ipAddress = balance = mails = world = worldTime12 = worldTime24= worldDate = ""; } int playerHidden = 0; @@ -77,9 +83,20 @@ public class KeywordReplacer implements IText playerlistBuilder.append(p.getDisplayName()); } playerlist = playerlistBuilder.toString(); - - date = new SimpleDateFormat("MMMM/dd/yyyy").format(new Date()); - time = new SimpleDateFormat("hh:mm:ss").format(new Date()); + + 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()); for (int i = 0; i < input.getLines().size(); i++) { @@ -95,6 +112,10 @@ public class KeywordReplacer implements IText 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); input.getLines().set(i, line); } } -- cgit v1.2.3 From 10ccbda30caee25d02e2e0e88e5cab37bbcd40c2 Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 2 Dec 2011 02:01:48 +0100 Subject: Added new tags to info.txt --- .../src/com/earth2me/essentials/textreader/KeywordReplacer.java | 2 +- Essentials/src/info.txt | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java index 79710a822..7a401164a 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java +++ b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java @@ -44,7 +44,7 @@ public class KeywordReplacer implements IText } else { - displayName = ipAddress = balance = mails = world = worldTime12 = worldTime24= worldDate = ""; + displayName = ipAddress = balance = mails = world = worldTime12 = worldTime24 = worldDate = ""; } int playerHidden = 0; diff --git a/Essentials/src/info.txt b/Essentials/src/info.txt index 4435364fe..e05843dcb 100644 --- a/Essentials/src/info.txt +++ b/Essentials/src/info.txt @@ -32,4 +32,10 @@ WORLD: {WORLD} WORLDS: {WORLDS} ONLINE: {ONLINE} UNIQUE: {UNIQUE} -PLAYERLIST: {PLAYERLIST} \ No newline at end of file +PLAYERLIST: {PLAYERLIST} +TIME: {TIME} +DATE: {DATE} +WORLDTIME12: {WORLDTIME12} +WORLDTIME24: {WORLDTIME24} +WORLDDATE: {WORLDDATE} +PLUGINS: {PLUGINS} -- cgit v1.2.3 From a020e0b9e65e791e7b24cfa08ec9abbdf9309762 Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 2 Dec 2011 03:25:22 +0100 Subject: Moved block to item conversion to Util class --- .../essentials/EssentialsBlockListener.java | 66 +---------------- Essentials/src/com/earth2me/essentials/Util.java | 83 ++++++++++++++++++++++ 2 files changed, 84 insertions(+), 65 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java index 88e536015..b5182b11b 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java @@ -28,71 +28,7 @@ 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()) - { - 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; - } + final ItemStack is = Util.convertBlockToItem(event.getBlockPlaced()); boolean unlimitedForUser = user.hasUnlimited(is); if (unlimitedForUser && user.getGameMode() == GameMode.SURVIVAL) { diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index 5ee3e3123..fe86fd167 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -12,6 +12,7 @@ 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 @@ -331,6 +332,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) -- cgit v1.2.3 From bfc90c610a53429ac5484743bed07374c8fcdd8b Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 2 Dec 2011 03:27:37 +0100 Subject: Null check --- Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java index b5182b11b..ceda6a60c 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java @@ -29,13 +29,17 @@ public class EssentialsBlockListener extends BlockListener // Do not rely on getItemInHand(); // http://leaky.bukkit.org/issues/663 final ItemStack is = Util.convertBlockToItem(event.getBlockPlaced()); + if (is == null) + { + return; + } boolean unlimitedForUser = user.hasUnlimited(is); if (unlimitedForUser && user.getGameMode() == GameMode.SURVIVAL) { ess.scheduleSyncDelayedTask( new Runnable() { - @Override + @Override public void run() { user.getInventory().addItem(is); -- cgit v1.2.3 From 1f05cb930b9b5df9bd1f35ea99a637b681cbb2d8 Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 2 Dec 2011 08:19:55 +0100 Subject: Allows to be teleported to bed location of offline players. Also adds missing return in /home command --- .../src/com/earth2me/essentials/OfflinePlayer.java | 3 +- .../earth2me/essentials/commands/Commandhome.java | 1 + .../essentials/craftbukkit/OfflineBedLocation.java | 52 ++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 Essentials/src/com/earth2me/essentials/craftbukkit/OfflineBedLocation.java diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index 09ba91f96..b554ec4fe 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -1,5 +1,6 @@ package com.earth2me.essentials; +import com.earth2me.essentials.craftbukkit.OfflineBedLocation; import static com.earth2me.essentials.I18n._; import java.net.InetSocketAddress; import java.util.HashSet; @@ -740,7 +741,7 @@ public class OfflinePlayer implements Player @Override public Location getBedSpawnLocation() { - throw new UnsupportedOperationException("Not supported yet."); + return OfflineBedLocation.getBedLocation(base.getName(), ess); } @Override diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java index 090cebd4c..8b684e3af 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java @@ -48,6 +48,7 @@ public class Commandhome extends EssentialsCommand if (bed != null) { user.getTeleport().teleport(bed, charge); + return; } } user.getTeleport().home(player, homeName.toLowerCase(Locale.ENGLISH), charge); 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; + } + } +} -- cgit v1.2.3 From 34ce207534801139176a821a405e94e1e1f8f64b Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 2 Dec 2011 08:30:52 +0100 Subject: New config options repair-enchanted (default true) and permission essentials.repair.enchanted --- Essentials/src/com/earth2me/essentials/ISettings.java | 2 ++ Essentials/src/com/earth2me/essentials/Settings.java | 4 ++++ .../com/earth2me/essentials/commands/Commandrepair.java | 14 ++++++++++++++ Essentials/src/config.yml | 5 +++++ 4 files changed, 25 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index 9724d1a16..d7764ed16 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -138,4 +138,6 @@ public interface ISettings extends IConf Set getNoGodWorlds(); boolean getUpdateBedAtDaytime(); + + boolean getRepairEnchanted(); } diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index ac74329ec..b65d53616 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -549,4 +549,8 @@ public class Settings implements ISettings { this.debug = debug; } + + public boolean getRepairEnchanted() { + return config.getBoolean("repair-enchanted", true); + } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java index 50c6ac7af..cf9e43f9f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java @@ -32,6 +32,14 @@ public class Commandrepair extends EssentialsCommand { throw new Exception(_("repairInvalidType")); } + + 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); @@ -104,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/config.yml b/Essentials/src/config.yml index e1a7e9d5a..f9eaa2ba4 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -227,6 +227,11 @@ no-god-in-worlds: # 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 + ############################################################ # +------------------------------------------------------+ # # | EssentialsHome | # -- cgit v1.2.3 From 3bbb8c380d327c062adf7310b13a658d18f27426 Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 2 Dec 2011 08:34:28 +0100 Subject: Missing language files for last commit --- Essentials/src/messages.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_nl.properties | 1 + 7 files changed, 7 insertions(+) diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 5d1efdf65..2bcf2f646 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -279,6 +279,7 @@ readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Reloaded all plugins. 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. diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index c5d9dc411..774b7e55d 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -279,6 +279,7 @@ readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Genindl\u00e6ste alle tilf\u00f8jelser. 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=\u00a77Teleporterings anmodning n\u00e6gtet. diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 75510937f..e8194b623 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -279,6 +279,7 @@ readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Alle plugins neu geladen. 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. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 28e7bd99f..61d0bf6e8 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -279,6 +279,7 @@ readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Reloaded all plugins. 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. diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index b4fc3afb9..22520bf58 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -279,6 +279,7 @@ readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Todos los plugins recargados. 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. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index ef72f4f8b..31309fa55 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -279,6 +279,7 @@ readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Toutes les extensions ont \u00e9t\u00e9 recharg\u00e9es. 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. diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index c101cc0be..d5ad33813 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -279,6 +279,7 @@ readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Alle plugins zijn herladen. 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. -- cgit v1.2.3 From 11d089569cbf445f53c47067819b1a663609cde7 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Dec 2011 09:17:20 +0000 Subject: Make the chat formatting config file link to the wiki. --- Essentials/src/config.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index f9eaa2ba4..2f43cde1e 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -20,8 +20,6 @@ - - ############################################################ # +------------------------------------------------------+ # # | Essentials (Global) | # @@ -308,24 +306,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. -- cgit v1.2.3 From 91af9d4d07a49d2f51a3d0651470d5688a563d7a Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Dec 2011 09:23:23 +0000 Subject: Remove invalid dupe permission from permbukkit example. --- Essentials/src/examples/permissionsbukkit.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 -- cgit v1.2.3 From 68c873ea0d0da42ddd3d7da756d948a02bc50214 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Dec 2011 09:28:57 +0000 Subject: items.csv update for crackedstonebrick (id98,2) --- Essentials/src/items.csv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index b7fffd973..c3dc3ffba 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -1269,10 +1269,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 -- cgit v1.2.3 From 293e7b04a26026b5a7a5f59917795e1e61e77ac3 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Dec 2011 21:32:32 +0000 Subject: Patching gamemode and god toggles to not match on ' ' --- Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java | 2 +- Essentials/src/com/earth2me/essentials/commands/Commandgod.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java index 821692464..62ace9357 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java @@ -30,7 +30,7 @@ public class Commandgamemode extends EssentialsCommand @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.gamemode.others")) + if (args.length > 0 && !args[0].trim().isEmpty() && user.isAuthorized("essentials.gamemode.others")) { gamemodeOtherPlayers(server, user, args[0]); return; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgod.java b/Essentials/src/com/earth2me/essentials/commands/Commandgod.java index 9506e48b5..4d5bd424b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgod.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgod.java @@ -28,7 +28,7 @@ public class Commandgod extends EssentialsCommand @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.god.others")) + if (args.length > 0 && !args[0].trim().isEmpty() && user.isAuthorized("essentials.god.others")) { godOtherPlayers(server, user, args[0]); return; -- cgit v1.2.3