summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Essentials/nbproject/project.properties8
-rw-r--r--Essentials/src/com/earth2me/essentials/AlternativeCommandsHandler.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/Enchantments.java21
-rw-r--r--Essentials/src/com/earth2me/essentials/Essentials.java116
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsConf.java5
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java119
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java149
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/ISettings.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/IUser.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/ItemDb.java115
-rw-r--r--Essentials/src/com/earth2me/essentials/Jails.java22
-rw-r--r--Essentials/src/com/earth2me/essentials/Kit.java66
-rw-r--r--Essentials/src/com/earth2me/essentials/Mob.java28
-rw-r--r--Essentials/src/com/earth2me/essentials/OfflinePlayer.java71
-rw-r--r--Essentials/src/com/earth2me/essentials/Settings.java90
-rw-r--r--Essentials/src/com/earth2me/essentials/SpawnMob.java295
-rw-r--r--Essentials/src/com/earth2me/essentials/TNTExplodeListener.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/Teleport.java130
-rw-r--r--Essentials/src/com/earth2me/essentials/Trade.java13
-rw-r--r--Essentials/src/com/earth2me/essentials/User.java49
-rw-r--r--Essentials/src/com/earth2me/essentials/UserData.java36
-rw-r--r--Essentials/src/com/earth2me/essentials/Util.java46
-rw-r--r--Essentials/src/com/earth2me/essentials/Warps.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/api/Economy.java13
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandafk.java9
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandantioch.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandbalance.java1
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandban.java14
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandenchant.java38
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandessentials.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandexp.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandfireball.java44
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandfly.java27
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java40
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandgive.java61
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandhat.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandhome.java13
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java17
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commanditem.java37
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandjump.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkick.java28
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkickall.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkill.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkillall.java12
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandmail.java57
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandmore.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandping.java2
-rwxr-xr-xEssentials/src/com/earth2me/essentials/commands/Commandrecipe.java197
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandseen.java27
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsell.java22
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsethome.java12
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java9
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandspawner.java12
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java270
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsudo.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtempban.java10
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtp.java53
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java25
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java1
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtppos.java21
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java57
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandunban.java13
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandwarp.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/PlayerNotFoundException.java11
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java243
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java42
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/InventoryWorkaround.java211
-rw-r--r--Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java8
-rw-r--r--Essentials/src/com/earth2me/essentials/metrics/Metrics.java170
-rw-r--r--Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java16
-rw-r--r--Essentials/src/com/earth2me/essentials/perm/BPermissions2Handler.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java11
-rw-r--r--Essentials/src/com/earth2me/essentials/perm/SimplyPermsHandler.java53
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java34
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignEnchant.java49
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignKit.java6
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java17
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignProtection.java8
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignSpawnmob.java12
-rw-r--r--Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java57
-rw-r--r--Essentials/src/com/earth2me/essentials/textreader/HelpInput.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java3
-rw-r--r--Essentials/src/config.yml84
-rw-r--r--Essentials/src/items.csv702
-rw-r--r--Essentials/src/messages.properties32
-rw-r--r--Essentials/src/messages_cs.properties20
-rw-r--r--Essentials/src/messages_da.properties20
-rw-r--r--Essentials/src/messages_de.properties20
-rw-r--r--Essentials/src/messages_en.properties32
-rw-r--r--Essentials/src/messages_es.properties88
-rw-r--r--Essentials/src/messages_fi.properties20
-rw-r--r--Essentials/src/messages_fr.properties234
-rw-r--r--Essentials/src/messages_it.properties20
-rw-r--r--Essentials/src/messages_nl.properties24
-rw-r--r--Essentials/src/messages_pl.properties20
-rw-r--r--Essentials/src/messages_pt.properties20
-rw-r--r--Essentials/src/messages_se.properties98
-rw-r--r--Essentials/src/plugin.yml52
-rw-r--r--Essentials/test/com/earth2me/essentials/FakeServer.java65
-rw-r--r--EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java41
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java6
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java5
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java26
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java112
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java5
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/log4j.properties4
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java1
-rw-r--r--EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java8
116 files changed, 3615 insertions, 1739 deletions
diff --git a/.gitignore b/.gitignore
index 524ed1334..9251ca7e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,4 +42,6 @@
/EssentialsGroupManager/.externalToolBuilders
/EssentialsAntiBuild/nbproject/private/
/EssentialsAntiBuild/dist/
-/EssentialsAntiBuild/build/ \ No newline at end of file
+/EssentialsAntiBuild/build/
+/jars
+/out \ No newline at end of file
diff --git a/Essentials/nbproject/project.properties b/Essentials/nbproject/project.properties
index a9cebbb92..f749b8553 100644
--- a/Essentials/nbproject/project.properties
+++ b/Essentials/nbproject/project.properties
@@ -68,7 +68,6 @@ file.reference.BOSEconomy7.jar=../lib/BOSEconomy7.jar
file.reference.bPermissions.jar=../lib/bPermissions.jar
file.reference.bpermissions2.jar=../lib/bpermissions2.jar
file.reference.bukkit.jar=../lib/bukkit.jar
-file.reference.craftbukkit.jar=../lib/craftbukkit.jar
file.reference.iCo4.jar=../lib/iCo4.jar
file.reference.iCo5.jar=../lib/iCo5.jar
file.reference.iCo6.jar=../lib/iCo6.jar
@@ -79,6 +78,7 @@ file.reference.PermissionsBukkit-1.2.jar=../lib/PermissionsBukkit-1.2.jar
file.reference.PermissionsEx.jar=../lib/PermissionsEx.jar
file.reference.Privileges.jar=..\\lib\\Privileges.jar
file.reference.Vault.jar=../lib/Vault.jar
+file.reference.SimplyPerms.jar=../lib/SimplyPerms.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=true
@@ -96,12 +96,12 @@ javac.classpath=\
${file.reference.lombok.jar}:\
${reference.EssentialsGroupManager.jar}:\
${file.reference.bukkit.jar}:\
- ${file.reference.craftbukkit.jar}:\
${file.reference.Vault.jar}:\
${file.reference.Privileges.jar}:\
- ${file.reference.bpermissions2.jar}
+ ${file.reference.bpermissions2.jar}:\
+ ${file.reference.SimplyPerms.jar}
# Space-separated list of extra javac options
-javac.compilerargs=
+javac.compilerargs=-Xlint:unchecked
javac.deprecation=false
javac.processorpath=\
${javac.classpath}
diff --git a/Essentials/src/com/earth2me/essentials/AlternativeCommandsHandler.java b/Essentials/src/com/earth2me/essentials/AlternativeCommandsHandler.java
index e75644ad5..e9cb6fe19 100644
--- a/Essentials/src/com/earth2me/essentials/AlternativeCommandsHandler.java
+++ b/Essentials/src/com/earth2me/essentials/AlternativeCommandsHandler.java
@@ -121,13 +121,14 @@ public class AlternativeCommandsHandler
return commands.get(0);
}
- public void executed(final String label, final String otherLabel)
+ public void executed(final String label, final PluginCommand pc)
{
+ final String altString = pc.getPlugin().getName() + ":" + pc.getLabel();
if (ess.getSettings().isDebug())
{
- LOGGER.log(Level.INFO, "Essentials: Alternative command " + label + " found, using " + otherLabel);
+ LOGGER.log(Level.INFO, "Essentials: Alternative command " + label + " found, using " + altString);
}
- disabledList.put(label, otherLabel);
+ disabledList.put(label, altString);
}
public Map<String, String> disabledCommands()
diff --git a/Essentials/src/com/earth2me/essentials/Enchantments.java b/Essentials/src/com/earth2me/essentials/Enchantments.java
index 875fd72e7..4a9fb4101 100644
--- a/Essentials/src/com/earth2me/essentials/Enchantments.java
+++ b/Essentials/src/com/earth2me/essentials/Enchantments.java
@@ -11,7 +11,6 @@ import org.bukkit.enchantments.Enchantment;
public class Enchantments
{
- private static final transient Pattern NUMPATTERN = Pattern.compile("\\d+");
private static final Map<String, Enchantment> ENCHANTMENTS = new HashMap<String, Enchantment>();
private static final Map<String, Enchantment> ALIASENCHANTMENTS = new HashMap<String, Enchantment>();
@@ -20,7 +19,7 @@ public class Enchantments
ENCHANTMENTS.put("alldamage", Enchantment.DAMAGE_ALL);
ALIASENCHANTMENTS.put("alldmg", Enchantment.DAMAGE_ALL);
ENCHANTMENTS.put("sharpness", Enchantment.DAMAGE_ALL);
- ENCHANTMENTS.put("sharp", Enchantment.DAMAGE_ALL);
+ ALIASENCHANTMENTS.put("sharp", Enchantment.DAMAGE_ALL);
ALIASENCHANTMENTS.put("dal", Enchantment.DAMAGE_ALL);
ENCHANTMENTS.put("ardmg", Enchantment.DAMAGE_ARTHROPODS);
@@ -38,12 +37,19 @@ public class Enchantments
ALIASENCHANTMENTS.put("minespeed", Enchantment.DIG_SPEED);
ALIASENCHANTMENTS.put("cutspeed", Enchantment.DIG_SPEED);
ALIASENCHANTMENTS.put("ds", Enchantment.DIG_SPEED);
+ ALIASENCHANTMENTS.put("eff", Enchantment.DIG_SPEED);
ENCHANTMENTS.put("durability", Enchantment.DURABILITY);
- ENCHANTMENTS.put("dura", Enchantment.DURABILITY);
+ ALIASENCHANTMENTS.put("dura", Enchantment.DURABILITY);
ENCHANTMENTS.put("unbreaking", Enchantment.DURABILITY);
ALIASENCHANTMENTS.put("d", Enchantment.DURABILITY);
+ ENCHANTMENTS.put("thorns", Enchantment.THORNS);
+ ENCHANTMENTS.put("highcrit", Enchantment.THORNS);
+ ALIASENCHANTMENTS.put("thorn", Enchantment.THORNS);
+ ALIASENCHANTMENTS.put("highercrit", Enchantment.THORNS);
+ ALIASENCHANTMENTS.put("t", Enchantment.THORNS);
+
ENCHANTMENTS.put("fireaspect", Enchantment.FIRE_ASPECT);
ENCHANTMENTS.put("fire", Enchantment.FIRE_ASPECT);
ALIASENCHANTMENTS.put("meleefire", Enchantment.FIRE_ASPECT);
@@ -51,10 +57,13 @@ public class Enchantments
ALIASENCHANTMENTS.put("fa", Enchantment.FIRE_ASPECT);
ENCHANTMENTS.put("knockback", Enchantment.KNOCKBACK);
+ ALIASENCHANTMENTS.put("kback", Enchantment.KNOCKBACK);
+ ALIASENCHANTMENTS.put("kb", Enchantment.KNOCKBACK);
ALIASENCHANTMENTS.put("k", Enchantment.KNOCKBACK);
ALIASENCHANTMENTS.put("blockslootbonus", Enchantment.LOOT_BONUS_BLOCKS);
ENCHANTMENTS.put("fortune", Enchantment.LOOT_BONUS_BLOCKS);
+ ALIASENCHANTMENTS.put("fort", Enchantment.LOOT_BONUS_BLOCKS);
ALIASENCHANTMENTS.put("lbb", Enchantment.LOOT_BONUS_BLOCKS);
ALIASENCHANTMENTS.put("mobslootbonus", Enchantment.LOOT_BONUS_MOBS);
@@ -83,7 +92,7 @@ public class Enchantments
ALIASENCHANTMENTS.put("fallprotection", Enchantment.PROTECTION_FALL);
ENCHANTMENTS.put("fallprot", Enchantment.PROTECTION_FALL);
ENCHANTMENTS.put("featherfall", Enchantment.PROTECTION_FALL);
- ENCHANTMENTS.put("featherfalling", Enchantment.PROTECTION_FALL);
+ ALIASENCHANTMENTS.put("featherfalling", Enchantment.PROTECTION_FALL);
ALIASENCHANTMENTS.put("pfa", Enchantment.PROTECTION_FALL);
ALIASENCHANTMENTS.put("fireprotection", Enchantment.PROTECTION_FIRE);
@@ -129,12 +138,12 @@ public class Enchantments
ALIASENCHANTMENTS.put("infinite", Enchantment.ARROW_INFINITE);
ALIASENCHANTMENTS.put("unlimited", Enchantment.ARROW_INFINITE);
ALIASENCHANTMENTS.put("unlimitedarrows", Enchantment.ARROW_INFINITE);
- ALIASENCHANTMENTS.put("ai", Enchantment.ARROW_INFINITE);
+ ALIASENCHANTMENTS.put("ai", Enchantment.ARROW_INFINITE);
}
public static Enchantment getByName(String name) {
Enchantment enchantment;
- if (NUMPATTERN.matcher(name).matches()) {
+ if (Util.isInt(name)) {
enchantment = Enchantment.getById(Integer.parseInt(name));
} else {
enchantment = Enchantment.getByName(name.toUpperCase(Locale.ENGLISH));
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java
index e0f5706ca..c390e8e7a 100644
--- a/Essentials/src/com/earth2me/essentials/Essentials.java
+++ b/Essentials/src/com/earth2me/essentials/Essentials.java
@@ -50,6 +50,7 @@ import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
+import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.world.WorldLoadEvent;
@@ -65,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException;
public class Essentials extends JavaPlugin implements IEssentials
{
- public static final int BUKKIT_VERSION = 2352;
+ public static final int BUKKIT_VERSION = 2586;
private static final Logger LOGGER = Logger.getLogger("Minecraft");
private transient ISettings settings;
private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this);
@@ -176,6 +177,8 @@ public class Essentials extends JavaPlugin implements IEssentials
itemDb = new ItemDb(this);
confList.add(itemDb);
execTimer.mark("Init(Worth/ItemDB)");
+ jails = new Jails(this);
+ confList.add(jails);
reload();
}
catch (YAMLException exception)
@@ -207,6 +210,39 @@ public class Essentials extends JavaPlugin implements IEssentials
backup = new Backup(this);
permissionsHandler = new PermissionsHandler(this, settings.useBukkitPermissions());
alternativeCommandsHandler = new AlternativeCommandsHandler(this);
+
+ timer = new EssentialsTimer(this);
+ getScheduler().scheduleSyncRepeatingTask(this, timer, 100, 100);
+
+ Economy.setEss(this);
+ execTimer.mark("RegHandler");
+
+ final MetricsStarter metricsStarter = new MetricsStarter(this);
+ if (metricsStarter.getStart() != null && metricsStarter.getStart() == true)
+ {
+ getScheduler().scheduleAsyncDelayedTask(this, metricsStarter, 1);
+ }
+ else if (metricsStarter.getStart() != null && metricsStarter.getStart() == false)
+ {
+ final MetricsListener metricsListener = new MetricsListener(this, metricsStarter);
+ pm.registerEvents(metricsListener, this);
+ }
+
+ final String timeroutput = execTimer.end();
+ if (getSettings().isDebug())
+ {
+ LOGGER.log(Level.INFO, "Essentials load " + timeroutput);
+ }
+ }
+
+ private void registerListeners(PluginManager pm) {
+ HandlerList.unregisterAll(this);
+
+ if (getSettings().isDebug())
+ {
+ LOGGER.log(Level.INFO, "Registering Listeners");
+ }
+
final EssentialsPluginListener serverListener = new EssentialsPluginListener(this);
pm.registerEvents(serverListener, this);
confList.add(serverListener);
@@ -231,35 +267,10 @@ public class Essentials extends JavaPlugin implements IEssentials
final EssentialsWorldListener worldListener = new EssentialsWorldListener(this);
pm.registerEvents(worldListener, this);
-
- //TODO: Check if this should be here, and not above before reload()
- jails = new Jails(this);
- confList.add(jails);
-
+
pm.registerEvents(tntListener, this);
-
- timer = new EssentialsTimer(this);
- getScheduler().scheduleSyncRepeatingTask(this, timer, 100, 100);
-
- Economy.setEss(this);
- execTimer.mark("RegListeners");
-
- final MetricsStarter metricsStarter = new MetricsStarter(this);
- if (metricsStarter.getStart() != null && metricsStarter.getStart() == true)
- {
- getScheduler().scheduleAsyncDelayedTask(this, metricsStarter, 1);
- }
- else if (metricsStarter.getStart() != null && metricsStarter.getStart() == false)
- {
- final MetricsListener metricsListener = new MetricsListener(this, metricsStarter);
- pm.registerEvents(metricsListener, this);
- }
-
- final String timeroutput = execTimer.end();
- if (getSettings().isDebug())
- {
- LOGGER.log(Level.INFO, "Essentials load " + timeroutput);
- }
+
+ jails.resetListener();
}
@Override
@@ -291,6 +302,9 @@ public class Essentials extends JavaPlugin implements IEssentials
}
i18n.updateLocale(settings.getLocale());
+
+ final PluginManager pm = getServer().getPluginManager();
+ registerListeners(pm);
}
@Override
@@ -308,7 +322,7 @@ public class Essentials extends JavaPlugin implements IEssentials
final PluginCommand pc = alternativeCommandsHandler.getAlternative(commandLabel);
if (pc != null)
{
- alternativeCommandsHandler.executed(commandLabel, pc.getLabel());
+ alternativeCommandsHandler.executed(commandLabel, pc);
try
{
return pc.execute(sender, commandLabel, args);
@@ -368,6 +382,19 @@ public class Essentials extends JavaPlugin implements IEssentials
return true;
}
+ if (user != null && user.isJailed() && !user.isAuthorized(cmd, "essentials.jail.allow."))
+ {
+ if (user.getJailTimeout() > 0)
+ {
+ user.sendMessage(_("playerJailedFor", user.getName(), Util.formatDateDiff(user.getJailTimeout())));
+ }
+ else
+ {
+ user.sendMessage(_("jailMessage"));
+ }
+ return true;
+ }
+
// Run the command
try
{
@@ -467,16 +494,22 @@ public class Essentials extends JavaPlugin implements IEssentials
}
if (base instanceof String)
{
- final User user = userMap.getUser((String)base);
- if (user != null && user.getBase() instanceof OfflinePlayer)
- {
- ((OfflinePlayer)user.getBase()).setName((String)base);
- }
- return user;
+ return getOfflineUser((String)base);
}
return null;
}
+ @Override
+ public User getOfflineUser(final String name)
+ {
+ final User user = userMap.getUser(name);
+ if (user != null && user.getBase() instanceof OfflinePlayer)
+ {
+ ((OfflinePlayer)user.getBase()).setName(name);
+ }
+ return user;
+ }
+
private <T extends Player> User getUser(final T base)
{
if (base == null)
@@ -509,17 +542,6 @@ public class Essentials extends JavaPlugin implements IEssentials
}
@Override
- public User getOfflineUser(final String name)
- {
- final User user = userMap.getUser(name);
- if (user != null && user.getBase() instanceof OfflinePlayer)
- {
- ((OfflinePlayer)user.getBase()).setName(name);
- }
- return user;
- }
-
- @Override
public World getWorld(final String name)
{
if (name.matches("[0-9]+"))
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java
index 0c6bec0fe..c5c35d901 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java
@@ -28,8 +28,7 @@ public class EssentialsBlockListener implements Listener
return;
}
final User user = ess.getUser(event.getPlayer());
- final boolean unlimitedForUser = user.hasUnlimited(is);
- if (unlimitedForUser && user.getGameMode() == GameMode.SURVIVAL)
+ if (user.hasUnlimited(is) && user.getGameMode() == GameMode.SURVIVAL)
{
ess.scheduleSyncDelayedTask(
new Runnable()
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsConf.java b/Essentials/src/com/earth2me/essentials/EssentialsConf.java
index d6414fb05..70e683da4 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsConf.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsConf.java
@@ -344,6 +344,11 @@ public class EssentialsConf extends YamlConfiguration
}
}
+ public void saveWithError() throws IOException
+ {
+ save(configFile);
+ }
+
@Override
public synchronized void save(final File file) throws IOException
{
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
index 0077d988c..a0d3d091f 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
@@ -5,10 +5,7 @@ import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Material;
-import org.bukkit.entity.Ageable;
-import org.bukkit.entity.Entity;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.entity.Player;
+import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
@@ -27,71 +24,93 @@ public class EssentialsEntityListener implements Listener
this.ess = ess;
}
+ // This method does something undocumented reguarding certain bucket types #EasterEgg
@EventHandler(priority = EventPriority.LOW)
public void onEntityDamage(final EntityDamageByEntityEvent event)
{
final Entity eAttack = event.getDamager();
final Entity eDefend = event.getEntity();
- if (eDefend instanceof Player && eAttack instanceof Player)
+ if (eAttack instanceof Player)
{
- final User defender = ess.getUser(eDefend);
final User attacker = ess.getUser(eAttack);
-
- if (ess.getSettings().getLoginAttackDelay() > 0 && !attacker.isAuthorized("essentials.pvpdelay.exempt")
- && (System.currentTimeMillis() < (attacker.getLastLogin() + ess.getSettings().getLoginAttackDelay())))
- {
- event.setCancelled(true);
- }
-
- if (attacker.hasInvulnerabilityAfterTeleport() || defender.hasInvulnerabilityAfterTeleport())
+ if (eDefend instanceof Player)
{
- event.setCancelled(true);
+ onPlayerVsPlayerDamage(event, (Player)eDefend, attacker);
}
-
- if (attacker.isGodModeEnabled() && !attacker.isAuthorized("essentials.god.pvp"))
+ else if (eDefend instanceof Ageable)
{
- event.setCancelled(true);
+ final ItemStack hand = attacker.getItemInHand();
+ if (hand != null && hand.getType() == Material.MILK_BUCKET)
+ {
+ ((Ageable)eDefend).setBaby();
+ hand.setType(Material.BUCKET);
+ attacker.setItemInHand(hand);
+ attacker.updateInventory();
+ event.setCancelled(true);
+ }
}
-
attacker.updateActivity(true);
- final List<String> commandList = attacker.getPowertool(attacker.getItemInHand());
- if (commandList != null && !commandList.isEmpty())
+ }
+ else if (eAttack instanceof Projectile && eDefend instanceof Player)
+ {
+ Entity shooter = ((Projectile)event.getDamager()).getShooter();
+ if (shooter instanceof Player)
{
- for (final String command : commandList)
- {
- if (command != null && !command.isEmpty())
- {
- ess.scheduleSyncDelayedTask(
- new Runnable()
- {
- @Override
- public void run()
- {
- attacker.getServer().dispatchCommand(attacker.getBase(), command.replaceAll("\\{player\\}", defender.getName()));
- LOGGER.log(Level.INFO, String.format("[PT] %s issued server command: /%s", attacker.getName(), command));
- }
- });
-
- event.setCancelled(true);
- return;
- }
- }
+ final User attacker = ess.getUser(shooter);
+ onPlayerVsPlayerDamage(event, (Player)eDefend, attacker);
+ attacker.updateActivity(true);
}
}
- else if (eAttack instanceof Player)
+ }
+
+ private void onPlayerVsPlayerDamage(final EntityDamageByEntityEvent event, final Player defender, final User attacker)
+ {
+ if (ess.getSettings().getLoginAttackDelay() > 0 && !attacker.isAuthorized("essentials.pvpdelay.exempt")
+ && (System.currentTimeMillis() < (attacker.getLastLogin() + ess.getSettings().getLoginAttackDelay())))
+ {
+ event.setCancelled(true);
+ }
+
+ if (!defender.equals(attacker.getBase()) && (attacker.hasInvulnerabilityAfterTeleport() || ess.getUser(defender).hasInvulnerabilityAfterTeleport()))
+ {
+ event.setCancelled(true);
+ }
+
+ if (attacker.isGodModeEnabled() && !attacker.isAuthorized("essentials.god.pvp"))
+ {
+ event.setCancelled(true);
+ }
+
+ if (attacker.isHidden() && !attacker.isAuthorized("essentials.vanish.pvp"))
+ {
+ event.setCancelled(true);
+ }
+
+ onPlayerVsPlayerPowertool(event, defender, attacker);
+ }
+
+ private void onPlayerVsPlayerPowertool(final EntityDamageByEntityEvent event, final Player defender, final User attacker)
+ {
+ final List<String> commandList = attacker.getPowertool(attacker.getItemInHand());
+ if (commandList != null && !commandList.isEmpty())
{
- final User player = ess.getUser(eAttack);
- player.updateActivity(true);
- if (eDefend instanceof Ageable)
+ for (final String command : commandList)
{
- final ItemStack hand = player.getItemInHand();
- if (hand != null && hand.getType() == Material.MILK_BUCKET)
+ if (command != null && !command.isEmpty())
{
- ((Ageable)eDefend).setBaby();
- hand.setType(Material.BUCKET);
- player.setItemInHand(hand);
- player.updateInventory();
+ ess.scheduleSyncDelayedTask(
+ new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ attacker.getServer().dispatchCommand(attacker.getBase(), command.replaceAll("\\{player\\}", defender.getName()));
+ LOGGER.log(Level.INFO, String.format("[PT] %s issued server command: /%s", attacker.getName(), command));
+ }
+ });
+
event.setCancelled(true);
+ return;
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
index 8ef218a67..93b793e49 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
@@ -6,7 +6,6 @@ import com.earth2me.essentials.textreader.KeywordReplacer;
import com.earth2me.essentials.textreader.TextInput;
import com.earth2me.essentials.textreader.TextPager;
import java.io.IOException;
-import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
@@ -15,6 +14,7 @@ import java.util.logging.Logger;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
+import org.bukkit.World;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -23,9 +23,10 @@ import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryType;
-import org.bukkit.event.player.PlayerLoginEvent.Result;
import org.bukkit.event.player.*;
+import org.bukkit.event.player.PlayerLoginEvent.Result;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
+import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
@@ -76,10 +77,20 @@ public class EssentialsPlayerListener implements Listener
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onPlayerMove(final PlayerMoveEvent event)
{
- if ((!ess.getSettings().cancelAfkOnMove() && !ess.getSettings().getFreezeAfkPlayers())
- || event.getFrom().getBlockX() == event.getTo().getBlockX()
- && event.getFrom().getBlockZ() == event.getTo().getBlockZ()
- && event.getFrom().getBlockY() == event.getTo().getBlockY())
+ if (!ess.getSettings().cancelAfkOnMove() && !ess.getSettings().getFreezeAfkPlayers())
+ {
+ event.getHandlers().unregister(this);
+
+ if (ess.getSettings().isDebug())
+ {
+ LOGGER.log(Level.INFO, "Unregistering move listener");
+ }
+
+ return;
+ }
+ if (event.getFrom().getBlockX() == event.getTo().getBlockX()
+ && event.getFrom().getBlockZ() == event.getTo().getBlockZ()
+ && event.getFrom().getBlockY() == event.getTo().getBlockY())
{
return;
}
@@ -131,6 +142,10 @@ public class EssentialsPlayerListener implements Listener
{
user.setLastLocation();
}
+ if (user.isRecipeSee())
+ {
+ user.getPlayer().getOpenInventory().getTopInventory().clear();
+ }
user.updateActivity(false);
user.dispose();
}
@@ -166,7 +181,8 @@ public class EssentialsPlayerListener implements Listener
for (String p : ess.getVanishedPlayers())
{
Player toVanish = ess.getUser(p).getBase();
- if (toVanish.isOnline()) {
+ if (toVanish.isOnline())
+ {
user.hidePlayer(toVanish);
}
}
@@ -174,7 +190,14 @@ public class EssentialsPlayerListener implements Listener
if (user.isAuthorized("essentials.sleepingignored"))
{
- user.setSleepingIgnored(true);
+ ess.scheduleSyncDelayedTask(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ user.setSleepingIgnored(true);
+ }
+ });
}
if (!ess.getSettings().isCommandDisabled("motd") && user.isAuthorized("essentials.motd"))
@@ -204,15 +227,38 @@ public class EssentialsPlayerListener implements Listener
final List<String> mail = user.getMails();
if (mail.isEmpty())
{
- user.sendMessage(_("noNewMail"));
+ final String msg = _("noNewMail");
+ if (!msg.isEmpty())
+ {
+ user.sendMessage(msg);
+ }
}
else
{
user.sendMessage(_("youHaveNewMail", mail.size()));
}
}
+ if (user.isAuthorized("essentials.fly.safelogin"))
+ {
+ final World world = user.getLocation().getWorld();
+ final int x = user.getLocation().getBlockX();
+ int y = user.getLocation().getBlockY();
+ final int z = user.getLocation().getBlockZ();
+ while (Util.isBlockUnsafe(world, x, y, z) && y > -1)
+ {
+ y--;
+ }
+
+ if (user.getLocation().getBlockY() - y > 1 || y < 0)
+ {
+ user.setAllowFlight(true);
+ user.setFlying(true);
+ user.sendMessage(_("flyMode", _("enabled"), user.getDisplayName()));
+ }
+ }
}
+ // Makes the compass item ingame always point to the first essentials home. #EasterEgg
private void updateCompass(final User user)
{
Location loc = user.getHome(user.getLocation());
@@ -260,8 +306,17 @@ public class EssentialsPlayerListener implements Listener
if (!banExpired && (user.isBanned() || event.getResult() == Result.KICK_BANNED))
{
- final String banReason = user.getBanReason();
- event.disallow(Result.KICK_BANNED, banReason != null && !banReason.isEmpty() && !banReason.equalsIgnoreCase("ban") ? banReason : _("defaultBanReason"));
+ String banReason = user.getBanReason();
+ if (banReason == null || banReason.isEmpty() || banReason.equalsIgnoreCase("ban"))
+ {
+ banReason = _("defaultBanReason");
+ }
+ if (user.getBanTimeout() > 0)
+ {
+ //TODO: TL This
+ banReason += "\n\n" + "Expires in " + Util.formatDateDiff(user.getBanTimeout());
+ }
+ event.disallow(Result.KICK_BANNED, banReason);
return;
}
@@ -322,14 +377,13 @@ public class EssentialsPlayerListener implements Listener
});
}
}
- private final static List<String> COMMANDS = Arrays.asList("msg", "r", "mail", "m", "t", "whisper", "emsg", "tell", "er", "reply", "ereply", "email", "action", "describe", "eme", "eaction", "edescribe", "etell", "ewhisper", "pm");
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event)
{
final Player player = event.getPlayer();
final String cmd = event.getMessage().toLowerCase(Locale.ENGLISH).split(" ")[0].replace("/", "").toLowerCase(Locale.ENGLISH);
- if (COMMANDS.contains(cmd))
+ if (ess.getSettings().getSocialSpyCommands().contains(cmd))
{
for (Player onlinePlayer : ess.getServer().getOnlinePlayers())
{
@@ -351,9 +405,10 @@ public class EssentialsPlayerListener implements Listener
public void onPlayerChangedWorldHack(final PlayerChangedWorldEvent event)
{
final Player user = event.getPlayer();
- if (user.getGameMode() != GameMode.CREATIVE) {
- user.setAllowFlight(false);
- }
+ if (user.getGameMode() != GameMode.CREATIVE)
+ {
+ user.setAllowFlight(false);
+ }
user.setFlySpeed(0.1f);
user.setWalkSpeed(0.2f);
}
@@ -403,6 +458,7 @@ public class EssentialsPlayerListener implements Listener
if (event.getItem() != null && event.getItem().getTypeId() != AIR)
{
final User user = ess.getUser(event.getPlayer());
+ user.updateActivity(true);
if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getTypeId()))
{
event.setCancelled(true);
@@ -414,6 +470,7 @@ public class EssentialsPlayerListener implements Listener
}
}
+ // This method allows the /jump lock feature to work, allows teleporting while flying #EasterEgg
private void useFlyClickJump(final User user)
{
try
@@ -499,10 +556,13 @@ public class EssentialsPlayerListener implements Listener
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onInventoryClickEvent(final InventoryClickEvent event)
{
- if (event.getView().getTopInventory().getType() == InventoryType.PLAYER)
+ final Inventory top = event.getView().getTopInventory();
+ final InventoryType type = top.getType();
+
+ if (type == InventoryType.PLAYER)
{
final User user = ess.getUser(event.getWhoClicked());
- final InventoryHolder invHolder = event.getView().getTopInventory().getHolder();
+ final InventoryHolder invHolder = top.getHolder();
if (invHolder != null && invHolder instanceof HumanEntity)
{
final User invOwner = ess.getUser((HumanEntity)invHolder);
@@ -511,10 +571,11 @@ public class EssentialsPlayerListener implements Listener
|| !invOwner.isOnline()))
{
event.setCancelled(true);
+ user.updateInventory();
}
}
}
- else if (event.getView().getTopInventory().getType() == InventoryType.ENDER_CHEST)
+ else if (type == InventoryType.ENDER_CHEST)
{
final User user = ess.getUser(event.getWhoClicked());
if (user.isEnderSee() && (!user.isAuthorized("essentials.enderchest.modify")))
@@ -522,20 +583,64 @@ public class EssentialsPlayerListener implements Listener
event.setCancelled(true);
}
}
+ else if (type == InventoryType.WORKBENCH)
+ {
+ User user = ess.getUser(event.getWhoClicked());
+ if (user.isRecipeSee())
+ {
+ event.setCancelled(true);
+ }
+ }
+ else if (type == InventoryType.CHEST && top.getSize() == 9)
+ {
+ final User user = ess.getUser(event.getWhoClicked());
+ final InventoryHolder invHolder = top.getHolder();
+ if (invHolder != null && invHolder instanceof HumanEntity && user.isInvSee())
+ {
+ event.setCancelled(true);
+ }
+ }
}
@EventHandler(priority = EventPriority.MONITOR)
public void onInventoryCloseEvent(final InventoryCloseEvent event)
{
- if (event.getView().getTopInventory().getType() == InventoryType.PLAYER)
+ final Inventory top = event.getView().getTopInventory();
+ final InventoryType type = top.getType();
+ if (type == InventoryType.PLAYER)
{
final User user = ess.getUser(event.getPlayer());
user.setInvSee(false);
}
- else if (event.getView().getTopInventory().getType() == InventoryType.ENDER_CHEST)
+ else if (type == InventoryType.ENDER_CHEST)
{
final User user = ess.getUser(event.getPlayer());
user.setEnderSee(false);
}
+ else if (type == InventoryType.WORKBENCH)
+ {
+ final User user = ess.getUser(event.getPlayer());
+ if (user.isRecipeSee())
+ {
+ user.setRecipeSee(false);
+ event.getView().getTopInventory().clear();
+ }
+ }
+ else if (type == InventoryType.CHEST && top.getSize() == 9)
+ {
+ final InventoryHolder invHolder = top.getHolder();
+ if (invHolder != null && invHolder instanceof HumanEntity)
+ {
+ final User user = ess.getUser(event.getPlayer());
+ user.setInvSee(false);
+ }
+ }
+ }
+
+ @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
+ public void onPlayerFishEvent(final PlayerFishEvent event)
+ {
+ final User user = ess.getUser(event.getPlayer());
+ user.updateActivity(true);
}
-} \ No newline at end of file
+}
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java
index 2ec8538ca..56cabf6cb 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java
@@ -20,6 +20,9 @@ public class EssentialsPluginListener implements Listener, IConf
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(final PluginEnableEvent event)
{
+ if (event.getPlugin().getName().equals("EssentialsChat")) {
+ ess.getSettings().setEssentialsChatActive(true);
+ }
ess.getPermissionsHandler().checkPermissions();
ess.getAlternativeCommandsHandler().addPlugin(event.getPlugin());
if (!ess.getPaymentMethod().hasMethod() && ess.getPaymentMethod().setMethod(ess.getServer().getPluginManager()))
@@ -31,6 +34,9 @@ public class EssentialsPluginListener implements Listener, IConf
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginDisable(final PluginDisableEvent event)
{
+ if (event.getPlugin().getName().equals("EssentialsChat")) {
+ ess.getSettings().setEssentialsChatActive(false);
+ }
ess.getPermissionsHandler().checkPermissions();
ess.getAlternativeCommandsHandler().removePlugin(event.getPlugin());
// Check to see if the plugin thats being disabled is the one we are using
diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java
index d8c421fde..c58ffa8e7 100644
--- a/Essentials/src/com/earth2me/essentials/ISettings.java
+++ b/Essentials/src/com/earth2me/essentials/ISettings.java
@@ -42,6 +42,8 @@ public interface ISettings extends IConf
double getHealCooldown();
+ Set<String> getSocialSpyCommands();
+
Map<String, Object> getKit(String name);
ConfigurationSection getKits();
@@ -149,6 +151,8 @@ public interface ISettings extends IConf
Set<String> getNoGodWorlds();
boolean getUpdateBedAtDaytime();
+
+ boolean allowUnsafeEnchantments();
boolean getRepairEnchanted();
@@ -179,4 +183,10 @@ public interface ISettings extends IConf
double getMaxFlySpeed();
double getMaxWalkSpeed();
+
+ public int getMailsPerMinute();
+
+ public void setEssentialsChatActive(boolean b);
+
+ long getMaxTempban();
}
diff --git a/Essentials/src/com/earth2me/essentials/IUser.java b/Essentials/src/com/earth2me/essentials/IUser.java
index 8c0d6212f..1b5f314be 100644
--- a/Essentials/src/com/earth2me/essentials/IUser.java
+++ b/Essentials/src/com/earth2me/essentials/IUser.java
@@ -42,4 +42,10 @@ public interface IUser extends Player
Teleport getTeleport();
void setJail(String jail);
+
+ boolean isIgnoreExempt();
+
+ boolean isAfk();
+
+ void setAfk(final boolean set);
}
diff --git a/Essentials/src/com/earth2me/essentials/ItemDb.java b/Essentials/src/com/earth2me/essentials/ItemDb.java
index 10fd12937..85753e816 100644
--- a/Essentials/src/com/earth2me/essentials/ItemDb.java
+++ b/Essentials/src/com/earth2me/essentials/ItemDb.java
@@ -3,8 +3,11 @@ package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.api.IItemDb;
import java.util.*;
+import java.util.regex.Pattern;
import org.bukkit.Material;
+import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
+import org.bukkit.inventory.meta.EnchantmentStorageMeta;
public class ItemDb implements IConf, IItemDb
@@ -20,6 +23,7 @@ public class ItemDb implements IConf, IItemDb
private final transient Map<ItemData, List<String>> names = new HashMap<ItemData, List<String>>();
private final transient Map<String, Short> durabilities = new HashMap<String, Short>();
private final transient ManagedFile file;
+ private final transient Pattern splitPattern = Pattern.compile("[:+',;.]");
@Override
public void reloadConfig()
@@ -84,19 +88,20 @@ public class ItemDb implements IConf, IItemDb
int itemid = 0;
String itemname = null;
short metaData = 0;
+ String[] parts = splitPattern.split(id);;
if (id.matches("^\\d+[:+',;.]\\d+$"))
{
- itemid = Integer.parseInt(id.split("[:+',;.]")[0]);
- metaData = Short.parseShort(id.split("[:+',;.]")[1]);
+ itemid = Integer.parseInt(parts[0]);
+ metaData = Short.parseShort(parts[1]);
}
- else if (id.matches("^\\d+$"))
+ else if (Util.isInt(id))
{
itemid = Integer.parseInt(id);
}
else if (id.matches("^[^:+',;.]+[:+',;.]\\d+$"))
{
- itemname = id.split("[:+',;.]")[0].toLowerCase(Locale.ENGLISH);
- metaData = Short.parseShort(id.split("[:+',;.]")[1]);
+ itemname = parts[0].toLowerCase(Locale.ENGLISH);
+ metaData = Short.parseShort(parts[1]);
}
else
{
@@ -135,18 +140,108 @@ public class ItemDb implements IConf, IItemDb
return retval;
}
+ public void addStringEnchantment(final User user, final boolean allowUnsafe, final ItemStack stack, final String string) throws Exception
+ {
+ final String[] split = splitPattern.split(string, 2);
+ if (split.length < 1)
+ {
+ return;
+ }
+
+ Enchantment enchantment = getEnchantment(user, split[0]);
+
+ int level = -1;
+ if (split.length > 1)
+ {
+ try
+ {
+ level = Integer.parseInt(split[1]);
+ }
+ catch (NumberFormatException ex)
+ {
+ level = -1;
+ }
+ }
+
+ if (level < 0 || (!allowUnsafe && level > enchantment.getMaxLevel()))
+ {
+ level = enchantment.getMaxLevel();
+ }
+ addEnchantment(user, allowUnsafe, stack, enchantment, level);
+ }
+
+ public void addEnchantment(final User user, final boolean allowUnsafe, final ItemStack stack, final Enchantment enchantment, final int level) throws Exception
+ {
+ try
+ {
+ if (stack.getType().equals(Material.ENCHANTED_BOOK))
+ {
+ EnchantmentStorageMeta meta = (EnchantmentStorageMeta)stack.getItemMeta();
+ if (level == 0)
+ {
+ meta.removeStoredEnchant(enchantment);
+ }
+ else
+ {
+ meta.addStoredEnchant(enchantment, level, allowUnsafe);
+ }
+ stack.setItemMeta(meta);
+ }
+ else // all other material types besides ENCHANTED_BOOK
+ {
+ if (level == 0)
+ {
+ stack.removeEnchantment(enchantment);
+ }
+ else
+ {
+ if (allowUnsafe)
+ {
+ stack.addUnsafeEnchantment(enchantment, level);
+ }
+ else
+ {
+ stack.addEnchantment(enchantment, level);
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new Exception("Enchantment " + enchantment.getName() + ": " + ex.getMessage(), ex);
+ }
+ }
+
+ //TODO: Properly TL this
+ public Enchantment getEnchantment(final User user, final String name) throws Exception
+ {
+ final Enchantment enchantment = Enchantments.getByName(name);
+ if (enchantment == null)
+ {
+ throw new Exception(_("enchantmentNotFound") + ": " + name);
+ }
+ final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH);
+ if (user != null && !user.isAuthorized("essentials.enchant." + enchantmentName))
+ {
+ throw new Exception(_("enchantmentPerm", enchantmentName));
+ }
+ return enchantment;
+ }
+
public String names(ItemStack item)
{
ItemData itemData = new ItemData(item.getTypeId(), item.getDurability());
List<String> nameList = names.get(itemData);
- if (nameList == null) {
- itemData = new ItemData(item.getTypeId(), (short) 0);
+ if (nameList == null)
+ {
+ itemData = new ItemData(item.getTypeId(), (short)0);
nameList = names.get(itemData);
- if (nameList == null) {
+ if (nameList == null)
+ {
return null;
}
}
-
+
if (nameList.size() > 15)
{
nameList = nameList.subList(0, 14);
@@ -154,6 +249,7 @@ public class ItemDb implements IConf, IItemDb
return Util.joinList(", ", nameList);
}
+
class ItemData
{
final private int itemNo;
@@ -198,6 +294,7 @@ public class ItemDb implements IConf, IItemDb
}
}
+
class LengthCompare implements java.util.Comparator<String>
{
public LengthCompare()
diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java
index 0aa90e08c..740ae0bff 100644
--- a/Essentials/src/com/earth2me/essentials/Jails.java
+++ b/Essentials/src/com/earth2me/essentials/Jails.java
@@ -44,6 +44,10 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
final PluginManager pluginManager = ess.getServer().getPluginManager();
final JailListener blockListener = new JailListener();
pluginManager.registerEvents(blockListener, ess);
+ if (ess.getSettings().isDebug())
+ {
+ LOGGER.log(Level.INFO, "Registering Jail listener");
+ }
}
@Override
@@ -55,16 +59,24 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
@Override
public void finishRead()
{
- if (enabled == false && getCount() > 0)
- {
- registerListeners();
- }
+ checkRegister();
}
@Override
public void finishWrite()
{
- if (enabled == false)
+ checkRegister();
+ }
+
+ public void resetListener()
+ {
+ enabled = false;
+ checkRegister();
+ }
+
+ private void checkRegister()
+ {
+ if (enabled == false && getCount() > 0)
{
registerListeners();
}
diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java
index d0a3b5d7e..4f0957f38 100644
--- a/Essentials/src/com/earth2me/essentials/Kit.java
+++ b/Essentials/src/com/earth2me/essentials/Kit.java
@@ -6,9 +6,7 @@ import com.earth2me.essentials.commands.NoChargeException;
import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
import java.util.*;
import java.util.logging.Level;
-import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
-import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
@@ -37,16 +35,17 @@ public class Kit
}
- public static void checkTime(final User user, final String kitName, final Map<String, Object> els) throws NoChargeException
+ public static void checkTime(final User user, final String kitName, final Map<String, Object> els) throws Exception
{
- if (user.isAuthorized("essentials.kit.exemptdelay")) {
+ if (user.isAuthorized("essentials.kit.exemptdelay"))
+ {
return;
}
-
+
final Calendar time = new GregorianCalendar();
// Take the current time, and remove the delay from it.
- final double delay = els.containsKey("delay") ? ((Number)els.get("delay")).doubleValue() : 0L;
+ final double delay = els.containsKey("delay") ? ((Number)els.get("delay")).doubleValue() : 0.0d;
final Calendar earliestTime = new GregorianCalendar();
earliestTime.add(Calendar.SECOND, -(int)delay);
earliestTime.add(Calendar.MILLISECOND, -(int)((delay * 1000.0) % 1000.0));
@@ -56,7 +55,7 @@ public class Kit
// When was the last kit used?
final long lastTime = user.getKitTimestamp(kitName);
- if (lastTime < earliestLong)
+ if (lastTime < earliestLong || lastTime == 0L)
{
user.setKitTimestamp(kitName, time.getTimeInMillis());
}
@@ -66,6 +65,11 @@ public class Kit
// If this happens, let's give the user the benifit of the doubt.
user.setKitTimestamp(kitName, time.getTimeInMillis());
}
+ else if (earliestLong < 0L)
+ {
+ user.sendMessage(_("kitOnce"));
+ throw new NoChargeException();
+ }
else
{
time.setTimeInMillis(lastTime);
@@ -82,7 +86,6 @@ public class Kit
{
throw new Exception(_("kitError2"));
}
-
try
{
@@ -100,57 +103,36 @@ public class Kit
try
{
boolean spew = false;
+ final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments();
for (String d : items)
{
+ if (d.startsWith(ess.getSettings().getCurrencySymbol()))
+ {
+ Double value = Double.parseDouble(d.substring(ess.getSettings().getCurrencySymbol().length()).trim());
+ Trade t = new Trade(value, ess);
+ t.pay(user);
+ continue;
+ }
+
final String[] parts = d.split(" ");
- final String[] item = parts[0].split("[:+',;.]", 2);
- final int id = Material.getMaterial(Integer.parseInt(item[0])).getId();
- final short data = item.length > 1 ? Short.parseShort(item[1]) : 0;
- final int amount = parts.length > 1 ? Integer.parseInt(parts[1]) : 1;
+ final ItemStack stack = ess.getItemDb().get(parts[0], parts.length > 1 ? Integer.parseInt(parts[1]) : 1);
- final ItemStack stack = new ItemStack(id, amount, data);
if (parts.length > 2)
{
for (int i = 2; i < parts.length; i++)
{
- final String[] split = parts[i].split("[:+',;.]", 2);
- if (split.length < 1)
- {
- continue;
- }
- final Enchantment enchantment = Enchantments.getByName(split[0]);
- if (enchantment == null)
- {
- throw new Exception("Enchantment not found: " + split[0]);
- }
- int level;
- if (split.length > 1)
- {
- level = Integer.parseInt(split[1]);
- }
- else
- {
- level = enchantment.getMaxLevel();
- }
- try
- {
- stack.addEnchantment(enchantment, level);
- }
- catch (Exception ex)
- {
- throw new Exception("Enchantment " + enchantment.getName() + ": " + ex.getMessage(), ex);
- }
+ ess.getItemDb().addStringEnchantment(null, allowUnsafe, stack, parts[i]);
}
}
final Map<Integer, ItemStack> overfilled;
if (user.isAuthorized("essentials.oversizedstacks"))
{
- overfilled = InventoryWorkaround.addItem(user.getInventory(), true, ess.getSettings().getOversizedStackSize(), stack);
+ overfilled = InventoryWorkaround.addOversizedItems(user.getInventory(), ess.getSettings().getOversizedStackSize(), stack);
}
else
{
- overfilled = InventoryWorkaround.addItem(user.getInventory(), true, 0, stack);
+ overfilled = InventoryWorkaround.addItems(user.getInventory(), stack);
}
for (ItemStack itemStack : overfilled.values())
{
diff --git a/Essentials/src/com/earth2me/essentials/Mob.java b/Essentials/src/com/earth2me/essentials/Mob.java
index 6cef12a7c..1586b041d 100644
--- a/Essentials/src/com/earth2me/essentials/Mob.java
+++ b/Essentials/src/com/earth2me/essentials/Mob.java
@@ -6,11 +6,15 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.Server;
+import org.bukkit.World;
+import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
+// Suffixes can be appended on the end of a mob name to make it plural
+// Entities without a suffix, will default to 's'
public enum Mob
{
CHICKEN("Chicken", Enemies.FRIENDLY, EntityType.CHICKEN),
@@ -37,8 +41,14 @@ public enum Mob
MAGMACUBE("MagmaCube", Enemies.ENEMY, EntityType.MAGMA_CUBE),
SNOWMAN("Snowman", Enemies.FRIENDLY, "", EntityType.SNOWMAN),
OCELOT("Ocelot", Enemies.NEUTRAL, EntityType.OCELOT),
- IRONGOLEM("IronGolem", Enemies.NEUTRAL, EntityType.IRON_GOLEM);
-
+ IRONGOLEM("IronGolem", Enemies.NEUTRAL, EntityType.IRON_GOLEM),
+ WITHER("Wither", Enemies.ENEMY, EntityType.WITHER),
+ BAT("Bat", Enemies.FRIENDLY, EntityType.BAT),
+ WITCH("Witch", Enemies.ENEMY, EntityType.WITCH),
+ BOAT("Boat", Enemies.NEUTRAL, EntityType.BOAT),
+ MINECART("Minecart", Enemies.NEUTRAL, EntityType.MINECART),
+ ENDERCRYSTAL("EnderCrystal", Enemies.NEUTRAL, EntityType.ENDER_CRYSTAL),
+ EXPERIENCEORB("ExperienceOrb", Enemies.NEUTRAL, EntityType.EXPERIENCE_ORB);
public static final Logger logger = Logger.getLogger("Minecraft");
private Mob(String n, Enemies en, String s, EntityType type)
@@ -68,14 +78,20 @@ public enum Mob
hashMap.put(mob.name.toLowerCase(Locale.ENGLISH), mob);
}
}
-
- public static Set<String> getMobList() {
+
+ public static Set<String> getMobList()
+ {
return Collections.unmodifiableSet(hashMap.keySet());
}
- public LivingEntity spawn(final Player player, final Server server, final Location loc) throws MobException
+ public Entity spawn(final Player player, final Server server, final Location loc) throws MobException
+ {
+ return spawn(player.getWorld(), server, loc);
+ }
+
+ public Entity spawn(final World world, final Server server, final Location loc) throws MobException
{
- final LivingEntity entity = player.getWorld().spawn(loc, (Class<? extends LivingEntity>)this.bukkitType.getEntityClass());
+ final Entity entity = world.spawn(loc, (Class<? extends Entity>)this.bukkitType.getEntityClass());
if (entity == null)
{
logger.log(Level.WARNING, _("unableToSpawnMob"));
diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java
index e861056ad..51dc92337 100644
--- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java
+++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java
@@ -11,11 +11,8 @@ import org.bukkit.conversations.ConversationAbandonedEvent;
import org.bukkit.entity.*;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
-import org.bukkit.inventory.Inventory;
-import org.bukkit.inventory.InventoryView;
+import org.bukkit.inventory.*;
import org.bukkit.inventory.InventoryView.Property;
-import org.bukkit.inventory.ItemStack;
-import org.bukkit.inventory.PlayerInventory;
import org.bukkit.map.MapView;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.permissions.Permission;
@@ -842,6 +839,12 @@ public class OfflinePlayer implements Player
}
@Override
+ public void setBedSpawnLocation(Location lctn, boolean force)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
public void playEffect(EntityEffect ee)
{
throw new UnsupportedOperationException("Not supported yet.");
@@ -1105,4 +1108,64 @@ public class OfflinePlayer implements Player
{
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ @Override
+ public void giveExpLevels(int i)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean getRemoveWhenFarAway()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setRemoveWhenFarAway(boolean bln)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public EntityEquipment getEquipment()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setCanPickupItems(boolean bln)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean getCanPickupItems()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Location getLocation(Location lctn)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setTexturePack(String string)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setMaxHealth(int i)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void resetMaxHealth()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java
index fff129d52..95123d051 100644
--- a/Essentials/src/com/earth2me/essentials/Settings.java
+++ b/Essentials/src/com/earth2me/essentials/Settings.java
@@ -12,6 +12,7 @@ import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.ChatColor;
+import org.bukkit.command.PluginCommand;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.MemoryConfiguration;
import org.bukkit.event.EventPriority;
@@ -189,6 +190,11 @@ public class Settings implements ISettings
final ConfigurationSection newSection = new MemoryConfiguration();
for (String command : section.getKeys(false))
{
+ PluginCommand cmd = ess.getServer().getPluginCommand(command);
+ if (command.charAt(0) == '/')
+ {
+ ess.getLogger().warning("Invalid command cost. '" + command + "' should not start with '/'.");
+ }
if (section.isDouble(command))
{
newSection.set(command.toLowerCase(Locale.ENGLISH), section.getDouble(command));
@@ -197,6 +203,24 @@ public class Settings implements ISettings
{
newSection.set(command.toLowerCase(Locale.ENGLISH), (double)section.getInt(command));
}
+ else if (section.isString(command))
+ {
+ String costString = section.getString(command);
+ try
+ {
+ double cost = Double.parseDouble(costString.trim().replace(getCurrencySymbol(), "").replaceAll("\\W", ""));
+ newSection.set(command.toLowerCase(Locale.ENGLISH), cost);
+ }
+ catch (NumberFormatException ex)
+ {
+ ess.getLogger().warning("Invalid command cost for: " + command + " (" + costString + ")");
+ }
+
+ }
+ else
+ {
+ ess.getLogger().warning("Invalid command cost for: " + command);
+ }
}
return newSection;
}
@@ -213,6 +237,31 @@ public class Settings implements ISettings
}
return 0.0;
}
+ private Set<String> socialSpyCommands = new HashSet<String>();
+
+ public Set<String> _getSocialSpyCommands()
+ {
+ Set<String> socialspyCommands = new HashSet<String>();
+
+ if (config.isConfigurationSection("socialspy-commands"))
+ {
+ for (String c : config.getStringList("socialspy-commands"))
+ {
+ socialspyCommands.add(c.toLowerCase(Locale.ENGLISH));
+ }
+ }
+ else
+ {
+ socialspyCommands.addAll(Arrays.asList("msg", "r", "mail", "m", "whisper", "emsg", "t", "tell", "er", "reply", "ereply", "email", "action", "describe", "eme", "eaction", "edescribe", "etell", "ewhisper", "pm"));
+ }
+
+ return socialspyCommands;
+ }
+
+ public Set<String> getSocialSpyCommands()
+ {
+ return socialSpyCommands;
+ }
private String nicknamePrefix = "~";
private String _getNicknamePrefix()
@@ -438,7 +487,9 @@ public class Settings implements ISettings
disableSuffix = _disableSuffix();
chatRadius = _getChatRadius();
commandCosts = _getCommandCosts();
+ socialSpyCommands = _getSocialSpyCommands();
warnOnBuildDisallow = _warnOnBuildDisallow();
+ mailsPerMinute = _getMailsPerMinute();
}
private List<Integer> itemSpawnBl = new ArrayList<Integer>();
@@ -557,6 +608,8 @@ public class Settings implements ISettings
return config.getString("locale", "");
}
+ //This method should always only return one character due to the implementation of the calling methods
+ //If you need to use a string currency, for example "coins", use the translation key 'currency'.
@Override
public String getCurrencySymbol()
{
@@ -695,6 +748,7 @@ public class Settings implements ISettings
}
private boolean prefixsuffixconfigured = false;
private boolean addprefixsuffix = false;
+ private boolean essentialsChatActive = false;
private boolean _addPrefixSuffix()
{
@@ -707,9 +761,15 @@ public class Settings implements ISettings
}
@Override
+ public void setEssentialsChatActive(boolean essentialsChatActive)
+ {
+ this.essentialsChatActive = essentialsChatActive;
+ }
+
+ @Override
public boolean addPrefixSuffix()
{
- return prefixsuffixconfigured ? addprefixsuffix : ess.getServer().getPluginManager().isPluginEnabled("EssentialsChat");
+ return prefixsuffixconfigured ? addprefixsuffix : essentialsChatActive;
}
private boolean disablePrefix = false;
@@ -796,6 +856,12 @@ public class Settings implements ISettings
{
return config.getBoolean("repair-enchanted", true);
}
+
+ @Override
+ public boolean allowUnsafeEnchantments()
+ {
+ return config.getBoolean("unsafe-enchantments", false);
+ }
@Override
public boolean isWorldTeleportPermissions()
@@ -863,7 +929,7 @@ public class Settings implements ISettings
@Override
public long getTpaAcceptCancellation()
{
- return config.getLong("tpa-accept-cancellation", 0);
+ return config.getLong("tpa-accept-cancellation", 120);
}
@Override
@@ -928,10 +994,30 @@ public class Settings implements ISettings
return maxSpeed > 1.0 ? 1.0 : Math.abs(maxSpeed);
}
+ //This option does not exist in the config.yml because it wasn't yet implemented in bukkit
+ //The code was commented out in the /speed command
@Override
public double getMaxWalkSpeed()
{
double maxSpeed = config.getDouble("max-walk-speed", 0.8);
return maxSpeed > 1.0 ? 1.0 : Math.abs(maxSpeed);
}
+ private int mailsPerMinute;
+
+ private int _getMailsPerMinute()
+ {
+ return config.getInt("mails-per-minute", 1000);
+ }
+
+ @Override
+ public int getMailsPerMinute()
+ {
+ return mailsPerMinute;
+ }
+
+ @Override
+ public long getMaxTempban()
+ {
+ return config.getLong("max-tempban-time", -1);
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/SpawnMob.java b/Essentials/src/com/earth2me/essentials/SpawnMob.java
new file mode 100644
index 000000000..cdb00cb3d
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/SpawnMob.java
@@ -0,0 +1,295 @@
+package com.earth2me.essentials;
+
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.Mob.MobException;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Random;
+import java.util.Set;
+import org.bukkit.DyeColor;
+import org.bukkit.Location;
+import org.bukkit.Server;
+import org.bukkit.block.Block;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.*;
+import org.bukkit.entity.Skeleton.SkeletonType;
+import org.bukkit.material.Colorable;
+
+
+public class SpawnMob
+{
+ public static String mobList(final User user)
+ {
+ final Set<String> mobList = Mob.getMobList();
+ final Set<String> availableList = new HashSet<String>();
+ for (String mob : mobList)
+ {
+ if (user.isAuthorized("essentials.spawnmob." + mob.toLowerCase()))
+ {
+ availableList.add(mob);
+ }
+ }
+ if (availableList.isEmpty())
+ {
+ availableList.add(_("none"));
+ }
+ return Util.joinList(availableList);
+ }
+
+ public static String[] mobData(final String mobString)
+ {
+ String[] returnString = new String[4];
+
+ final String[] parts = mobString.split(",");
+ String[] mobParts = parts[0].split(":");
+
+ returnString[0] = mobParts[0];
+ if (mobParts.length == 2)
+ {
+ returnString[1] = mobParts[1];
+ }
+
+ if (parts.length > 1)
+ {
+ String[] mountParts = parts[1].split(":");
+ returnString[2] = mountParts[0];
+ if (mountParts.length == 2)
+ {
+ returnString[3] = mountParts[1];
+ }
+ }
+
+ return returnString;
+ }
+
+ // This method spawns a mob where the user is looking, owned by user
+ public static void spawnmob(final IEssentials ess, final Server server, final User user, final String[] Data, int mobCount) throws Exception
+ {
+ final Block block = Util.getTarget(user).getBlock();
+ if (block == null)
+ {
+ throw new Exception(_("unableToSpawnMob"));
+ }
+ spawnmob(ess, server, user, user, block.getLocation(), Data, mobCount);
+ }
+
+ // This method spawns a mob at loc, owned by noone
+ public static void spawnmob(final IEssentials ess, final Server server, final CommandSender sender, final Location loc, final String[] Data, int mobCount) throws Exception
+ {
+ spawnmob(ess, server, sender, null, loc, Data, mobCount);
+ }
+
+ // This method spawns a mob at target, owned by target
+ public static void spawnmob(final IEssentials ess, final Server server, final CommandSender sender, final User target, final String[] Data, int mobCount) throws Exception
+ {
+ spawnmob(ess, server, sender, target, target.getLocation(), Data, mobCount);
+ }
+
+ // This method spawns a mob at loc, owned by target
+ public static void spawnmob(final IEssentials ess, final Server server, final CommandSender sender, final User target, final Location loc, final String[] Data, int mobCount) throws Exception
+ {
+ final Location sloc = Util.getSafeDestination(loc);
+ final String mobType = Data[0];
+ final String mobData = Data[1];
+ final String mountType = Data[2];
+ final String mountData = Data[3];
+
+ Mob mob = Mob.fromName(mobType);
+ Mob mobMount = null;
+
+ checkSpawnable(ess, sender, mob);
+
+ if (mountType != null)
+ {
+ mobMount = Mob.fromName(mountType);
+ checkSpawnable(ess, sender, mobMount);
+ }
+
+ int serverLimit = ess.getSettings().getSpawnMobLimit();
+ if (mobCount > serverLimit)
+ {
+ mobCount = serverLimit;
+ sender.sendMessage(_("mobSpawnLimit"));
+ }
+
+ try
+ {
+ for (int i = 0; i < mobCount; i++)
+ {
+ spawnMob(ess, server, sender, target, sloc, mob, mobData, mobMount, mountData);
+ }
+ sender.sendMessage(mobCount + " " + mob.name.toLowerCase(Locale.ENGLISH) + mob.suffix + " " + _("spawned"));
+ }
+ catch (MobException e1)
+ {
+ throw new Exception(_("unableToSpawnMob"), e1);
+ }
+ catch (NumberFormatException e2)
+ {
+ throw new Exception(_("numberRequired"), e2);
+ }
+ catch (NullPointerException np)
+ {
+ throw new Exception(_("soloMob"), np);
+ }
+ }
+
+ private static void spawnMob(final IEssentials ess, final Server server, final CommandSender sender, final User target, final Location sloc, Mob mob, String mobData, Mob mobMount, String mountData) throws Exception
+ {
+ Entity spawnedMob = mob.spawn(sloc.getWorld(), server, sloc);
+ Entity spawnedMount = null;
+
+ if (mobMount != null)
+ {
+ spawnedMount = mobMount.spawn(sloc.getWorld(), server, sloc);
+ spawnedMob.setPassenger(spawnedMount);
+ }
+ if (mobData != null)
+ {
+ changeMobData(mob.getType(), spawnedMob, mobData, target);
+ }
+ if (spawnedMount != null && mountData != null)
+ {
+ changeMobData(mobMount.getType(), spawnedMount, mountData, target);
+ }
+ }
+
+ private static void checkSpawnable(IEssentials ess, CommandSender sender, Mob mob) throws Exception
+ {
+ if (mob == null)
+ {
+ throw new Exception(_("invalidMob"));
+ }
+
+ if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH)))
+ {
+ throw new Exception(_("disabledToSpawnMob"));
+ }
+
+ if (sender instanceof User && !((User)sender).isAuthorized("essentials.spawnmob." + mob.name.toLowerCase()))
+ {
+ throw new Exception(_("noPermToSpawnMob"));
+ }
+ }
+
+ private static void changeMobData(final EntityType type, final Entity spawned, String data, final User target) throws Exception
+ {
+ data = data.toLowerCase(Locale.ENGLISH);
+
+ if (spawned instanceof Slime)
+ {
+ try
+ {
+ ((Slime)spawned).setSize(Integer.parseInt(data));
+ }
+ catch (Exception e)
+ {
+ throw new Exception(_("slimeMalformedSize"), e);
+ }
+ }
+
+ if ((spawned instanceof Ageable) && data.contains("baby"))
+ {
+ ((Ageable)spawned).setBaby();
+ data = data.replace("baby", "");
+ }
+
+ if (spawned instanceof Colorable)
+ {
+ final String color = data.toUpperCase(Locale.ENGLISH);
+ try
+ {
+ if (color.equals("RANDOM"))
+ {
+ final Random rand = new Random();
+ ((Colorable)spawned).setColor(DyeColor.values()[rand.nextInt(DyeColor.values().length)]);
+ }
+ else if (color.length() > 1)
+ {
+ ((Colorable)spawned).setColor(DyeColor.valueOf(color));
+ }
+ }
+ catch (Exception e)
+ {
+ throw new Exception(_("sheepMalformedColor"), e);
+ }
+ }
+
+ if (spawned instanceof Tameable && data.contains("tamed") && target != null)
+ {
+ final Tameable tameable = ((Tameable)spawned);
+ tameable.setTamed(true);
+ tameable.setOwner(target.getBase());
+ data = data.replace("tamed", "");
+ }
+
+ if (type == EntityType.WOLF)
+ {
+ if (data.contains("angry"))
+ {
+ ((Wolf)spawned).setAngry(true);
+ }
+ }
+
+ if (type == EntityType.CREEPER && data.contains("powered"))
+ {
+ ((Creeper)spawned).setPowered(true);
+ }
+
+ if (type == EntityType.OCELOT)
+ {
+ if (data.contains("siamese"))
+ {
+ ((Ocelot)spawned).setCatType(Ocelot.Type.SIAMESE_CAT);
+ }
+ else if (data.contains("red"))
+ {
+ ((Ocelot)spawned).setCatType(Ocelot.Type.RED_CAT);
+ }
+ else if (data.contains("black"))
+ {
+ ((Ocelot)spawned).setCatType(Ocelot.Type.BLACK_CAT);
+ }
+ }
+
+ if (type == EntityType.VILLAGER)
+ {
+ for (Villager.Profession prof : Villager.Profession.values())
+ {
+ if (data.contains(prof.toString().toLowerCase(Locale.ENGLISH)))
+ {
+ ((Villager)spawned).setProfession(prof);
+ }
+ }
+ }
+
+ if (spawned instanceof Zombie)
+ {
+ if (data.contains("villager"))
+ {
+ ((Zombie)spawned).setVillager(true);
+ }
+ if (data.contains("baby"))
+ {
+ ((Zombie)spawned).setBaby(true);
+ }
+ }
+
+ if (type == EntityType.SKELETON)
+ {
+ if (data.contains("wither"))
+ {
+ ((Skeleton)spawned).setSkeletonType(SkeletonType.WITHER);
+ }
+ }
+
+ if (type == EntityType.EXPERIENCE_ORB)
+ {
+ if (Util.isInt(data))
+ {
+ ((ExperienceOrb)spawned).setExperience(Integer.parseInt(data));
+
+ }
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java b/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java
index 4187f835d..79cdfa7b4 100644
--- a/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java
+++ b/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java
@@ -24,13 +24,13 @@ public class TNTExplodeListener implements Listener, Runnable
if (!enabled)
{
enabled = true;
- timer = ess.scheduleSyncDelayedTask(this, 1000);
+ timer = ess.scheduleSyncDelayedTask(this, 200);
return;
}
if (timer != -1)
{
ess.getScheduler().cancelTask(timer);
- timer = ess.scheduleSyncDelayedTask(this, 1000);
+ timer = ess.scheduleSyncDelayedTask(this, 200);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java
index 6a666a199..fc1a2cc04 100644
--- a/Essentials/src/com/earth2me/essentials/Teleport.java
+++ b/Essentials/src/com/earth2me/essentials/Teleport.java
@@ -2,10 +2,12 @@ package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.api.ITeleport;
+import com.earth2me.essentials.commands.NoChargeException;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.logging.Logger;
import org.bukkit.Location;
+import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
@@ -14,30 +16,30 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
public class Teleport implements Runnable, ITeleport
{
private static final double MOVE_CONSTANT = 0.3;
-
-
+
+
private class Target
{
private final Location location;
private final String name;
-
+
Target(Location location)
{
this.location = location;
this.name = null;
}
-
+
Target(Player entity)
{
this.name = entity.getName();
this.location = null;
}
-
+
public Location getLocation()
{
if (this.name != null)
{
-
+
return ess.getServer().getPlayerExact(name).getLocation();
}
return location;
@@ -47,7 +49,7 @@ public class Teleport implements Runnable, ITeleport
private IUser teleportUser;
private int teleTimer = -1;
private long started; // time this task was initiated
- private long delay; // how long to delay the teleport
+ private long tpdelay; // how long to delay the teleport
private int health;
// note that I initially stored a clone of the location for reference, but...
// when comparing locations, I got incorrect mismatches (rounding errors, looked like)
@@ -56,20 +58,21 @@ public class Teleport implements Runnable, ITeleport
private long initY;
private long initZ;
private Target teleportTarget;
+ private boolean respawn;
private Trade chargeFor;
private final IEssentials ess;
private static final Logger logger = Logger.getLogger("Minecraft");
private TeleportCause cause;
-
+
private void initTimer(long delay, Target target, Trade chargeFor, TeleportCause cause)
{
- initTimer(delay, user, target, chargeFor, cause);
+ initTimer(delay, user, target, chargeFor, cause, false);
}
-
- private void initTimer(long delay, IUser teleportUser, Target target, Trade chargeFor, TeleportCause cause)
+
+ private void initTimer(long delay, IUser teleportUser, Target target, Trade chargeFor, TeleportCause cause, boolean respawn)
{
this.started = System.currentTimeMillis();
- this.delay = delay;
+ this.tpdelay = delay;
this.health = teleportUser.getHealth();
this.initX = Math.round(teleportUser.getLocation().getX() * MOVE_CONSTANT);
this.initY = Math.round(teleportUser.getLocation().getY() * MOVE_CONSTANT);
@@ -78,12 +81,13 @@ public class Teleport implements Runnable, ITeleport
this.teleportTarget = target;
this.chargeFor = chargeFor;
this.cause = cause;
+ this.respawn = respawn;
}
-
+
@Override
public void run()
{
-
+
if (user == null || !user.isOnline() || user.getLocation() == null)
{
cancel(false);
@@ -94,7 +98,7 @@ public class Teleport implements Runnable, ITeleport
cancel(false);
return;
}
-
+
if (!user.isAuthorized("essentials.teleport.timer.move")
&& (Math.round(teleportUser.getLocation().getX() * MOVE_CONSTANT) != initX
|| Math.round(teleportUser.getLocation().getY() * MOVE_CONSTANT) != initY
@@ -107,7 +111,7 @@ public class Teleport implements Runnable, ITeleport
}
health = teleportUser.getHealth(); // in case user healed, then later gets injured
long now = System.currentTimeMillis();
- if (now > started + delay)
+ if (now > started + tpdelay)
{
try
{
@@ -115,8 +119,14 @@ public class Teleport implements Runnable, ITeleport
teleportUser.sendMessage(_("teleportationCommencing"));
try
{
-
- teleportUser.getTeleport().now(teleportTarget, cause);
+ if (respawn)
+ {
+ teleportUser.getTeleport().respawn(cause);
+ }
+ else
+ {
+ teleportUser.getTeleport().now(teleportTarget, cause);
+ }
cancel(false);
if (chargeFor != null)
{
@@ -138,13 +148,13 @@ public class Teleport implements Runnable, ITeleport
}
}
}
-
+
public Teleport(IUser user, IEssentials ess)
{
this.user = user;
this.ess = ess;
}
-
+
public void cooldown(boolean check) throws Exception
{
final Calendar time = new GregorianCalendar();
@@ -160,7 +170,7 @@ public class Teleport implements Runnable, ITeleport
// When was the last teleport used?
final Long lastTime = user.getLastTeleportTimestamp();
-
+
if (lastTime > time.getTimeInMillis())
{
// This is to make sure time didn't get messed up on last kit use.
@@ -217,7 +227,7 @@ public class Teleport implements Runnable, ITeleport
}
now(new Target(loc), cause);
}
-
+
public void now(Player entity, boolean cooldown, TeleportCause cause) throws Exception
{
if (cooldown)
@@ -226,7 +236,7 @@ public class Teleport implements Runnable, ITeleport
}
now(new Target(entity), cause);
}
-
+
private void now(Target target, TeleportCause cause) throws Exception
{
cancel(false);
@@ -241,21 +251,21 @@ public class Teleport implements Runnable, ITeleport
{
teleport(loc, chargeFor, TeleportCause.PLUGIN);
}
-
+
public void teleport(Location loc, Trade chargeFor, TeleportCause cause) throws Exception
{
teleport(new Target(loc), chargeFor, cause);
}
-
+
public void teleport(Player entity, Trade chargeFor, TeleportCause cause) throws Exception
{
teleport(new Target(entity), chargeFor, cause);
}
-
+
private void teleport(Target target, Trade chargeFor, TeleportCause cause) throws Exception
{
double delay = ess.getSettings().getTeleportDelay();
-
+
if (chargeFor != null)
{
chargeFor.isAffordableFor(user);
@@ -271,11 +281,11 @@ public class Teleport implements Runnable, ITeleport
}
return;
}
-
+
cancel(false);
- warnUser(user);
+ warnUser(user, delay);
initTimer((long)(delay * 1000.0), target, chargeFor, cause);
-
+
teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
}
@@ -283,9 +293,8 @@ public class Teleport implements Runnable, ITeleport
public void teleportToMe(User otherUser, Trade chargeFor, TeleportCause cause) throws Exception
{
Target target = new Target(user);
-
double delay = ess.getSettings().getTeleportDelay();
-
+
if (chargeFor != null)
{
chargeFor.isAffordableFor(user);
@@ -301,15 +310,14 @@ public class Teleport implements Runnable, ITeleport
}
return;
}
-
+
cancel(false);
- warnUser(otherUser);
- initTimer((long)(delay * 1000.0), otherUser, target, chargeFor, cause);
-
+ warnUser(otherUser, delay);
+ initTimer((long)(delay * 1000.0), otherUser, target, chargeFor, cause, false);
teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
}
-
- private void warnUser(final IUser user)
+
+ private void warnUser(final IUser user, final double delay)
{
Calendar c = new GregorianCalendar();
c.add(Calendar.SECOND, (int)delay);
@@ -320,19 +328,55 @@ public class Teleport implements Runnable, ITeleport
//The respawn function is a wrapper used to handle tp fallback, on /jail and /home
public void respawn(final Trade chargeFor, TeleportCause cause) throws Exception
{
+ double delay = ess.getSettings().getTeleportDelay();
+ if (chargeFor != null)
+ {
+ chargeFor.isAffordableFor(user);
+ }
+ cooldown(true);
+ if (delay <= 0 || user.isAuthorized("essentials.teleport.timer.bypass"))
+ {
+ cooldown(false);
+ respawn(cause);
+ if (chargeFor != null)
+ {
+ chargeFor.charge(user);
+ }
+ return;
+ }
+
+ cancel(false);
+ warnUser(user, delay);
+ initTimer((long)(delay * 1000.0), user, null, chargeFor, cause, true);
+ teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
+ }
+
+ public void respawn(TeleportCause cause) throws Exception
+ {
final Player player = user.getBase();
- final Location bed = player.getBedSpawnLocation();
- final PlayerRespawnEvent pre = new PlayerRespawnEvent(player, bed == null ? player.getWorld().getSpawnLocation() : bed, bed != null);
- ess.getServer().getPluginManager().callEvent(pre);
- teleport(new Target(pre.getRespawnLocation()), chargeFor, cause);
+ Location bed = player.getBedSpawnLocation();
+ if (bed != null && bed.getBlock().getType() == Material.BED_BLOCK)
+ {
+ now(new Target(bed), cause);
+ }
+ else
+ {
+ if (ess.getSettings().isDebug())
+ {
+ ess.getLogger().info("Could not find bed spawn, forcing respawn event.");
+ }
+ final PlayerRespawnEvent pre = new PlayerRespawnEvent(player, player.getWorld().getSpawnLocation(), false);
+ ess.getServer().getPluginManager().callEvent(pre);
+ now(new Target(pre.getRespawnLocation()), cause);
+ }
}
//The warp function is a wrapper used to teleport a player to a /warp
public void warp(String warp, Trade chargeFor, TeleportCause cause) throws Exception
{
Location loc = ess.getWarps().getWarp(warp);
- teleport(new Target(loc), chargeFor, cause);
user.sendMessage(_("warpingTo", warp));
+ teleport(new Target(loc), chargeFor, cause);
}
//The back function is a wrapper used to teleport a player /back to their previous location.
diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java
index ff37a5d28..1a03a0145 100644
--- a/Essentials/src/com/earth2me/essentials/Trade.java
+++ b/Essentials/src/com/earth2me/essentials/Trade.java
@@ -77,7 +77,7 @@ public class Trade
}
if (getItemStack() != null
- && !InventoryWorkaround.containsItem(user.getInventory(), true, true, itemStack))
+ && !user.getInventory().containsAtLeast(itemStack, itemStack.getAmount()))
{
throw new ChargeException(_("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " ")));
}
@@ -113,7 +113,7 @@ public class Trade
{
if (dropItems)
{
- final Map<Integer, ItemStack> leftOver = InventoryWorkaround.addItem(user.getInventory(), true, getItemStack());
+ final Map<Integer, ItemStack> leftOver = InventoryWorkaround.addItems(user.getInventory(), getItemStack());
final Location loc = user.getLocation();
for (ItemStack itemStack : leftOver.values())
{
@@ -137,7 +137,7 @@ public class Trade
}
else
{
- success = InventoryWorkaround.addAllItems(user.getInventory(), true, getItemStack());
+ success = InventoryWorkaround.addAllItems(user.getInventory(), getItemStack());
}
user.updateInventory();
}
@@ -165,11 +165,11 @@ public class Trade
}
if (getItemStack() != null)
{
- if (!InventoryWorkaround.containsItem(user.getInventory(), true, true, itemStack))
+ if (!user.getInventory().containsAtLeast(itemStack, itemStack.getAmount()))
{
throw new ChargeException(_("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " ")));
}
- InventoryWorkaround.removeItem(user.getInventory(), true, true, getItemStack());
+ user.getInventory().removeItem(getItemStack());
user.updateInventory();
}
if (command != null)
@@ -234,6 +234,9 @@ public class Trade
public static void log(String type, String subtype, String event, String sender, Trade charge, String receiver, Trade pay, Location loc, IEssentials ess)
{
+ //isEcoLogUpdateEnabled() - This refers to log entries with no location, ie API updates #EasterEgg
+ //isEcoLogEnabled() - This refers to log entries with with location, ie /pay /sell and eco signs.
+
if ((loc == null && !ess.getSettings().isEcoLogUpdateEnabled())
|| (loc != null && !ess.getSettings().isEcoLogEnabled()))
{
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java
index 01284d4b8..6fce1c087 100644
--- a/Essentials/src/com/earth2me/essentials/User.java
+++ b/Essentials/src/com/earth2me/essentials/User.java
@@ -12,6 +12,8 @@ import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
+import org.bukkit.potion.PotionEffect;
+import org.bukkit.potion.PotionEffectType;
public class User extends UserData implements Comparable<User>, IReplyTo, IUser
@@ -29,6 +31,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
private boolean rightClickJump = false;
private transient Location afkPosition = null;
private boolean invSee = false;
+ private boolean recipeSee = false;
private boolean enderSee = false;
private static final Logger logger = Logger.getLogger("Minecraft");
@@ -70,8 +73,8 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
}
return result;
}
-
- private boolean isAuthorizedCheck(final String node)
+
+ private boolean isAuthorizedCheck(final String node)
{
if (base instanceof OfflinePlayer)
@@ -79,11 +82,6 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
return false;
}
- if (isJailed())
- {
- return false;
- }
-
try
{
return ess.getPermissionsHandler().hasPermission(base, node);
@@ -306,6 +304,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
if (ess.getSettings().addPrefixSuffix())
{
+ //These two extra toggles are not documented, because they are mostly redundant #EasterEgg
if (!ess.getSettings().disablePrefix())
{
final String ptext = ess.getPermissionsHandler().getPrefix(base).replace('&', '§');
@@ -537,7 +536,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
if (broadcast && !isHidden())
{
setDisplayNick();
- ess.broadcastMessage(this, _("userIsNotAway", getDisplayName()));
+ final String msg = _("userIsNotAway", getDisplayName());
+ if (!msg.isEmpty())
+ {
+ ess.broadcastMessage(this, msg);
+ }
}
}
lastActivity = System.currentTimeMillis();
@@ -570,7 +573,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
if (!isHidden())
{
setDisplayNick();
- ess.broadcastMessage(this, _("userIsAway", getDisplayName()));
+ final String msg = _("userIsAway", getDisplayName());
+ if (!msg.isEmpty())
+ {
+ ess.broadcastMessage(this, msg);
+ }
}
}
}
@@ -680,6 +687,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
}
setHidden(true);
ess.getVanishedPlayers().add(getName());
+ if (isAuthorized("essentials.vanish.effect"))
+ {
+ this.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1, false));
+ }
}
else
{
@@ -689,6 +700,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
}
setHidden(false);
ess.getVanishedPlayers().remove(getName());
+ if (isAuthorized("essentials.vanish.effect"))
+ {
+ this.removePotionEffect(PotionEffectType.INVISIBILITY);
+ }
}
}
@@ -728,4 +743,20 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
{
this.rightClickJump = rightClickJump;
}
+
+ @Override
+ public boolean isIgnoreExempt()
+ {
+ return this.isAuthorized("essentials.chat.ignoreexempt");
+ }
+
+ public boolean isRecipeSee()
+ {
+ return recipeSee;
+ }
+
+ public void setRecipeSee(boolean recipeSee)
+ {
+ this.recipeSee = recipeSee;
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java
index e9b84e656..94b1631f5 100644
--- a/Essentials/src/com/earth2me/essentials/UserData.java
+++ b/Essentials/src/com/earth2me/essentials/UserData.java
@@ -49,23 +49,23 @@ public abstract class UserData extends PlayerExtension implements IConf
lastHealTimestamp = _getLastHealTimestamp();
jail = _getJail();
mails = _getMails();
- teleportEnabled = getTeleportEnabled();
- ignoredPlayers = getIgnoredPlayers();
+ teleportEnabled = _getTeleportEnabled();
godmode = _getGodModeEnabled();
- muted = getMuted();
+ muted = _getMuted();
muteTimeout = _getMuteTimeout();
- jailed = getJailed();
+ jailed = _getJailed();
jailTimeout = _getJailTimeout();
lastLogin = _getLastLogin();
lastLogout = _getLastLogout();
lastLoginAddress = _getLastLoginAddress();
- afk = getAfk();
+ afk = _getAfk();
geolocation = _getGeoLocation();
isSocialSpyEnabled = _isSocialSpyEnabled();
isNPC = _isNPC();
arePowerToolsEnabled = _arePowerToolsEnabled();
kitTimestamps = _getKitTimestamps();
nickname = _getNickname();
+ setIgnoredPlayers(_getIgnoredPlayers());
}
private double money;
@@ -161,7 +161,7 @@ public abstract class UserData extends PlayerExtension implements IConf
public void setHome(String name, Location loc)
{
//Invalid names will corrupt the yaml
- name = Util.sanitizeFileName(name);
+ name = Util.safeString(name);
homes.put(name, loc);
config.setProperty("homes." + name, loc);
config.save();
@@ -172,7 +172,7 @@ public abstract class UserData extends PlayerExtension implements IConf
String search = getHomeName(name);
if (!homes.containsKey(search))
{
- search = Util.sanitizeFileName(search);
+ search = Util.safeString(search);
}
if (homes.containsKey(search))
{
@@ -415,7 +415,7 @@ public abstract class UserData extends PlayerExtension implements IConf
}
private boolean teleportEnabled;
- private boolean getTeleportEnabled()
+ private boolean _getTeleportEnabled()
{
return config.getBoolean("teleportenabled", true);
}
@@ -447,7 +447,7 @@ public abstract class UserData extends PlayerExtension implements IConf
}
private List<String> ignoredPlayers;
- public List<String> getIgnoredPlayers()
+ public List<String> _getIgnoredPlayers()
{
return Collections.synchronizedList(config.getStringList("ignore"));
}
@@ -480,7 +480,7 @@ public abstract class UserData extends PlayerExtension implements IConf
public boolean isIgnoredPlayer(IUser user)
{
- return (ignoredPlayers.contains(user.getName().toLowerCase(Locale.ENGLISH)) && !user.isAuthorized("essentials.chat.ignoreexempt"));
+ return (ignoredPlayers.contains(user.getName().toLowerCase(Locale.ENGLISH)) && !user.isIgnoreExempt());
}
public void setIgnoredPlayer(IUser user, boolean set)
@@ -515,10 +515,15 @@ public abstract class UserData extends PlayerExtension implements IConf
}
private boolean muted;
- public boolean getMuted()
+ public boolean _getMuted()
{
return config.getBoolean("muted", false);
}
+
+ public boolean getMuted()
+ {
+ return muted;
+ }
public boolean isMuted()
{
@@ -551,7 +556,7 @@ public abstract class UserData extends PlayerExtension implements IConf
}
private boolean jailed;
- private boolean getJailed()
+ private boolean _getJailed()
{
return config.getBoolean("jailed", false);
}
@@ -635,7 +640,10 @@ public abstract class UserData extends PlayerExtension implements IConf
public void setLastLogin(long time)
{
_setLastLogin(time);
- _setLastLoginAddress(base.getAddress().getAddress().getHostAddress());
+ if (base.getAddress() != null && base.getAddress().getAddress() != null)
+ {
+ _setLastLoginAddress(base.getAddress().getAddress().getHostAddress());
+ }
config.save();
}
private long lastLogout;
@@ -675,7 +683,7 @@ public abstract class UserData extends PlayerExtension implements IConf
}
private boolean afk;
- private boolean getAfk()
+ private boolean _getAfk()
{
return config.getBoolean("afk", false);
}
diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java
index 34e5c6420..a31d18f0e 100644
--- a/Essentials/src/com/earth2me/essentials/Util.java
+++ b/Essentials/src/com/earth2me/essentials/Util.java
@@ -23,16 +23,20 @@ public class Util
private final static Logger logger = Logger.getLogger("Minecraft");
private final static Pattern INVALIDFILECHARS = Pattern.compile("[^a-z0-9]");
private final static Pattern INVALIDCHARS = Pattern.compile("[^\t\n\r\u0020-\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFC]");
- private final static Pattern BADFILENAMES = Pattern.compile("^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\\.(.+))?$", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE | Pattern.COMMENTS);
+ //Used to clean file names before saving to disk
public static String sanitizeFileName(final String name)
{
- String newName = INVALIDFILECHARS.matcher(name.toLowerCase(Locale.ENGLISH)).replaceAll("_");
- if(BADFILENAMES.matcher(newName).matches())
- newName = "_" + newName;
- return newName;
+ return safeString(name);
}
+ //Used to clean strings/names before saving as filenames/permissions
+ public static String safeString(final String string)
+ {
+ return INVALIDFILECHARS.matcher(string.toLowerCase(Locale.ENGLISH)).replaceAll("_");
+ }
+
+ //Less restrictive string sanitizing, when not used as perm or filename
public static String sanitizeString(final String string)
{
return INVALIDCHARS.matcher(string).replaceAll("");
@@ -601,6 +605,7 @@ public class Util
}
private static transient final Pattern URL_PATTERN = Pattern.compile("((?:(?:https?)://)?[\\w-_\\.]{2,})\\.([a-z]{2,3}(?:/\\S+)?)");
private static transient final Pattern VANILLA_PATTERN = Pattern.compile("\u00A7+[0-9A-FK-ORa-fk-or]");
+ private static transient final Pattern LOGCOLOR_PATTERN = Pattern.compile("\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]");
private static transient final Pattern REPLACE_PATTERN = Pattern.compile("&([0-9a-fk-or])");
private static transient final Pattern VANILLA_COLOR_PATTERN = Pattern.compile("\u00A7+[0-9A-Fa-f]");
private static transient final Pattern VANILLA_MAGIC_PATTERN = Pattern.compile("\u00A7+[Kk]");
@@ -609,6 +614,7 @@ public class Util
private static transient final Pattern REPLACE_MAGIC_PATTERN = Pattern.compile("&(k)");
private static transient final Pattern REPLACE_FORMAT_PATTERN = Pattern.compile("&([l-or])");
+ //This method is used to simply strip the native minecraft colour codes
public static String stripFormat(final String input)
{
if (input == null)
@@ -618,29 +624,26 @@ public class Util
return VANILLA_PATTERN.matcher(input).replaceAll("");
}
- public static String replaceFormat(final String input)
+ public static String stripLogColorFormat(final String input)
{
if (input == null)
{
return null;
}
- return REPLACE_PATTERN.matcher(input).replaceAll("\u00a7$1");
+ return LOGCOLOR_PATTERN.matcher(input).replaceAll("");
}
- public static String blockURL(final String input)
+ //This method is used to simply replace the ess colour codes with minecraft ones, ie &c
+ public static String replaceFormat(final String input)
{
if (input == null)
{
return null;
}
- String text = URL_PATTERN.matcher(input).replaceAll("$1 $2");
- while (URL_PATTERN.matcher(text).find())
- {
- text = URL_PATTERN.matcher(text).replaceAll("$1 $2");
- }
- return text;
+ return REPLACE_PATTERN.matcher(input).replaceAll("\u00a7$1");
}
+ //This is the general permission sensitive message format function, does not touch urls.
public static String formatString(final IUser user, final String permBase, final String input)
{
if (input == null)
@@ -675,6 +678,7 @@ public class Util
return message;
}
+ //This is the general permission sensitive message format function, checks for urls.
public static String formatMessage(final IUser user, final String permBase, final String input)
{
if (input == null)
@@ -688,6 +692,20 @@ public class Util
}
return message;
}
+
+ private static String blockURL(final String input)
+ {
+ if (input == null)
+ {
+ return null;
+ }
+ String text = URL_PATTERN.matcher(input).replaceAll("$1 $2");
+ while (URL_PATTERN.matcher(text).find())
+ {
+ text = URL_PATTERN.matcher(text).replaceAll("$1 $2");
+ }
+ return text;
+ }
private static String stripColor(final String input, final Pattern pattern)
{
diff --git a/Essentials/src/com/earth2me/essentials/Warps.java b/Essentials/src/com/earth2me/essentials/Warps.java
index ece987aba..6c3448f4e 100644
--- a/Essentials/src/com/earth2me/essentials/Warps.java
+++ b/Essentials/src/com/earth2me/essentials/Warps.java
@@ -3,6 +3,7 @@ package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.commands.WarpNotFoundException;
import java.io.File;
+import java.io.IOException;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -70,7 +71,14 @@ public class Warps implements IConf
}
conf.setProperty(null, loc);
conf.setProperty("name", name);
- conf.save();
+ try
+ {
+ conf.saveWithError();
+ }
+ catch (IOException ex)
+ {
+ throw new IOException(_("invalidWarpName"));
+ }
}
public void delWarp(String name) throws Exception
diff --git a/Essentials/src/com/earth2me/essentials/api/Economy.java b/Essentials/src/com/earth2me/essentials/api/Economy.java
index 6ed1829b3..579afd4d1 100644
--- a/Essentials/src/com/earth2me/essentials/api/Economy.java
+++ b/Essentials/src/com/earth2me/essentials/api/Economy.java
@@ -8,7 +8,6 @@ import com.earth2me.essentials.Util;
import java.io.File;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.bukkit.entity.Player;
/**
@@ -72,17 +71,7 @@ public final class Economy
{
throw new RuntimeException(noCallBeforeLoad);
}
- User user;
- Player player = ess.getServer().getPlayer(name);
- if (player != null)
- {
- user = ess.getUser(player);
- }
- else
- {
- user = ess.getOfflineUser(name);
- }
- return user;
+ return ess.getUser(name);
}
/**
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java
index c71883571..6a5d6dc26 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java
@@ -32,12 +32,13 @@ public class Commandafk extends EssentialsCommand
private void toggleAfk(User user)
{
user.setDisplayNick();
+ String msg = "";
if (!user.toggleAfk())
{
//user.sendMessage(_("markedAsNotAway"));
if (!user.isHidden())
{
- ess.broadcastMessage(user, _("userIsNotAway", user.getDisplayName()));
+ msg = _("userIsNotAway", user.getDisplayName());
}
user.updateActivity(false);
}
@@ -46,8 +47,12 @@ public class Commandafk extends EssentialsCommand
//user.sendMessage(_("markedAsAway"));
if (!user.isHidden())
{
- ess.broadcastMessage(user, _("userIsAway", user.getDisplayName()));
+ msg = _("userIsAway", user.getDisplayName());
}
}
+ if (!msg.isEmpty())
+ {
+ ess.broadcastMessage(user, msg);
+ }
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java b/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java
index 968d0012c..79ef1f969 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java
@@ -6,7 +6,7 @@ import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.entity.TNTPrimed;
-
+// This command has a in theme message that only shows if you supply a parameter #EasterEgg
public class Commandantioch extends EssentialsCommand
{
public Commandantioch()
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java
index 15c3c9088..e4aebd197 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java
@@ -27,6 +27,7 @@ public class Commandbalance extends EssentialsCommand
@Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
+ //TODO: Remove 'other' perm
final double bal = (args.length < 1
|| !(user.isAuthorized("essentials.balance.others")
|| user.isAuthorized("essentials.balance.other"))
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java
index cf6ea53df..05e2b51c6 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java
@@ -4,6 +4,7 @@ import com.earth2me.essentials.Console;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.OfflinePlayer;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
import java.util.logging.Level;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -20,6 +21,7 @@ public class Commandban extends EssentialsCommand
@Override
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
+ boolean nomatch = false;
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
@@ -31,6 +33,7 @@ public class Commandban extends EssentialsCommand
}
catch (NoSuchFieldException e)
{
+ nomatch = true;
user = ess.getUser(new OfflinePlayer(args[0], ess));
}
if (!user.isOnline())
@@ -55,7 +58,7 @@ public class Commandban extends EssentialsCommand
String banReason;
if (args.length > 1)
{
- banReason = _("banFormat", getFinalArg(args, 1), senderName);
+ banReason = _("banFormat", Util.replaceFormat(getFinalArg(args, 1).replace("\\n", "\n")), senderName);
}
else
{
@@ -64,14 +67,19 @@ public class Commandban extends EssentialsCommand
user.setBanReason(banReason);
user.setBanned(true);
+ user.setBanTimeout(0);
user.kickPlayer(banReason);
-
+
server.getLogger().log(Level.INFO, _("playerBanned", senderName, user.getName(), banReason));
+
+ if (nomatch) {
+ sender.sendMessage(_("userUnknown", args[0]));
+ }
for (Player onlinePlayer : server.getOnlinePlayers())
{
final User player = ess.getUser(onlinePlayer);
- if (player.isAuthorized("essentials.ban.notify"))
+ if (onlinePlayer == sender || player.isAuthorized("essentials.ban.notify"))
{
onlinePlayer.sendMessage(_("playerBanned", senderName, user.getName(), banReason));
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java b/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java
index 579be06ff..97abbc6db 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java
@@ -35,7 +35,7 @@ public class Commandenchant extends EssentialsCommand
for (Map.Entry<String, Enchantment> entry : Enchantments.entrySet())
{
final String enchantmentName = entry.getValue().getName().toLowerCase(Locale.ENGLISH);
- if (enchantmentslist.contains(enchantmentName) || user.isAuthorized("essentials.enchant." + enchantmentName))
+ if (enchantmentslist.contains(enchantmentName) || (user.isAuthorized("essentials.enchant." + enchantmentName) && entry.getValue().canEnchantItem(stack)))
{
enchantmentslist.add(entry.getKey());
//enchantmentslist.add(enchantmentName);
@@ -43,6 +43,7 @@ public class Commandenchant extends EssentialsCommand
}
throw new NotEnoughArgumentsException(_("enchantments", Util.joinList(enchantmentslist.toArray())));
}
+
int level = -1;
if (args.length > 1)
{
@@ -55,19 +56,12 @@ public class Commandenchant extends EssentialsCommand
level = -1;
}
}
- final Enchantment enchantment = getEnchantment(args[0], user);
- if (level < 0 || level > enchantment.getMaxLevel())
- {
- level = enchantment.getMaxLevel();
- }
- if (level == 0)
- {
- stack.removeEnchantment(enchantment);
- }
- else
- {
- stack.addEnchantment(enchantment, level);
- }
+
+ final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments() && user.isAuthorized("essentials.enchant.allowunsafe");
+ final Enchantment enchantment = ess.getItemDb().getEnchantment(user, args[0]);
+ ess.getItemDb().addEnchantment(user, allowUnsafe, stack, enchantment, level);
+
+
user.getInventory().setItemInHand(stack);
user.updateInventory();
final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH);
@@ -80,20 +74,4 @@ public class Commandenchant extends EssentialsCommand
user.sendMessage(_("enchantmentApplied", enchantmentName.replace('_', ' ')));
}
}
-
- public static Enchantment getEnchantment(final String name, final User user) throws Exception
- {
-
- final Enchantment enchantment = Enchantments.getByName(name);
- if (enchantment == null)
- {
- throw new Exception(_("enchantmentNotFound"));
- }
- final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH);
- if (user != null && !user.isAuthorized("essentials.enchant." + enchantmentName))
- {
- throw new Exception(_("enchantmentPerm", enchantmentName));
- }
- return enchantment;
- }
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
index fe33aebd7..8598a31e9 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
@@ -14,7 +14,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Player;
-
+// This command has 4 undocumented behaviours #EasterEgg
public class Commandessentials extends EssentialsCommand
{
public Commandessentials()
@@ -55,6 +55,7 @@ public class Commandessentials extends EssentialsCommand
}
}
+ //If you do not supply an argument this command will list 'overridden' commands.
private void run_disabled(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
sender.sendMessage("Essentials " + ess.getDescription().getVersion());
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java
index f3dac79e2..5d3658470 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java
@@ -125,13 +125,13 @@ public class Commandexp extends EssentialsCommand
sender.sendMessage(_("exp", target.getDisplayName(), SetExpFix.getTotalExperience(target), target.getLevel(), SetExpFix.getExpUntilNextLevel(target)));
}
- private void setExp(final CommandSender sender, final User target, String strAmount, final boolean give)
+ private void setExp(final CommandSender sender, final User target, String strAmount, final boolean give) throws NotEnoughArgumentsException
{
Long amount;
strAmount = strAmount.toLowerCase(Locale.ENGLISH);
- if (strAmount.startsWith("l"))
+ if (strAmount.startsWith("l") || strAmount.endsWith("l"))
{
- strAmount = strAmount.substring(1);
+ strAmount = strAmount.replaceAll("l","");
int neededLevel = Integer.parseInt(strAmount);
if (give)
{
@@ -142,6 +142,10 @@ public class Commandexp extends EssentialsCommand
}
else {
amount = Long.parseLong(strAmount);
+ if (amount < 0 || amount > Integer.MAX_VALUE)
+ {
+ throw new NotEnoughArgumentsException();
+ }
}
if (give)
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java b/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java
index 671d0f72b..f1aae3ca7 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java
@@ -2,8 +2,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.User;
import org.bukkit.Server;
-import org.bukkit.entity.Fireball;
-import org.bukkit.entity.SmallFireball;
+import org.bukkit.entity.*;
import org.bukkit.util.Vector;
@@ -18,12 +17,43 @@ public class Commandfireball extends EssentialsCommand
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
boolean small = false;
- if (args.length > 0 && args[0].equalsIgnoreCase("small"))
+ Class<? extends Entity> type = Fireball.class;
+ Projectile projectile;
+ int speed = 2;
+ if (args.length > 0)
{
- small = true;
+ if (args[0].equalsIgnoreCase("small"))
+ {
+ type = SmallFireball.class;
+ }
+ else if (args[0].equalsIgnoreCase("arrow"))
+ {
+ type = Arrow.class;
+ }
+ else if (args[0].equalsIgnoreCase("skull"))
+ {
+ type = WitherSkull.class;
+ }
+ else if (args[0].equalsIgnoreCase("egg"))
+ {
+ type = Egg.class;
+ }
+ else if(args[0].equalsIgnoreCase("snowball"))
+ {
+ type = Snowball.class;
+ }
+ else if(args[0].equalsIgnoreCase("expbottle"))
+ {
+ type = ThrownExpBottle.class;
+ }
+ else if(args[0].equalsIgnoreCase("large"))
+ {
+ type = LargeFireball.class;
+ }
}
- final Vector direction = user.getEyeLocation().getDirection().multiply(2);
- Fireball fireball = user.getWorld().spawn(user.getEyeLocation().add(direction.getX(), direction.getY(), direction.getZ()), small ? SmallFireball.class : Fireball.class);
- fireball.setShooter(user.getBase());
+ final Vector direction = user.getEyeLocation().getDirection().multiply(speed);
+ projectile = (Projectile)user.getWorld().spawn(user.getEyeLocation().add(direction.getX(), direction.getY(), direction.getZ()), type);
+ projectile.setShooter(user.getBase());
+ projectile.setVelocity(direction);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java
index 86347d3e9..a299770b1 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java
@@ -28,15 +28,34 @@ public class Commandfly extends EssentialsCommand
@Override
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- if (args.length > 0 && args[0].trim().length() > 2 && user.isAuthorized("essentials.fly.others"))
+ if (args.length == 1)
+ {
+ if (args[0].equalsIgnoreCase("on") || args[0].startsWith("ena") || args[0].equalsIgnoreCase("1"))
+ {
+ user.setAllowFlight(true);
+ }
+ else if (args[0].equalsIgnoreCase("off") || args[0].startsWith("dis") || args[0].equalsIgnoreCase("0"))
+ {
+ user.setAllowFlight(false);
+ }
+ else if (user.isAuthorized("essentials.fly.others"))
+ {
+ flyOtherPlayers(server, user, args);
+ return;
+ }
+ }
+ else if (args.length == 2 && user.isAuthorized("essentials.fly.others"))
{
flyOtherPlayers(server, user, args);
return;
}
- user.setAllowFlight(!user.getAllowFlight());
- if (!user.getAllowFlight())
+ else
{
- user.setFlying(false);
+ user.setAllowFlight(!user.getAllowFlight());
+ if (!user.getAllowFlight())
+ {
+ user.setFlying(false);
+ }
}
user.sendMessage(_("flyMode", _(user.getAllowFlight() ? "enabled" : "disabled"), user.getDisplayName()));
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java
index 85aeaa673..5b9b854cb 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java
@@ -19,12 +19,22 @@ public class Commandgamemode extends EssentialsCommand
@Override
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- if (args.length < 2)
+ GameMode gameMode;
+ if (args.length == 0)
{
throw new NotEnoughArgumentsException();
}
- GameMode gameMode = matchGameMode(args[0].toLowerCase(Locale.ENGLISH));
- gamemodeOtherPlayers(server, sender, gameMode, args[1]);
+ else if (args.length == 1)
+ {
+ gameMode = matchGameMode(commandLabel);
+ gamemodeOtherPlayers(server, sender, gameMode, args[0]);
+ }
+ else if (args.length == 2)
+ {
+ gameMode = matchGameMode(args[0].toLowerCase(Locale.ENGLISH));
+ gamemodeOtherPlayers(server, sender, gameMode, args[1]);
+ }
+
}
@Override
@@ -43,16 +53,23 @@ public class Commandgamemode extends EssentialsCommand
}
else
{
- try {
+ try
+ {
gameMode = matchGameMode(args[0].toLowerCase(Locale.ENGLISH));
}
- catch (NotEnoughArgumentsException e) {
- gameMode = matchGameMode(commandLabel);
- gamemodeOtherPlayers(server, user, gameMode, args[0]);
- return;
+ catch (NotEnoughArgumentsException e)
+ {
+ if (user.isAuthorized("essentials.gamemode.others"))
+ {
+ gameMode = matchGameMode(commandLabel);
+ gamemodeOtherPlayers(server, user, gameMode, args[0]);
+ return;
+ }
+ throw new NotEnoughArgumentsException();
}
}
- if (gameMode == null) {
+ if (gameMode == null)
+ {
gameMode = user.getGameMode() == GameMode.SURVIVAL ? GameMode.CREATIVE : user.getGameMode() == GameMode.CREATIVE ? GameMode.ADVENTURE : GameMode.SURVIVAL;
}
user.setGameMode(gameMode);
@@ -104,11 +121,12 @@ public class Commandgamemode extends EssentialsCommand
mode = GameMode.ADVENTURE;
}
else if (modeString.equalsIgnoreCase("gmt") || modeString.equalsIgnoreCase("egmt")
- || modeString.contains("toggle") || modeString.contains("cycle") || modeString.equalsIgnoreCase("t"))
+ || modeString.contains("toggle") || modeString.contains("cycle") || modeString.equalsIgnoreCase("t"))
{
mode = null;
}
- else {
+ else
+ {
throw new NotEnoughArgumentsException();
}
return mode;
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
index c5c1a0b6b..94b4b6d6b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
@@ -8,7 +8,6 @@ import java.util.Locale;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@@ -44,44 +43,42 @@ public class Commandgive extends EssentialsCommand
final User giveTo = getPlayer(server, args, 0);
- if (args.length > 3 && Util.isInt(args[2]) && Util.isInt(args[3]))
+ try
{
- stack.setAmount(Integer.parseInt(args[2]));
- stack.setDurability(Short.parseShort(args[3]));
- }
- else if (args.length > 2 && Integer.parseInt(args[2]) > 0)
- {
- stack.setAmount(Integer.parseInt(args[2]));
- }
- else if (ess.getSettings().getDefaultStackSize() > 0)
- {
- stack.setAmount(ess.getSettings().getDefaultStackSize());
+ if (args.length > 3 && Util.isInt(args[2]) && Util.isInt(args[3]))
+ {
+ stack.setAmount(Integer.parseInt(args[2]));
+ stack.setDurability(Short.parseShort(args[3]));
+ }
+ else if (args.length > 2 && Integer.parseInt(args[2]) > 0)
+ {
+ stack.setAmount(Integer.parseInt(args[2]));
+ }
+ else if (ess.getSettings().getDefaultStackSize() > 0)
+ {
+ stack.setAmount(ess.getSettings().getDefaultStackSize());
+ }
+ else if (ess.getSettings().getOversizedStackSize() > 0 && giveTo.isAuthorized("essentials.oversizedstacks"))
+ {
+ stack.setAmount(ess.getSettings().getOversizedStackSize());
+ }
}
- else if (ess.getSettings().getOversizedStackSize() > 0 && giveTo.isAuthorized("essentials.oversizedstacks"))
+ catch (NumberFormatException e)
{
- stack.setAmount(ess.getSettings().getOversizedStackSize());
+ throw new NotEnoughArgumentsException();
}
if (args.length > 3)
{
+ boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments();
+ if (allowUnsafe && sender instanceof Player && !ess.getUser(sender).isAuthorized("essentials.enchant.allowunsafe"))
+ {
+ allowUnsafe = false;
+ }
+
for (int i = Util.isInt(args[3]) ? 4 : 3; i < args.length; i++)
{
- final String[] split = args[i].split("[:+',;.]", 2);
- if (split.length < 1)
- {
- continue;
- }
- final Enchantment enchantment = Commandenchant.getEnchantment(split[0], sender instanceof Player ? ess.getUser(sender) : null);
- int level;
- if (split.length > 1)
- {
- level = Integer.parseInt(split[1]);
- }
- else
- {
- level = enchantment.getMaxLevel();
- }
- stack.addEnchantment(enchantment, level);
+ ess.getItemDb().addStringEnchantment(null, allowUnsafe, stack, args[i]);
}
}
@@ -94,11 +91,11 @@ public class Commandgive extends EssentialsCommand
sender.sendMessage(_("giveSpawn", stack.getAmount(), itemName, giveTo.getDisplayName()));
if (giveTo.isAuthorized("essentials.oversizedstacks"))
{
- InventoryWorkaround.addItem(giveTo.getInventory(), true, ess.getSettings().getOversizedStackSize(), stack);
+ InventoryWorkaround.addOversizedItems(giveTo.getInventory(), ess.getSettings().getOversizedStackSize(), stack);
}
else
{
- InventoryWorkaround.addItem(giveTo.getInventory(), true, stack);
+ InventoryWorkaround.addItems(giveTo.getInventory(), stack);
}
giveTo.updateInventory();
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhat.java b/Essentials/src/com/earth2me/essentials/commands/Commandhat.java
index 5dd0fbb74..7ab9a446c 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandhat.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandhat.java
@@ -31,7 +31,7 @@ public class Commandhat extends EssentialsCommand
{
final ItemStack air = new ItemStack(Material.AIR);
inv.setHelmet(air);
- InventoryWorkaround.addItem(user.getInventory(), true, head);
+ InventoryWorkaround.addItems(user.getInventory(), head);
user.sendMessage(_("hatRemoved"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
index 546bfc85d..a5d355415 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
@@ -23,7 +23,6 @@ public class Commandhome extends EssentialsCommand
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
final Trade charge = new Trade(this.getName(), ess);
- charge.isAffordableFor(user);
User player = user;
String homeName = "";
String[] nameParts;
@@ -45,7 +44,7 @@ public class Commandhome extends EssentialsCommand
}
try
{
- if ("bed".equalsIgnoreCase(homeName))
+ if ("bed".equalsIgnoreCase(homeName) && user.isAuthorized("essentials.home.bed"))
{
final Location bed = player.getBedSpawnLocation();
if (bed != null && bed.getBlock().getType() == Material.BED_BLOCK)
@@ -66,17 +65,11 @@ public class Commandhome extends EssentialsCommand
final List<String> homes = player.getHomes();
if (homes.isEmpty() && player.equals(user))
{
- if (bed != null)
- {
- user.getTeleport().teleport(bed, charge, TeleportCause.COMMAND);
- throw new NoChargeException();
- }
user.getTeleport().respawn(charge, TeleportCause.COMMAND);
-
}
else if (homes.isEmpty())
{
- throw new Exception(player == user ? _("noHomeSet") : _("noHomeSetPlayer"));
+ throw new Exception(_("noHomeSetPlayer"));
}
else if (homes.size() == 1 && player.equals(user))
{
@@ -84,7 +77,7 @@ public class Commandhome extends EssentialsCommand
}
else
{
- if (bed != null)
+ if (bed != null && user.isAuthorized("essentials.home.bed"))
{
homes.add("bed");
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java b/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java
index 3964dbe67..1f9083351 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.User;
import org.bukkit.Server;
+import org.bukkit.inventory.Inventory;
public class Commandinvsee extends EssentialsCommand
@@ -10,6 +11,8 @@ public class Commandinvsee extends EssentialsCommand
{
super("invsee");
}
+
+ //This method has a hidden param, which if given will display the equip slots. #easteregg
@Override
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
@@ -18,8 +21,20 @@ public class Commandinvsee extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
+
final User invUser = getPlayer(server, args, 0);
+ Inventory inv;
+
+ if (args.length > 1 && user.isAuthorized("essentials.invsee.equip"))
+ {
+ inv = server.createInventory(invUser, 9, "Equipped");
+ inv.setContents(invUser.getInventory().getArmorContents());
+ }
+ else
+ {
+ inv = invUser.getInventory();
+ }
+ user.openInventory(inv);
user.setInvSee(true);
- user.openInventory(invUser.getInventory());
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java
index 1a77d772d..a071d8068 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java
@@ -6,7 +6,6 @@ import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
import java.util.Locale;
import org.bukkit.Material;
import org.bukkit.Server;
-import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
@@ -50,33 +49,21 @@ public class Commanditem extends EssentialsCommand
{
stack.setAmount(ess.getSettings().getOversizedStackSize());
}
- if (args.length > 2)
- {
- for (int i = 2; i < args.length; i++)
- {
- final String[] split = args[i].split("[:+',;.]", 2);
- if (split.length < 1)
- {
- continue;
- }
- final Enchantment enchantment = Commandenchant.getEnchantment(split[0], user);
- int level;
- if (split.length > 1)
- {
- level = Integer.parseInt(split[1]);
- }
- else
- {
- level = enchantment.getMaxLevel();
- }
- stack.addEnchantment(enchantment, level);
- }
- }
}
catch (NumberFormatException e)
{
throw new NotEnoughArgumentsException();
}
+ if (args.length > 2)
+ {
+ final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments() && user.isAuthorized("essentials.enchant.allowunsafe");
+
+ for (int i = 2; i < args.length; i++)
+ {
+ ess.getItemDb().addStringEnchantment(null, allowUnsafe, stack, args[i]);
+ }
+ }
+
if (stack.getType() == Material.AIR)
{
@@ -87,11 +74,11 @@ public class Commanditem extends EssentialsCommand
user.sendMessage(_("itemSpawn", stack.getAmount(), displayName));
if (user.isAuthorized("essentials.oversizedstacks"))
{
- InventoryWorkaround.addItem(user.getInventory(), true, ess.getSettings().getOversizedStackSize(), stack);
+ InventoryWorkaround.addOversizedItems(user.getInventory(), ess.getSettings().getOversizedStackSize(), stack);
}
else
{
- InventoryWorkaround.addItem(user.getInventory(), true, stack);
+ InventoryWorkaround.addItems(user.getInventory(), stack);
}
user.updateInventory();
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandjump.java b/Essentials/src/com/earth2me/essentials/commands/Commandjump.java
index ba7182628..073c20dce 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandjump.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandjump.java
@@ -8,7 +8,7 @@ import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
-
+// This method contains an undocumented sub command #EasterEgg
public class Commandjump extends EssentialsCommand
{
public Commandjump()
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java
index 287a3cc62..d977055e2 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java
@@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.Console;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
import java.util.logging.Level;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -24,23 +25,34 @@ public class Commandkick extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- final User user = getPlayer(server, args, 0);
- if (sender instanceof Player && user.isAuthorized("essentials.kick.exempt"))
+ final User target = getPlayer(server, args, 0, true);
+ if (sender instanceof Player)
{
- throw new Exception(_("kickExempt"));
+ User user = ess.getUser(sender);
+ if (target.isHidden() && !user.isAuthorized("essentials.list.hidden"))
+ {
+ throw new PlayerNotFoundException();
+ }
+ if (target.isAuthorized("essentials.kick.exempt"))
+ {
+ throw new Exception(_("kickExempt"));
+ }
}
- final String kickReason = args.length > 1 ? getFinalArg(args, 1) : _("kickDefault");
- user.kickPlayer(kickReason);
+
+ String kickReason = args.length > 1 ? getFinalArg(args, 1) : _("kickDefault");
+ kickReason = Util.replaceFormat(kickReason.replace("\\n", "\n"));
+
+ target.kickPlayer(kickReason);
final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
-
- server.getLogger().log(Level.INFO, _("playerKicked", senderName, user.getName(), kickReason));
+
+ server.getLogger().log(Level.INFO, _("playerKicked", senderName, target.getName(), kickReason));
for (Player onlinePlayer : server.getOnlinePlayers())
{
User player = ess.getUser(onlinePlayer);
if (player.isAuthorized("essentials.kick.notify"))
{
- onlinePlayer.sendMessage(_("playerKicked", senderName, user.getName(), kickReason));
+ onlinePlayer.sendMessage(_("playerKicked", senderName, target.getName(), kickReason));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java
index 4722b7d68..4fc0b20be 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java
@@ -1,6 +1,7 @@
package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -16,6 +17,9 @@ public class Commandkickall extends EssentialsCommand
@Override
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
+ String kickReason = args.length > 0 ? getFinalArg(args, 0) : _("kickDefault");
+ kickReason = Util.replaceFormat(kickReason.replace("\\n", "\n"));
+
for (Player onlinePlayer : server.getOnlinePlayers())
{
if (sender instanceof Player && onlinePlayer.getName().equalsIgnoreCase(((Player)sender).getName()))
@@ -24,7 +28,7 @@ public class Commandkickall extends EssentialsCommand
}
else
{
- onlinePlayer.kickPlayer(args.length > 0 ? getFinalArg(args, 0) : _("kickDefault"));
+ onlinePlayer.kickPlayer(kickReason);
}
}
sender.sendMessage(_("kickedAll"));
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkill.java b/Essentials/src/com/earth2me/essentials/commands/Commandkill.java
index a2e58227b..a83b0d490 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkill.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkill.java
@@ -21,7 +21,7 @@ public class Commandkill extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
-
+
//TODO: TL this
if (args[0].trim().length() < 2)
{
@@ -32,12 +32,18 @@ public class Commandkill extends EssentialsCommand
{
final EntityDamageEvent ede = new EntityDamageEvent(matchPlayer, sender instanceof Player && ((Player)sender).getName().equals(matchPlayer.getName()) ? EntityDamageEvent.DamageCause.SUICIDE : EntityDamageEvent.DamageCause.CUSTOM, Short.MAX_VALUE);
server.getPluginManager().callEvent(ede);
- if (ede.isCancelled() && !sender.hasPermission("essentials.kill.force"))
+ if (ede.isCancelled() && sender instanceof Player && !ess.getUser(sender).isAuthorized("essentials.kill.force"))
{
continue;
}
matchPlayer.damage(Short.MAX_VALUE);
+
+ if (matchPlayer.getHealth() > 0)
+ {
+ matchPlayer.setHealth(0);
+ }
+
sender.sendMessage(_("kill", matchPlayer.getDisplayName()));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java
index 380369f35..191a1268a 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Mob;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.Locale;
import org.bukkit.Chunk;
@@ -10,6 +11,7 @@ import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.*;
import org.bukkit.event.entity.EntityDeathEvent;
+import org.bukkit.inventory.ItemStack;
public class Commandkillall extends EssentialsCommand
@@ -109,7 +111,7 @@ public class Commandkillall extends EssentialsCommand
continue;
}
}
- if(entity instanceof Ocelot)
+ if (entity instanceof Ocelot)
{
if (((Ocelot)entity).isTamed())
{
@@ -120,7 +122,7 @@ public class Commandkillall extends EssentialsCommand
{
if (entity instanceof Animals || entity instanceof NPC || entity instanceof Snowman || entity instanceof WaterMob)
{
- EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST);
+ EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, new ArrayList<ItemStack>(0));
ess.getServer().getPluginManager().callEvent(event);
entity.remove();
numKills++;
@@ -130,7 +132,7 @@ public class Commandkillall extends EssentialsCommand
{
if (entity instanceof Monster || entity instanceof ComplexLivingEntity || entity instanceof Flying || entity instanceof Slime)
{
- EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST);
+ EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, new ArrayList<ItemStack>(0));
ess.getServer().getPluginManager().callEvent(event);
entity.remove();
numKills++;
@@ -138,14 +140,14 @@ public class Commandkillall extends EssentialsCommand
}
else if (all)
{
- EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST);
+ EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, new ArrayList<ItemStack>(0));
ess.getServer().getPluginManager().callEvent(event);
entity.remove();
numKills++;
}
else if (entityClass != null && entityClass.isAssignableFrom(entity.getClass()))
{
- EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST);
+ EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, new ArrayList<ItemStack>(0));
ess.getServer().getPluginManager().callEvent(event);
entity.remove();
numKills++;
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java b/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java
index 9db608235..a94f09cdb 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java
@@ -7,7 +7,7 @@ import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.entity.Ocelot;
-
+// This command is not documented on the wiki #EasterEgg
public class Commandkittycannon extends EssentialsCommand
{
private static Random random = new Random();
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java
index 60306c272..76c52c8e2 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java
@@ -6,11 +6,13 @@ import com.earth2me.essentials.Util;
import java.util.List;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import org.bukkit.entity.Player;
public class Commandmail extends EssentialsCommand
{
+ private static int mailsPerMinute = 0;
+ private static long timestamp = 0;
+
public Commandmail()
{
super("mail");
@@ -42,24 +44,29 @@ public class Commandmail extends EssentialsCommand
throw new Exception(_("noPerm", "essentials.mail.send"));
}
- Player player = server.getPlayer(args[1]);
- User u;
- if (player != null)
- {
- u = ess.getUser(player);
- }
- else
- {
- u = ess.getOfflineUser(args[1]);
- }
+ User u = ess.getUser(args[1]);
if (u == null)
{
throw new Exception(_("playerNeverOnServer", args[1]));
}
if (!u.isIgnoredPlayer(user))
{
- final String mail = Util.sanitizeString(Util.stripFormat(getFinalArg(args, 2)));
- u.addMail(user.getName() + ": " + mail);
+ final String mail = user.getName() + ": " + Util.sanitizeString(Util.stripFormat(getFinalArg(args, 2)));
+ if (mail.length() > 1000)
+ {
+ throw new Exception("Mail message too long. Try to keep it below 1000");
+ }
+ if (Math.abs(System.currentTimeMillis() - timestamp) > 60000)
+ {
+ timestamp = System.currentTimeMillis();
+ mailsPerMinute = 0;
+ }
+ mailsPerMinute++;
+ if (mailsPerMinute > ess.getSettings().getMailsPerMinute())
+ {
+ throw new Exception("Too many mails have been send within the last minute. Maximum: " + ess.getSettings().getMailsPerMinute());
+ }
+ u.addMail(mail);
}
user.sendMessage(_("mailSent"));
return;
@@ -96,16 +103,7 @@ public class Commandmail extends EssentialsCommand
}
else if (args.length >= 3 && "send".equalsIgnoreCase(args[0]))
{
- Player player = server.getPlayer(args[1]);
- User u;
- if (player != null)
- {
- u = ess.getUser(player);
- }
- else
- {
- u = ess.getOfflineUser(args[1]);
- }
+ User u = ess.getUser(args[1]);
if (u == null)
{
throw new Exception(_("playerNeverOnServer", args[1]));
@@ -117,20 +115,13 @@ public class Commandmail extends EssentialsCommand
else if (args.length >= 1 && "sendall".equalsIgnoreCase(args[0]))
{
ess.scheduleAsyncDelayedTask(new SendAll("Server: " + getFinalArg(args, 2)));
+ sender.sendMessage(_("mailSent"));
+ return;
}
else if (args.length >= 2)
{
//allow sending from console without "send" argument, since it's the only thing the console can do
- Player player = server.getPlayer(args[0]);
- User u;
- if (player != null)
- {
- u = ess.getUser(player);
- }
- else
- {
- u = ess.getOfflineUser(args[0]);
- }
+ User u = ess.getUser(args[0]);
if (u == null)
{
throw new Exception(_("playerNeverOnServer", args[0]));
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmore.java b/Essentials/src/com/earth2me/essentials/commands/Commandmore.java
index 3fce3110c..e50e21e45 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandmore.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandmore.java
@@ -25,7 +25,7 @@ public class Commandmore extends EssentialsCommand
if (stack.getAmount() >= ((user.isAuthorized("essentials.oversizedstacks"))
? ess.getSettings().getOversizedStackSize() : stack.getMaxStackSize()))
{
- throw new NoChargeException();
+ throw new Exception(_("fullStack"));
}
final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
if (ess.getSettings().permissionBasedItemSpawn()
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandping.java b/Essentials/src/com/earth2me/essentials/commands/Commandping.java
index 43aa18d5f..0b1df5bf5 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandping.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandping.java
@@ -5,7 +5,7 @@ import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-
+// This command can be used to echo messages to the users screen, mostly useless but also an #EasterEgg
public class Commandping extends EssentialsCommand
{
public Commandping()
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java b/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java
new file mode 100755
index 000000000..57294e53c
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java
@@ -0,0 +1,197 @@
+package com.earth2me.essentials.commands;
+
+import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+import org.bukkit.Material;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+import org.bukkit.inventory.FurnaceRecipe;
+import org.bukkit.inventory.InventoryView;
+import org.bukkit.inventory.ItemStack;
+import org.bukkit.inventory.Recipe;
+import org.bukkit.inventory.ShapedRecipe;
+import org.bukkit.inventory.ShapelessRecipe;
+
+
+public class Commandrecipe extends EssentialsCommand
+{
+ public Commandrecipe()
+ {
+ super("recipe");
+ }
+
+ @Override
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
+ if (args.length < 1)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+
+ final ItemStack itemType = ess.getItemDb().get(args[0]);
+ int recipeNo = 0;
+
+ if (args.length > 1)
+ {
+ if (Util.isInt(args[1]))
+ {
+ recipeNo = Integer.parseInt(args[1]) - 1;
+ }
+ else
+ {
+ throw new Exception(_("invalidNumber"));
+ }
+ }
+
+ final List<Recipe> recipesOfType = ess.getServer().getRecipesFor(itemType);
+ if (recipesOfType.size() < 1)
+ {
+ throw new Exception(_("recipeNone", getMaterialName(itemType)));
+ }
+
+ if (recipeNo < 0 || recipeNo >= recipesOfType.size())
+ {
+ throw new Exception(_("recipeBadIndex"));
+ }
+
+ final Recipe selectedRecipe = recipesOfType.get(recipeNo);
+ sender.sendMessage(_("recipe", getMaterialName(itemType), recipeNo + 1, recipesOfType.size()));
+
+ if (selectedRecipe instanceof FurnaceRecipe)
+ {
+ furnaceRecipe(sender, (FurnaceRecipe)selectedRecipe);
+ }
+ else if (selectedRecipe instanceof ShapedRecipe)
+ {
+ shapedRecipe(sender, (ShapedRecipe)selectedRecipe);
+ }
+ else if (selectedRecipe instanceof ShapelessRecipe)
+ {
+ shapelessRecipe(sender, (ShapelessRecipe)selectedRecipe);
+ }
+
+ if (recipesOfType.size() > 1 && args.length == 1)
+ {
+ sender.sendMessage(_("recipeMore", commandLabel, args[0], getMaterialName(itemType)));
+ }
+ }
+
+ public void furnaceRecipe(final CommandSender sender, final FurnaceRecipe recipe)
+ {
+ sender.sendMessage(_("recipeFurnace", getMaterialName(recipe.getInput())));
+ }
+
+ public void shapedRecipe(final CommandSender sender, final ShapedRecipe recipe)
+ {
+ final Map<Character, ItemStack> recipeMap = recipe.getIngredientMap();
+
+ if (sender instanceof Player)
+ {
+ final User user = ess.getUser(sender);
+ user.setRecipeSee(true);
+ final InventoryView view = user.openWorkbench(null, true);
+ final String[] recipeShape = recipe.getShape();
+ final Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
+ for (int j = 0; j < recipeShape.length; j++)
+ {
+ for (int k = 0; k < recipeShape[j].length(); k++)
+ {
+ final ItemStack item = ingredientMap.get(recipeShape[j].toCharArray()[k]);
+ if(item == null)
+ {
+ continue;
+ }
+ item.setAmount(0);
+ view.getTopInventory().setItem(j * 3 + k + 1, item);
+ }
+ }
+ }
+ else
+ {
+ final HashMap<Material, String> colorMap = new HashMap<Material, String>();
+ int i = 1;
+ for (Character c : "abcdefghi".toCharArray())
+ {
+ ItemStack item = recipeMap.get(c);
+ if (!colorMap.containsKey(item == null ? null : item.getType()))
+ {
+ colorMap.put(item == null ? null : item.getType(), String.valueOf(i++));
+ }
+ }
+ final Material[][] materials = new Material[3][3];
+ for (int j = 0; j < recipe.getShape().length; j++)
+ {
+ for (int k = 0; k < recipe.getShape()[j].length(); k++)
+ {
+ ItemStack item = recipe.getIngredientMap().get(recipe.getShape()[j].toCharArray()[k]);
+ materials[j][k] = item == null ? null : item.getType();
+ }
+ }
+ sender.sendMessage(_("recipeGrid", colorMap.get(materials[0][0]), colorMap.get(materials[0][1]), colorMap.get(materials[0][2])));
+ sender.sendMessage(_("recipeGrid", colorMap.get(materials[1][0]), colorMap.get(materials[1][1]), colorMap.get(materials[1][2])));
+ sender.sendMessage(_("recipeGrid", colorMap.get(materials[2][0]), colorMap.get(materials[2][1]), colorMap.get(materials[2][2])));
+
+ StringBuilder s = new StringBuilder();
+ for (Material items : colorMap.keySet().toArray(new Material[colorMap.size()]))
+ {
+ s.append(_("recipeGridItem", colorMap.get(items), getMaterialName(items)));
+ }
+ sender.sendMessage(_("recipeWhere", s.toString()));
+ }
+ }
+
+ public void shapelessRecipe(final CommandSender sender, final ShapelessRecipe recipe)
+ {
+ final List<ItemStack> ingredients = recipe.getIngredientList();
+ if (sender instanceof Player)
+ {
+ final User user = ess.getUser(sender);
+ user.setRecipeSee(true);
+ final InventoryView view = user.openWorkbench(null, true);
+ for (int i = 0; i < ingredients.size(); i++)
+ {
+ view.setItem(i + 1, ingredients.get(i));
+ }
+
+ }
+ else
+ {
+ StringBuilder s = new StringBuilder();
+ for (int i = 0; i < ingredients.size(); i++)
+ {
+ s.append(getMaterialName(ingredients.get(i)));
+ if (i != ingredients.size() - 1)
+ {
+ s.append(",");
+ }
+ s.append(" ");
+ }
+ sender.sendMessage(_("recipeShapeless", s.toString()));
+ }
+ }
+
+ public String getMaterialName(final ItemStack stack)
+ {
+ if (stack == null)
+ {
+ return _("recipeNothing");
+ }
+ return getMaterialName(stack.getType());
+ }
+
+ public String getMaterialName(final Material type)
+ {
+ if (type == null)
+ {
+ return _("recipeNothing");
+ }
+ return type.toString().replace("_", " ").toLowerCase(Locale.ENGLISH);
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java
index 24f1f9c41..b415108e2 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java
@@ -35,12 +35,28 @@ public class Commandseen extends EssentialsCommand
}
try
{
- User player = getPlayer(server, args, 0);
- player.setDisplayNick();
- sender.sendMessage(_("seenOnline", player.getDisplayName(), Util.formatDateDiff(player.getLastLogin())));
+ User user = getPlayer(server, args, 0);
+ user.setDisplayNick();
+ sender.sendMessage(_("seenOnline", user.getDisplayName(), Util.formatDateDiff(user.getLastLogin())));
+ if (user.isAfk())
+ {
+ sender.sendMessage(_("whoisAFK", _("true")));
+ }
+ if (user.isJailed())
+ {
+ sender.sendMessage(_("whoisJail", (user.getJailTimeout() > 0
+ ? Util.formatDateDiff(user.getJailTimeout())
+ : _("true"))));
+ }
+ if (user.isMuted())
+ {
+ sender.sendMessage(_("whoisMuted", (user.getMuteTimeout() > 0
+ ? Util.formatDateDiff(user.getMuteTimeout())
+ : _("true"))));
+ }
if (extra)
{
- sender.sendMessage(_("whoisIPAddress", player.getAddress().getAddress().toString()));
+ sender.sendMessage(_("whoisIPAddress", user.getAddress().getAddress().toString()));
}
}
catch (NoSuchFieldException e)
@@ -60,7 +76,8 @@ public class Commandseen extends EssentialsCommand
{
sender.sendMessage(_("whoisIPAddress", player.getLastLoginAddress()));
final Location loc = player.getLastLocation();
- if (loc != null) {
+ if (loc != null)
+ {
sender.sendMessage(_("whoisLocation", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
index 566d1b42e..ec3262958 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
@@ -22,6 +22,8 @@ public class Commandsell extends EssentialsCommand
@Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
+ double totalWorth = 0.0;
+ String type = "";
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
@@ -41,12 +43,16 @@ public class Commandsell extends EssentialsCommand
}
try
{
- sellItem(user, stack, args, true);
+ totalWorth += sellItem(user, stack, args, true);
}
catch (Exception e)
{
}
}
+ if (totalWorth > 0)
+ {
+ user.sendMessage(_("totalWorthAll", type, Util.displayCurrency(totalWorth, ess)));
+ }
return;
}
else if (args[0].equalsIgnoreCase("blocks"))
@@ -59,12 +65,16 @@ public class Commandsell extends EssentialsCommand
}
try
{
- sellItem(user, stack, args, true);
+ totalWorth += sellItem(user, stack, args, true);
}
catch (Exception e)
{
}
}
+ if (totalWorth > 0)
+ {
+ user.sendMessage(_("totalWorthBlocks", type, Util.displayCurrency(totalWorth, ess)));
+ }
return;
}
if (is == null)
@@ -74,7 +84,7 @@ public class Commandsell extends EssentialsCommand
sellItem(user, is, args, false);
}
- private void sellItem(User user, ItemStack is, String[] args, boolean isBulkSell) throws Exception
+ private double sellItem(User user, ItemStack is, String[] args, boolean isBulkSell) throws Exception
{
if (is == null || is.getType() == Material.AIR)
{
@@ -149,19 +159,19 @@ public class Commandsell extends EssentialsCommand
}
else
{
- return;
+ return worth * amount;
}
}
//TODO: Prices for Enchantments
final ItemStack ris = is.clone();
ris.setAmount(amount);
- InventoryWorkaround.removeItem(user.getInventory(), true, true, ris);
+ user.getInventory().removeItem(ris);
user.updateInventory();
Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(worth * amount, ess), user.getLocation(), ess);
user.giveMoney(worth * amount);
user.sendMessage(_("itemSold", Util.displayCurrency(worth * amount, ess), amount, is.getType().toString().toLowerCase(Locale.ENGLISH), Util.displayCurrency(worth, ess)));
logger.log(Level.INFO, _("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(Locale.ENGLISH), Util.displayCurrency(worth * amount, ess), amount, Util.displayCurrency(worth, ess)));
-
+ return worth * amount;
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
index c97761f8d..1e27e7e3b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
@@ -4,7 +4,6 @@ import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.Locale;
-import java.util.regex.Pattern;
import org.bukkit.Location;
import org.bukkit.Server;
@@ -40,14 +39,10 @@ public class Commandsethome extends EssentialsCommand
{
if (user.isAuthorized("essentials.sethome.others"))
{
- usersHome = ess.getUser(ess.getServer().getPlayer(args[0]));
+ usersHome = ess.getUser(args[0]);
if (usersHome == null)
{
- usersHome = ess.getOfflineUser(args[0]);
- }
- if (usersHome == null)
- {
- throw new Exception(_("playerNotFound"));
+ throw new NoSuchFieldException(_("playerNotFound"));
}
name = args[1].toLowerCase(Locale.ENGLISH);
}
@@ -59,8 +54,7 @@ public class Commandsethome extends EssentialsCommand
}
if ("bed".equals(name) || Util.isInt(name))
{
- user.sendMessage(_("invalidHomeName"));
- throw new NoChargeException();
+ throw new NoSuchFieldException(_("invalidHomeName"));
}
usersHome.setHome(name, location);
user.sendMessage(_("homeSet", user.getLocation().getWorld().getName(), user.getLocation().getBlockX(), user.getLocation().getBlockY(), user.getLocation().getBlockZ()));
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
index 42da62b85..2469f6ec1 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
@@ -22,9 +22,10 @@ public class Commandsetwarp extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
-
- if (args[0].matches("[0-9]+")) {
- throw new NotEnoughArgumentsException();
+
+ if (Util.isInt(args[0]))
+ {
+ throw new NoSuchFieldException(_("invalidWarpName"));
}
final Location loc = user.getLocation();
@@ -39,7 +40,7 @@ public class Commandsetwarp extends EssentialsCommand
{
}
- if (warpLoc == null || user.isAuthorized("essentials.warp.overwrite." + Util.sanitizeFileName(args[0])))
+ if (warpLoc == null || user.isAuthorized("essentials.warp.overwrite." + Util.safeString(args[0])))
{
warps.setWarp(args[0], loc);
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java
index 351b6a8b4..a01f42f01 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java
@@ -34,6 +34,7 @@ public class Commandspawner extends EssentialsCommand
}
String name = args[0];
+ int delay = 0;
Mob mob = null;
mob = Mob.fromName(name);
@@ -49,11 +50,20 @@ public class Commandspawner extends EssentialsCommand
{
throw new Exception(_("noPermToSpawnMob"));
}
+ if (args.length > 1)
+ {
+ if (Util.isInt(args[1]))
+ {
+ delay = Integer.parseInt(args[1]);
+ }
+ }
final Trade charge = new Trade("spawner-" + mob.name.toLowerCase(Locale.ENGLISH), ess);
charge.isAffordableFor(user);
try
{
- ((CreatureSpawner)target.getBlock().getState()).setSpawnedType(mob.getType());
+ CreatureSpawner spawner = (CreatureSpawner)target.getBlock().getState();
+ spawner.setSpawnedType(mob.getType());
+ spawner.setDelay(delay);
}
catch (Throwable ex)
{
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
index 489a4ba91..5c43898a8 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
@@ -2,20 +2,11 @@ package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Mob;
-import com.earth2me.essentials.Mob.MobException;
+import com.earth2me.essentials.SpawnMob;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
-import java.util.HashSet;
-import java.util.Locale;
-import java.util.Random;
-import java.util.Set;
-import org.bukkit.DyeColor;
-import org.bukkit.Location;
import org.bukkit.Server;
-import org.bukkit.block.Block;
-import org.bukkit.entity.Villager.Profession;
-import org.bukkit.entity.*;
-import org.bukkit.material.Colorable;
+import org.bukkit.command.CommandSender;
public class Commandspawnmob extends EssentialsCommand
@@ -30,256 +21,41 @@ public class Commandspawnmob extends EssentialsCommand
{
if (args.length < 1)
{
- final Set<String> mobList = Mob.getMobList();
- final Set<String> availableList = new HashSet<String>();
- for (String mob : mobList)
- {
- if (user.isAuthorized("essentials.spawnmob." + mob.toLowerCase()))
- {
- availableList.add(mob);
- }
- }
- if (availableList.isEmpty())
- {
- availableList.add(_("none"));
- }
- throw new NotEnoughArgumentsException(_("mobsAvailable", Util.joinList(availableList)));
+ final String mobList = SpawnMob.mobList(user);
+ throw new NotEnoughArgumentsException(_("mobsAvailable", mobList));
}
+ String[] mobData = SpawnMob.mobData(args[0]);
- final String[] mountparts = args[0].split(",");
- String[] parts = mountparts[0].split(":");
- String mobType = parts[0];
- String mobData = null;
- if (parts.length == 2)
- {
- mobData = parts[1];
- }
- String mountType = null;
- String mountData = null;
- if (mountparts.length > 1)
- {
- parts = mountparts[1].split(":");
- mountType = parts[0];
- if (parts.length == 2)
- {
- mountData = parts[1];
- }
- }
-
-
- Entity spawnedMob = null;
- Mob mob = null;
- Entity spawnedMount = null;
- Mob mobMount = null;
-
- mob = Mob.fromName(mobType);
- if (mob == null)
- {
- throw new Exception(_("invalidMob"));
- }
-
- if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH)))
- {
- throw new Exception(_("disabledToSpawnMob"));
- }
- if (!user.isAuthorized("essentials.spawnmob." + mob.name.toLowerCase()))
+ int mobCount = 1;
+ if (args.length >= 2)
{
- throw new Exception(_("noPermToSpawnMob"));
+ mobCount = Integer.parseInt(args[1]);
}
- final Block block = Util.getTarget(user).getBlock();
- if (block == null)
- {
- throw new Exception(_("unableToSpawnMob"));
- }
- User otherUser = null;
if (args.length >= 3)
{
- otherUser = getPlayer(ess.getServer(), args, 2);
- }
- final Location loc = (otherUser == null) ? block.getLocation() : otherUser.getLocation();
- final Location sloc = Util.getSafeDestination(loc);
- try
- {
- spawnedMob = mob.spawn(user, server, sloc);
- }
- catch (MobException e)
- {
- throw new Exception(_("unableToSpawnMob"), e);
- }
-
- if (mountType != null)
- {
- mobMount = Mob.fromName(mountType);
- if (mobMount == null)
- {
- user.sendMessage(_("invalidMob"));
- return;
- }
-
- if (ess.getSettings().getProtectPreventSpawn(mobMount.getType().toString().toLowerCase(Locale.ENGLISH)))
- {
- throw new Exception(_("disabledToSpawnMob"));
- }
- if (!user.isAuthorized("essentials.spawnmob." + mobMount.name.toLowerCase()))
- {
- throw new Exception(_("noPermToSpawnMob"));
- }
- try
- {
- spawnedMount = mobMount.spawn(user, server, loc);
- }
- catch (MobException e)
- {
- throw new Exception(_("unableToSpawnMob"), e);
- }
- spawnedMob.setPassenger(spawnedMount);
- }
- if (mobData != null)
- {
- changeMobData(mob.getType(), spawnedMob, mobData, user);
- }
- if (spawnedMount != null && mountData != null)
- {
- changeMobData(mobMount.getType(), spawnedMount, mountData, user);
+ final User target = getPlayer(ess.getServer(), args, 2);
+ SpawnMob.spawnmob(ess, server, user, target, mobData, mobCount);
+ return;
}
- if (args.length >= 2)
- {
- int mobCount = Integer.parseInt(args[1]);
- int serverLimit = ess.getSettings().getSpawnMobLimit();
- if (mobCount > serverLimit)
- {
- mobCount = serverLimit;
- user.sendMessage(_("mobSpawnLimit"));
- }
- try
- {
- for (int i = 1; i < mobCount; i++)
- {
- spawnedMob = mob.spawn(user, server, loc);
- if (mobMount != null)
- {
- try
- {
- spawnedMount = mobMount.spawn(user, server, loc);
- }
- catch (MobException e)
- {
- throw new Exception(_("unableToSpawnMob"), e);
- }
- spawnedMob.setPassenger(spawnedMount);
- }
- if (mobData != null)
- {
- changeMobData(mob.getType(), spawnedMob, mobData, user);
- }
- if (spawnedMount != null && mountData != null)
- {
- changeMobData(mobMount.getType(), spawnedMount, mountData, user);
- }
- }
- user.sendMessage(mobCount + " " + mob.name.toLowerCase(Locale.ENGLISH) + mob.suffix + " " + _("spawned"));
- }
- catch (MobException e1)
- {
- throw new Exception(_("unableToSpawnMob"), e1);
- }
- catch (NumberFormatException e2)
- {
- throw new Exception(_("numberRequired"), e2);
- }
- catch (NullPointerException np)
- {
- throw new Exception(_("soloMob"), np);
- }
- }
- else
- {
- user.sendMessage(mob.name + " " + _("spawned"));
- }
+ SpawnMob.spawnmob(ess, server, user, mobData, mobCount);
}
- private void changeMobData(final EntityType type, final Entity spawned, String data, final User user) throws Exception
+ @Override
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- data = data.toLowerCase(Locale.ENGLISH);
-
- if (spawned instanceof Slime)
- {
- try
- {
- ((Slime)spawned).setSize(Integer.parseInt(data));
- }
- catch (Exception e)
- {
- throw new Exception(_("slimeMalformedSize"), e);
- }
- }
- if (spawned instanceof Ageable && data.contains("baby"))
- {
- ((Ageable)spawned).setBaby();
- return;
- }
- if (spawned instanceof Colorable)
- {
- final String color = data.toUpperCase(Locale.ENGLISH).replace("BABY", "");
- try
- {
- if (color.equals("RANDOM"))
- {
- final Random rand = new Random();
- ((Colorable)spawned).setColor(DyeColor.values()[rand.nextInt(DyeColor.values().length)]);
- }
- else
- {
- ((Colorable)spawned).setColor(DyeColor.valueOf(color));
- }
- }
- catch (Exception e)
- {
- throw new Exception(_("sheepMalformedColor"), e);
- }
- }
- if (spawned instanceof Tameable && data.contains("tamed"))
- {
- final Tameable tameable = ((Tameable)spawned);
- tameable.setTamed(true);
- tameable.setOwner(user.getBase());
- }
- if (type == EntityType.WOLF
- && data.contains("angry"))
- {
- ((Wolf)spawned).setAngry(true);
- }
- if (type == EntityType.CREEPER && data.contains("powered"))
+ if (args.length < 3)
{
- ((Creeper)spawned).setPowered(true);
- }
- if (type == EntityType.OCELOT)
- {
- if (data.contains("siamese"))
- {
- ((Ocelot)spawned).setCatType(Ocelot.Type.SIAMESE_CAT);
- }
- else if (data.contains("red"))
- {
- ((Ocelot)spawned).setCatType(Ocelot.Type.RED_CAT);
- }
- else if (data.contains("black"))
- {
- ((Ocelot)spawned).setCatType(Ocelot.Type.BLACK_CAT);
- }
- }
- if (type == EntityType.VILLAGER)
- {
- for (Profession prof : Villager.Profession.values())
- {
- if (data.contains(prof.toString().toLowerCase(Locale.ENGLISH)))
- {
- ((Villager)spawned).setProfession(prof);
- }
- }
+ final String mobList = Util.joinList(Mob.getMobList());
+ throw new NotEnoughArgumentsException(_("mobsAvailable", mobList));
}
+
+ String[] mobData = SpawnMob.mobData(args[0]);
+ int mobCount = Integer.parseInt(args[1]);
+
+ final User target = getPlayer(ess.getServer(), args, 2);
+ SpawnMob.spawnmob(ess, server, sender, target, mobData, mobCount);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java
index d41cf9a51..b2bd5d14b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java
@@ -27,13 +27,13 @@ public class Commandsudo extends EssentialsCommand
}
final User user = getPlayer(server, args, 0, false);
- if(args[1].equalsIgnoreCase("say"))
+ if(args[1].toLowerCase().startsWith("c:"))
{
- if (user.isAuthorized("essentials.sudo.exempt"))
+ if (user.isAuthorized("essentials.sudo.exempt") && sender instanceof Player)
{
throw new Exception(_("sudoExempt"));
}
- user.chat(getFinalArg(args, 2));
+ user.chat(getFinalArg(args, 1).substring(2));
return;
}
final String command = args[1];
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
index 0549e9c0d..cf706aa8b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
@@ -4,6 +4,7 @@ import com.earth2me.essentials.Console;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import java.util.GregorianCalendar;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -35,7 +36,7 @@ public class Commandtempban extends EssentialsCommand
}
else
{
- if (user.isAuthorized("essentials.tempban.exempt"))
+ if (user.isAuthorized("essentials.tempban.exempt") && sender instanceof Player)
{
sender.sendMessage(_("tempbanExempt"));
return;
@@ -44,6 +45,13 @@ public class Commandtempban extends EssentialsCommand
final String time = getFinalArg(args, 1);
final long banTimestamp = Util.parseDateDiff(time, true);
+ final long maxBanLength = ess.getSettings().getMaxTempban() * 1000;
+ if (maxBanLength > 0 && ((banTimestamp - GregorianCalendar.getInstance().getTimeInMillis()) > maxBanLength) && !(ess.getUser(sender).isAuthorized("essentials.tempban.unlimited")))
+ {
+ sender.sendMessage(_("oversizedTempban"));
+ throw new NoChargeException();
+ }
+
final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
final String banReason = _("tempBanned", Util.formatDateDiff(banTimestamp), senderName);
user.setBanReason(banReason);
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
index 7c6cbe82d..59dbc1a3e 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
@@ -4,6 +4,7 @@ import com.earth2me.essentials.Console;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
+import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
@@ -40,13 +41,34 @@ public class Commandtp extends EssentialsCommand
charge.isAffordableFor(user);
user.getTeleport().teleport(player, charge, TeleportCause.COMMAND);
throw new NoChargeException();
-
- default:
+ case 4:
if (!user.isAuthorized("essentials.tp.others"))
{
throw new Exception(_("noPerm", "essentials.tp.others"));
}
+ final User target2 = getPlayer(server, args, 0);
+ final double x = args[1].startsWith("~") ? target2.getLocation().getX() + Integer.parseInt(args[1].substring(1)) : Integer.parseInt(args[1]);
+ final double y = args[2].startsWith("~") ? target2.getLocation().getY() + Integer.parseInt(args[2].substring(1)) : Integer.parseInt(args[2]);
+ final double z = args[3].startsWith("~") ? target2.getLocation().getZ() + Integer.parseInt(args[3].substring(1)) : Integer.parseInt(args[3]);
+ if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000)
+ {
+ throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //todo: I18n
+ }
+ final Location location = new Location(target2.getWorld(), x, y, z);
+ if (!target2.isTeleportEnabled())
+ {
+ throw new Exception(_("teleportDisabled", target2.getDisplayName()));
+ }
+ target2.getTeleport().now(location, false, TeleportCause.COMMAND);
user.sendMessage(_("teleporting"));
+ target2.sendMessage(_("teleporting"));
+ break;
+ case 2:
+ default:
+ if (!user.isAuthorized("essentials.tp.others"))
+ {
+ throw new Exception(_("noPerm", "essentials.tp.others"));
+ }
final User target = getPlayer(server, args, 0);
final User toPlayer = getPlayer(server, args, 1);
if (!target.isTeleportEnabled())
@@ -63,6 +85,7 @@ public class Commandtp extends EssentialsCommand
throw new Exception(_("noPerm", "essentials.worlds." + toPlayer.getWorld().getName()));
}
target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND);
+ user.sendMessage(_("teleporting"));
target.sendMessage(_("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName()));
break;
}
@@ -76,10 +99,28 @@ public class Commandtp extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- sender.sendMessage(_("teleporting"));
final User target = getPlayer(server, args, 0);
- final User toPlayer = getPlayer(server, args, 1);
- target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND);
- target.sendMessage(_("teleportAtoB", Console.NAME, toPlayer.getDisplayName()));
+ if (args.length == 2)
+ {
+ final User toPlayer = getPlayer(server, args, 1);
+ target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND);
+ target.sendMessage(_("teleportAtoB", Console.NAME, toPlayer.getDisplayName()));
+ }
+ else if (args.length > 3)
+ {
+ final double x = args[1].startsWith("~") ? target.getLocation().getX() + Integer.parseInt(args[1].substring(1)) : Integer.parseInt(args[1]);
+ final double y = args[2].startsWith("~") ? target.getLocation().getY() + Integer.parseInt(args[2].substring(1)) : Integer.parseInt(args[2]);
+ final double z = args[3].startsWith("~") ? target.getLocation().getZ() + Integer.parseInt(args[3].substring(1)) : Integer.parseInt(args[3]);
+ if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000)
+ {
+ throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //todo: I18n
+ }
+ final Location location = new Location(target.getWorld(), x, y, z);
+ target.getTeleport().now(location, false, TeleportCause.COMMAND);
+ target.sendMessage(_("teleporting"));
+ } else {
+ throw new NotEnoughArgumentsException();
+ }
+ sender.sendMessage(_("teleporting"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
index 865492921..7c950ae96 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
@@ -1,5 +1,6 @@
package com.earth2me.essentials.commands;
+import com.earth2me.essentials.ChargeException;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
@@ -52,24 +53,24 @@ public class Commandtpaccept extends EssentialsCommand
}
final Trade charge = new Trade(this.getName(), ess);
- if (user.isTpRequestHere())
- {
- charge.isAffordableFor(user);
- }
- else
- {
- charge.isAffordableFor(target);
- }
user.sendMessage(_("requestAccepted"));
target.sendMessage(_("requestAcceptedFrom", user.getDisplayName()));
- if (user.isTpRequestHere())
+ try
{
- target.getTeleport().teleportToMe(user, charge, TeleportCause.COMMAND);
+ if (user.isTpRequestHere())
+ {
+ target.getTeleport().teleportToMe(user, charge, TeleportCause.COMMAND);
+ }
+ else
+ {
+ target.getTeleport().teleport(user, charge, TeleportCause.COMMAND);
+ }
}
- else
+ catch (ChargeException ex)
{
- target.getTeleport().teleport(user, charge, TeleportCause.COMMAND);
+ user.sendMessage(_("pendingTeleportCancelled"));
+ ess.showError(target, ex, commandLabel);
}
user.requestTeleport(null, false);
throw new NoChargeException();
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java
index b6ea96b26..e130949ad 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java
@@ -33,6 +33,7 @@ public class Commandtpahere extends EssentialsCommand
player.requestTeleport(user, true);
player.sendMessage(_("teleportHereRequest", user.getDisplayName()));
player.sendMessage(_("typeTpaccept"));
+ player.sendMessage(_("typeTpdeny"));
if (ess.getSettings().getTpaAcceptCancellation() != 0)
{
player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation()));
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
index 75910cd85..c9253c99b 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
@@ -24,9 +24,9 @@ public class Commandtppos extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- final int x = Integer.parseInt(args[0]);
- final int y = Integer.parseInt(args[1]);
- final int z = Integer.parseInt(args[2]);
+ final double x = args[0].startsWith("~") ? user.getLocation().getX() + Integer.parseInt(args[0].substring(1)) : Integer.parseInt(args[0]);
+ final double y = args[1].startsWith("~") ? user.getLocation().getY() + Integer.parseInt(args[1].substring(1)) : Integer.parseInt(args[1]);
+ final double z = args[2].startsWith("~") ? user.getLocation().getZ() + Integer.parseInt(args[2].substring(1)) : Integer.parseInt(args[2]);
final Location location = new Location(user.getWorld(), x, y, z);
if (args.length > 3)
{
@@ -36,6 +36,10 @@ public class Commandtppos extends EssentialsCommand
{
location.setPitch(Float.parseFloat(args[4]));
}
+ if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000)
+ {
+ throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //todo: I18n
+ }
final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
user.sendMessage(_("teleporting"));
@@ -52,9 +56,9 @@ public class Commandtppos extends EssentialsCommand
}
User user = ess.getUser(server.getPlayer(args[0]));
- final int x = Integer.parseInt(args[1]);
- final int y = Integer.parseInt(args[2]);
- final int z = Integer.parseInt(args[3]);
+ final double x = args[1].startsWith("~") ? user.getLocation().getX() + Integer.parseInt(args[1].substring(1)) : Integer.parseInt(args[1]);
+ final double y = args[2].startsWith("~") ? user.getLocation().getY() + Integer.parseInt(args[2].substring(1)) : Integer.parseInt(args[2]);
+ final double z = args[3].startsWith("~") ? user.getLocation().getZ() + Integer.parseInt(args[3].substring(1)) : Integer.parseInt(args[3]);
final Location location = new Location(user.getWorld(), x, y, z);
if (args.length > 4)
{
@@ -64,8 +68,13 @@ public class Commandtppos extends EssentialsCommand
{
location.setPitch(Float.parseFloat(args[5]));
}
+ if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000)
+ {
+ throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //todo: I18n
+ }
sender.sendMessage(_("teleporting"));
user.sendMessage(_("teleporting"));
user.getTeleport().teleport(location, null, TeleportCause.COMMAND);
+
}
} \ No newline at end of file
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java b/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java
index 1fc4c2aa4..769060980 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java
@@ -3,6 +3,8 @@ package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
public class Commandtptoggle extends EssentialsCommand
@@ -13,10 +15,59 @@ public class Commandtptoggle extends EssentialsCommand
}
@Override
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
+ {
+ if (args.length < 1)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+
+ toggleOtherPlayers(server, sender, args);
+ }
+
+ @Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
- user.sendMessage(user.toggleTeleportEnabled()
- ? _("teleportationEnabled")
- : _("teleportationDisabled"));
+ if (args.length > 0 && args[0].trim().length() > 2 && user.isAuthorized("essentials.tptoggle.others"))
+ {
+ toggleOtherPlayers(server, user, args);
+ return;
+ }
+
+ user.sendMessage(user.toggleTeleportEnabled() ? _("teleportationEnabled") : _("teleportationDisabled"));
+ }
+
+ private void toggleOtherPlayers(final Server server, final CommandSender sender, final String[] args)
+ {
+ for (Player matchPlayer : server.matchPlayer(args[0]))
+ {
+ final User player = ess.getUser(matchPlayer);
+ if (player.isHidden())
+ {
+ continue;
+ }
+
+ if (args.length > 1)
+ {
+ if (args[1].contains("on") || args[1].contains("ena") || args[1].equalsIgnoreCase("1"))
+ {
+ player.setTeleportEnabled(true);
+ }
+ else
+ {
+ player.setTeleportEnabled(false);
+ }
+ }
+ else
+ {
+ player.toggleTeleportEnabled();
+ }
+
+ final boolean enabled = player.isTeleportEnabled();
+
+
+ player.sendMessage(enabled ? _("teleportationEnabled") : _("teleportationDisabled"));
+ sender.sendMessage(enabled ? _("teleportationEnabledFor", matchPlayer.getDisplayName()) : _("teleportationDisabledFor", matchPlayer.getDisplayName()));
+ }
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
index dda1475d0..7d50eafa5 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
+import org.bukkit.OfflinePlayer;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -23,12 +24,20 @@ public class Commandunban extends EssentialsCommand
try
{
- final User player = getPlayer(server, args, 0, true);
- player.setBanned(false);
+ final User user = getPlayer(server, args, 0, true);
+ user.setBanned(false);
+ user.setBanTimeout(0);
sender.sendMessage(_("unbannedPlayer"));
}
catch (NoSuchFieldException e)
{
+ final OfflinePlayer player = server.getOfflinePlayer(args[0]);
+ if (player.isBanned()) {
+ player.setBanned(false);
+ sender.sendMessage(_("unbannedPlayer"));
+ return;
+ }
+
throw new Exception(_("playerNotFound"), e);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java b/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
index 38a8725ba..fd0f3be2c 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
@@ -103,7 +103,7 @@ public class Commandunlimited extends EssentialsCommand
{
message = "enableUnlimited";
enableUnlimited = true;
- if (!InventoryWorkaround.containsItem(target.getInventory(), true, true, stack))
+ if (!target.getInventory().containsAtLeast(stack, stack.getAmount()))
{
target.getInventory().addItem(stack);
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java
index 4268ed797..9755d451d 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java
@@ -37,8 +37,9 @@ public class Commandwarp extends EssentialsCommand
}
if (args.length > 0)
{
+ //TODO: Remove 'otherplayers' permission.
User otherUser = null;
- if (args.length == 2 && user.isAuthorized("essentials.warp.otherplayers"))
+ if (args.length == 2 && (user.isAuthorized("essentials.warp.otherplayers") || user.isAuthorized("essentials.warp.others")))
{
otherUser = ess.getUser(server.getPlayer(args[1]));
if (otherUser == null)
diff --git a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
index 6bc0649e9..5287016eb 100644
--- a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
+++ b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
@@ -56,14 +56,14 @@ public abstract class EssentialsCommand implements IEssentialsCommand
}
if (args[pos].isEmpty())
{
- throw new NoSuchFieldException(_("playerNotFound"));
+ throw new PlayerNotFoundException();
}
final User user = ess.getUser(args[pos]);
if (user != null)
{
if (!getOffline && (!user.isOnline() || user.isHidden()))
{
- throw new NoSuchFieldException(_("playerNotFound"));
+ throw new PlayerNotFoundException();
}
return user;
}
@@ -85,7 +85,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand
return userMatch;
}
}
- throw new NoSuchFieldException(_("playerNotFound"));
+ throw new PlayerNotFoundException();
}
@Override
diff --git a/Essentials/src/com/earth2me/essentials/commands/PlayerNotFoundException.java b/Essentials/src/com/earth2me/essentials/commands/PlayerNotFoundException.java
new file mode 100644
index 000000000..c33e87522
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/PlayerNotFoundException.java
@@ -0,0 +1,11 @@
+package com.earth2me.essentials.commands;
+
+import static com.earth2me.essentials.I18n._;
+
+public class PlayerNotFoundException extends NoSuchFieldException
+{
+ public PlayerNotFoundException()
+ {
+ super(_("playerNotFound"));
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java
deleted file mode 100644
index 8456c956e..000000000
--- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java
+++ /dev/null
@@ -1,243 +0,0 @@
-package com.earth2me.essentials.craftbukkit;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.ListIterator;
-import org.bukkit.Material;
-import org.bukkit.entity.HumanEntity;
-import org.bukkit.event.inventory.InventoryType;
-import org.bukkit.inventory.Inventory;
-import org.bukkit.inventory.InventoryHolder;
-import org.bukkit.inventory.ItemStack;
-
-
-public class FakeInventory implements Inventory
-{
- ItemStack[] items;
-
- public FakeInventory(ItemStack[] items)
- {
- this.items = new ItemStack[items.length];
- for (int i = 0; i < items.length; i++)
- {
- if (items[i] == null)
- {
- continue;
- }
- this.items[i] = items[i].clone();
- }
- }
-
- @Override
- public int getSize()
- {
- return items.length;
- }
-
- @Override
- public String getName()
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public ItemStack getItem(int i)
- {
- return items[i];
- }
-
- @Override
- public void setItem(int i, ItemStack is)
- {
- items[i] = is;
- }
-
- @Override
- public HashMap<Integer, ItemStack> addItem(ItemStack... iss)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public HashMap<Integer, ItemStack> removeItem(ItemStack... iss)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public ItemStack[] getContents()
- {
- return items;
- }
-
- @Override
- public void setContents(ItemStack[] iss)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public boolean contains(int i)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public boolean contains(Material mtrl)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public boolean contains(ItemStack is)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public boolean contains(int i, int i1)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public boolean contains(Material mtrl, int i)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public boolean contains(ItemStack is, int i)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public HashMap<Integer, ? extends ItemStack> all(int i)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public HashMap<Integer, ? extends ItemStack> all(Material mtrl)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public HashMap<Integer, ? extends ItemStack> all(ItemStack is)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public int first(int i)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public int first(Material mtrl)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public int first(ItemStack is)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public int firstEmpty()
- {
- for (int i = 0; i < items.length; i++)
- {
- if (items[i] == null || items[i].getTypeId() == 0) {
- return i;
- }
- }
- return -1;
- }
-
- @Override
- public void remove(int i)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void remove(Material mtrl)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void remove(ItemStack is)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void clear(int i)
- {
- items[i] = null;
- }
-
- @Override
- public void clear()
- {
- for (int i = 0; i < items.length; i++)
- {
- items[i] = null;
- }
- }
-
- @Override
- public List<HumanEntity> getViewers()
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public String getTitle()
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public InventoryType getType()
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public InventoryHolder getHolder()
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public ListIterator<ItemStack> iterator()
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public int getMaxStackSize()
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void setMaxStackSize(int size)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public ListIterator<ItemStack> iterator(int index)
- {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-}
diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java
index 1ac37e459..df7a237fa 100644
--- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java
+++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java
@@ -699,4 +699,46 @@ public class FakeWorld implements World
{
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ @Override
+ public int getAmbientSpawnLimit()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public void setAmbientSpawnLimit(int i)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String[] getGameRules()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getGameRuleValue(String string)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean setGameRuleValue(String string, String string1)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean isGameRule(String string)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public boolean createExplosion(double d, double d1, double d2, float f, boolean bln, boolean bln1)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/InventoryWorkaround.java b/Essentials/src/com/earth2me/essentials/craftbukkit/InventoryWorkaround.java
index fc9cbb74b..2e05f5c43 100644
--- a/Essentials/src/com/earth2me/essentials/craftbukkit/InventoryWorkaround.java
+++ b/Essentials/src/com/earth2me/essentials/craftbukkit/InventoryWorkaround.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.craftbukkit;
import java.util.HashMap;
import java.util.Map;
+import org.bukkit.Bukkit;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
@@ -15,49 +16,17 @@ public final class InventoryWorkaround
{
}
- public static int first(final Inventory inventory, final ItemStack item, final boolean enforceDurability, final boolean enforceAmount, final boolean enforceEnchantments)
- {
- return next(inventory, item, 0, enforceDurability, enforceAmount, enforceEnchantments);
- }
-
- public static int next(final Inventory cinventory, final ItemStack item, final int start, final boolean enforceDurability, final boolean enforceAmount, final boolean enforceEnchantments)
- {
- final ItemStack[] inventory = cinventory.getContents();
- for (int i = start; i < inventory.length; i++)
- {
- final ItemStack cItem = inventory[i];
- if (cItem == null)
- {
- continue;
- }
- if (item.getTypeId() == cItem.getTypeId() && (!enforceAmount || item.getAmount() == cItem.getAmount()) && (!enforceDurability || cItem.getDurability() == item.getDurability()) && (!enforceEnchantments || cItem.getEnchantments().equals(item.getEnchantments())))
- {
- return i;
- }
- }
- return -1;
- }
-
- public static int firstPartial(final Inventory cinventory, final ItemStack item, final boolean enforceDurability)
- {
- return firstPartial(cinventory, item, enforceDurability, item.getType().getMaxStackSize());
- }
-
- public static int firstPartial(final Inventory cinventory, final ItemStack item, final boolean enforceDurability, final int maxAmount)
+ private static int firstPartial(final Inventory inventory, final ItemStack item, final int maxAmount)
{
if (item == null)
{
return -1;
}
- final ItemStack[] inventory = cinventory.getContents();
- for (int i = 0; i < inventory.length; i++)
+ final ItemStack[] stacks = inventory.getContents();
+ for (int i = 0; i < stacks.length; i++)
{
- final ItemStack cItem = inventory[i];
- if (cItem == null)
- {
- continue;
- }
- if (item.getTypeId() == cItem.getTypeId() && cItem.getAmount() < maxAmount && (!enforceDurability || cItem.getDurability() == item.getDurability()) && cItem.getEnchantments().equals(item.getEnchantments()))
+ final ItemStack cItem = stacks[i];
+ if (cItem != null && cItem.getAmount() < maxAmount && cItem.isSimilar(item))
{
return i;
}
@@ -65,26 +34,24 @@ public final class InventoryWorkaround
return -1;
}
- public static boolean addAllItems(final Inventory cinventory, final boolean enforceDurability, final ItemStack... items)
+ public static boolean addAllItems(final Inventory inventory, final ItemStack... items)
{
- final Inventory fake = new FakeInventory(cinventory.getContents());
- if (addItem(fake, enforceDurability, items).isEmpty())
+ final Inventory fakeInventory = Bukkit.getServer().createInventory(null, inventory.getType());
+ fakeInventory.setContents(inventory.getContents());
+ if (addItems(fakeInventory, items).isEmpty())
{
- addItem(cinventory, enforceDurability, items);
+ addItems(inventory, items);
return true;
}
- else
- {
- return false;
- }
+ return false;
}
- public static Map<Integer, ItemStack> addItem(final Inventory cinventory, final boolean forceDurability, final ItemStack... items)
+ public static Map<Integer, ItemStack> addItems(final Inventory inventory, final ItemStack... items)
{
- return addItem(cinventory, forceDurability, 0, items);
+ return addOversizedItems(inventory, 0, items);
}
- public static Map<Integer, ItemStack> addItem(final Inventory cinventory, final boolean enforceDurability, final int oversizedStacks, final ItemStack... items)
+ public static Map<Integer, ItemStack> addOversizedItems(final Inventory inventory, final int oversizedStacks, final ItemStack... items)
{
final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
@@ -95,7 +62,7 @@ public final class InventoryWorkaround
// combine items
- ItemStack[] combined = new ItemStack[items.length];
+ final ItemStack[] combined = new ItemStack[items.length];
for (int i = 0; i < items.length; i++)
{
if (items[i] == null || items[i].getAmount() < 1)
@@ -109,7 +76,7 @@ public final class InventoryWorkaround
combined[j] = items[i].clone();
break;
}
- if (combined[j].getTypeId() == items[i].getTypeId() && (!enforceDurability || combined[j].getDurability() == items[i].getDurability()) && combined[j].getEnchantments().equals(items[i].getEnchantments()))
+ if (combined[j].isSimilar(items[i]))
{
combined[j].setAmount(combined[j].getAmount() + items[i].getAmount());
break;
@@ -130,13 +97,13 @@ public final class InventoryWorkaround
{
// Do we already have a stack of it?
final int maxAmount = oversizedStacks > item.getType().getMaxStackSize() ? oversizedStacks : item.getType().getMaxStackSize();
- final int firstPartial = firstPartial(cinventory, item, enforceDurability, maxAmount);
+ final int firstPartial = firstPartial(inventory, item, maxAmount);
// Drat! no partial stack
if (firstPartial == -1)
{
// Find a free spot!
- final int firstFree = cinventory.firstEmpty();
+ final int firstFree = inventory.firstEmpty();
if (firstFree == -1)
{
@@ -151,13 +118,13 @@ public final class InventoryWorkaround
{
final ItemStack stack = item.clone();
stack.setAmount(maxAmount);
- cinventory.setItem(firstFree, stack);
+ inventory.setItem(firstFree, stack);
item.setAmount(item.getAmount() - maxAmount);
}
else
{
// Just store it
- cinventory.setItem(firstFree, item);
+ inventory.setItem(firstFree, item);
break;
}
}
@@ -165,7 +132,7 @@ public final class InventoryWorkaround
else
{
// So, apparently it might only partially fit, well lets do just that
- final ItemStack partialItem = cinventory.getItem(firstPartial);
+ final ItemStack partialItem = inventory.getItem(firstPartial);
final int amount = item.getAmount();
final int partialAmount = partialItem.getAmount();
@@ -185,138 +152,4 @@ public final class InventoryWorkaround
}
return leftover;
}
-
- public static Map<Integer, ItemStack> removeItem(final Inventory cinventory, final boolean enforceDurability, final boolean enforceEnchantments, final ItemStack... items)
- {
- final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
-
- // TODO: optimization
-
- for (int i = 0; i < items.length; i++)
- {
- final ItemStack item = items[i];
- if (item == null)
- {
- continue;
- }
- int toDelete = item.getAmount();
-
- while (true)
- {
-
- // Bail when done
- if (toDelete <= 0)
- {
- break;
- }
-
- // get first Item, ignore the amount
- final int first = first(cinventory, item, enforceDurability, false, enforceEnchantments);
-
- // Drat! we don't have this type in the inventory
- if (first == -1)
- {
- item.setAmount(toDelete);
- leftover.put(i, item);
- break;
- }
- else
- {
- final ItemStack itemStack = cinventory.getItem(first);
- final int amount = itemStack.getAmount();
-
- if (amount <= toDelete)
- {
- toDelete -= amount;
- // clear the slot, all used up
- cinventory.clear(first);
- }
- else
- {
- // split the stack and store
- itemStack.setAmount(amount - toDelete);
- cinventory.setItem(first, itemStack);
- toDelete = 0;
- }
- }
- }
- }
- return leftover;
- }
-
- public static boolean containsItem(final Inventory cinventory, final boolean enforceDurability, final boolean enforceEnchantments, final ItemStack... items)
- {
- final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
-
- // TODO: optimization
-
- // combine items
-
- ItemStack[] combined = new ItemStack[items.length];
- for (int i = 0; i < items.length; i++)
- {
- if (items[i] == null)
- {
- continue;
- }
- for (int j = 0; j < combined.length; j++)
- {
- if (combined[j] == null)
- {
- combined[j] = items[i].clone();
- break;
- }
- if (combined[j].getTypeId() == items[i].getTypeId() && (!enforceDurability || combined[j].getDurability() == items[i].getDurability()) && (!enforceEnchantments || combined[j].getEnchantments().equals(items[i].getEnchantments())))
- {
- combined[j].setAmount(combined[j].getAmount() + items[i].getAmount());
- break;
- }
- }
- }
-
- for (int i = 0; i < combined.length; i++)
- {
- final ItemStack item = combined[i];
- if (item == null)
- {
- continue;
- }
- int mustHave = item.getAmount();
- int position = 0;
-
- while (true)
- {
- // Bail when done
- if (mustHave <= 0)
- {
- break;
- }
-
- final int slot = next(cinventory, item, position, enforceDurability, false, enforceEnchantments);
-
- // Drat! we don't have this type in the inventory
- if (slot == -1)
- {
- leftover.put(i, item);
- break;
- }
- else
- {
- final ItemStack itemStack = cinventory.getItem(slot);
- final int amount = itemStack.getAmount();
-
- if (amount <= mustHave)
- {
- mustHave -= amount;
- }
- else
- {
- mustHave = 0;
- }
- position = slot + 1;
- }
- }
- }
- return leftover.isEmpty();
- }
}
diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java b/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java
index 7ed3034c3..e484ebfe1 100644
--- a/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java
+++ b/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java
@@ -67,6 +67,10 @@ public class SetExpFix
exp += getExpAtLevel(currentLevel);
currentLevel++;
}
+ if (exp < 0)
+ {
+ exp = Integer.MAX_VALUE;
+ }
return exp;
}
@@ -82,6 +86,10 @@ public class SetExpFix
currentLevel--;
exp += getExpAtLevel(currentLevel);
}
+ if (exp < 0)
+ {
+ exp = Integer.MAX_VALUE;
+ }
return exp;
}
diff --git a/Essentials/src/com/earth2me/essentials/metrics/Metrics.java b/Essentials/src/com/earth2me/essentials/metrics/Metrics.java
index a0bf103e8..77e68a9d6 100644
--- a/Essentials/src/com/earth2me/essentials/metrics/Metrics.java
+++ b/Essentials/src/com/earth2me/essentials/metrics/Metrics.java
@@ -35,6 +35,7 @@ import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
+import org.bukkit.scheduler.BukkitTask;
/**
@@ -51,7 +52,7 @@ public class Metrics
/**
* The current revision number
*/
- private final static int REVISION = 5;
+ private final static int REVISION = 6;
/**
* The base url of the metrics domain
*/
@@ -61,10 +62,6 @@ public class Metrics
*/
private static final String REPORT_URL = "/report/%s";
/**
- * The file where guid and opt out is stored in
- */
- private static final String CONFIG_FILE = "plugins/PluginMetrics/config.yml";
- /**
* The separator to use for custom data. This MUST NOT change unless you are hosting your own version of metrics and
* want to change it.
*/
@@ -98,13 +95,17 @@ public class Metrics
*/
private final String guid;
/**
+ * Debug mode
+ */
+ private final boolean debug;
+ /**
* Lock for synchronization
*/
private final Object optOutLock = new Object();
/**
- * Id of the scheduled task
+ * The scheduled task
*/
- private volatile int taskId = -1;
+ private volatile BukkitTask task = null;
public Metrics(final Plugin plugin) throws IOException
{
@@ -116,29 +117,31 @@ public class Metrics
this.plugin = plugin;
// load the config
- configurationFile = new File(CONFIG_FILE);
+ configurationFile = getConfigFile();
configuration = YamlConfiguration.loadConfiguration(configurationFile);
// add some defaults
configuration.addDefault("opt-out", false);
configuration.addDefault("guid", UUID.randomUUID().toString());
+ configuration.addDefault("debug", false);
// Do we need to create the file?
if (configuration.get("guid", null) == null)
{
- configuration.options().header("http://metrics.griefcraft.com").copyDefaults(true);
+ configuration.options().header("http://mcstats.org").copyDefaults(true);
configuration.save(configurationFile);
}
// Load the guid then
guid = configuration.getString("guid");
+ debug = configuration.getBoolean("debug", false);
}
/**
* Construct and create a Graph that can be used to separate specific plotters to their own graphs on the metrics
* website. Plotters can be added to the graph object returned.
*
- * @param name
+ * @param name The name of the graph
* @return Graph object created. Will never return NULL under normal circumstances unless bad parameters are given
*/
public Graph createGraph(final String name)
@@ -161,7 +164,7 @@ public class Metrics
/**
* Adds a custom data plotter to the default graph
*
- * @param plotter
+ * @param plotter The plotter to use to plot custom data
*/
public void addCustomData(final Plotter plotter)
{
@@ -193,7 +196,7 @@ public class Metrics
}
// Begin hitting the server with glorious data
- taskId = plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable()
+ task = plugin.getServer().getScheduler().runTaskTimerAsynchronously(plugin, new Runnable()
{
private boolean firstPost = true;
@@ -205,10 +208,15 @@ public class Metrics
synchronized (optOutLock)
{
// Disable Task, if it is running and the server owner decided to opt-out
- if (isOptOut() && taskId > 0)
+ if (isOptOut() && task != null)
{
- plugin.getServer().getScheduler().cancelTask(taskId);
- taskId = -1;
+ task.cancel();
+ task = null;
+ // Tell all plotters to stop gathering information.
+ for (Graph graph : graphs)
+ {
+ graph.onOptOut();
+ }
}
}
@@ -223,7 +231,10 @@ public class Metrics
}
catch (IOException e)
{
- Bukkit.getLogger().log(Level.FINE, "[Metrics] " + e.getMessage());
+ if (debug)
+ {
+ Bukkit.getLogger().log(Level.INFO, "[Metrics] " + e.getMessage());
+ }
}
}
}, 0, PING_INTERVAL * 1200);
@@ -233,7 +244,7 @@ public class Metrics
/**
* Has the server owner denied plugin metrics?
*
- * @return
+ * @return true if metrics should be opted out of it
*/
public boolean isOptOut()
{
@@ -242,16 +253,22 @@ public class Metrics
try
{
// Reload the metrics file
- configuration.load(CONFIG_FILE);
+ configuration.load(getConfigFile());
}
catch (IOException ex)
{
- Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage());
+ if (debug)
+ {
+ Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage());
+ }
return true;
}
catch (InvalidConfigurationException ex)
{
- Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage());
+ if (debug)
+ {
+ Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage());
+ }
return true;
}
return configuration.getBoolean("opt-out", false);
@@ -276,7 +293,7 @@ public class Metrics
}
// Enable Task, if it is not running
- if (taskId < 0)
+ if (task == null)
{
start();
}
@@ -297,35 +314,81 @@ public class Metrics
if (!isOptOut())
{
configuration.set("opt-out", true);
- final File file = new File(CONFIG_FILE);
- configuration.save(file);
+ configuration.save(configurationFile);
}
// Disable Task, if it is running
- if (taskId >= 0)
+ if (task != null)
{
- this.plugin.getServer().getScheduler().cancelTask(taskId);
- taskId = -1;
+ task.cancel();
+ task = null;
}
}
}
/**
+ * Gets the File object of the config file that should be used to store data such as the GUID and opt-out status
+ *
+ * @return the File object for the config file
+ */
+ public File getConfigFile()
+ {
+ // I believe the easiest way to get the base folder (e.g craftbukkit set via -P) for plugins to use
+ // is to abuse the plugin object we already have
+ // plugin.getDataFolder() => base/plugins/PluginA/
+ // pluginsFolder => base/plugins/
+ // The base is not necessarily relative to the startup directory.
+ File pluginsFolder = plugin.getDataFolder().getParentFile();
+
+ // return => base/plugins/PluginMetrics/config.yml
+ return new File(new File(pluginsFolder, "PluginMetrics"), "config.yml");
+ }
+
+ /**
* Generic method that posts a plugin to the metrics website
*/
private void postPlugin(final boolean isPing) throws IOException
{
- // The plugin's description file containg all of the plugin data such as name, version, author, etc
- final PluginDescriptionFile description = plugin.getDescription();
+ // Server software specific section
+ PluginDescriptionFile description = plugin.getDescription();
+ String pluginName = description.getName();
+ boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled
+ String pluginVersion = description.getVersion();
+ String serverVersion = Bukkit.getVersion();
+ int playersOnline = Bukkit.getServer().getOnlinePlayers().length;
+
+ // END server software specific section -- all code below does not use any code outside of this class / Java
// Construct the post data
final StringBuilder data = new StringBuilder();
+
+ // The plugin's description file containg all of the plugin data such as name, version, author, etc
data.append(encode("guid")).append('=').append(encode(guid));
- encodeDataPair(data, "version", description.getVersion());
- encodeDataPair(data, "server", Bukkit.getVersion());
- encodeDataPair(data, "players", Integer.toString(Bukkit.getServer().getOnlinePlayers().length));
+ encodeDataPair(data, "version", pluginVersion);
+ encodeDataPair(data, "server", serverVersion);
+ encodeDataPair(data, "players", Integer.toString(playersOnline));
encodeDataPair(data, "revision", String.valueOf(REVISION));
+ // New data as of R6
+ String osname = System.getProperty("os.name");
+ String osarch = System.getProperty("os.arch");
+ String osversion = System.getProperty("os.version");
+ String java_version = System.getProperty("java.version");
+ int coreCount = Runtime.getRuntime().availableProcessors();
+
+ // normalize os arch .. amd64 -> x86_64
+ if (osarch.equals("amd64"))
+ {
+ osarch = "x86_64";
+ }
+
+ encodeDataPair(data, "osname", osname);
+ encodeDataPair(data, "osarch", osarch);
+ encodeDataPair(data, "osversion", osversion);
+ encodeDataPair(data, "cores", Integer.toString(coreCount));
+ encodeDataPair(data, "online-mode", Boolean.toString(onlineMode));
+ encodeDataPair(data, "java_version", java_version);
+
// If we're pinging, append it
if (isPing)
{
@@ -342,10 +405,6 @@ public class Metrics
{
final Graph graph = iter.next();
- // Because we have a lock on the graphs set already, it is reasonable to assume
- // that our lock transcends down to the individual plotters in the graphs also.
- // Because our methods are private, no one but us can reasonably access this list
- // without reflection so this is a safe assumption without adding more code.
for (Plotter plotter : graph.getPlotters())
{
// The key name to send to the metrics server
@@ -364,7 +423,7 @@ public class Metrics
}
// Create the url
- final URL url = new URL(BASE_URL + String.format(REPORT_URL, description.getName()));
+ URL url = new URL(BASE_URL + String.format(REPORT_URL, encode(pluginName)));
// Connect to the website
URLConnection connection;
@@ -420,13 +479,12 @@ public class Metrics
}
}
}
- //if (response.startsWith("OK")) - We should get "OK" followed by an optional description if everything goes right
}
/**
* Check if mineshafter is present. If it is, we need to bypass it to send POST requests
*
- * @return
+ * @return true if mineshafter is installed on the server
*/
private boolean isMineshafterPresent()
{
@@ -450,10 +508,9 @@ public class Metrics
* encodeDataPair(data, "version", description.getVersion());
* </code>
*
- * @param buffer
- * @param key
- * @param value
- * @return
+ * @param buffer the stringbuilder to append the data pair onto
+ * @param key the key value
+ * @param value the value
*/
private static void encodeDataPair(final StringBuilder buffer, final String key, final String value) throws UnsupportedEncodingException
{
@@ -463,8 +520,8 @@ public class Metrics
/**
* Encode text as UTF-8
*
- * @param text
- * @return
+ * @param text the text to encode
+ * @return the encoded text, as UTF-8
*/
private static String encode(final String text) throws UnsupportedEncodingException
{
@@ -495,7 +552,7 @@ public class Metrics
/**
* Gets the graph's name
*
- * @return
+ * @return the Graph's name
*/
public String getName()
{
@@ -505,7 +562,7 @@ public class Metrics
/**
* Add a plotter to the graph, which will be used to plot entries
*
- * @param plotter
+ * @param plotter the plotter to add to the graph
*/
public void addPlotter(final Plotter plotter)
{
@@ -515,7 +572,7 @@ public class Metrics
/**
* Remove a plotter from the graph
*
- * @param plotter
+ * @param plotter the plotter to remove from the graph
*/
public void removePlotter(final Plotter plotter)
{
@@ -525,7 +582,7 @@ public class Metrics
/**
* Gets an <b>unmodifiable</b> set of the plotter objects in the graph
*
- * @return
+ * @return an unmodifiable {@link Set} of the plotter objects
*/
public Set<Plotter> getPlotters()
{
@@ -549,6 +606,13 @@ public class Metrics
final Graph graph = (Graph)object;
return graph.name.equals(name);
}
+
+ /**
+ * Called when the server owner decides to opt-out of Metrics while the server is running.
+ */
+ protected void onOptOut()
+ {
+ }
}
@@ -573,7 +637,7 @@ public class Metrics
/**
* Construct a plotter with a specific plot name
*
- * @param name
+ * @param name the name of the plotter to use, which will show up on the website
*/
public Plotter(final String name)
{
@@ -581,9 +645,11 @@ public class Metrics
}
/**
- * Get the current value for the plotted point
+ * Get the current value for the plotted point. Since this function defers to an external function it may or may
+ * not return immediately thus cannot be guaranteed to be thread friendly or safe. This function can be called
+ * from any thread so care should be taken when accessing resources that need to be synchronized.
*
- * @return
+ * @return the current value for the point to be plotted.
*/
public abstract int getValue();
@@ -607,7 +673,7 @@ public class Metrics
@Override
public int hashCode()
{
- return getColumnName().hashCode() + getValue();
+ return getColumnName().hashCode();
}
@Override
diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java
index b0592855d..3e9ee9e49 100644
--- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java
+++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java
@@ -134,6 +134,14 @@ public class MetricsStarter implements Runnable
{
enabledGraph.addPlotter(new SimplePlotter("Warps"));
}
+ if (ess.getSettings().getTeleportCooldown() > 0)
+ {
+ enabledGraph.addPlotter(new SimplePlotter("TeleportCooldown"));
+ }
+ if (ess.getSettings().getTeleportDelay() > 0)
+ {
+ enabledGraph.addPlotter(new SimplePlotter("TeleportDelay"));
+ }
if (!ess.getSettings().areSignsDisabled())
{
enabledGraph.addPlotter(new SimplePlotter("Signs"));
@@ -142,6 +150,14 @@ public class MetricsStarter implements Runnable
{
enabledGraph.addPlotter(new SimplePlotter("AutoAFK"));
}
+ if (ess.getSettings().changePlayerListName())
+ {
+ enabledGraph.addPlotter(new SimplePlotter("PlayerListName"));
+ }
+ if (ess.getSettings().getOperatorColor() != null)
+ {
+ enabledGraph.addPlotter(new SimplePlotter("OpColour"));
+ }
if (ess.getSettings().changeDisplayName())
{
enabledGraph.addPlotter(new SimplePlotter("DisplayName"));
diff --git a/Essentials/src/com/earth2me/essentials/perm/BPermissions2Handler.java b/Essentials/src/com/earth2me/essentials/perm/BPermissions2Handler.java
index 653a13441..791ffbe92 100644
--- a/Essentials/src/com/earth2me/essentials/perm/BPermissions2Handler.java
+++ b/Essentials/src/com/earth2me/essentials/perm/BPermissions2Handler.java
@@ -35,7 +35,7 @@ public class BPermissions2Handler extends SuperpermsHandler
@Override
public boolean inGroup(final Player base, final String group)
{
- return ApiLayer.hasGroup(base.getWorld().getName(), CalculableType.USER, base.getName(), group);
+ return ApiLayer.hasGroupRecursive(base.getWorld().getName(), CalculableType.USER, base.getName(), group);
}
@Override
diff --git a/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java b/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java
index ab2332528..c5653b0ad 100644
--- a/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java
+++ b/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java
@@ -134,6 +134,17 @@ public class PermissionsHandler implements IPermissionsHandler
return;
}
+ final Plugin simplyPermsPlugin = pluginManager.getPlugin("SimplyPerms");
+ if (simplyPermsPlugin != null && simplyPermsPlugin.isEnabled())
+ {
+ if (!(handler instanceof SimplyPermsHandler))
+ {
+ LOGGER.log(Level.INFO, "Essentials: Using SimplyPerms based permissions.");
+ handler = new SimplyPermsHandler(simplyPermsPlugin);
+ }
+ return;
+ }
+
final Plugin privPlugin = pluginManager.getPlugin("Privileges");
if (privPlugin != null && privPlugin.isEnabled())
{
diff --git a/Essentials/src/com/earth2me/essentials/perm/SimplyPermsHandler.java b/Essentials/src/com/earth2me/essentials/perm/SimplyPermsHandler.java
new file mode 100644
index 000000000..cdd9ffa93
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/perm/SimplyPermsHandler.java
@@ -0,0 +1,53 @@
+package com.earth2me.essentials.perm;
+
+import java.util.List;
+
+import net.crystalyx.bukkit.simplyperms.SimplyAPI;
+import net.crystalyx.bukkit.simplyperms.SimplyPlugin;
+
+import org.bukkit.entity.Player;
+import org.bukkit.plugin.Plugin;
+
+public class SimplyPermsHandler extends SuperpermsHandler {
+
+ private final transient SimplyAPI api;
+
+ public SimplyPermsHandler(final Plugin plugin) {
+ this.api = ((SimplyPlugin) plugin).getAPI();
+ }
+
+ @Override
+ public String getGroup(final Player base)
+ {
+ final List<String> groups = api.getPlayerGroups(base.getName());
+ if (groups == null || groups.isEmpty()) return null;
+ return groups.get(0);
+ }
+
+ @Override
+ public List<String> getGroups(final Player base)
+ {
+ return api.getPlayerGroups(base.getName());
+ }
+
+ @Override
+ public boolean inGroup(final Player base, final String group)
+ {
+ final List<String> groups = api.getPlayerGroups(base.getName());
+ for (String group1 : groups)
+ {
+ if (group1.equalsIgnoreCase(group))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean canBuild(Player base, String group)
+ {
+ return hasPermission(base, "essentials.build") || hasPermission(base, "permissions.allow.build");
+ }
+
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java
index e5f125cf8..aeecf5368 100644
--- a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java
+++ b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java
@@ -17,6 +17,7 @@ import org.bukkit.inventory.ItemStack;
public class EssentialsSign
{
private static final Set<Material> EMPTY_SET = new HashSet<Material>();
+
protected transient final String signName;
public EssentialsSign(final String signName)
@@ -258,6 +259,11 @@ public class EssentialsSign
{
return EMPTY_SET;
}
+
+ public boolean areHeavyEventRequired()
+ {
+ return false;
+ }
protected final void validateTrade(final ISign sign, final int index, final IEssentials ess) throws SignException
{
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java
index 517c313cc..fce49958e 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java
@@ -32,6 +32,7 @@ public class SignBlockListener implements Listener
{
if (ess.getSettings().areSignsDisabled())
{
+ event.getHandlers().unregister(this);
return;
}
@@ -43,6 +44,13 @@ public class SignBlockListener implements Listener
public boolean protectSignsAndBlocks(final Block block, final Player player)
{
+ // prevent any signs be broken by destroying the block they are attached to
+ if (EssentialsSign.checkIfBlockBreaksSigns(block))
+ {
+ LOGGER.log(Level.INFO, "Prevented that a block was broken next to a sign.");
+ return true;
+ }
+
final int mat = block.getTypeId();
if (mat == SIGN_POST || mat == WALL_SIGN)
{
@@ -57,15 +65,10 @@ public class SignBlockListener implements Listener
}
}
}
- // prevent any signs be broken by destroying the block they are attached to
- if (EssentialsSign.checkIfBlockBreaksSigns(block))
- {
- LOGGER.log(Level.INFO, "Prevented that a block was broken next to a sign.");
- return true;
- }
+
for (EssentialsSign sign : ess.getSettings().enabledSigns())
{
- if (sign.getBlocks().contains(block.getType())
+ if (sign.areHeavyEventRequired() && sign.getBlocks().contains(block.getType())
&& !sign.onBlockBreak(block, player, ess))
{
LOGGER.log(Level.INFO, "A block was protected by a sign.");
@@ -80,6 +83,7 @@ public class SignBlockListener implements Listener
{
if (ess.getSettings().areSignsDisabled())
{
+ event.getHandlers().unregister(this);
return;
}
User user = ess.getUser(event.getPlayer());
@@ -105,6 +109,7 @@ public class SignBlockListener implements Listener
{
if (ess.getSettings().areSignsDisabled())
{
+ event.getHandlers().unregister(this);
return;
}
@@ -129,6 +134,7 @@ public class SignBlockListener implements Listener
{
if (ess.getSettings().areSignsDisabled())
{
+ event.getHandlers().unregister(this);
return;
}
@@ -148,7 +154,7 @@ public class SignBlockListener implements Listener
}
for (EssentialsSign sign : ess.getSettings().enabledSigns())
{
- if (sign.getBlocks().contains(block.getType())
+ if (sign.areHeavyEventRequired() && sign.getBlocks().contains(block.getType())
&& !sign.onBlockPlace(block, event.getPlayer(), ess))
{
event.setCancelled(true);
@@ -162,6 +168,7 @@ public class SignBlockListener implements Listener
{
if (ess.getSettings().areSignsDisabled())
{
+ event.getHandlers().unregister(this);
return;
}
@@ -176,7 +183,7 @@ public class SignBlockListener implements Listener
}
for (EssentialsSign sign : ess.getSettings().enabledSigns())
{
- if (sign.getBlocks().contains(block.getType())
+ if (sign.areHeavyEventRequired() && sign.getBlocks().contains(block.getType())
&& !sign.onBlockBurn(block, ess))
{
event.setCancelled(true);
@@ -190,6 +197,7 @@ public class SignBlockListener implements Listener
{
if (ess.getSettings().areSignsDisabled())
{
+ event.getHandlers().unregister(this);
return;
}
@@ -204,7 +212,7 @@ public class SignBlockListener implements Listener
}
for (EssentialsSign sign : ess.getSettings().enabledSigns())
{
- if (sign.getBlocks().contains(block.getType())
+ if (sign.areHeavyEventRequired() && sign.getBlocks().contains(block.getType())
&& !sign.onBlockIgnite(block, ess))
{
event.setCancelled(true);
@@ -218,6 +226,7 @@ public class SignBlockListener implements Listener
{
if (ess.getSettings().areSignsDisabled())
{
+ event.getHandlers().unregister(this);
return;
}
@@ -233,7 +242,7 @@ public class SignBlockListener implements Listener
}
for (EssentialsSign sign : ess.getSettings().enabledSigns())
{
- if (sign.getBlocks().contains(block.getType())
+ if (sign.areHeavyEventRequired() && sign.getBlocks().contains(block.getType())
&& !sign.onBlockPush(block, ess))
{
event.setCancelled(true);
@@ -248,6 +257,7 @@ public class SignBlockListener implements Listener
{
if (ess.getSettings().areSignsDisabled())
{
+ event.getHandlers().unregister(this);
return;
}
@@ -264,7 +274,7 @@ public class SignBlockListener implements Listener
}
for (EssentialsSign sign : ess.getSettings().enabledSigns())
{
- if (sign.getBlocks().contains(block.getType())
+ if (sign.areHeavyEventRequired() && sign.getBlocks().contains(block.getType())
&& !sign.onBlockPush(block, ess))
{
event.setCancelled(true);
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java b/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java
index 37203555c..bf92a17f8 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java
@@ -17,7 +17,16 @@ public class SignEnchant extends EssentialsSign
@Override
protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
{
- final ItemStack stack = sign.getLine(1).equals("*") || sign.getLine(1).equalsIgnoreCase("any") ? null : getItemStack(sign.getLine(1), 1, ess);
+ final ItemStack stack;
+ try
+ {
+ stack = sign.getLine(1).equals("*") || sign.getLine(1).equalsIgnoreCase("any") ? null : getItemStack(sign.getLine(1), 1, ess);
+ }
+ catch (SignException e)
+ {
+ sign.setLine(1, "§c<item|any>");
+ throw e;
+ }
final String[] enchantLevel = sign.getLine(2).split(":");
if (enchantLevel.length != 2)
{
@@ -40,7 +49,8 @@ public class SignEnchant extends EssentialsSign
sign.setLine(2, "§c<enchant>");
throw new SignException(ex.getMessage(), ex);
}
- if (level < 1 || level > enchantment.getMaxLevel())
+ final boolean allowUnsafe = ess.getSettings().allowUnsafeEnchantments() && player.isAuthorized("essentials.enchant.allowunsafe");
+ if (level < 0 || (!allowUnsafe && level > enchantment.getMaxLevel()))
{
level = enchantment.getMaxLevel();
sign.setLine(2, enchantLevel[0] + ":" + level);
@@ -49,7 +59,14 @@ public class SignEnchant extends EssentialsSign
{
if (stack != null)
{
- stack.addEnchantment(enchantment, level);
+ if (allowUnsafe)
+ {
+ stack.addUnsafeEnchantment(enchantment, level);
+ }
+ else
+ {
+ stack.addEnchantment(enchantment, level);
+ }
}
}
catch (Throwable ex)
@@ -103,13 +120,37 @@ public class SignEnchant extends EssentialsSign
final ItemStack toEnchant = playerHand;
try
{
- toEnchant.addEnchantment(enchantment, level);
+ if (level == 0)
+ {
+ toEnchant.removeEnchantment(enchantment);
+ }
+ else
+ {
+ if (ess.getSettings().allowUnsafeEnchantments())
+ {
+ toEnchant.addUnsafeEnchantment(enchantment, level);
+ }
+ else
+ {
+ toEnchant.addEnchantment(enchantment, level);
+ }
+ }
}
catch (Exception ex)
{
throw new SignException(ex.getMessage(), ex);
}
+ final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH);
+ if (level == 0)
+ {
+ player.sendMessage(_("enchantmentRemoved", enchantmentName.replace('_', ' ')));
+ }
+ else
+ {
+ player.sendMessage(_("enchantmentApplied", enchantmentName.replace('_', ' ')));
+ }
+
charge.charge(player);
Trade.log("Sign", "Enchant", "Interact", username, charge, username, charge, sign.getBlock().getLocation(), ess);
player.updateInventory();
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java b/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java
index edc5b856d..fbbd1cd8c 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java
@@ -24,6 +24,7 @@ public class SignEntityListener implements Listener
{
if (ess.getSettings().areSignsDisabled())
{
+ event.getHandlers().unregister(this);
return;
}
@@ -39,7 +40,7 @@ public class SignEntityListener implements Listener
}
for (EssentialsSign sign : ess.getSettings().enabledSigns())
{
- if (sign.getBlocks().contains(block.getType()))
+ if (sign.areHeavyEventRequired() && sign.getBlocks().contains(block.getType()))
{
event.setCancelled(!sign.onBlockExplode(block, ess));
return;
@@ -53,6 +54,7 @@ public class SignEntityListener implements Listener
{
if (ess.getSettings().areSignsDisabled())
{
+ event.getHandlers().unregister(this);
return;
}
@@ -67,7 +69,7 @@ public class SignEntityListener implements Listener
}
for (EssentialsSign sign : ess.getSettings().enabledSigns())
{
- if (sign.getBlocks().contains(block.getType())
+ if (sign.areHeavyEventRequired() && sign.getBlocks().contains(block.getType())
&& !sign.onBlockBreak(block, ess))
{
event.setCancelled(true);
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignKit.java b/Essentials/src/com/earth2me/essentials/signs/SignKit.java
index 1c3528a18..6b856fc36 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignKit.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignKit.java
@@ -1,5 +1,6 @@
package com.earth2me.essentials.signs;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.*;
import com.earth2me.essentials.commands.NoChargeException;
import java.util.List;
@@ -73,6 +74,9 @@ public class SignKit extends EssentialsSign
}
return true;
}
- return false;
+ else
+ {
+ throw new SignException(_("noKitPermission", "essentials.kits." + kitName));
+ }
}
}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java b/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java
index 08257c9e4..b447ed9dd 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java
@@ -21,10 +21,19 @@ public class SignPlayerListener implements Listener
this.ess = ess;
}
+ //This following code below listens to cancelled events to fix a bukkit issue
+ //Right clicking signs with a block in hand, can now fire cancelled events.
+ //This is because when the block place is cancelled (for example not enough space for the block to be placed),
+ //the event will be marked as cancelled, thus preventing 30% of sign purchases.
@EventHandler(priority = EventPriority.LOW)
public void onPlayerInteract(final PlayerInteractEvent event)
{
- if (ess.getSettings().areSignsDisabled() || (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.RIGHT_CLICK_AIR))
+ if (ess.getSettings().areSignsDisabled())
+ {
+ event.getHandlers().unregister(this);
+ return;
+ }
+ if (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.RIGHT_CLICK_AIR)
{
return;
}
@@ -57,10 +66,10 @@ public class SignPlayerListener implements Listener
final int mat = block.getTypeId();
if (mat == Material.SIGN_POST.getId() || mat == Material.WALL_SIGN.getId())
{
- final Sign csign = (Sign)block.getState();
+ final String csign = ((Sign)block.getState()).getLine(0);
for (EssentialsSign sign : ess.getSettings().enabledSigns())
{
- if (csign.getLine(0).equalsIgnoreCase(sign.getSuccessName()))
+ if (csign.equalsIgnoreCase(sign.getSuccessName()))
{
sign.onSignInteract(block, event.getPlayer(), ess);
event.setCancelled(true);
@@ -72,7 +81,7 @@ public class SignPlayerListener implements Listener
{
for (EssentialsSign sign : ess.getSettings().enabledSigns())
{
- if (sign.getBlocks().contains(block.getType())
+ if (sign.areHeavyEventRequired() && sign.getBlocks().contains(block.getType())
&& !sign.onBlockInteract(block, event.getPlayer(), ess))
{
event.setCancelled(true);
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignProtection.java b/Essentials/src/com/earth2me/essentials/signs/SignProtection.java
index 6fdf056e2..b5a679324 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignProtection.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignProtection.java
@@ -10,7 +10,7 @@ import org.bukkit.block.BlockFace;
import org.bukkit.block.Sign;
import org.bukkit.inventory.ItemStack;
-
+@Deprecated // This sign will be removed soon
public class SignProtection extends EssentialsSign
{
private final transient Set<Material> protectedBlocks = EnumSet.noneOf(Material.class);
@@ -241,6 +241,12 @@ public class SignProtection extends EssentialsSign
{
return protectedBlocks;
}
+
+ @Override
+ public boolean areHeavyEventRequired()
+ {
+ return true;
+ }
@Override
protected boolean onBlockPlace(final Block block, final User player, final String username, final IEssentials ess) throws SignException
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignSpawnmob.java b/Essentials/src/com/earth2me/essentials/signs/SignSpawnmob.java
index 7c4cfcd54..23f08a414 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignSpawnmob.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignSpawnmob.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.signs;
import com.earth2me.essentials.ChargeException;
import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.SpawnMob;
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
import com.earth2me.essentials.commands.Commandspawnmob;
@@ -27,20 +28,17 @@ public class SignSpawnmob extends EssentialsSign
{
final Trade charge = getTrade(sign, 3, ess);
charge.isAffordableFor(player);
- Commandspawnmob command = new Commandspawnmob();
- command.setEssentials(ess);
- String[] args = new String[]
- {
- sign.getLine(2), sign.getLine(1)
- };
+
try
{
- command.run(ess.getServer(), player, "spawnmob", args);
+ String[] mobData = SpawnMob.mobData(sign.getLine(2));
+ SpawnMob.spawnmob(ess, ess.getServer(), player, player, mobData, Integer.parseInt(sign.getLine(1)));
}
catch (Exception ex)
{
throw new SignException(ex.getMessage(), ex);
}
+
charge.charge(player);
return true;
}
diff --git a/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java b/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java
index b6fbe3b33..51609446c 100644
--- a/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java
+++ b/Essentials/src/com/earth2me/essentials/storage/BukkitConstructor.java
@@ -1,5 +1,6 @@
package com.earth2me.essentials.storage;
+import com.earth2me.essentials.Util;
import java.lang.reflect.Field;
import java.util.List;
import java.util.Locale;
@@ -13,22 +14,21 @@ import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
import org.bukkit.plugin.Plugin;
-import org.bukkit.plugin.java.JavaPluginLoader;
import org.yaml.snakeyaml.TypeDescription;
import org.yaml.snakeyaml.constructor.Constructor;
+import org.yaml.snakeyaml.constructor.CustomClassLoaderConstructor;
import org.yaml.snakeyaml.error.YAMLException;
import org.yaml.snakeyaml.introspector.Property;
import org.yaml.snakeyaml.nodes.*;
-public class BukkitConstructor extends Constructor
+public class BukkitConstructor extends CustomClassLoaderConstructor
{
- private final transient Pattern NUMPATTERN = Pattern.compile("\\d+");
private final transient Plugin plugin;
public BukkitConstructor(final Class clazz, final Plugin plugin)
{
- super(clazz);
+ super(clazz, plugin.getClass().getClassLoader());
this.plugin = plugin;
yamlClassConstructors.put(NodeId.scalar, new ConstructBukkitScalar());
yamlClassConstructors.put(NodeId.mapping, new ConstructBukkitMapping());
@@ -44,7 +44,7 @@ public class BukkitConstructor extends Constructor
{
final String val = (String)constructScalar((ScalarNode)node);
Material mat;
- if (NUMPATTERN.matcher(val).matches())
+ if (Util.isInt(val))
{
final int typeId = Integer.parseInt(val);
mat = Material.getMaterial(typeId);
@@ -68,7 +68,7 @@ public class BukkitConstructor extends Constructor
return null;
}
Material mat;
- if (NUMPATTERN.matcher(split[0]).matches())
+ if (Util.isInt(split[0]))
{
final int typeId = Integer.parseInt(split[0]);
mat = Material.getMaterial(typeId);
@@ -82,7 +82,7 @@ public class BukkitConstructor extends Constructor
return null;
}
byte data = 0;
- if (split.length == 2 && NUMPATTERN.matcher(split[1]).matches())
+ if (split.length == 2 && Util.isInt(split[1]))
{
data = Byte.parseByte(split[1]);
}
@@ -106,7 +106,7 @@ public class BukkitConstructor extends Constructor
return null;
}
Material mat;
- if (NUMPATTERN.matcher(split2[0]).matches())
+ if (Util.isInt(split2[0]))
{
final int typeId = Integer.parseInt(split2[0]);
mat = Material.getMaterial(typeId);
@@ -120,12 +120,12 @@ public class BukkitConstructor extends Constructor
return null;
}
short data = 0;
- if (split2.length == 2 && NUMPATTERN.matcher(split2[1]).matches())
+ if (split2.length == 2 && Util.isInt(split2[1]))
{
data = Short.parseShort(split2[1]);
}
int size = mat.getMaxStackSize();
- if (split1.length > 1 && NUMPATTERN.matcher(split1[1]).matches())
+ if (split1.length > 1 && Util.isInt(split1[1]))
{
size = Integer.parseInt(split1[1]);
}
@@ -140,7 +140,7 @@ public class BukkitConstructor extends Constructor
continue;
}
Enchantment enchantment;
- if (NUMPATTERN.matcher(split3[0]).matches())
+ if (Util.isInt(split3[0]))
{
final int enchantId = Integer.parseInt(split3[0]);
enchantment = Enchantment.getById(enchantId);
@@ -154,7 +154,7 @@ public class BukkitConstructor extends Constructor
continue;
}
int level = enchantment.getStartLevel();
- if (split3.length == 2 && NUMPATTERN.matcher(split3[1]).matches())
+ if (split3.length == 2 && Util.isInt(split3[1]))
{
level = Integer.parseInt(split3[1]);
}
@@ -184,7 +184,7 @@ public class BukkitConstructor extends Constructor
return null;
}
Enchantment enchant;
- if (NUMPATTERN.matcher(split[0]).matches())
+ if (Util.isInt(split[0]))
{
final int typeId = Integer.parseInt(split[0]);
enchant = Enchantment.getById(typeId);
@@ -198,7 +198,7 @@ public class BukkitConstructor extends Constructor
return null;
}
int level = enchant.getStartLevel();
- if (split.length == 2 && NUMPATTERN.matcher(split[1]).matches())
+ if (split.length == 2 && Util.isInt(split[1]))
{
level = Integer.parseInt(split[1]);
}
@@ -276,6 +276,7 @@ public class BukkitConstructor extends Constructor
return super.construct(node);
}
+ @Override
protected Object constructJavaBean2ndStep(final MappingNode node, final Object object)
{
Map<Class<? extends Object>, TypeDescription> typeDefinitions;
@@ -284,7 +285,8 @@ public class BukkitConstructor extends Constructor
final Field typeDefField = Constructor.class.getDeclaredField("typeDefinitions");
typeDefField.setAccessible(true);
typeDefinitions = (Map<Class<? extends Object>, TypeDescription>)typeDefField.get((Constructor)BukkitConstructor.this);
- if (typeDefinitions == null) {
+ if (typeDefinitions == null)
+ {
throw new NullPointerException();
}
}
@@ -402,29 +404,4 @@ public class BukkitConstructor extends Constructor
return object;
}
}
-
- @Override
- protected Class<?> getClassForNode(final Node node)
- {
- Class<?> clazz;
- final String name = node.getTag().getClassName();
- if (plugin == null)
- {
- clazz = super.getClassForNode(node);
- }
- else
- {
- final JavaPluginLoader jpl = (JavaPluginLoader)plugin.getPluginLoader();
- clazz = jpl.getClassByName(name);
- }
-
- if (clazz == null)
- {
- throw new YAMLException("Class not found: " + name);
- }
- else
- {
- return clazz;
- }
- }
}
diff --git a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java
index 4efb6c43f..b091e2135 100644
--- a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java
+++ b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java
@@ -47,6 +47,7 @@ public class HelpInput implements IText
newLines.clear();
lines.add(_("helpFrom", p.getDescription().getName()));
}
+ final boolean isOnWhitelist = user.isAuthorized("essentials.help." + pluginNameLow);
for (Map.Entry<String, Map<String, Object>> k : cmds.entrySet())
{
@@ -81,7 +82,7 @@ public class HelpInput implements IText
{
permissions = value.get(PERMISSIONS);
}
- if (user.isAuthorized("essentials.help." + pluginNameLow))
+ if (isOnWhitelist || user.isAuthorized("essentials.help." + pluginNameLow + "." + k.getKey()))
{
pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION)));
}
diff --git a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java
index 4c875098b..2a95d4d84 100644
--- a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java
+++ b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java
@@ -3,6 +3,7 @@ package com.earth2me.essentials.textreader;
import com.earth2me.essentials.DescParseTickFormat;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
@@ -42,7 +43,7 @@ public class KeywordReplacer implements IText
userName = user.getName();
ipAddress = user.getAddress() == null || user.getAddress().getAddress() == null ? "" : user.getAddress().getAddress().toString();
address = user.getAddress() == null ? "" : user.getAddress().toString();
- balance = Double.toString(user.getMoney());
+ balance = Util.displayCurrency(user.getMoney(), ess);
mails = Integer.toString(user.getMails().size());
world = user.getLocation() == null || user.getLocation().getWorld() == null ? "" : user.getLocation().getWorld().getName();
worldTime12 = DescParseTickFormat.format12(user.getWorld() == null ? 0 : user.getWorld().getTime());
diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml
index 9fa0f8c4c..10247ab09 100644
--- a/Essentials/src/config.yml
+++ b/Essentials/src/config.yml
@@ -32,11 +32,10 @@ change-displayname: true
# The value of change-displayname (above) has to be true.
#change-playerlist: true
-# Adds the prefix and suffix to the displayname of the player, so it will be displayed in messages and lists.
-# The prefix/suffix can be set using Permissions, Group Manager or PermissionsEx.
+# When essentialschat.jar isnt used, force essentials to add the prefix and suffix from permission plugins to displayname
+# This setting is ignored if essentialschat.jar is used, and defaults to 'true'
# The value of change-displayname (above) has to be true.
-# If you don't set this, it will default to true if essentials chat is installed.
-# Don't forget to remove the # in front of the line
+# Do not edit this setting unless you know what you are doing!
#add-prefix-suffix: false
# The delay, in seconds, required between /home, /tp, etc.
@@ -65,6 +64,7 @@ item-spawn-blacklist:
# - essentials.give.item-all
# - essentials.give.item-[itemname]
# - essentials.give.item-[itemid]
+# For more information, visit http://wiki.ess3.net/wiki/Command_Reference/ICheat#Item.2FGive
permission-based-item-spawn: false
# Mob limit on the /spawnmob command per execution
@@ -76,7 +76,7 @@ warn-on-smite: true
# motd and rules are now configured in the files motd.txt and rules.txt
# When a command conflicts with another plugin, by default, Essentials will try to force the OTHER plugin to take priority.
-# Commands in in this list, will tell Essentials to 'not give up' the command to other plugins.
+# Commands in this list, will tell Essentials to 'not give up' the command to other plugins.
# In this state, which plugin 'wins' appears to be almost random.
#
# If you have two plugin with the same command and you wish to force Essentials to take over, you need an alias.
@@ -89,11 +89,37 @@ overridden-commands:
# Disabled commands will be completely unavailable on the server.
# Disabling commands here will have no effect on command conflicts.
disabled-commands:
-# - nick
+# - nick
+
+# These commands will be shown to players with socialSpy enabled
+# You can add commands from other plugins you may want to track or
+# remove commands that are used for something you dont want to spy on
+socialspy-commands:
+ - msg
+ - w
+ - r
+ - mail
+ - m
+ - t
+ - whisper
+ - emsg
+ - tell
+ - er
+ - reply
+ - ereply
+ - email
+ - action
+ - describe
+ - eme
+ - eaction
+ - edescribe
+ - etell
+ - ewhisper
+ - pm
# If you do not wish to use a permission system, you can define a list of 'player perms' below.
-# This list has no effect if your using a supported permissions system.
-# If your using an unsupported permissions system simply delete this section.
+# This list has no effect if you are using a supported permissions system.
+# If you are using an unsupported permissions system simply delete this section.
# Whitelist the commands and permissions you wish to give players by default (everything else is op only).
# These are the permissions without the "essentials." part.
player-commands:
@@ -181,6 +207,7 @@ player-commands:
# All kit names should be lower case, and will be treated as lower in permissions/costs.
# Syntax: - itemID[:DataValue] Amount [Enchantment:Level]..
# 'delay' refers to the cooldown between how often you can use each kit, measured in seconds.
+# For more information, visit http://wiki.ess3.net/wiki/Command_Reference/ICheat#kits
kits:
dtools:
delay: 10
@@ -200,7 +227,7 @@ kits:
# See http://wiki.ess3.net/wiki/Sign_Tutorial for instructions on how to use these.
# To enable signs, remove # symbol. To disable all signs, comment/remove each sign.
# Essentials Colored sign support will be enabled when any sign types are enabled.
-# Color is not an actual sign, its for enabling using color codes on signs, when the correct permissions are given.
+# Color is not an actual sign, it's for enabling using color codes on signs, when the correct permissions are given.
enabledSigns:
#- color
@@ -246,8 +273,10 @@ debug: false
# Set the locale for all messages
# If you don't set this, the default locale of the server will be used.
+# For example, to set language to English, set locale to en, to use the file "messages_en.properties"
# Don't forget to remove the # in front of the line
-#locale: de_DE
+# For more information, visit http://wiki.ess3.net/wiki/Locale
+#locale: en
# Turn off god mode when people exit
remove-god-on-disconnect: false
@@ -287,12 +316,12 @@ no-god-in-worlds:
# Set to true to enable per-world permissions for teleporting between worlds with essentials commands
# This applies to /world, /back, /tp[a|o][here|all], but not warps.
# Give someone permission to teleport to a world with essentials.worlds.<worldname>
-# This does not effect the /home command, there is a separate toggle below for this.
+# This does not affect the /home command, there is a separate toggle below for this.
world-teleport-permissions: false
# The number of items given if the quantity parameter is left out in /item or /give.
# If this number is below 1, the maximum stack size size is given. If over-sized stacks
-# are not enabled, any number higher then the maximum stack size results in more than one stack.
+# are not enabled, any number higher than the maximum stack size results in more than one stack.
default-stack-size: -1
# Over-sized stacks are stacks that ignore the normal max stack size.
@@ -305,6 +334,10 @@ oversized-stacksize: 64
# essentials.repair.enchanted
repair-enchanted: true
+# Allow 'unsafe' enchantments in kits and item spawning.
+# Warning: Mixing and overleveling some enchantments can cause issues with clients, servers and plugins.
+unsafe-enchantments: false
+
#Do you want essentials to keep track of previous location for /back in the teleport listener?
#If you set this to true any plugin that uses teleport will have the previous location registered.
register-back-in-listener: false
@@ -315,6 +348,13 @@ login-attack-delay: 5
#Set the max fly speed, values range from 0.1 to 1.0
max-fly-speed: 0.8
+#Set the maximum amount of mail that can be sent within a minute.
+mails-per-minute: 1000
+
+# Set the maximum time /tempban can be used for in seconds.
+# Set to -1 to disable, and essentials.tempban.unlimited can be used to override.
+max-tempban-time: -1
+
############################################################
# +------------------------------------------------------+ #
# | EssentialsHome | #
@@ -333,6 +373,7 @@ world-home-permissions: false
# Players need essentials.sethome.multiple before they can have more than 1 home, defaults to 'default' below.
# Define different amounts of multiple homes for different permissions, e.g. essentials.sethome.multiple.vip
# People with essentials.sethome.multiple.unlimited are not limited by these numbers.
+# For more information, visit http://wiki.ess3.net/wiki/Multihome
sethome-multiple:
default: 3
# essentials.sethome.multiple.vip
@@ -342,7 +383,7 @@ sethome-multiple:
# Set timeout in seconds for players to accept tpa before request is cancelled.
# Set to 0 for no timeout
-tpa-accept-cancellation: 0
+tpa-accept-cancellation: 120
############################################################
# +------------------------------------------------------+ #
@@ -350,6 +391,8 @@ tpa-accept-cancellation: 0
# +------------------------------------------------------+ #
############################################################
+# For more information, visit http://wiki.ess3.net/wiki/Essentials_Economy
+
# Defines the balance with which new players begin. Defaults to 0.
starting-balance: 0
@@ -368,7 +411,7 @@ command-costs:
currency-symbol: '$'
# Set the maximum amount of money a player can have
-# The amount is always limited to 10 trillions because of the limitations of a java double
+# The amount is always limited to 10 trillion because of the limitations of a java double
max-money: 10000000000000
# Set the minimum amount of money a player can have (must be above the negative of max-money).
@@ -457,6 +500,10 @@ protect:
fireball-explosion: false
fireball-fire: false
fireball-playerdamage: false
+ witherskull-explosion: false
+ witherskull-playerdamage: false
+ wither-spawnexplosion: false
+ wither-blockreplace: false
creeper-explosion: false
creeper-playerdamage: false
creeper-blockdamage: false
@@ -493,7 +540,10 @@ protect:
ocelot: false
iron_golem: false
villager: false
-
+ wither: false
+ bat: false
+ witch: false
+
# Maximum height the creeper should explode. -1 allows them to explode everywhere.
# Set prevent.creeper-explosion to true, if you want to disable creeper explosions.
creeper:
@@ -546,6 +596,9 @@ protect:
# Should the damage after hit by a lightning be disabled?
lightning: false
+
+ # Should Wither damage be disabled?
+ wither: false
# Disable weather options
weather:
@@ -560,6 +613,7 @@ protect:
############################################################
# Disable various default physics and behaviors
+ # For more information, visit http://wiki.ess3.net/wiki/AntiBuild
# Should people with build: false in permissions be allowed to build
# Set true to disable building for those people
diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv
index a3d6ca91b..bcc3fffb8 100644
--- a/Essentials/src/items.csv
+++ b/Essentials/src/items.csv
@@ -639,19 +639,22 @@ pstick,29,7
spiderweb,30,0
sweb,30,0
web,30,0
-longgrass,31,0
-tallgrass,31,0
-wildgrass,31,0
-grasslong,31,0
-grasstall,31,0
-grasswild,31,0
-lgrass,31,0
-tgrass,31,0
-wgrass,31,0
+longgrass,31,1
+tallgrass,31,1
+wildgrass,31,1
+grasslong,31,1
+grasstall,31,1
+grasswild,31,1
+lgrass,31,1
+tgrass,31,1
+wgrass,31,1
+fern,31,2
+bush,31,2
deadshrub,32,0
-shrubdead,32,0
dshrub,32,0
-shrubd,32,0
+deadbush,32,0
+dbush,32,0
+deadsapling,32,0
normalpistonbase,33,7
normalpiston,33,7
normpistonbase,33,7
@@ -826,12 +829,16 @@ rose,38,0
redflower,38,0
rflower,38,0
brownmushroom,39,0
+brownshroom,39,0
brownmush,39,0
bmushroom,39,0
+bshroom,39,0
bmush,39,0
redmushroom,40,0
+redshroom,40,0
redmush,40,0
rmushroom,40,0
+rshroom,40,0
rmush,40,0
goldblock,41,0
blockgold,41,0
@@ -1148,9 +1155,126 @@ doublesbrickhalfblock,43,5
dsbrickhalfblock,43,5
doublesbhalfblock,43,5
dsbhalfblock,43,5
-adminslab,43,6
-magicslab,43,6
-adslab,43,6
+netherbrickdoubleslab,43,6
+hellbrickdoubleslab,43,6
+nbrickdoubleslab,43,6
+hbrickdoubleslab,43,6
+netherdoubleslab,43,6
+helldoubleslab,43,6
+nbdoubleslab,43,6
+hbdoubleslab,43,6
+hdoubleslab,43,6
+ndoubleslab,43,6
+netherbrickdoublestep,43,6
+hellbrickdoublestep,43,6
+nbrickdoublestep,43,6
+hbrickdoublestep,43,6
+netherdoublestep,43,6
+helldoublestep,43,6
+nbdoublestep,43,6
+hbdoublestep,43,6
+ndoublestep,43,6
+hdoublestep,43,6
+netherbrickdoublehalfblock,43,6
+hellbrickdoublehalfblock,43,6
+nbrickdoublehalfblock,43,6
+hbrickdoublehalfblock,43,6
+netherdoublehalfblock,43,6
+helldoublehalfblock,43,6
+nbdoublehalfblock,43,6
+hbdoublehalfblock,43,6
+ndoublehalfblock,43,6
+hdoublehalfblock,43,6
+netherbrickdslab,43,6
+hellbrickdslab,43,6
+nbrickdslab,43,6
+hbrickdslab,43,6
+netherdslab,43,6
+helldslab,43,6
+nbdslab,43,6
+hbdslab,43,6
+hdslab,43,6
+ndslab,43,6
+netherbrickdstep,43,6
+hellbrickdstep,43,6
+nbrickdstep,43,6
+hbrickdstep,43,6
+netherdstep,43,6
+helldstep,43,6
+nbdstep,43,6
+hbdstep,43,6
+ndstep,43,6
+hdstep,43,6
+netherbrickdhalfblock,43,6
+hellbrickdhalfblock,43,6
+nbrickdhalfblock,43,6
+hbrickdhalfblock,43,6
+netherdhalfblock,43,6
+helldhalfblock,43,6
+nbdhalfblock,43,6
+hbdhalfblock,43,6
+ndhalfblock,43,6
+hdhalfblock,43,6
+doublenetherbrickslab,43,6
+doublehellbrickslab,43,6
+doublenbrickslab,43,6
+doublehbrickslab,43,6
+doublenetherslab,43,6
+doublehellslab,43,6
+doublenbslab,43,6
+doublehbslab,43,6
+doublehslab,43,6
+doublenslab,43,6
+doublenetherbrickstep,43,6
+doublehellbrickstep,43,6
+doublenbrickstep,43,6
+doublehbrickstep,43,6
+doublenetherstep,43,6
+doublehellstep,43,6
+doublenbstep,43,6
+doublehbstep,43,6
+doublenstep,43,6
+doublehstep,43,6
+doublenetherbrickhalfblock,43,6
+doublehellbrickhalfblock,43,6
+doublenbrickhalfblock,43,6
+doublehbrickhalfblock,43,6
+doublenetherhalfblock,43,6
+doublehellhalfblock,43,6
+doublenbhalfblock,43,6
+doublehbhalfblock,43,6
+doublenhalfblock,43,6
+doublehhalfblock,43,6
+dnetherbrickslab,43,6
+dhellbrickslab,43,6
+dnbrickslab,43,6
+dhbrickslab,43,6
+dnetherslab,43,6
+dhellslab,43,6
+dnbslab,43,6
+dhbslab,43,6
+dhslab,43,6
+dnslab,43,6
+dnetherbrickstep,43,6
+dhellbrickstep,43,6
+dnbrickstep,43,6
+dhbrickstep,43,6
+dnetherstep,43,6
+dhellstep,43,6
+dnbstep,43,6
+dhbstep,43,6
+dnstep,43,6
+dhstep,43,6
+dnetherbrickhalfblock,43,6
+dhellbrickhalfblock,43,6
+dnbrickhalfblock,43,6
+dhbrickhalfblock,43,6
+dnetherhalfblock,43,6
+dhellhalfblock,43,6
+dnbhalfblock,43,6
+dhbhalfblock,43,6
+dnhalfblock,43,6
+dhhalfblock,43,6
smoothstonestep,44,0
stonestep,44,0
sstep,44,0
@@ -1163,13 +1287,13 @@ smoothstonehalfblock,44,0
stonehalfblock,44,0
shalfblock,44,0
halfblock,44,0
-sanddstonestep,44,1
+sandstonestep,44,1
sstonestep,44,1
ssstep,44,1
-sanddstoneslab,44,1
+sandstoneslab,44,1
sstoneslab,44,1
ssslab,44,1
-sanddstonehalfblock,44,1
+sandstonehalfblock,44,1
sstonehalfblock,44,1
sshalfblock,44,1
woodenplankstonestep,44,2
@@ -1229,6 +1353,35 @@ stonebrickhalfblock,44,5
stonebhalfblock,44,5
sbrickhalfblock,44,5
sbhalfblock,44,5
+hellbrickslab,44,6
+nbrickslab,44,6
+hbrickslab,44,6
+netherslab,44,6
+hellslab,44,6
+nbslab,44,6
+hbslab,44,6
+hslab,44,6
+nslab,44,6
+netherbrickstep,44,6
+hellbrickstep,44,6
+nbrickstep,44,6
+hbrickstep,44,6
+netherstep,44,6
+hellstep,44,6
+nbstep,44,6
+hbstep,44,6
+nstep,44,6
+hstep,44,6
+netherbrickhalfblock,44,6
+hellbrickhalfblock,44,6
+nbrickhalfblock,44,6
+hbrickhalfblock,44,6
+netherhalfblock,44,6
+hellhalfblock,44,6
+nbhalfblock,44,6
+hbhalfblock,44,6
+nhalfblock,44,6
+hhalfblock,44,6
brickblock,45,0
blockbrick,45,0
bblock,45,0
@@ -1587,7 +1740,6 @@ tdoor,96,0
doort,96,0
trapd,96,0
dtrap,96,0
-monsteregg,97,0
silverfish,97,0
monsteregg,97,0
monstereggsmoothstone,97,0
@@ -1660,33 +1812,54 @@ circlestonebrick,98,3
circlestonebb,98,3
circlestone,98,3
circlesbb,98,3
+giantredmushroom,99,0
hugeredmushroom,99,0
bigredmushroom,99,0
-brmushroom,99,0
-giantredmushroom,99,0
+gredmushroom,99,0
+hredmushroom,99,0
+bredmushroom,99,0
+giantrmushroom,99,0
+hugermushroom,99,0
+bigrmushroom,99,0
grmushroom,99,0
+hrmushroom,99,0
+brmushroom,99,0
+giantbrownmushroom,100,0
hugebrownmushroom,100,0
bigbrownmushroom,100,0
-bbmushroom,100,0
-giantbrownmushroom,100,0
+gbrownmushroom,100,0
+hbrownmushroom,100,0
+bbrownmushroom,100,0
+giantbmushroom,100,0
+hugebmushroom,100,0
+bigbmushroom,100,0
gbmushroom,100,0
+hbmushroom,100,0
+bbmushroom,100,0
ironbars,101,0
ironbarsb,101,0
ironbarsblock,101,0
-metalbarsblock,101,0
-metalbarsb,101,0
+ironfence,101,0
metalbars,101,0
-jailbarsblock,101,0
-jailbarsb,101,0
+metalbarsb,101,0
+metalbarsblock,101,0
+metalfence,101,0
jailbars,101,0
-mbarsblock,101,0
-mbarsb,101,0
+jailbarsb,101,0
+jailbarsblock,101,0
+jailfence,101,0
mbars,101,0
-jbarsblock,101,0
-jbarsb,101,0
+mbarsb,101,0
+mbarsblock,101,0
+mfence,101,0
jbars,101,0
+jbarsb,101,0
+jbarsblock,101,0
+jfence,101,0
+ibars,101,0
ibarsb,101,0
ibarsblock,101,0
+ifence,101,0
glasspane,102,0
glassp,102,0
paneglass,102,0
@@ -1784,48 +1957,42 @@ hellbrick,112,0
deathbrick,112,0
dbrick,112,0
hbrick,112,0
+netherbrickfence,113,0
+hellbrickfence,113,0
+nbrickfence,113,0
+hbrickfence,113,0
+netherbfence,113,0
+hellbfence,113,0
netherfence,113,0
-nfence,113,0
hellfence,113,0
-deathfence,113,0
-dfence,113,0
+nbfence,113,0
+hbfence,113,0
+nfence,113,0
hfence,113,0
netherbrickstairs,114,0
-nbrickstairs,114,0
hellbrickstairs,114,0
-deathbrickstairs,114,0
-dbrickstairs,114,0
+nbrickstairs,114,0
hbrickstairs,114,0
-dstairs,114,0
-hstairs,114,0
-hellstairs,114,0
-deathstairs,114,0
-nstairs,114,0
-netherstairs,114,0
-dbstairs,114,0
-hbstairs,114,0
+netherbstairs,114,0
hellbstairs,114,0
-deathbstairs,114,0
+netherstairs,114,0
+hellstairs,114,0
nbstairs,114,0
-netherbstairs,114,0
+hbstairs,114,0
+nstairs,114,0
+hstairs,114,0
netherbrickstair,114,0
-nbrickstair,114,0
hellbrickstair,114,0
-deathbrickstair,114,0
-dbrickstair,114,0
+nbrickstair,114,0
hbrickstair,114,0
-dstair,114,0
-hstair,114,0
-hellstair,114,0
-deathstair,114,0
-nstair,114,0
-netherstair,114,0
-dbstair,114,0
-hbstair,114,0
+netherbstair,114,0
hellbstair,114,0
-deathbstair,114,0
+netherstair,114,0
+hellstair,114,0
nbstair,114,0
-netherbstair,114,0
+hbstair,114,0
+nstair,114,0
+hstair,114,0
netherwarts,115,0
netherwart,115,0
netherplant,115,0
@@ -1851,17 +2018,23 @@ dwart,115,0
dplant,115,0
dcrop,115,0
enchantmenttable,116,0
-magictable,116,0
+enchantingtable,116,0
+enchanttable,116,0
etable,116,0
-booktable,116,0
-magicdesk,116,0
+magicaltable,116,0
+magictable,116,0
+mtable,116,0
enchantmentdesk,116,0
+enchantingdesk,116,0
+enchantdesk,116,0
edesk,116,0
+magicaldesk,116,0
+magicdesk,116,0
+mdesk,116,0
+booktable,116,0
bookdesk,116,0
btable,116,0
bdesk,116,0
-mtable,116,0
-mdesk,116,0
brewingstandblock,117,0
brewerblock,117,0
potionstandblock,117,0
@@ -2815,9 +2988,14 @@ forestwoodhalfblock,126,3
forestwhalfblock,126,3
foresthalfblock,126,3
cocoaplant,127,0
-cocopant,127,0
+cocoplant,127,0
+cplant,127,0
cocoafruit,127,0
cocofruit,127,0
+cfruit,127,0
+cocoapod,127,0
+cocopod,127,0
+cpod,127,0
sandstairs,128,0
sandstonestairs,128,0
sandsstairs,128,0
@@ -2950,6 +3128,141 @@ forestwoodenstair,136,0
forestwoodstair,136,0
forestwstair,136,0
foreststair,136,0
+commandblock,137,0
+blockcommand,137,0
+cmdblock,137,0
+blockcmd,137,0
+macroblock,137,0
+blockmacro,137,0
+beacon,138,0
+beaconblock,138,0
+cobblestonewall,139,0
+cstonewall,139,0
+cobblewall,139,0
+cobblestonefence,139,0
+cstonefence,139,0
+cobblefence,139,0
+mosscobblestonewall,139,1
+mosscstonewall,139,1
+mosscobblewall,139,1
+mcobblestonewall,139,1
+mcstonewall,139,1
+mcobblewall,139,1
+mosscobblestonefence,139,1
+mosscstonefence,139,1
+mosscobblefence,139,1
+mcobblestonefence,139,1
+mcstonefence,139,1
+mcobblefence,139,1
+emptyflowerpot,140,0
+emptypot,140,0
+flowerpotblock,140,0
+potblock,140,0
+roseflowerpot,140,1
+rosepot,140,1
+dandelionflowerpot,140,2
+dandelionpot,140,2
+oaksaplingflowerpot,140,3
+saplingflowerpot,140,3
+oakflowerpot,140,3
+oaksaplingpot,140,3
+saplingpot,140,3
+oakpot,140,3
+sprucesaplingflowerpot,140,4
+spruceflowerpot,140,4
+darksaplingflowerpot,140,4
+darkflowerpot,140,4
+pinesaplingflowerpot,140,4
+pineflowerpot,140,4
+sprucesaplingpot,140,4
+sprucepot,140,4
+darksaplingpot,140,4
+darkpot,140,4
+pinesaplingpot,140,4
+pinepot,140,4
+birchsaplingflowerpot,140,5
+birchflowerpot,140,5
+lightsaplingflowerpot,140,5
+lightflowerpot,140,5
+whitesaplingflowerpot,140,5
+whiteflowerpot,140,5
+birchsaplingpot,140,5
+birchpot,140,5
+lightsaplingpot,140,5
+lightpot,140,5
+whitesaplingpot,140,5
+whitepot,140,5
+forestsaplingflowerpot,140,6
+forestflowerpot,140,6
+junglesaplingflowerpot,140,6
+jungleflowerpot,140,6
+forestsaplingpot,140,6
+forestpot,140,6
+junglesaplingpot,140,6
+junglepot,140,6
+redmushroomflowerpot,140,7
+redshroomflowerpot,140,7
+redmushflowerpot,140,7
+rmushroomflowerpot,140,7
+rshroomflowerpot,140,7
+rmushflowerpot,140,7
+redmushroompot,140,7
+redshroompot,140,7
+redmushpot,140,7
+rmushroompot,140,7
+rshroompot,140,7
+rmushpot,140,7
+brownmushroomflowerpot,140,8
+brownshroomflowerpot,140,8
+brownmushflowerpot,140,8
+bmushroomflowerpot,140,8
+bshroomflowerpot,140,7
+bmushflowerpot,140,8
+brownmushroompot,140,8
+brownshroompot,140,8
+brownmushpot,140,8
+bmushroompot,140,8
+bshroompot,140,8
+bmushpot,140,8
+cactusflowerpot,140,9
+cactuspot,140,9
+deadbushflowerpot,140,10
+dbushflowerpot,140,10
+deadsaplingflowerpot,140,10
+dsaplingflowerpot,140,10
+deadshrubflowerpot,140,10
+dshrubflowerpot,140,10
+deadbushpot,140,10
+dbushpot,140,10
+deadsaplingpot,140,10
+dsaplingpot,140,10
+deadshrubpot,140,10
+dshrubpot,140,10
+fernflowerpot,140,11
+bushflowerpot,140,11
+fernpot,140,11
+bushpot,140,11
+carrots,141,0
+plantedcarrot,141,0
+plantcarrot,141,0
+growingcarrot,141,0
+potatoes,142,0
+plantedpotato,142,0
+plantpotato,142,0
+growingpotato,142,0
+woodenplankbutton,143,0
+woodplankbutton,143,0
+wplankbutton,143,0
+plankbutton,143,0
+woodenbutton,143,0
+woodbutton,143,0
+wbutton,143,0
+headblock,144,0
+anvil,145,0
+slightlydamagedanvil,145,1
+slightdamageanvil,145,1
+damagedanvil,145,1
+verydamagedanvil,145,2
ironshovel,256,0
ironspade,256,0
ishovel,256,0
@@ -3819,7 +4132,6 @@ dioder,356,0
diode,356,0
cookie,357,0
chart,358,0
-map,358,0
map0,358,0
map1,358,1
map2,358,2
@@ -3897,6 +4209,7 @@ badflesh,367,0
poisonflesh,367,0
zombieremains,367,0
enderpearl,368,0
+endpearl,368,0
pearl,368,0
epearl,368,0
bluepearl,368,0
@@ -4075,6 +4388,19 @@ healingpot,373,8197
healpot,373,8197
lifepot,373,8197
hpot,373,8197
+nightvisionpotion,373,8198
+nvisionpotion,373,8198
+nightvpotion,373,8198
+darkvisionpotion,373,8198
+dvisionpotion,373,8198
+darkvpotion,373,8198
+nightvisionpot,373,8198
+nvisionpot,373,8198
+nightvpot,373,8198
+darkvisionpot,373,8198
+dvisionpot,373,8198
+darkvpot,373,8198
+npot,373,8198
weaknesspotion,373,8200
weakpotion,373,8200
weaknesspot,373,8200
@@ -4099,6 +4425,13 @@ harmingpot,373,8204
damagepot,373,8204
dmgpot,373,8204
dpot,373,8204
+invisibilitypotion,373,8206
+invisiblepotion,373,8206
+invpotion,373,8206
+invisibilitypot,373,8206
+invisiblepot,373,8206
+invpot,373,8206
+ipot,373,8206
regenerationleveliipotion,373,8225
regenerateleveliipotion,373,8225
regenleveliipotion,373,8225
@@ -4162,7 +4495,7 @@ healinglevel2pot,373,8229
heallevel2pot,373,8229
healingiipot,373,8229
healiipot,373,8229
-h2potpot,373,8229
+h2pot,373,8229
strengthleveliipotion,373,8233
strongleveliipotion,373,8233
strleveliipotion,373,8233
@@ -4249,6 +4582,31 @@ acidextendedpot,373,8260
posionexpot,373,8260
acidexpot,373,8260
pepot,373,8260
+nightvisionextendedpotion,373,8262
+nvisionextendedpotion,373,8262
+nightvextendedpotion,373,8262
+darkvisionextendedpotion,373,8262
+dvisionextendedpotion,373,8262
+darkvextendedpotion,373,8262
+nightvisionexpotion,373,8262
+nvisionexpotion,373,8262
+nightvexpotion,373,8262
+darkvisionexpotion,373,8262
+dvisionexpotion,373,8262
+darkvexpotion,373,8262
+nightvisionextendedpot,373,8262
+nvisionextendedpot,373,8262
+nightvextendedpot,373,8262
+darkvisionextendedpot,373,8262
+dvisionextendedpot,373,8262
+darkvextendedpot,373,8262
+nightvisionexpot,373,8262
+nvisionexpot,373,8262
+nightvexpot,373,8262
+darkvisionexpot,373,8262
+dvisionexpot,373,8262
+darkvexpot,373,8262
+nepot,373,8262
weaknessextendedpotion,373,8264
weakextendedpotion,373,8264
weaknessexpotion,373,8264
@@ -4280,6 +4638,19 @@ slowextenedpot,373,8266
slownessexpot,373,8266
slowexpot,373,8266
slepot,373,8266
+invisibilityextendedpotion,373,8270
+invisibleextendedpotion,373,8270
+invextendedpotion,373,8270
+invisibilityexpotion,373,8270
+invisibleexpotion,373,8270
+invexpotion,373,8270
+invisibilityextendedpot,373,8270
+invisibleextendedpot,373,8270
+invextendedpot,373,8270
+invisibilityexpot,373,8270
+invisibleexpot,373,8270
+invexpot,373,8270
+iepot,373,8270
regenerationdualbitpotion,373,8289
regeneratedualbitpotion,373,8289
regendualbitpotion,373,8289
@@ -4398,6 +4769,31 @@ splashclearpotion,373,16390
splashclearpot,373,16390
splclearpotion,373,16390
splclearpot,373,16390
+splashnightvisionpotion,373,16390
+splashnvisionpotion,373,16390
+splashnightvpotion,373,16390
+splashdarkvisionpotion,373,16390
+splashdvisionpotion,373,16390
+splashdarkvpotion,373,16390
+splashnightvisionpot,373,16390
+splashnvisionpot,373,16390
+splashnightvpot,373,16390
+splashdarkvisionpot,373,16390
+splashdvisionpot,373,16390
+splashdarkvpot,373,16390
+splnightvisionpotion,373,16390
+splnvisionpotion,373,16390
+splnightvpotion,373,16390
+spldarkvisionpotion,373,16390
+spldvisionpotion,373,16390
+spldarkvpotion,373,16390
+splnightvisionpot,373,16390
+splnvisionpot,373,16390
+splnightvpot,373,16390
+spldarkvisionpot,373,16390
+spldvisionpot,373,16390
+spldarkvpot,373,16390
+spnpot,373,16390
splashclearextendedpotion,373,16391
splashclearexpotion,373,16391
splashclear2potion,373,16391
@@ -4466,6 +4862,19 @@ splashthinpotion,373,16398
splashthinpot,373,16398
splthinpotion,373,16398
splthinpot,373,16398
+splashinvisibilitypotion,373,16398
+splashinvisiblepotion,373,16398
+splashinvpotion,373,16398
+splashinvisibilitypot,373,16398
+splashinvisiblepot,373,16398
+splashinvpot,373,16398
+splinvisibilitypotion,373,16398
+splinvisiblepotion,373,16398
+splinvpotion,373,16398
+splinvisibilitypot,373,16398
+splinvisiblepot,373,16398
+splinvpot,373,16398
+spipot,373,16398
splashthinextendedpotion,373,16399
splashthinexpotion,373,16399
splashthin2potion,373,16399
@@ -4912,6 +5321,55 @@ splacidextendedpot,373,16452
splposionexpot,373,16452
splacidexpot,373,16452
sppepot,373,16452
+splashnightvisionextendedpotion,373,16454
+splashnvisionextendedpotion,373,16454
+splashnightvextendedpotion,373,16454
+splashdarkvisionextendedpotion,373,16454
+splashdvisionextendedpotion,373,16454
+splashdarkvextendedpotion,373,16454
+splashnightvisionextendedpot,373,16454
+splashnvisionextendedpot,373,16454
+splashnightvextendedpot,373,16454
+splashdarkvisionextendedpot,373,16454
+splashdvisionextendedpot,373,16454
+splashdarkvextendedpot,373,16454
+splashnightvisionexpotion,373,16454
+splashnvisionexpotion,373,16454
+splashnightvexpotion,373,16454
+splashdarkvisionexpotion,373,16454
+splashdvisionexpotion,373,16454
+splashdarkvexpotion,373,16454
+splashnightvisionexpot,373,16454
+splashnvisionexpot,373,16454
+splashnightvexpot,373,16454
+splashdarkvisionexpot,373,16454
+splashdvisionexpot,373,16454
+splashdarkvexpot,373,16454
+splnightvisionextendedpotion,373,16454
+splnvisionextendedpotion,373,16454
+splnightvextendedpotion,373,16454
+spldarkvisionextendedpotion,373,16454
+spldvisionextendedpotion,373,16454
+spldarkvextendedpotion,373,16454
+splnightvisionextendedpot,373,16454
+splnvisionextendedpot,373,16454
+splnightvextendedpot,373,16454
+spldarkvisionextendedpot,373,16454
+spldvisionextendedpot,373,16454
+spldarkvextendedpot,373,16454
+splnightvisionexpotion,373,16454
+splnvisionexpotion,373,16454
+splnightvexpotion,373,16454
+spldarkvisionexpotion,373,16454
+spldvisionexpotion,373,16454
+spldarkvexpotion,373,16454
+splnightvisionexpot,373,16454
+splnvisionexpot,373,16454
+splnightvexpot,373,16454
+spldarkvisionexpot,373,16454
+spldvisionexpot,373,16454
+spldarkvexpot,373,16454
+spnepot,373,16454
splashweaknessextendedpotion,373,16456
splashweakextendedpotion,373,16456
splashweaknessexpotion,373,16456
@@ -4971,6 +5429,31 @@ splslowextenedpot,373,16458
splslownessexpot,373,16458
splslowexpot,373,16458
spslepot,373,16458
+splashinvisibilityextendedpotion,373,16462
+splashinvisibleextendedpotion,373,16462
+splashinvextendedpotion,373,16462
+splashinvisibilityextendedpot,373,16462
+splashinvisibleextendedpot,373,16462
+splashinvextendedpot,373,16462
+splashinvisibilityexpotion,373,16462
+splashinvisibleexpotion,373,16462
+splashinvexpotion,373,16462
+splashinvisibilityexpot,373,16462
+splashinvisibleexpot,373,16462
+splashinvexpot,373,16462
+splinvisibilityextendedpotion,373,16462
+splinvisibleextendedpotion,373,16462
+splinvextendedpotion,373,16462
+splinvisibilityextendedpot,373,16462
+splinvisibleextendedpot,373,16462
+splinvextendedpot,373,16462
+splinvisibilityexpotion,373,16462
+splinvisibleexpotion,373,16462
+splinvexpotion,373,16462
+splinvisibilityexpot,373,16462
+splinvisibleexpot,373,16462
+splinvexpot,373,16462
+spiepot,373,16462
splashregenerationdualbitpotion,373,16481
splashregeneratedualbitpotion,373,16481
splashregendualbitpotion,373,16481
@@ -5126,6 +5609,7 @@ icauldronitem,380,0
scauldronitem,380,0
eyeofender,381,0
endereye,381,0
+endeye,381,0
evilendereye,381,0
evileyeofender,381,0
evilenderpearl,381,0
@@ -5191,6 +5675,10 @@ egglavaslime,383,62
egglavacube,383,62
eggmagmacube,383,62
eggmagmaslime,383,62
+bategg,383,65
+eggbat,383,65
+witchegg,383,66
+eggwitch,383,66
pigegg,383,90
eggpig,383,90
sheepegg,383,91
@@ -5243,6 +5731,84 @@ sealedbook,387,0
diary,387,0
ownedbook,387,0
emerald,388,0
+itemframe,389,0
+pictureframe,389,0
+iframe,389,0
+pframe,389,0
+flowerpot,390,0
+pot,390,0
+carrot,391,0
+potato,392,0
+bakedpotato,393,0
+roastedpotato,393,0
+cookedpotato,393,0
+bakepotato,393,0
+roastpotato,393,0
+cookpotato,393,0
+posionouspotato,394,0
+posionpotato,394,0
+emptymap,395,0
+map,395,0
+goldencarrot,396,0
+goldcarrot,396,0
+gcarrot,396,0
+head,397,0
+skeletonhead,397,0
+headskeleton,397,0
+witherhead,397,1
+witherskeletonhead,397,1
+wskeletionhead,397,1
+headwither,397,1
+headwitherskeleton,397,1
+headwskeletion,397,1
+zombiehead,397,2
+headzombie,397,2
+humanhead,397,3
+stevehead,397,3
+headhuman,397,3
+headsteve,397,3
+creeperhead,397,4
+headcreeper,397,4
+carrotonastick,398,0
+carrotonstick,398,0
+netherstar,399,0
+hellstar,399,0
+nstar,399,0
+hstar,399,0
+star,399,0
+pumpkinpie,400,0
+pumpkincake,400,0
+ppie,400,0
+pcake,400,0
+pie,400,0
+fireworkrocket,401,0
+fireworkmissle,401,0
+firework,401,0
+fworkrocket,401,0
+fworkmissle,401,0
+fwork,401,0
+fwrocket,401,0
+fwmissle,401,0
+fireworkstar,402,0
+fworkstar,402,0
+fwstar,402,0
+fireworkball,402,0
+fworkball,402,0
+fwball,402,0
+fireworkpowder,402,0
+fworkpowder,402,0
+fwpowder,402,0
+fireworkcharge,402,0
+fworkcharge,402,0
+fwcharge,402,0
+enchantmentbook,403,0
+enchantedbook,403,0
+enchantingbook,403,0
+enchantbook,403,0
+magicalbook,403,0
+magicbook,403,0
+ebook,403,0
+mbook,403,0
goldmusicrecord,2256,0
goldmusicdisk,2256,0
goldmusicdisc,2256,0
@@ -5782,4 +6348,4 @@ cd11,2266,0
11record,2266,0
11disk,2266,0
11disc,2266,0
-11cd,2266,0 \ No newline at end of file
+11cd,2266,0
diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties
index 4852f2bef..9f27e5eea 100644
--- a/Essentials/src/messages.properties
+++ b/Essentials/src/messages.properties
@@ -2,7 +2,7 @@
# Single quotes have to be doubled: ''
# Translations start here
# by:
-action=\u00a7d* {0} {1}
+action=\u00a75* {0} \u00a75{1}
addedToAccount=\u00a7a{0} has been added to your account.
addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2}
adventure= adventure
@@ -23,7 +23,7 @@ backupStarted=\u00a76Backup started
balance=\u00a7aBalance:\u00a7c {0}
balanceTop=\u00a76Top balances ({0})
banExempt=\u00a74You can not ban that player.
-banFormat=Banned: {0}
+banFormat=\u00a74Banned:\n\u00a7r{0}
banIpAddress=\u00a76Banned IP address
bigTreeFailure=\u00a74Big tree generation failure. Try again on grass or dirt.
bigTreeSuccess= \u00a76Big tree spawned.
@@ -194,7 +194,7 @@ listAmountHidden= \u00a76There are \u00a7c{0}\u00a76/{1}\u00a76 out of maximum \
listGroupTag={0}\u00a7r:
listHiddenTag= \u00a77[HIDDEN]\u00a7r
loadWarpError=\u00a74Failed to load warp {0}
-localFormat=Local: <{0}> {1}
+localFormat=[L]<{0}> {1}
mailClear=\u00a76To mark your mail as read, type\u00a7c /mail clear
mailCleared=\u00a76Mail Cleared!
mailSent=\u00a76Mail sent!
@@ -264,7 +264,7 @@ notRecommendedBukkit= \u00a74* ! * Bukkit version is not the recommended build f
notSupportedYet=Not supported yet.
nothingInHand=\u00a74You have nothing in your hand.
now=now
-nuke=\u00a7dMay death rain upon them
+nuke=\u00a75May death rain upon them
numberRequired=A number goes there, silly.
onlyDayNight=/time only supports day/night.
onlyPlayers=\u00a74Only in-game players can use {0}.
@@ -373,6 +373,8 @@ timeSet=\u00a76Time set in all worlds.
timeSetPermission=\u00a74You are not authorized to set the time.
timeWorldCurrent=\u00a76The current time in\u00a7c {0} \u00a76is \u00a7c{1}
timeWorldSet=\u00a76The time was set to\u00a7c {0} \u00a76in: \u00a7c{1}
+totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
+totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=\u00a76Current TPS = {0}
tradeCompleted=\u00a7aTrade completed.
tradeSignEmpty=\u00a74The trade sign has nothing available for you.
@@ -397,8 +399,8 @@ unvanished=\u00a76You are once again visible.
unvanishedReload=\u00a74A reload has forced you to become visible.
upgradingFilesError=Error while upgrading the files
userDoesNotExist=\u00a74The user\u00a7c {0} \u00a74does not exist.
-userIsAway=\u00a7d{0} \u00a7dis now AFK
-userIsNotAway=\u00a7d{0} \u00a7dis no longer AFK
+userIsAway=\u00a75{0} \u00a75is now AFK
+userIsNotAway=\u00a75{0} \u00a75is no longer AFK
userJailed=\u00a76You have been jailed
userUsedPortal={0} used an existing exit portal.
userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1}
@@ -458,3 +460,21 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
+userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
+teleportationEnabledFor=\u00a76Teleportation enabled for {0}
+teleportationDisabledFor=\u00a76Teleportation disabled for {0}
+kitOnce=\u00a74You can't use that kit again.
+fullStack=\u00a74You already have a full stack
+oversizedTempban=\u00a74You may not ban a player for this period of time.
+recipeNone=No recipes exist for {0}
+invalidNumber=Invalid Number
+recipeBadIndex=There is no recipe by that number
+recipeNothing=nothing
+recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
+recipeFurnace=\u00a76Smelt \u00a7c{0}
+recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
+recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
+recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
+recipeWhere=\u00a76Where: {0}
+recipeShapeless=\u00a76Combine \u00a7c{0}
diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties
index 26e039001..486c085cb 100644
--- a/Essentials/src/messages_cs.properties
+++ b/Essentials/src/messages_cs.properties
@@ -376,6 +376,8 @@ timeSet=Cas nastaven ve vsech svetech.
timeSetPermission=\u00a7cNejsi autorizovany ke zmene casu.
timeWorldCurrent=Ve svete {0} je prave \u00a73{1}
timeWorldSet=Cas byl nastaven na {0} ve: \u00a7c{1}
+totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
+totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Current TPS = {0}
tradeCompleted=\u00a77Vymena kompletni.
tradeSignEmpty=Tato cedule jiz nema dostupny material na vymenu.
@@ -461,3 +463,21 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
+userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
+teleportationEnabledFor=\u00a76Teleportation enabled for {0}
+teleportationDisabledFor=\u00a76Teleportation disabled for {0}
+kitOnce=\u00a74You can't use that kit again.
+fullStack=\u00a74You already have a full stack
+oversizedTempban=\u00a74You may not ban a player for this period of time.
+recipeNone=No recipes exist for {0}
+invalidNumber=Invalid Number
+recipeBadIndex=There is no recipe by that number
+recipeNothing=nothing
+recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
+recipeFurnace=\u00a76Smelt \u00a7c{0}
+recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
+recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
+recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
+recipeWhere=\u00a76Where: {0}
+recipeShapeless=\u00a76Combine \u00a7c{0}
diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties
index 9419ad45e..f69dc4ebb 100644
--- a/Essentials/src/messages_da.properties
+++ b/Essentials/src/messages_da.properties
@@ -373,6 +373,8 @@ timeSet=Tid \u00c3\u00a6ndret i alle verdener.
timeSetPermission=\u00a7cDu har ikke tilladelse til at \u00c3\u00a6ndre tiden.
timeWorldCurrent=Tiden p\u00c3\u00a5 nuv\u00c3\u00a6rende tidspunkt i {0} er \u00a73{1}
timeWorldSet=Tiden blev \u00c3\u00a6ndret til {0} i: \u00a7c{1}
+totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
+totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Current TPS = {0}
tradeCompleted=\u00a77Handel gennemf\u00f8rt.
tradeSignEmpty=Handelsskiltet har udsolgt!
@@ -458,3 +460,21 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
+userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
+teleportationEnabledFor=\u00a76Teleportation enabled for {0}
+teleportationDisabledFor=\u00a76Teleportation disabled for {0}
+kitOnce=\u00a74You can't use that kit again.
+fullStack=\u00a74You already have a full stack
+oversizedTempban=\u00a74You may not ban a player for this period of time.
+recipeNone=No recipes exist for {0}
+invalidNumber=Invalid Number
+recipeBadIndex=There is no recipe by that number
+recipeNothing=nothing
+recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
+recipeFurnace=\u00a76Smelt \u00a7c{0}
+recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
+recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
+recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
+recipeWhere=\u00a76Where: {0}
+recipeShapeless=\u00a76Combine \u00a7c{0}
diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties
index 90e373b33..2d2284542 100644
--- a/Essentials/src/messages_de.properties
+++ b/Essentials/src/messages_de.properties
@@ -373,6 +373,8 @@ timeSet=Zeit in allen Welten gesetzt.
timeSetPermission=\u00a7cDu hast keine Berechtigung die Zeit zu \u00e4ndern.
timeWorldCurrent=Die momentane Zeit in {0} ist \u00a73{1}
timeWorldSet=Die Zeit in \u00a7c{1}\u00a7f wurde zu {0} gesetzt.
+totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
+totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Current TPS = {0}
tradeCompleted=\u00a77Handel abgeschlossen.
tradeSignEmpty=Der Bestand des Trade-Schild ist aufgebraucht.
@@ -458,3 +460,21 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
+userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
+teleportationEnabledFor=\u00a76Teleportation enabled for {0}
+teleportationDisabledFor=\u00a76Teleportation disabled for {0}
+kitOnce=\u00a74You can't use that kit again.
+fullStack=\u00a74You already have a full stack
+oversizedTempban=\u00a74You may not ban a player for this period of time.
+recipeNone=No recipes exist for {0}
+invalidNumber=Invalid Number
+recipeBadIndex=There is no recipe by that number
+recipeNothing=nothing
+recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
+recipeFurnace=\u00a76Smelt \u00a7c{0}
+recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
+recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
+recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
+recipeWhere=\u00a76Where: {0}
+recipeShapeless=\u00a76Combine \u00a7c{0}
diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties
index 4852f2bef..9f27e5eea 100644
--- a/Essentials/src/messages_en.properties
+++ b/Essentials/src/messages_en.properties
@@ -2,7 +2,7 @@
# Single quotes have to be doubled: ''
# Translations start here
# by:
-action=\u00a7d* {0} {1}
+action=\u00a75* {0} \u00a75{1}
addedToAccount=\u00a7a{0} has been added to your account.
addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2}
adventure= adventure
@@ -23,7 +23,7 @@ backupStarted=\u00a76Backup started
balance=\u00a7aBalance:\u00a7c {0}
balanceTop=\u00a76Top balances ({0})
banExempt=\u00a74You can not ban that player.
-banFormat=Banned: {0}
+banFormat=\u00a74Banned:\n\u00a7r{0}
banIpAddress=\u00a76Banned IP address
bigTreeFailure=\u00a74Big tree generation failure. Try again on grass or dirt.
bigTreeSuccess= \u00a76Big tree spawned.
@@ -194,7 +194,7 @@ listAmountHidden= \u00a76There are \u00a7c{0}\u00a76/{1}\u00a76 out of maximum \
listGroupTag={0}\u00a7r:
listHiddenTag= \u00a77[HIDDEN]\u00a7r
loadWarpError=\u00a74Failed to load warp {0}
-localFormat=Local: <{0}> {1}
+localFormat=[L]<{0}> {1}
mailClear=\u00a76To mark your mail as read, type\u00a7c /mail clear
mailCleared=\u00a76Mail Cleared!
mailSent=\u00a76Mail sent!
@@ -264,7 +264,7 @@ notRecommendedBukkit= \u00a74* ! * Bukkit version is not the recommended build f
notSupportedYet=Not supported yet.
nothingInHand=\u00a74You have nothing in your hand.
now=now
-nuke=\u00a7dMay death rain upon them
+nuke=\u00a75May death rain upon them
numberRequired=A number goes there, silly.
onlyDayNight=/time only supports day/night.
onlyPlayers=\u00a74Only in-game players can use {0}.
@@ -373,6 +373,8 @@ timeSet=\u00a76Time set in all worlds.
timeSetPermission=\u00a74You are not authorized to set the time.
timeWorldCurrent=\u00a76The current time in\u00a7c {0} \u00a76is \u00a7c{1}
timeWorldSet=\u00a76The time was set to\u00a7c {0} \u00a76in: \u00a7c{1}
+totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
+totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=\u00a76Current TPS = {0}
tradeCompleted=\u00a7aTrade completed.
tradeSignEmpty=\u00a74The trade sign has nothing available for you.
@@ -397,8 +399,8 @@ unvanished=\u00a76You are once again visible.
unvanishedReload=\u00a74A reload has forced you to become visible.
upgradingFilesError=Error while upgrading the files
userDoesNotExist=\u00a74The user\u00a7c {0} \u00a74does not exist.
-userIsAway=\u00a7d{0} \u00a7dis now AFK
-userIsNotAway=\u00a7d{0} \u00a7dis no longer AFK
+userIsAway=\u00a75{0} \u00a75is now AFK
+userIsNotAway=\u00a75{0} \u00a75is no longer AFK
userJailed=\u00a76You have been jailed
userUsedPortal={0} used an existing exit portal.
userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1}
@@ -458,3 +460,21 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
+userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
+teleportationEnabledFor=\u00a76Teleportation enabled for {0}
+teleportationDisabledFor=\u00a76Teleportation disabled for {0}
+kitOnce=\u00a74You can't use that kit again.
+fullStack=\u00a74You already have a full stack
+oversizedTempban=\u00a74You may not ban a player for this period of time.
+recipeNone=No recipes exist for {0}
+invalidNumber=Invalid Number
+recipeBadIndex=There is no recipe by that number
+recipeNothing=nothing
+recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
+recipeFurnace=\u00a76Smelt \u00a7c{0}
+recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
+recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
+recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
+recipeWhere=\u00a76Where: {0}
+recipeShapeless=\u00a76Combine \u00a7c{0}
diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties
index b3b098d91..7915968fb 100644
--- a/Essentials/src/messages_es.properties
+++ b/Essentials/src/messages_es.properties
@@ -10,10 +10,10 @@ alertBroke=Roto:
alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} en: {3}
alertPlaced=Situado:
alertUsed=Usado:
-antiBuildBreak=\u00a74You are not permitted to break {0} blocks here.
-antiBuildInteract=\u00a74You are not permitted to interact with {0}.
-antiBuildPlace=\u00a74You are not permitted to place {0} here.
-antiBuildUse=\u00a74You are not permitted to use {0}.
+antiBuildBreak=\u00a74Tu no tines permitido romper {0} bloques aca.
+antiBuildInteract=\u00a74Tu no tienes permitido interactuar con {0}.
+antiBuildPlace=\u00a74Tu no tienes permitido poner {0} aca.
+antiBuildUse=\u00a74Tu no tienes permitido usar {0}.
autoAfkKickReason=Has sido echado por ausentarte mas de {0} minutos.
backAfterDeath=\u00a77Usa el comando /back para volver al punto en el que moriste.
backUsageMsg=\u00a77Volviendo a la localizacion anterior.
@@ -28,7 +28,7 @@ banIpAddress=\u00a77Direccion IP baneada.
bigTreeFailure=\u00a7cBig Generacion de arbol fallida. Prueba de nuevo en hierba o arena.
bigTreeSuccess= \u00a77Big Arbol generado.
blockList=Essentials le ha cedido los siguientes comandos a otros plugins:
-broadcast=[\u00a7cAnuncio\u00a7f]\u00a7a {0}
+broadcast=\u00a7c[\u00a76Broadcast\u00a7c]\u00a7a {0}
buildAlert=\u00a7cNo tienes permisos para construir.
bukkitFormatChanged=Version de formato de Bukkit cambiado. Version no comprobada.
burnMsg=\u00a77Has puesto {0} en fuego durante {1} segundos.
@@ -36,16 +36,16 @@ canTalkAgain=\u00a77Ya puedes hablar de nuevo.
cantFindGeoIpDB=No se puede encontrar la base de datos del Geo IP.
cantReadGeoIpDB=Error al intentar leer la base de datos del Geo IP.
cantSpawnItem=\u00a7cNo tienes acceso para producir este objeto {0}
-chatTypeAdmin=[A]
-chatTypeLocal=[L]
+chatTypeAdmin=
+chatTypeLocal=
chatTypeSpy=[Espia]
commandFailed=Comando {0} fallado:
commandHelpFailedForPlugin=Error obteniendo ayuda para: {0}
-commandNotLoaded=\u00a7cCommand {0} esta cargado incorrectamente.
+commandNotLoaded=\u00a7cComando {0} esta cargado incorrectamente.
compassBearing=\u00a77Bearing: {0} ({1} grados).
configFileMoveError=Error al mover config.yml para hacer una copia de seguridad de la localizacion.
configFileRenameError=Error al renombrar archivo temp a config.yml.
-connectedPlayers=Jugadores conectados:
+connectedPlayers=Jugadores conectados:
connectionFailed=Error al abrir conexion.
cooldownWithMessage=\u00a7cTiempo restante: {0}
corruptNodeInConfig=\u00a74Notice: Tu archivo de configuracion tiene un nodo {0} incorrecto.
@@ -118,7 +118,7 @@ hatArmor=\u00a7cNo puedes usar este item como sombrero!
hatEmpty=\u00a7cNo estas usando un sombrero.
hatFail=\u00a7cDebes tener un item en tu mano para usarlo de sombrero.
hatPlaced=\u00a7eDisfruta tu nuevo sombrero!
-hatRemoved=\u00a7eYour hat has been removed.
+hatRemoved=\u00a7eTu sombrero a sido removido.
haveBeenReleased=\u00a77Has sido liberado.
heal=\u00a77Has sido curado.
healOther=\u00a77Has curado a {0}.
@@ -157,7 +157,7 @@ inventoryClearedOthers=\u00a77Inventario de \u00a7c{0}\u00a77 limpiado.
is=es
itemCannotBeSold=Ese objeto no puede ser vendido al servidor.
itemMustBeStacked=El objeto tiene que ser intercambiado en pilas. Una cantidad de 2s seria de dos pilas, etc.
-itemNames=Item short names: {0}
+itemNames=Articulo nombres cortos: {0}
itemNotEnough1=\u00a7cNo tienes suficientes ejemplares de ese objeto para venderlo.
itemNotEnough2=\u00a77Si pensabas en vender todos tus objetos de ese tipo, usa /sell nombredeobjeto
itemNotEnough3=\u00a77/sell nombredeobjeto -1 vendera todos excepto un objeto, etc.
@@ -188,10 +188,10 @@ kitTimed=\u00a7c No puedes usar ese kit de nuevo para otro{0}.
kits=\u00a77Kits: {0}
lightningSmited=\u00a77Acabas de ser golpeado.
lightningUse=\u00a77Golpeando a {0}
-listAfkTag = \u00a77[AFK]\u00a7f
+listAfkTag = \u00a77[Lejos]\u00a7f
listAmount = \u00a79Hay \u00a7c{0}\u00a79 jugadores de un maximo de \u00a7c{1}\u00a79 jugadores online.
listAmountHidden = \u00a79Hay \u00a7c{0}\u00a79 jugadores de un maximo de \u00a7c{1}\u00a79 jugadores online.
-listGroupTag={0}\u00a7f:
+listGroupTag={0}\u00a7f:
listHiddenTag = \u00a77[ESCONDIDO]\u00a7f
loadWarpError=Error al cargar el teletransporte {0}
localFormat=Local: <{0}> {1}
@@ -218,7 +218,7 @@ moneyTaken={0} han sido sacados de tu cuenta bancaria.
month=mes
months=meses
moreThanZero=Las cantidades han de ser mayores que 0.
-moveSpeed=\u00a77Set {0} speed to {1} for {2}.
+moveSpeed=\u00a77Has puesto {0} velocidad a {1} por {2}.
msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
muteExempt=\u00a7cNo puedes silenciar a ese jugador.
mutedPlayer=Player {0} silenciado.
@@ -251,7 +251,7 @@ noPendingRequest=No tienes ninguna peticion pendiente.
noPerm=\u00a7cNo tienes el permiso de \u00a7f{0}\u00a7c.
noPermToSpawnMob=\u00a7cNo tienes permisos para spawnear a este mob.
noPlacePermission=\u00a7cNo tienes permiso para situar ese bloque en ese lugar.
-noPowerTools=You have no power tools assigned.
+noPowerTools=Usted no tiene ningunas herramientas el\u00c3\u00a9ctricas asignadas.
noRules=\u00a7cNo hay reglas especificadas todavia.
noWarpsDefined=No hay teletransportes definidos aun.
none=ninguno
@@ -262,7 +262,7 @@ notEnoughMoney=No tienes el dinero suficiente.
notFlying=no volando
notRecommendedBukkit=* ! * La version de bukkit no es la recomendada para esta version de Essentials.
notSupportedYet=No tiene soporte por el momento.
-nothingInHand = \u00a7cNo tienes anda en tu mano.
+nothingInHand = \u00a7cNo tienes nada en tu mano.
now=ahora
nuke=Que la muerta afecte al que no despierte.
numberRequired=Un numero es necesario, amigo .
@@ -304,8 +304,8 @@ powerToolRemove=Comando \u00a7c{0}\u00a7f borrado desde {1}.
powerToolRemoveAll=Todos los comandos borrados desde {0}.
powerToolsDisabled=Todas tus herramientas de poder han sido desactivadas.
powerToolsEnabled=Todas tus herramientas de poder han sido activadas.
-protectionOwner=\u00a76[EssentialsProtect] Due&ntilde;o de la proteccion: {0}
-questionFormat=\u00a77[Pregunta]\u00a7f {0}
+protectionOwner=\u00a76[EssentialsProtect] Dueno de la proteccion: {0}
+questionFormat=\u00a7c[Pregunta]\u00a7f {0}
readNextPage=escribe /{0} {1} para leer la prox. pagina.
reloadAllPlugins=\u00a77Todos los plugins recargados.
removed=\u00a77{0} entidades removidas.
@@ -330,7 +330,7 @@ serverFull=Servidor lleno.
serverTotal=Server Total: {0}
setSpawner=Cambiado tipo de spawner a {0}
sheepMalformedColor=Color malformado.
-shoutFormat=\u00a77[Shout]\u00a7f {0}
+shoutFormat=\u00a7a[Mundo]\u00a7f {0}
signFormatFail=\u00a74[{0}]
signFormatSuccess=\u00a71[{0}]
signFormatTemplate=[{0}]
@@ -343,7 +343,7 @@ spawned=nacido
sudoExempt=No puedes usar el comando sudo con este user.
sudoRun=Forzando {0} a ejecutar: /{1} {2}
suicideMessage=\u00a77Adios mundo cruel...
-suicideSuccess= \u00a77{0} se quito su propia vida.
+suicideSuccess= \u00a77{0} se tiro desde un rascacielos.
survival=supervivencia
takenFromAccount=\u00a7c{0} han sido sacados de tu cuenta.
takenFromOthersAccount=\u00a7c{0} han sidos sacados de la cuenta de {1}\u00a7c . Nuevo presupuesto: {2}
@@ -373,6 +373,8 @@ timeSet=Tiempo establecido en todos los mundos.
timeSetPermission=\u00a7cNo estas autorizado para establecer la hora.
timeWorldCurrent=La hora actual en {0} es \u00a73{1}
timeWorldSet=La hora ha sido establecida a {0} en: \u00a7c{1}
+totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
+totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=TPS actual = {0}
tradeCompleted=\u00a77Intercambio completado.
tradeSignEmpty=Esta tienda no tiene nada disponible para ti.
@@ -423,7 +425,7 @@ weatherStormFor=\u00a77Has establecido el tiempo como tormenta en este {1} duran
weatherSun=\u00a77Has establecido el tiempo como sol en este mundo.
weatherSunFor=\u00a77Has establecido el tiempo como sol en este {1} durante {0} segundos.
whoisAFK=\u00a76 - AFK:\u00a7f {0}
-whoisBanned=\u00a76 - Banned:\u00a7f {0}
+whoisBanned=\u00a76 - Baneado:\u00a7f {0}
whoisExp=\u00a76 - Exp:\u00a7f {0} (Nivel {1})
whoisFly=\u00a76 - Modo de vuelo:\u00a7f {0} ({1})
whoisGamemode=\u00a76 - Modo de juego:\u00a7f {0}
@@ -441,20 +443,38 @@ whoisTop=\u00a76 ====== WhoIs:\u00a7f {0} \u00a76======
worth=\u00a77Pila de {0} con valor de \u00a7c{1}\u00a77 ({2} objeto(s) a {3} cada uno)
worthMeta=\u00a77Pila de {0} con metadata de {1} , con valor de \u00a7c{2}\u00a77 ({3} objeto(s) a {4} cada uno)
worthSet=Establecer el valor de un valor
-year=a&ntilde;o
-years=a&ntilde;os
+year=ano
+years=anos
youAreHealed=\u00a77Has sido curado.
youHaveNewMail=\u00a7cTienes {0} mensajes!\u00a7f Pon \u00a77/mail read\u00a7f para ver tus emails no leidos!.
-posX=\u00a76X: {0} (+East <-> -West)
-posY=\u00a76Y: {0} (+Up <-> -Down)
-posZ=\u00a76Z: {0} (+South <-> -North)
-posYaw=\u00a76Yaw: {0} (Rotation)
-posPitch=\u00a76Pitch: {0} (Head angle)
-distance=\u00a76Distance: {0}
-giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76.
+posX=\u00a76X: {0} (+Este <-> -Oeste)
+posY=\u00a76Y: {0} (+Arriba <-> -abajo)
+posZ=\u00a76Z: {0} (+Sur <-> -Norte)
+posYaw=\u00a76gui\u00c3\u00b1ar: {0} (Rotacion)
+posPitch=\u00a76Tono: {0} (Angulo de cabeza)
+distance=\u00a76Distancia: {0}
+giveSpawn=\u00a76Se a dado\u00a7c {0} \u00a76de\u00a7c {1} a\u00a7c {2}\u00a76.
warpList={0}
uptime=\u00a76Uptime:\u00a7c {0}
-antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
-antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
-gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
-invalidHomeName=\u00a74Invalid home name
+antiBuildCraft=\u00a74No se le permite crear\u00a7c {0}\u00a74.
+antiBuildDrop=\u00a74No se le permite botar \u00a7c {0}\u00a74.
+gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entidades
+invalidHomeName=\u00a74Nombre de casa invalido
+invalidWarpName=\u00a74Nombre de warp invalido
+userUnknown=\u00a74Peligro: El jugador '\u00a7c{0}\u00a74' Nunca a ingresado a este servidor.
+teleportationEnabledFor=\u00a76Teleportation enabled for {0}
+teleportationDisabledFor=\u00a76Teleportation disabled for {0}
+kitOnce=\u00a74You can't use that kit again.
+fullStack=\u00a74You already have a full stack
+oversizedTempban=\u00a74You may not ban a player for this period of time.
+recipeNone=No recipes exist for {0}
+invalidNumber=Invalid Number
+recipeBadIndex=There is no recipe by that number
+recipeNothing=nothing
+recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
+recipeFurnace=\u00a76Smelt \u00a7c{0}
+recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
+recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
+recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
+recipeWhere=\u00a76Where: {0}
+recipeShapeless=\u00a76Combine \u00a7c{0}
diff --git a/Essentials/src/messages_fi.properties b/Essentials/src/messages_fi.properties
index 8dd5343ad..05da0a0d6 100644
--- a/Essentials/src/messages_fi.properties
+++ b/Essentials/src/messages_fi.properties
@@ -373,6 +373,8 @@ timeSet=Aika asetettu kaikissa maailmoissa.
timeSetPermission=\u00a7cSinulla ei ole lupaa vaihtaa aikaa.
timeWorldCurrent=T\u00e4m\u00e4nhetkinen aika maailmassa {0} on \u00a73{1}
timeWorldSet=Aika vaihdettiin {0} maailmassa: \u00a7c{1}
+totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
+totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=T\u00e4m\u00e4nhetkinen TPS = {0}
tradeCompleted=\u00a77Vaihto suoritettu.
tradeSignEmpty=Vaihtokyltill\u00e4 ei ole mit\u00e4\u00e4n tarjolla sinulle.
@@ -458,3 +460,21 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
+userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
+teleportationEnabledFor=\u00a76Teleportation enabled for {0}
+teleportationDisabledFor=\u00a76Teleportation disabled for {0}
+kitOnce=\u00a74You can't use that kit again.
+fullStack=\u00a74You already have a full stack
+oversizedTempban=\u00a74You may not ban a player for this period of time.
+recipeNone=No recipes exist for {0}
+invalidNumber=Invalid Number
+recipeBadIndex=There is no recipe by that number
+recipeNothing=nothing
+recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
+recipeFurnace=\u00a76Smelt \u00a7c{0}
+recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
+recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
+recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
+recipeWhere=\u00a76Where: {0}
+recipeShapeless=\u00a76Combine \u00a7c{0}
diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties
index 7468952a6..82566c31e 100644
--- a/Essentials/src/messages_fr.properties
+++ b/Essentials/src/messages_fr.properties
@@ -3,31 +3,31 @@
# Translations start here
# by: L\u00e9a Gris
action=* {0} {1}
-addedToAccount=\u00a7a{0} a \u00e9t\u00e9 rajout\u00e9 \u00e0 votre compte.
-addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2}
+addedToAccount=\u00a7a{0} ont \u00e9t\u00e9 ajout\u00e9 \u00e0 votre compte.
+addedToOthersAccount=\u00a7a{0} ajout\u00e9s au compte de {1}\u00a7a. Nouveau solde : {2}
adventure = adventure
alertBroke=a cass\u00e9 :
alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} \u00e0:{3}
alertPlaced=a plac\u00e9 :
alertUsed=a utilis\u00e9 :
-antiBuildBreak=\u00a74You are not permitted to break {0} blocks here.
-antiBuildInteract=\u00a74You are not permitted to interact with {0}.
-antiBuildPlace=\u00a74You are not permitted to place {0} here.
-antiBuildUse=\u00a74You are not permitted to use {0}.
+antiBuildBreak=\u00a74Vous n'\u00eates pas autoris\u00e9s \u00e0 casser des blocs de {0} ici.
+antiBuildInteract=\u00a74Vous n'\u00eates pas autoris\u00e9s \u00e0 interagir avec {0}.
+antiBuildPlace=\u00a74Vous n'\u00eates pas autoris\u00e9s \u00e0 placer {0} ici.
+antiBuildUse=\u00a74Vous n'\u00eates pas autoris\u00e9s \u00e0 utliser {0}.
autoAfkKickReason=Vous avez \u00e9t\u00e9 \u00e9ject\u00e9 pour inactivit\u00e9e sup\u00e9rieure \u00e0 {0} minutes.
backAfterDeath=\u00a77Utilisez la commande /back pour retourner \u00e0 l''endroit ou vous \u00eates mort.
-backUsageMsg=\u00a77Retour \u00e0 votre emplacement pr\u00e9c\u00c3\u00a8dent.
-backupDisabled=An external backup script has not been configured.
+backUsageMsg=\u00a77Retour \u00e0 votre emplacement pr\u00e9c\u00e9dent.
+backupDisabled=Aucun script de backup externe n'a \u00e9t\u00e9 configur\u00e9.
backupFinished=Sauvegarde termin\u00e9
backupStarted=D\u00e9but de la sauvegarde...
balance=\u00a77Solde : {0}
balanceTop=\u00a77Meilleurs soldes au ({0})
banExempt=\u00a77Vous ne pouvez pas bannir ce joueur.
-banFormat=Banned: {0}
+banFormat=Banni : {0}
banIpAddress=\u00a77Adresse IP bannie.
bigTreeFailure=\u00a7c\u00c9chec de la g\u00e9n\u00e9ration du gros arbre. Essayez de nouveau sur de la terre ou de l'herbe.
bigTreeSuccess=\u00a77Gros arbre cr\u00e9e.
-blockList=Essentials relayed the following commands to another plugin:
+blockList=Essentials a relay\u00e9 les commandes suivantes \u00e0 un autre plugin :
broadcast=[\u00a7cMessage\u00a7f]\u00a7a {0}
buildAlert=\u00a7cVous n'avez pas la permission de construire.
bukkitFormatChanged=Le format de la version de Bukkit a \u00e9t\u00e9 chang\u00e9. La version n''a pas \u00e9t\u00e9 v\u00e9rifi\u00e9e.
@@ -35,7 +35,7 @@ burnMsg=\u00a77Vous avez enflamm\u00e9 {0} pour {1} seconde(s).
canTalkAgain=\u00a77Vous pouvez de nouveau parler.
cantFindGeoIpDB=N'arrive pas \u00e0 trouver la base de donn\u00e9es GeoIP!
cantReadGeoIpDB=Echec de la lecture de la base de donn\u00e9es GeoIP!
-cantSpawnItem=\u00a7cVous n''avez pas le droit de faire appara\u00c3\u00aetre {0}
+cantSpawnItem=\u00a7cVous n''avez pas le droit de faire appara\u00eetre {0}
chatTypeAdmin=[A]
chatTypeLocal=[L]
chatTypeSpy=[Spy]
@@ -46,15 +46,15 @@ compassBearing=\u00a77Orientation : {0} ({1} degr\u00e9s).
configFileMoveError=\u00c9chec du d\u00e9placement de config.yml vers l'emplacement de sauvegarde.
configFileRenameError=\u00c9chec du changement de nom du fichier temporaire de config.yml
connectedPlayers=Joueurs connect\u00e9s :
-connectionFailed=\u00c9chec de l'ouverture de la connexion.
+connectionFailed=\u00c9chec de la connexion.
cooldownWithMessage=\u00a7cR\u00e9utilisation : {0}
corruptNodeInConfig=\u00a74Annonce : Votre fichier de configuration a un {0} n\u0153ud corrompu.
-couldNotFindTemplate=Le mod\u00c3\u00a8le {0} est introuvable
-creatingConfigFromTemplate=Cr\u00e9ation de la configuration \u00e0 partir du mod\u00c3\u00a8le : {0}
+couldNotFindTemplate=Le mod\u00e8le {0} est introuvable
+creatingConfigFromTemplate=Cr\u00e9ation de la configuration \u00e0 partir du mod\u00e8le : {0}
creatingEmptyConfig=Cr\u00e9ation d''une configuration vierge : {0}
creative=cr\u00e9atif
currency={0}{1}
-currentWorld=Current World: {0}
+currentWorld=Monde actuel : {0}
day=jour
days=jours
defaultBanReason=Le marteau du bannissement a frapp\u00e9 !
@@ -62,7 +62,7 @@ deleteFileError=Le fichier {0} n''a pas pu \u00eatre supprim\u00e9
deleteHome=\u00a77La r\u00e9sidence {0} a \u00e9t\u00e9 supprim\u00e9e.
deleteJail=\u00a77La prison {0} a \u00e9t\u00e9 supprim\u00e9e.
deleteWarp=\u00a77Warp {0} supprim\u00e9.
-deniedAccessCommand=L''acc\u00c3\u00a8s \u00e0 la commande a \u00e9t\u00e9 refus\u00e9 pour {0}.
+deniedAccessCommand=L''acc\u00e8s \u00e0 la commande a \u00e9t\u00e9 refus\u00e9 pour {0}.
dependancyDownloaded=[Essentials] Fichier {0} correctement t\u00e9l\u00e9charg\u00e9.
dependancyException=[Essentials] Une erreur est survenue lors de la tentative de t\u00e9l\u00e9chargement.
dependancyNotFound=[Essentials] Une d\u00e9pendance requise n'a pas \u00e9t\u00e9 trouv\u00e9e, t\u00e9l\u00e9chargement en cours.
@@ -72,25 +72,25 @@ 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.
+disabledToSpawnMob=L'invacation de ce monstre a \u00e9t\u00e9 d\u00e9sactiv\u00e9e dans le fichier de configuration.
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 (Pays : 0.6 Mo, villes : 20Mo)
duplicatedUserdata=Donn\u00e9e utilisateur dupliqu\u00e9e : {0} et {1}
-durability=\u00a77This tool has \u00a7c{0}\u00a77 uses left
+durability=\u00a77Cet outil a \u00a7c{0}\u00a77 usages restants
enableUnlimited=\u00a77Quantit\u00e9 illimit\u00e9e de {0} \u00e0 {1}.
enabled=activ\u00e9
enchantmentApplied = \u00a77L''enchantement {0} a \u00e9t\u00e9 appliqu\u00e9 \u00e0 l''objet dans votre main.
-enchantmentNotFound = \u00a7cEnchantement non-trouv\u00e9
+enchantmentNotFound = \u00a7cEnchantement non trouv\u00e9
enchantmentPerm = \u00a7cVous n''avez pas les droits pour {0}.
-enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item in hand.
-enchantments = \u00a77Enchantments : {0}
+enchantmentRemoved = \u00a77L'enchantement {0} de l'item dans votre main a \u00e9t\u00e9 supprim\u00e9.
+enchantments = \u00a77Enchantements : {0}
errorCallingCommand=Erreur en appelant la commande /{0}
errorWithMessage=\u00a7cErreur : {0}
essentialsHelp1=Le fichier est corrompuet Essentials ne peut l'ouvrir. Essentials est maintenant d\u00e9sactiv\u00e9. Si vous ne pouvez corriger vous-m\u00eame, aller \u00e0 http://tiny.cc/EssentialsChat
essentialsHelp2=Le fichier est corrompuet Essentials ne peut l'ouvrir. Essentials est maintenant d\u00e9sactiv\u00e9. Si vous ne pouvez corriger vous-m\u00eame, tapez /essentialshelp ou aller \u00e0 http://tiny.cc/EssentialsChat
essentialsReload=\u00a77Essentials {0} a \u00e9t\u00e9 recharg\u00e9.
-exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up.
-expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp.
+exp=\u00a7c{0} \u00a77a\u00a7c {1} \u00a77exp (niveau\u00a7c {2}\u00a77) et a besoin de\u00a7c {3} \u00a77pour monter d'un niveau.
+expSet=\u00a7c{0} \u00a77a maintenant\u00a7c {1} \u00a77exp.
extinguish=\u00a77Vous cessez de br\u00fbler.
extinguishOthers=\u00a77Vous avez \u00e9teint la combustion de {0}.
failedToCloseConfig=Echec de la fermeture de la configuration {0}
@@ -100,7 +100,7 @@ false=\u00a74false\u00a7f
feed=\u00a77Vous avez \u00e9t\u00e9 rassasi\u00e9.
feedOther=\u00a77 est rassasi\u00e9 {0}.
fileRenameError=Echec du changement de nom de {0}
-flyMode=\u00a77Set fly mode {0} for {1}.
+flyMode=\u00a77Fly mode {0} pour {1} d\u00e9fini.
flying=flying
foreverAlone=\u00a7cVous n''avez personne \u00e0 qui r\u00e9pondre
freedMemory=A lib\u00e9r\u00e9 {0} Mo.
@@ -114,21 +114,21 @@ geoipJoinFormat=Joueur {0} vient de {1}
godDisabledFor=d\u00e9sactiv\u00e9 pour {0}
godEnabledFor=activ\u00e9 pour {0}
godMode=\u00a77Mode Dieu {0}.
-hatArmor=\u00a7cError, you cannot use this item as a hat!
-hatEmpty=\u00a7cYou are not wearing a hat.
-hatFail=\u00a7cYou must have something to wear in your hand.
-hatPlaced=\u00a7eEnjoy your new hat!
-hatRemoved=\u00a7eYour hat has been removed.
+hatArmor=\u00a7cErreur, vous ne pouvez pas utliser cet item comme chapeau !
+hatEmpty=\u00a7cVous ne portez pas de chapeau.
+hatFail=\u00a7cVous devez avoir quelque chose \u00e0 porter dans votre main.
+hatPlaced=\u00a7eProfitez bien de votre nouveau chapeau !
+hatRemoved=\u00a7eVotre chapeau a \u00e9t\u00e9 retir\u00e9.
haveBeenReleased=\u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9.
heal=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
healOther=\u00a77{0} a \u00e9t\u00e9 soign\u00e9.
helpConsole=Pour voir l''aide tapez ?
helpFrom=\u00a77Commands from {0}:
helpLine=\u00a76/{0}\u00a7f: {1}
-helpMatching=\u00a77Commands matching "{0}":
+helpMatching=\u00a77Commandes correspondant \u00e0 "{0}" :
helpOp=\u00a7c[Aide Admin]\u00a7f \u00a77{0} : \u00a7f {1}
helpPages=Page \u00a7c{0}\u00a7f sur \u00a7c{1}\u00a7f.
-helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1}
+helpPlugin=\u00a74{0}\u00a7f: Aide Plugin : /help {1}
holeInFloor=Trou dans le Sol.
homeSet=\u00a77R\u00e9sidence d\u00e9finie.
homeSetToBed=\u00a77Votre r\u00e9sidence est d\u00e9sormais li\u00e9e \u00e0 ce lit.
@@ -147,8 +147,8 @@ invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu.
invSee=Vous voyez l''inventaire de {0}.
invSeeHelp=Utilisez /invsee pour revenir \u00e0 votre inventaire.
invalidCharge=\u00a7cCharge invalide.
-invalidHome=Home {0} doesn't exist
-invalidMob=Mauvias type de cr\u00e9ature.
+invalidHome=La r\u00e9sidence {0} n'existe pas
+invalidMob=Mauvais type de cr\u00e9ature.
invalidServer=Serveur non valide.
invalidSignLine=La ligne {0} du panneau est invalide.
invalidWorld=\u00a7cMonde invalide.
@@ -173,11 +173,11 @@ jailNotExist=Cette prison n'existe pas.
jailReleased=\u00a77Joueur \u00a7e{0}\u00a77 lib\u00e9r\u00e9.
jailReleasedPlayerNotify=\u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9 !
jailSentenceExtended=Dur\u00e9e d''emprisonnement rallong\u00e9e de : {0}
-jailSet=\u00a77La prison {0} a \u00e9t\u00e9 cr\u00e9\u00e9.
+jailSet=\u00a77La prison {0} a \u00e9t\u00e9 cr\u00e9\u00e9e.
jumpError=\u00c7a aurait pu faire mal au cerveau de votre ordinateur.
kickDefault=\u00c9ject\u00e9 du serveur
kickExempt=\u00a77Vous ne pouvez pas \u00e9jecter ce joueur.
-kickedAll=\u00a7cKicked all players from server
+kickedAll=\u00a7cTous les joueurs ont \u00e9t\u00e9 \u00e9ject\u00e9s
kill=\u00a77Tu\u00e9 {0}.
kitError2=\u00a7cCe kit n'existe pas ou a \u00e9t\u00e9 mal d\u00e9fini.
kitError=\u00a7cIl n'y a pas de kits valides.
@@ -193,14 +193,14 @@ listAmount = \u00a79Il y a \u00a7c{0}\u00a79 joueurs en ligne sur \u00a7c{1}\u00
listAmountHidden = \u00a79Il y a \u00a7c{0}\u00a77/{1}\u00a79 sur un maximum de \u00a7c{2}\u00a79 joueurs en ligne.
listGroupTag={0}\u00a7f:
listHiddenTag = \u00a77[MASQU\u00c9]\u00a7f
-loadWarpError=\u00c9chec du chargement du point de t\u00e9l\u00e9portation {0}.
-localFormat=Locale : <{0}> {1}
+loadWarpError=\u00c9chec du chargement du warp {0}.
+localFormat=Local : <{0}> {1}
mailClear=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear
mailCleared=\u00a77Courrier supprim\u00e9 !
mailSent=\u00a77Courrier envoy\u00e9 !
markMailAsRead=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear
markedAsAway=\u00a77Vous \u00eates d\u00e9sormais AFK.
-markedAsNotAway=\u00a77Vous n'\u00eates d\u00e9sormais plus AFK.
+markedAsNotAway=\u00a77Vous n'\u00eates plus AFK.
maxHomes=Vous ne pouvez pas cr\u00e9er plus de {0} r\u00e9sidences.
mayNotJail=\u00a7cVous ne pouvez pas emprisonner cette personne.
me=moi
@@ -213,7 +213,7 @@ mobSpawnLimit=Quantit\u00e9 de cr\u00e9atures limit\u00e9 \u00e0 au maximum du s
mobSpawnTarget=Le bloc cible doit \u00eatre un g\u00e9n\u00e9rateur de cr\u00e9atures.
mobsAvailable=\u00a77cr\u00e9atures : {0}
moneyRecievedFrom=\u00a7a{0} a \u00e9t\u00e9 re\u00e7u de {1}
-moneySentTo=\u00a7a{0} a \u00e9t\u00e9 envoy\u00e9 \u00e0 {1}
+moneySentTo=\u00a7a{0} ont \u00e9t\u00e9 envoy\u00e9s \u00e0 {1}
moneyTaken={0} pr\u00e9lev\u00e9(s) de votre compte.
month=mois
months=mois
@@ -233,12 +233,12 @@ nickNamesAlpha=\u00a7cLes surnoms doivent \u00eatre alphanum\u00e9riques.
nickNoMore=\u00a7 Vous n'avez plus de surnom.
nickOthersPermission=\u00a7cVous n'avez pas la permission de changer le surnom des autres.
nickSet=\u00a77Votre surnom est maintenant \u00a7c{0}
-noAccessCommand=\u00a7cVous n'avez pas acc\u00c3\u00a8s \u00e0 cette commande.
+noAccessCommand=\u00a7cVous n'avez pas acc\u00e8s \u00e0 cette commande.
noAccessPermission=\u00a7cVous n''avez pas la permissions d''acc\u00e9der \u00e0 cette {0}
-noBreakBedrock=You are not allowed to destroy bedrock.
+noBreakBedrock=Vous n'\u00eates pas autoris\u00e9s \u00e0 d\u00e9truire la bedrock.
noDestroyPermission=\u00a7cVous n''avez pas la permission de d\u00e9truire ce {0}.
-noDurability=\u00a7cThis item does not have a durability.
-noGodWorldWarning=\u00a7cWarning! Le mode Dieu est d\u00e9sactiv\u00e9 dans ce monde.
+noDurability=\u00a7cCet item n'a pas de durabilit\u00e9.
+noGodWorldWarning=\u00a7cAttention ! Le mode dieu est d\u00e9sactiv\u00e9 dans ce monde.
noHelpFound=\u00a7cAucune commande correspondante.
noHomeSet=Vous n'avez pas d\u00e9fini de r\u00e9sidence.
noHomeSetPlayer=Le joueur n'a pas d\u00e9fini sa r\u00e9sidence.
@@ -250,43 +250,43 @@ noNewMail=\u00a77Vous n'avez pas de courrier.
noPendingRequest=Vous n'avez pas de requ\u00eate non lue.
noPerm=\u00a7cVous n''avez pas la permission \u00a7f{0}\u00a7c.
noPermToSpawnMob=\u00a7cVous n'avez pas la permission d'invoquer cette cr\u00e9ature.
-noPlacePermission=\u00a7cVous n'avez pas la permission de placer un bloc pr\u00c3\u00a8 de cette pancarte.
+noPlacePermission=\u00a7cVous n'avez pas la permission de placer un bloc pr\u00e8s de cette pancarte.
noPowerTools=Vous n'avez pas d'outil macro associ\u00e9.
noRules=\u00a7cIl n'y a pas encore de r\u00e8gles d\u00e9finies.
-noWarpsDefined=Aucun point de t\u00e9l\u00e9portation d\u00e9fini.
+noWarpsDefined=Aucun warp d\u00e9fini.
none=aucun
notAllowedToQuestion=\u00a7cVous n'\u00eates pas autoris\u00e9 \u00e0 poser des questions.
notAllowedToShout=\u00a7cVous n'\u00eates pas autoris\u00e9 \u00e0 crier.
notEnoughExperience=Vous n'avez pas assez d'exp\u00e9rience.
notEnoughMoney=Vous n'avez pas les fonds n\u00e9cessaires.
notFlying=not flying
-notRecommendedBukkit=* ! * La version de Bukkit n'est pas celle qui est recommand\u00e9 pour cette version de Essentials.
+notRecommendedBukkit=* ! * Cette version de Bukkit n'est pas recommand\u00e9 pour cette version de Essentials.
notSupportedYet=Pas encore pris en charge.
nothingInHand = \u00a7cVous n'avez rien en main.
now=maintenant
nuke=Que la mort s'abatte sur eux !
-numberRequired=Il faut fournir un nombre ici.
+numberRequired=Un nombre est requis ici.
onlyDayNight=/time ne supporte que (jour) day/night (nuit).
-onlyPlayers=Seulement les joueurs en jeu peuvent utiliser {0}.
+onlyPlayers=Seuls les joueurs en jeu peuvent utiliser {0}.
onlySunStorm=/weather ne supporte que (soleil) sun/storm (temp\u00eate).
-orderBalances=Classement des balance de {0} utilisateurs, patientez ...
+orderBalances=Classement des soldes des {0} joueurs, patientez ...
pTimeCurrent=Pour \u00a7e{0}\u00a7f l''heure est {1}.
pTimeCurrentFixed=L''heure de \u00a7e{0}\u00a7f est fix\u00e9e \u00e0 {1}.
pTimeNormal=\u00a7fPour \u00a7e{0}\u00a7f l'heure est normale et correspond au server.
pTimeOthersPermission=\u00a7cVous n'etes pas autoris\u00e9 \u00e0 changer l'heure des autres joueurs.
-pTimePlayers=Ces joueurs ont leur propre horraire :
+pTimePlayers=Ces joueurs ont leur propre horaire :
pTimeReset=l''heure a \u00e9t\u00e9 r\u00e9initialis\u00e9e \u00e0 : \u00a7e{0}
pTimeSet=l''heure du joueur a \u00e9t\u00e9 r\u00e9egl\u00e9ee \u00e0 \u00a73{0}\u00a7f pour : \u00a7e{1}
pTimeSetFixed=l''heure du joueur a \u00e9t\u00e9 fix\u00e9e \u00e0 : \u00a7e{1}
parseError=Erreur de conversion {0} \u00e0 la ligne {1}
pendingTeleportCancelled=\u00a7cRequete de t\u00e9l\u00e9portation annul\u00e9e.
-permissionsError=Permissions/GroupManager manquant, les pr\u00e9fixes et suffixes ne seront pas affich\u00e9s.
+permissionsError=Permissions/GroupManager manquant, les pr\u00e9fixes et suffixes ne seront pas affich\u00e9s.
playerBanned=\u00a7cJoueur {0} banni {1} pour {2}
-playerInJail=\u00a7cLe joueur est d\u00e9j\u00e0 dans la prison {0}.
+playerInJail=\u00a7cLe joueur est d\u00e9j\u00e0 emprisonn\u00e9 dans {0}.
playerJailed=\u00a77Le joueur {0} a \u00e9t\u00e9 emprisonn\u00e9.
playerJailedFor=\u00a77{0} a \u00e9t\u00e9 emprisonn\u00e9 pour {1}.
playerKicked=\u00a7c{0} a \u00e9t\u00e9 \u00e9ject\u00e9 {1} pour {2}.
-playerMuted=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duis au silence.
+playerMuted=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duit au silence.
playerMutedFor=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duis au silence pour {0}
playerNeverOnServer=\u00a7cLe joueur {0} n''a jamais \u00e9t\u00e9 sur le serveur.
playerNotFound=\u00a7cLe joueur est introuvable.
@@ -296,7 +296,7 @@ possibleWorlds=\u00a77Les mondes possibles sont les nombres de 0 \u00e0 {0}.
powerToolAir=La commande ne peut pas \u00eatre assign\u00e9e \u00e0 l'air.
powerToolAlreadySet=La commande \u00a7c{0}\u00a7f est d\u00e9j\u00e0 assign\u00e9e \u00e0 {1}.
powerToolAttach=Commande \u00a7c{0}\u00a7f assign\u00e9e \u00e0 {1}.
-powerToolClearAll=Toutes les commandes assign\u00e9es ont \u00e9et\u00e9e retir\u00e9ees.
+powerToolClearAll=Toutes les commandes assign\u00e9es ont \u00e9t\u00e9 retir\u00e9es.
powerToolList={1} assign\u00e9s aux commandes : \u00a7c{0}\u00a7f.
powerToolListEmpty={0} n'a pas de commande assign\u00e9e.
powerToolNoSuchCommandAssigned=La commande \u00a7c{0}\u00a7f n''a pas \u00e9t\u00e9 assign\u00e9e \u00e0 {1}.
@@ -313,42 +313,42 @@ repair=Vous avez r\u00e9par\u00e9 votre : \u00a7e{0}.
repairAlreadyFixed=\u00a77Cet objet n'a pas besoin de r\u00e9paration.
repairEnchanted=\u00a77Vous n'\u00eates pas autoris\u00e9 \u00e0 r\u00e9parer les objets enchant\u00e9s.
repairInvalidType=\u00a7cCet objet ne peut \u00eatre r\u00e9par\u00e9.
-repairNone=Aucun objet n'a besoin d'u00eatre r\u00e9par\u00e9.
+repairNone=Aucun objet n'a besoin d'\u00eatre r\u00e9par\u00e9.
requestAccepted=\u00a77Demande de t\u00e9l\u00e9portation accept\u00e9e.
requestAcceptedFrom=\u00a77{0} a accept\u00e9 votre demande de t\u00e9l\u00e9portation.
requestDenied=\u00a77Demande de t\u00e9l\u00e9portation refus\u00e9e.
requestDeniedFrom=\u00a77{0} a refus\u00e9 votre demande de t\u00e9l\u00e9portation.
requestSent=\u00a77Requ\u00eate envoy\u00e9e \u00e0 {0}\u00a77.
-requestTimedOut=\u00a7cLa de mande de t\u00e9l\u00e9portation a expir\u00e9.
-requiredBukkit=* ! * Vous avez besoin au moins de la version {0} de CraftBukkit. T\u00e9l\u00e9chargez-la ici http://dl.bukkit.org/downloads/craftbukkit/
+requestTimedOut=\u00a7cLa demande de t\u00e9l\u00e9portation a expir\u00e9.
+requiredBukkit=* ! * Vous avez au moins besoin de la version {0} de CraftBukkit. T\u00e9l\u00e9chargez-la ici http://dl.bukkit.org/downloads/craftbukkit/
returnPlayerToJailError=Error occurred when trying to return player {0} to jail: {1}
second=seconde
seconds=secondes
seenOffline=Le joueur {0} est hors ligne depuis {1}
seenOnline=Le joueur {0} est en ligne depuis {1}
serverFull=Le serveur est plein.
-serverTotal=Server Total: {0}
+serverTotal=Total du serveur : {0}
setSpawner=Type de g\u00e9n\u00e9rateur chang\u00e9 en {0}
-sheepMalformedColor=Couleur mal form\u00e9e.
+sheepMalformedColor=Couleur incorrecte.
shoutFormat=\u00a77[Crie]\u00a7f {0}
signFormatFail=\u00a74[{0}]
signFormatSuccess=\u00a71[{0}]
signFormatTemplate=[{0}]
signProtectInvalidLocation=\u00a74Vous n'avez pas l'autorisation de cr\u00e9er une pancarte ici.
-similarWarpExist=Un point de t\u00e9l\u00e9portation avec un nom similaire existe d\u00e9j\u00e0.
-slimeMalformedSize=Taille mal form\u00e9e.
-soloMob=Ce cr\u00e9ature aime \u00eatre seul.
+similarWarpExist=Un warp avec un nom similaire existe d\u00e9j\u00e0.
+slimeMalformedSize=Taille incorrecte.
+soloMob=Cette cr\u00e9ature pr\u00e9f\u00e8re \u00eatre seule.
spawnSet=\u00a77Le point de d\u00e9part a \u00e9t\u00e9 d\u00e9fini pour le groupe {0}.
spawned=invoqu\u00e9(s)
sudoExempt=You cannot sudo this user
-sudoRun=Forcing {0} to run: /{1} {2}
+sudoRun=Le joueur {0} ex\u00e9cute de force : /{1} {2}
suicideMessage=\u00a77Au revoir monde cruel...
suicideSuccess=\u00a77{0} s''est suicid\u00e9.
survival=survie
-takenFromAccount=\u00a7c{0} ont \u00e9t\u00e9 retir\u00e9 de votre compte.
-takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2}
+takenFromAccount=\u00a7c{0} ont \u00e9t\u00e9 retir\u00e9s de votre compte.
+takenFromOthersAccount=\u00a7c{0} retir\u00e9s du compte de {1}\u00a7c. Nouveau solde : {2}
teleportAAll=\u00a77Demande de t\u00e9l\u00e9portation envoy\u00e9e \u00e0 tous les joueurs...
-teleportAll=\u00a77T\u00e9l\u00e9poration de tous les joueurs.
+teleportAll=\u00a77T\u00e9l\u00e9portation de tous les joueurs.
teleportAtoB=\u00a77{0}\u00a77 vous a t\u00e9l\u00e9port\u00e9 \u00e0 {1}\u00a77.
teleportDisabled={0} a la t\u00e9l\u00e9portation d\u00e9sactiv\u00e9.
teleportHereRequest=\u00a7c{0}\u00a7c Vous a demand\u00e9 de vous t\u00e9l\u00e9porter \u00e0 lui/elle.
@@ -357,9 +357,9 @@ teleportRequest=\u00a7c{0}\u00a7c vous demande s''il peut se t\u00e9l\u00e9porte
teleportRequestTimeoutInfo=\u00a77Cette demande de t\u00e9l\u00e9portation expirera dans {0} secondes.
teleportTop=\u00a77T\u00e9l\u00e9portation vers le haut.
teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation...
-teleportationDisabled=\u00a77T\u00e9l\u00e9poration d\u00e9sactiv\u00e9.
+teleportationDisabled=\u00a77T\u00e9l\u00e9portation d\u00e9sactiv\u00e9.
teleportationEnabled=\u00a77T\u00e9l\u00e9portation activ\u00e9e.
-teleporting=\u00a77T\u00e9l\u00e9poration en cours...
+teleporting=\u00a77T\u00e9l\u00e9portation en cours...
teleportingPortal=\u00a77T\u00e9l\u00e9portation via portail.
tempBanned=Banni temporairement du serveur pour {0}
tempbanExempt=\u00a77Vous ne pouvez pas bannir temporairement ce joueur.
@@ -373,12 +373,14 @@ timeSet=Heure r\u00e9gl\u00e9e dans tous les mondes.
timeSetPermission=\u00a7cVous n'\u00eates pas autoris\u00e9 \u00e0 r\u00e9gler l'heure.
timeWorldCurrent=Il est \u00a73{1}\u00a77 dans \u00a7c{0}.
timeWorldSet=L''heure a \u00e9t\u00e9 r\u00e9gl\u00e9e \u00e0 {0} dans : \u00a7c{1}
+totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
+totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Current TPS = {0}
tradeCompleted=\u00a77\u00c9change termin\u00e9.
tradeSignEmpty=Le panneau de vente n'as pas encore assez de stock.
tradeSignEmptyOwner=Il n'y a rien \u00e0 collecter de cette pancarte d'\u00e9change commercial.
treeFailure=\u00a7cEchec de la g\u00e9n\u00e9ration de l'arbre. Essayez de nouveau sur de l'herbe ou de la terre.
-treeSpawned=\u00a77Arbre cr\u00e9\u00e9.
+treeSpawned=\u00a77Arbre cr\u00e9 \u00e9.
true=\u00a72true\u00a7f
typeTpaccept=\u00a77Pour le t\u00e9l\u00e9porter, utilisez \u00a7c/tpaccept\u00a77.
typeTpdeny=\u00a77Pour d\u00e9cliner cette demande, utilisez \u00a7c/tpdeny\u00a77.
@@ -391,55 +393,55 @@ unknownItemId=Num\u00e9ro d''objet inconnu : {0}
unknownItemInList=L''objet {0} est inconnu dans la liste {1}.
unknownItemName=Nom d''objet inconnu : {0}
unlimitedItemPermission=\u00a7cPas de permission pour l''objet illimit\u00e9 {0}.
-unlimitedItems=Objets illimit\u00e9s:
+unlimitedItems=Objets illimit\u00e9s :
unmutedPlayer=Le joueur {0} n''est plus muet.
unvanished=\u00a7aYou are once again visible.
unvanishedReload=\u00a7cA reload has forced you to become visible.
upgradingFilesError=Erreur durant la mise \u00e0 jour des fichiers.
userDoesNotExist=L''utilisateur {0} n''existe pas.
-userIsAway={0} s'est mis en AFK
+userIsAway={0} est d\u00e9sormais AFK
userIsNotAway={0} n'est plus AFK
userJailed=\u00a77Vous avez \u00e9t\u00e9 emprisonn\u00e9.
userUsedPortal={0} a utilis\u00e9 un portail existant.
userdataMoveBackError=Echec du d\u00e9placement de userdata/{0}.tmp vers userdata/{1}
userdataMoveError=Echec du d\u00e9placement de userdata/{0} vers userdata/{1}.tmp
usingTempFolderForTesting=Utilise un fichier temporaire pour un test.
-vanished=\u00a7aYou have now been vanished.
-versionMismatch=Versions diff\u00e9rentes ! Mettez s''il vous plait {0} \u00e0 la m\u00eame version.
-versionMismatchAll=Mauvaise version ! S'il vous plait mettez des jars Essentials de version identique.
+vanished=\u00a7aVous \u00eates d\u00e9sormais invisible.
+versionMismatch=Versions diff\u00e9rentes ! Veuillez mettre {0} \u00e0 la m\u00eame version.
+versionMismatchAll=Mauvaise version ! Veuillez mettre des jars Essentials de m\u00eame version.
voiceSilenced=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duit au silence.
-walking=walking
-warpDeleteError=Probl\u00c3\u00a8me concernant la suppression du fichier warp.
+walking=en train de marcher
+warpDeleteError=Probl\u00e8me concernant la suppression du fichier warp.
warpListPermission=\u00a7cVous n'avez pas la permission d'afficher la liste des points de t\u00e9l\u00e9portation.
-warpNotExist=Ce point de t\u00e9l\u00e9portation n'existe pas.
-warpOverwrite=\u00a7cYou cannot overwrite that warp.
-warpSet=\u00a77Le point de t\u00e9l\u00e9portation {0} a \u00e9t\u00e9 cr\u00e9\u00e9.
-warpUsePermission=\u00a7cVous n'avez pas la permission d'utiliser ce point de t\u00e9l\u00e9portation.
+warpNotExist=Ce warp n'existe pas.
+warpOverwrite=\u00a7cVous ne pouvez pas \u00e9craser ce warp.
+warpSet=\u00a77Le warp {0} a \u00e9t\u00e9 cr\u00e9 \u00e9.
+warpUsePermission=\u00a7cVous n'avez pas la permission d'utiliser ce warp.
warpingTo=\u00a77T\u00e9l\u00e9portation vers {0}.
-warps=point de t\u00e9l\u00e9portations : {0}
-warpsCount=\u00a77Il y a {0} points de t\u00e9l\u00e9portations. Page {1} sur {2}.
+warps=warps : {0}
+warpsCount=\u00a77Il y a {0} warps. Page {1} sur {2}.
weatherStorm=\u00a77Vous avez programm\u00e9 l''orage dans {0}
weatherStormFor=\u00a77Vous avez programm\u00e9 l''orage dans {0} pour {1} secondes.
weatherSun=\u00a77Vous avez programm\u00e9 le beau temps dans {0}
weatherSunFor=\u00a77Vous avez programm\u00e9 le beau temps dans {0} pour {1} secondes.
-whoisAFK=\u00a76 - AFK:\u00a7f {0}
-whoisBanned=\u00a76 - Banni:\u00a7f {0}
-whoisExp=\u00a76 - Exp:\u00a7f {0} (Level {1})
-whoisFly=\u00a76 - Fly mode:\u00a7f {0} ({1})
-whoisGamemode=\u00a76 - Mode de jeu:\u00a7f {0}
-whoisGeoLocation=\u00a76 - Emplacement:\u00a7f {0}
-whoisGod=\u00a76 - Mode Dieu:\u00a7f {0}
-whoisHealth=\u00a76 - Sant\u00e9:\u00a7f {0} / 20
-whoisIPAddress=\u00a76 - Adresse IP:\u00a7f {0}
-whoisJail=\u00a76 - Jail:\u00a7f {0}
-whoisLocation=\u00a76 - Emplacement:\u00a7f ({0}, {1}, {2}, {3})
-whoisMoney=\u00a76 - Argent:\u00a7f {0}
-whoisMuted=\u00a76 - Muted:\u00a7f {0}
-whoisNick=\u00a76 - Nick:\u00a7f {0}
-whoisOp=\u00a76 - OP:\u00a7f {0}
+whoisAFK=\u00a76 - AFK :\u00a7f {0}
+whoisBanned=\u00a76 - Banni :\u00a7f {0}
+whoisExp=\u00a76 - Exp :\u00a7f {0} (Level {1})
+whoisFly=\u00a76 - Fly mode :\u00a7f {0} ({1})
+whoisGamemode=\u00a76 - Mode de jeu :\u00a7f {0}
+whoisGeoLocation=\u00a76 - Emplacement :\u00a7f {0}
+whoisGod=\u00a76 - Mode dieu :\u00a7f {0}
+whoisHealth=\u00a76 - Sant\u00e9 :\u00a7f {0} / 20
+whoisIPAddress=\u00a76 - Adresse IP :\u00a7f {0}
+whoisJail=\u00a76 - Jail :\u00a7f {0}
+whoisLocation=\u00a76 - Position :\u00a7f ({0}, {1}, {2}, {3})
+whoisMoney=\u00a76 - Argent :\u00a7f {0}
+whoisMuted=\u00a76 - Muet :\u00a7f {0}
+whoisNick=\u00a76 - Surnom :\u00a7f {0}
+whoisOp=\u00a76 - OP :\u00a7f {0}
whoisTop=\u00a76 ====== WhoIs:\u00a7f {0} \u00a76======
-worth=\u00a77Une pile de {0} vaut \u00a7c{1}\u00a77 ({2} objet(s) \u00e0 {3} chacun)
-worthMeta=\u00a77Une pile de {0} avec la m\u00e9tadonn\u00e9e de {1} vaut \u00a7c{2}\u00a77 ({3} objet(s) \u00e0 {4} chacun)
+worth=\u00a77Un stack de {0} vaut \u00a7c{1}\u00a77 ({2} objet(s) \u00e0 {3} chacun)
+worthMeta=\u00a77Un stack de {0} de type {1} vaut \u00a7c{2}\u00a77 ({3} objet(s) \u00e0 {4} chacun)
worthSet=Valeur cr\u00e9e
year=ann\u00e9e
years=ann\u00e9es
@@ -448,13 +450,31 @@ youHaveNewMail=\u00a7cVous avez {0} messages ! \u00a7fEntrez \u00a77/mail read\u
posX=\u00a76X: {0} (+East <-> -West)
posY=\u00a76Y: {0} (+Up <-> -Down)
posZ=\u00a76Z: {0} (+South <-> -North)
-posYaw=\u00a76Yaw: {0} (Rotation)
-posPitch=\u00a76Pitch: {0} (Head angle)
-distance=\u00a76Distance: {0}
+posYaw=\u00a76Yaw : {0} (Rotation)
+posPitch=\u00a76Pitch : {0} (Head angle)
+distance=\u00a76Distance : {0}
giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76.
warpList={0}
-uptime=\u00a76Uptime:\u00a7c {0}
-antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
-antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
-gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
-invalidHomeName=\u00a74Invalid home name
+uptime=\u00a76Dur\u00e9e de fonctionnent :\u00a7c {0}
+antiBuildCraft=\u00a74Vous n'\u00eates pas autoris\u00e9s \u00e0 cr\u00e9er\u00a7c {0}\u00a74.
+antiBuildDrop=\u00a74Vous n'\u00eates pas autoris\u00e9s \u00e0 jeter\u00a7c {0}\u00a74.
+gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 portions, \u00a7c{3}\u00a76 entit\u00e9s
+invalidHomeName=\u00a74Nom de r\u00e9sindence invalide
+invalidWarpName=\u00a74Nom de warp invalide
+userUnknown=\u00a74Attention : Le joueur '\u00a7c{0}\u00a74' n'est jamais venu sur ce serveur.
+teleportationEnabledFor=\u00a76Teleportation enabled for {0}
+teleportationDisabledFor=\u00a76Teleportation disabled for {0}
+kitOnce=\u00a74You can't use that kit again.
+fullStack=\u00a74You already have a full stack
+oversizedTempban=\u00a74You may not ban a player for this period of time.
+recipeNone=No recipes exist for {0}
+invalidNumber=Invalid Number
+recipeBadIndex=There is no recipe by that number
+recipeNothing=nothing
+recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
+recipeFurnace=\u00a76Smelt \u00a7c{0}
+recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
+recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
+recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
+recipeWhere=\u00a76Where: {0}
+recipeShapeless=\u00a76Combine \u00a7c{0}
diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties
index 91e2e8f27..c8bcdd711 100644
--- a/Essentials/src/messages_it.properties
+++ b/Essentials/src/messages_it.properties
@@ -373,6 +373,8 @@ timeSet=Orario definito in tutti i mondi.
timeSetPermission=\u00a7cNon sei autorizzato a regolare l''orario.
timeWorldCurrent=L''orario attuale in {0} e'' \u00a73{1}
timeWorldSet=L''orario e'' stato regolato alle {0} in: \u00a7c{1}
+totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
+totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Current TPS = {0}
tradeCompleted=\u00a77Affare concluso.
tradeSignEmpty=L''insegna non dispone di forniture sufficienti.
@@ -458,3 +460,21 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
+userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
+teleportationEnabledFor=\u00a76Teleportation enabled for {0}
+teleportationDisabledFor=\u00a76Teleportation disabled for {0}
+kitOnce=\u00a74You can't use that kit again.
+fullStack=\u00a74You already have a full stack
+oversizedTempban=\u00a74You may not ban a player for this period of time.
+recipeNone=No recipes exist for {0}
+invalidNumber=Invalid Number
+recipeBadIndex=There is no recipe by that number
+recipeNothing=nothing
+recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
+recipeFurnace=\u00a76Smelt \u00a7c{0}
+recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
+recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
+recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
+recipeWhere=\u00a76Where: {0}
+recipeShapeless=\u00a76Combine \u00a7c{0}
diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties
index 62be530f1..11fe951d6 100644
--- a/Essentials/src/messages_nl.properties
+++ b/Essentials/src/messages_nl.properties
@@ -373,6 +373,8 @@ timeSet=Tijd ingesteld in alle werelden.
timeSetPermission=\u00a7cJe bent niet bevoegd om de tijd te veranderen.
timeWorldCurrent=De actuele tijd in {0} is \u00a73{1}
timeWorldSet=De tijd was veranderd naar {0} in: \u00a7c{1}
+totalWorthAll=\u00a7aAlle spullen verkocht voor een totale waarde van {1}.
+totalWorthBlocks=\u00a7aAlle blokken verkocht voor een totale waarde van {1}.
tps=Huidige TPS = {0}
tradeCompleted=\u00a77Ruil verricht.
tradeSignEmpty=Dit handelsbord heeft een te kleine voorraad.
@@ -397,7 +399,7 @@ unvanished=\u00a7aYou are once again visible.
unvanishedReload=\u00a7cEen herlading heeft je geforceerd om zichtbaar te worden.
upgradingFilesError=Fout tijdens het upgraden van de bestanden
userDoesNotExist=Speler {0} bestaat niet.
-userIsAway={0} is nu afwezing.
+userIsAway={0} is nu afwezig.
userIsNotAway={0} is niet meer afwezig.
userJailed=\u00a77Je bent in de gevangenis gezet.
userUsedPortal={0} gebruikte een bestaande uitgangs portal.
@@ -422,7 +424,7 @@ weatherStorm=\u00a77Je hebt het weer naar stormachtig gezet in de {0}
weatherStormFor=\u00a77Je hebt het weer in de {0} naar stormachtig gezet voor {1} seconde
weatherSun=\u00a77Je hebt het weer naar zonnig gezet in de {0}
weatherSunFor=\u00a77Je hebt het weer in de {0} naar zonnig gezet voor {1} seconde
-whoisAFK=\u00a76 - Afwezing:\u00a7f {0}
+whoisAFK=\u00a76 - Afwezig:\u00a7f {0}
whoisBanned=\u00a76 - Verbannen:\u00a7f {0}
whoisExp=\u00a76 - Exp:\u00a7f {0} (Level {1})
whoisFly=\u00a76 - Vlieg modus:\u00a7f {0} ({1})
@@ -458,3 +460,21 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
+userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
+teleportationEnabledFor=\u00a76Teleportation enabled for {0}
+teleportationDisabledFor=\u00a76Teleportation disabled for {0}
+kitOnce=\u00a74You can't use that kit again.
+fullStack=\u00a74You already have a full stack
+oversizedTempban=\u00a74You may not ban a player for this period of time.
+recipeNone=No recipes exist for {0}
+invalidNumber=Invalid Number
+recipeBadIndex=There is no recipe by that number
+recipeNothing=nothing
+recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
+recipeFurnace=\u00a76Smelt \u00a7c{0}
+recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
+recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
+recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
+recipeWhere=\u00a76Where: {0}
+recipeShapeless=\u00a76Combine \u00a7c{0}
diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties
index 1a1e73d65..4c666c1cc 100644
--- a/Essentials/src/messages_pl.properties
+++ b/Essentials/src/messages_pl.properties
@@ -373,6 +373,8 @@ timeSet=Czas ustawiono we wszystkich swiatach.
timeSetPermission=\u00a7cNie masz uprawnien do ustawiania czasu.
timeWorldCurrent=Obecny czas {0} to \u00a73{1}.
timeWorldSet=Czas ustawiono {0} w: \u00a7c{1}.
+totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
+totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Current TPS = {0}
tradeCompleted=\u00a77Handel zakonczono.
tradeSignEmpty=Tabliczka handlowa nie jest dostepna dla Ciebie.
@@ -458,3 +460,21 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
+userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
+teleportationEnabledFor=\u00a76Teleportation enabled for {0}
+teleportationDisabledFor=\u00a76Teleportation disabled for {0}
+kitOnce=\u00a74You can't use that kit again.
+fullStack=\u00a74You already have a full stack
+oversizedTempban=\u00a74You may not ban a player for this period of time.
+recipeNone=No recipes exist for {0}
+invalidNumber=Invalid Number
+recipeBadIndex=There is no recipe by that number
+recipeNothing=nothing
+recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
+recipeFurnace=\u00a76Smelt \u00a7c{0}
+recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
+recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
+recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
+recipeWhere=\u00a76Where: {0}
+recipeShapeless=\u00a76Combine \u00a7c{0}
diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties
index 11a2c1df0..8db1a6bc4 100644
--- a/Essentials/src/messages_pt.properties
+++ b/Essentials/src/messages_pt.properties
@@ -373,6 +373,8 @@ timeSet=Horario definido em todos os mundos.
timeSetPermission=\u00a7cVoc\u00ea nao tem autoriza\u00e7ao para modificar o hor\u00e1rio.
timeWorldCurrent=O hor\u00e1rio atual no mundo {0} e \u00a73{1}
timeWorldSet=O hor\u00e1rio foi definido para {0} no: \u00a7c{1}
+totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
+totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Current TPS = {0}
tradeCompleted=\u00a77Compra concluida.
tradeSignEmpty=A placa de troca nao tem abastecimento suficiente.
@@ -458,3 +460,21 @@ antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
invalidHomeName=\u00a74Invalid home name
+invalidWarpName=\u00a74Invalid warp name
+userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this server.
+teleportationEnabledFor=\u00a76Teleportation enabled for {0}
+teleportationDisabledFor=\u00a76Teleportation disabled for {0}
+kitOnce=\u00a74You can't use that kit again.
+fullStack=\u00a74You already have a full stack
+oversizedTempban=\u00a74You may not ban a player for this period of time.
+recipeNone=No recipes exist for {0}
+invalidNumber=Invalid Number
+recipeBadIndex=There is no recipe by that number
+recipeNothing=nothing
+recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
+recipeFurnace=\u00a76Smelt \u00a7c{0}
+recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
+recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
+recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
+recipeWhere=\u00a76Where: {0}
+recipeShapeless=\u00a76Combine \u00a7c{0}
diff --git a/Essentials/src/messages_se.properties b/Essentials/src/messages_se.properties
index c7685d6f4..03b5f35ae 100644
--- a/Essentials/src/messages_se.properties
+++ b/Essentials/src/messages_se.properties
@@ -5,15 +5,15 @@
action=* {0} {1}
addedToAccount=\u00a7a{0} har blivit tillagt p\u00e5 ditt konto.
addedToOthersAccount=\u00a7a{0} har blivit tillagt p\u00e5 {1}\u00a7a konto. Ny balans: {2}
-adventure = adventure
+adventure = \u00E4ventyr
alertBroke=gjorde s\u00f6nder:
alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3}
alertPlaced=placerade:
alertUsed=anv\u00e4nde:
-antiBuildBreak=\u00a74You are not permitted to break {0} blocks here.
-antiBuildInteract=\u00a74You are not permitted to interact with {0}.
-antiBuildPlace=\u00a74You are not permitted to place {0} here.
-antiBuildUse=\u00a74You are not permitted to use {0}.
+antiBuildBreak=\u00a74Du har inte till\u00E5telse att ta s\u00F6nder {0} blocks h\u00E4r.
+antiBuildInteract=\u00a74Du har inte till\u00E5telse att p\u00E5verka {0}.
+antiBuildPlace=\u00a74Du har inte till\u00E5telse att placera {0} h\u00E4r.
+antiBuildUse=\u00a74Du har inte till\u00E5telse att anv\u00E4nda {0}.
autoAfkKickReason=Du har blivit utsparkad f\u00f6r att ha varit inaktiv i mer \u00e4n {0} minuter.
backAfterDeath=\u00a77Anv\u00e4nd /back kommandot f\u00f6r att komma tillbaka till din d\u00f6dsplats.
backUsageMsg=\u00a77Tar dig tillbaka till din f\u00f6reg\u00e5ende position.
@@ -48,7 +48,7 @@ configFileRenameError=Kunde inte byta namn p\u00e5 temp-filen till config.yml
connectedPlayers=Anslutna spelare:
connectionFailed=Kunde inte \u00f6ppna anslutning.
cooldownWithMessage=\u00a7cNedkylning: {0}
-corruptNodeInConfig=\u00a74Notice: Din konfigurationsfil har en korrupt {0} nod.
+corruptNodeInConfig=\u00a74Observera: Din konfigurationsfil har en korrupt {0} nod.
couldNotFindTemplate=Kunde inte hitta mallen {0}
creatingConfigFromTemplate=Skapar konfiguration fr\u00e5n mallen: {0}
creatingEmptyConfig=Skapar tom konfiguration: {0}
@@ -115,10 +115,10 @@ godDisabledFor=inaktiverat f\u00f6r {0}
godEnabledFor=aktiverat f\u00f6r {0}
godMode=\u00a77Od\u00f6dlighet {0}.
hatArmor=\u00a7cFel, du kan inte anv\u00e4nda den h\u00e4r saken som en hatt!
-hatEmpty=\u00a7cYou are not wearing a hat.
+hatEmpty=\u00a7cDu har inte p\u00E5 dig en hatt.
hatFail=\u00a7cDu m\u00e5ste ha n\u00e5gonting att b\u00e4ra i din hand.
hatPlaced=\u00a7eNjut av din nya hatt!
-hatRemoved=\u00a7eYour hat has been removed.
+hatRemoved=\u00a7eDin hatt har tagits bort.
haveBeenReleased=\u00a77Du har blivit friad
heal=\u00a77Du har blivit l\u00e4kt.
healOther=\u00a77L\u00e4kte {0}.
@@ -148,7 +148,7 @@ invSee=Du ser nu {0}s f\u00f6rr\u00e5d.
invSeeHelp=Anv\u00e4nd /invsee f\u00f6r att \u00e5terst\u00e4lla ditt f\u00f6rr\u00e5d.
invalidCharge=\u00a7cOgiltig laddning.
invalidHome=Hemmet {0} finns inte
-invalidMob=Ogiltig monster-typ.
+invalidMob=Ogiltig monstertyp.
invalidServer=Ogiltig server!
invalidSignLine=Rad {0} p\u00e5 skylten \u00e4r ogiltig.
invalidWorld=\u00a7cOgiltig v\u00e4rld.
@@ -157,7 +157,7 @@ inventoryClearedOthers=\u00a77F\u00f6rr\u00e5det av \u00a7c{0}\u00a77 \u00e4r re
is=\u00e4r
itemCannotBeSold=Det objektet kan inte s\u00e4ljas till servern.
itemMustBeStacked=Objektet m\u00e5ste k\u00f6pas i staplar. En m\u00e4ngd av 2s kommer bli 2 staplar, etc.
-itemNames=Item short names: {0}
+itemNames=F\u00F6rkortning p\u00E5 objekt: {0}
itemNotEnough1=\u00a7cDu har inte tillr\u00e4ckligt av den saken f\u00f6r att s\u00e4lja.
itemNotEnough2=\u00a77Om du ville s\u00e4lja alla block av den typen, anv\u00e4nd /sell blocknamn
itemNotEnough3=\u00a77/sell blocknamn -1 kommer att s\u00e4lja allt av den blocktypen f\u00f6rutom 1 o.s.v.
@@ -165,7 +165,7 @@ itemSellAir=F\u00f6rs\u00f6kte du att s\u00e4lja luft? S\u00e4tt en sak i din ha
itemSold=\u00a77S\u00e5lde f\u00f6r \u00a7c{0} \u00a77({1} {2} f\u00f6r {3} styck)
itemSoldConsole={0} s\u00e5lde {1} f\u00f6r \u00a77{2} \u00a77({3} saker f\u00f6r {4} styck)
itemSpawn=\u00a77Ger {0} stycken {1}
-itemType=Item: {0} - {1}
+itemType=Objekt: {0} - {1}
itemsCsvNotLoaded=Kunde inte ladda items.csv.
jailAlreadyIncarcerated=\u00a7cPersonen \u00e4r redan i f\u00e4ngelse: {0}
jailMessage=\u00a7cBryter du mot reglerna, f\u00e5r du st\u00e5 ditt kast.
@@ -218,7 +218,7 @@ moneyTaken={0} \u00e4r taget fr\u00e5n ditt bankkonto.
month=m\u00e5nad
months=m\u00e5nader
moreThanZero=M\u00e5ngden m\u00e5ste vara st\u00f6rre \u00e4n 0.
-moveSpeed=\u00a77Set {0} speed to {1} for {2}.
+moveSpeed=\u00a77Satte {0}fart till {1} f\u00F6r {2}.
msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
muteExempt=\u00a7cDu kan inte tysta den spelaren.
mutedPlayer=Spelaren {0} \u00e4r tystad.
@@ -259,7 +259,7 @@ notAllowedToQuestion=\u00a7cDu har inte tillst\u00e5nd att anv\u00e4nda den fr\u
notAllowedToShout=\u00a7cDu har inte tillst\u00e5nd att ropa.
notEnoughExperience=Du har inte nog med erfarenhet.
notEnoughMoney=Du har inte tillr\u00e4ckligt med pengar.
-notFlying=not flying
+notFlying=flyger inte
notRecommendedBukkit= * ! * Bukkit-versionen \u00e4r inte rekommenderad f\u00f6r den h\u00e4r versionen av Essentials.
notSupportedYet=St\u00f6ds inte \u00e4n.
nothingInHand = \u00a7cDu har inget i din hand.
@@ -373,6 +373,8 @@ timeSet=Tid inst\u00e4lld i alla v\u00e4rldar.
timeSetPermission=\u00a7cDu har inte tillst\u00e5nd att st\u00e4lla in tiden.
timeWorldCurrent=Den nuvarande tiden i {0} \u00e4r \u00a73{1}
timeWorldSet=Tiden \u00e4r nu {0} i: \u00a7c{1}
+totalWorthAll=\u00a7aS\u00E5lde alla objekt f\u00F6r ett totalt v\u00E4rde av {1}.
+totalWorthBlocks=\u00a7aS\u00E5lde alla blocks f\u00F6r ett totalt v\u00E4rde av {1}.
tps=Nuvarande TPS = {0}
tradeCompleted=\u00a77K\u00f6p avslutat.
tradeSignEmpty=K\u00f6pskylten har inget tillg\u00e4ngligt f\u00f6r dig.
@@ -408,7 +410,7 @@ vanished=\u00a7aDu \u00e4r nu osynlig.
versionMismatch=Versionerna matchar inte! V\u00e4nligen uppgradera {0} till samma version.
versionMismatchAll=Versionerna matchar inte! V\u00e4nligen uppgradera alla Essentials jars till samma version.
voiceSilenced=\u00a77Din r\u00f6st har tystats
-walking=walking
+walking=g\u00e5r
warpDeleteError=Problem med att ta bort warp-filen.
warpListPermission=\u00a7cDu har inte tillst\u00e5nd att lista warparna.
warpNotExist=Den warpen finns inte.
@@ -423,19 +425,19 @@ weatherStormFor=\u00a77Du har st\u00e4llt in v\u00e4dret till storm i {0} f\u00f
weatherSun=\u00a77Du har st\u00e4llt in v\u00e4dret till sol i {0}
weatherSunFor=\u00a77Du har st\u00e4llt in v\u00e4dret till sol i {0} f\u00f6r {1} sekunder
whoisAFK=\u00a76 - AFK:\u00a7f {0}
-whoisBanned=\u00a76 - Banned:\u00a7f {0}
-whoisExp=\u00a76 - Exp:\u00a7f {0} (Level {1})
-whoisFly=\u00a76 - Fly mode:\u00a7f {0} ({1})
-whoisGamemode=\u00a76 - Gamemode:\u00a7f {0}
-whoisGeoLocation=\u00a76 - Location:\u00a7f {0}
-whoisGod=\u00a76 - God mode:\u00a7f {0}
-whoisHealth=\u00a76 - Health:\u00a7f {0}/20
-whoisIPAddress=\u00a76 - IP Address:\u00a7f {0}
-whoisJail=\u00a76 - Jail:\u00a7f {0}
-whoisLocation=\u00a76 - Location:\u00a7f ({0}, {1}, {2}, {3})
-whoisMoney=\u00a76 - Money:\u00a7f {0}
-whoisMuted=\u00a76 - Muted:\u00a7f {0}
-whoisNick=\u00a76 - Nick:\u00a7f {0}
+whoisBanned=\u00a76 - Bannad:\u00a7f {0}
+whoisExp=\u00a76 - Erfarenhet:\u00a7f {0} (Level {1})
+whoisFly=\u00a76 - Flygl\u00e4ge:\u00a7f {0} ({1})
+whoisGamemode=\u00a76 - Spell\u00e4ge:\u00a7f {0}
+whoisGeoLocation=\u00a76 - Lokalisering:\u00a7f {0}
+whoisGod=\u00a76 - Gudsl\u00e4ge:\u00a7f {0}
+whoisHealth=\u00a76 - H\u00e4lsa:\u00a7f {0}/20
+whoisIPAddress=\u00a76 - IP-Adress:\u00a7f {0}
+whoisJail=\u00a76 - F\u00e4ngelse:\u00a7f {0}
+whoisLocation=\u00a76 - Lokalisering:\u00a7f ({0}, {1}, {2}, {3})
+whoisMoney=\u00a76 - Pengar:\u00a7f {0}
+whoisMuted=\u00a76 - Tystad:\u00a7f {0}
+whoisNick=\u00a76 - Smeknamn:\u00a7f {0}
whoisOp=\u00a76 - OP:\u00a7f {0}
whoisTop=\u00a76 ====== WhoIs:\u00a7f {0} \u00a76======
worth=\u00a77Stapeln med {0} ({2} objekt) \u00e4r v\u00e4rd \u00a7c{1}\u00a77 ({3} styck)
@@ -445,16 +447,34 @@ year=\u00e5r
years=\u00e5r
youAreHealed=\u00a77Du har blivit l\u00e4kt.
youHaveNewMail=\u00a7cDu har {0} meddelanden!\u00a7f Skriv \u00a77/mail read\u00a7f f\u00f6r att l\u00e4sa dina meddelanden.
-posX=\u00a76X: {0} (+East <-> -West)
-posY=\u00a76Y: {0} (+Up <-> -Down)
-posZ=\u00a76Z: {0} (+South <-> -North)
-posYaw=\u00a76Yaw: {0} (Rotation)
-posPitch=\u00a76Pitch: {0} (Head angle)
-distance=\u00a76Distance: {0}
-giveSpawn=\u00a76Giving\u00a7c {0} \u00a76of\u00a7c {1} to\u00a7c {2}\u00a76.
+posX=\u00a76X: {0} (+\u00D6ster <-> -V\u00e4st)
+posY=\u00a76Y: {0} (+Upp <-> -Ner)
+posZ=\u00a76Z: {0} (+Syd <-> -Nort)
+posYaw=\u00a76Girning: {0} (Rotation)
+posPitch=\u00a76Pitch: {0} (Huvudvinkel)
+distance=\u00a76Avst\u00E5nd: {0}
+giveSpawn=\u00a76Ger\u00a7c {0} \u00a76av\u00a7c {1} till\u00a7c {2}\u00a76.
warpList={0}
-uptime=\u00a76Uptime:\u00a7c {0}
-antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
-antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
-gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
-invalidHomeName=\u00a74Invalid home name
+uptime=\u00a76Upptid:\u00a7c {0}
+antiBuildCraft=\u00a74Du har inte till\u00E5telse att skapa\u00a7c {0}\u00a74.
+antiBuildDrop=\u00a74Du har inte till\u00E5telse att kasta ut\u00a7c {0}\u00a74.
+gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 bitar, \u00a7c{3}\u00a76 enheter
+invalidHomeName=\u00a74Ogiltigt hemnamn
+invalidWarpName=\u00a74Ogiltigt warpnamn
+userUnknown=\u00a74Varning: Anv\u00E4ndaren '\u00a7c{0}\u00a74' har aldrig varit inne p\u00E5 denna server tidigare.
+teleportationEnabledFor=\u00a76TTeleportering aktiverat f\u00F6r {0}
+teleportationDisabledFor=\u00a76Teleportering inaktiverat f\u00F6r {0}
+kitOnce=\u00a74Du kan inte av\u00E4nda det kitet igen.
+fullStack=\u00a74Du har redan en full stapel
+oversizedTempban=\u00a74Du kan inte banna en spelare just vid denna tidpunkt.
+recipeNone=No recipes exist for {0}
+invalidNumber=Invalid Number
+recipeBadIndex=There is no recipe by that number
+recipeNothing=nothing
+recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
+recipeFurnace=\u00a76Smelt \u00a7c{0}
+recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
+recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
+recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
+recipeWhere=\u00a76Where: {0}
+recipeShapeless=\u00a76Combine \u00a7c{0}
diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml
index 225534a08..8c66921d0 100644
--- a/Essentials/src/plugin.yml
+++ b/Essentials/src/plugin.yml
@@ -109,35 +109,31 @@ commands:
aliases: [efeed,eat,eeat]
fly:
description: Take off, and soar!
- usage: /<command> [player] [on|off]
+ usage: /<command> [player [on|off]]
aliases: [efly]
- itemdb:
- description: Searches for an item.
- usage: /<command> <item>
- aliases: [eitemdb,itemno,eitemno,durability,dura,edura,edurability]
fireball:
description: Throw a fireball.
- usage: /<command> [small]
- aliases: [efireball]
+ usage: /<command> [small|skull]
+ aliases: [efireball,fireskull,efireskull,fireentity,efireentity]
gamemode:
description: Change player gamemode.
usage: /<command> <survival|creative|adventure> [player]
aliases: [gm,creative,creativemode,survival,survivalmode,adventure,adventuremode,gmc,gma,gms,gmt,egamemod,eecreative,ecreativemode,esurvival,esurvivalmode,eadventure,eadventuremode,egmc,egma,egms,egm,egmt]
- getpos:
- description: Get your current coordinates or those of a player.
- usage: /<command> [player]
- aliases: [coords,egetpos,position,eposition,whereami,ewhereami]
gc:
description: Reports memory, uptime and tick info.
usage: /<command>
aliases: [elag,lag,mem,memory,egc,emem,ememory,uptime,euptime]
+ getpos:
+ description: Get your current coordinates or those of a player.
+ usage: /<command> [player]
+ aliases: [coords,egetpos,position,eposition,whereami,ewhereami]
give:
description: Give a player an item.
usage: /<command> <player> <item|numeric> [amount <enchantmentname[:level]> ...]
aliases: [egive]
god:
description: Enables your godly powers.
- usage: /<command> [player] [on|off]
+ usage: /<command> [player [on|off]]
aliases: [tgm,godmode,egod,etgm,egodmode]
hat:
description: Get some cool new headgear
@@ -175,6 +171,10 @@ commands:
description: Spawn an item.
usage: /<command> <item|numeric> [amount <enchantmentname[:level]> ...]
aliases: [i,eitem]
+ itemdb:
+ description: Searches for an item.
+ usage: /<command> <item>
+ aliases: [eitemdb,itemno,eitemno,durability,dura,edura,edurability]
jails:
description: List all jails.
usage: /<command>
@@ -191,10 +191,6 @@ commands:
description: Kicks all players off the server except the issuer.
usage: /<command> [reason]
aliases: [ekickall]
- kit:
- description: Obtains the specified kit or views all available kits.
- usage: /<command> [kit] [player]
- aliases: [ekit,kits,ekits]
kill:
description: Kills specified player.
usage: /<command> <player>
@@ -203,17 +199,21 @@ commands:
description: Kill all mobs in a world.
usage: /<command> [mobType] [radius]
aliases: [ekillall,butcher,ebutcher,mobkill,emobkill]
+ kit:
+ description: Obtains the specified kit or views all available kits.
+ usage: /<command> [kit] [player]
+ aliases: [ekit,kits,ekits]
kittycannon:
description: Throw an exploding kitten at your opponent
usage: /<command>
- list:
- description: List all online players.
- usage: /<command>
- aliases: [playerlist,who,online,plist,eplist,elist,ewho,eplayerlist,eonline]
lightning:
description: The power of Thor. Strike at cursor or player.
usage: /<command> [player] [power]
aliases: [strike,smite,thor,shock,elightning,estrike,esmite,ethor,eshock]
+ list:
+ description: List all online players.
+ usage: /<command>
+ aliases: [playerlist,who,online,plist,eplist,elist,ewho,eplayerlist,eonline]
mail:
description: Manages inter-player, intra-server mail.
usage: /<command> [read|clear|send [to] [message]|sendall [message]]
@@ -233,7 +233,7 @@ commands:
msg:
description: Sends a private message to the specified player.
usage: /<command> <to> <message>
- aliases: [m,t,emsg,tell,etell,whisper,ewhisper]
+ aliases: [w,m,t,emsg,tell,etell,whisper,ewhisper]
mute:
description: Mutes or unmutes a player.
usage: /<command> <player> [datediff]
@@ -278,6 +278,10 @@ commands:
description: Displays the username of a user based on nick.
usage: /<command> <nickname>
aliases: [erealname]
+ recipe:
+ description: Displays how to craft items.
+ usage: /<command> <item> [number]
+ aliases: [method, formula, recipes, emethod, eformula, erecipes, erecipe]
remove:
description: Removes entities in your world
usage: /<command> <drops|arrows|boats|minecarts|xp|paintings> [radius]
@@ -325,7 +329,7 @@ commands:
spawnmob:
description: Spawns a mob.
usage: /<command> <mob>[:data][,<mount>[:data]] [amount] [player]
- aliases: [espawnmob,mob,emob]
+ aliases: [espawnmob,spawnentity,espawnentity,mob,emob]
speed:
description: Change your speed limits
usage: /<command> <speed> [player]
@@ -404,7 +408,7 @@ commands:
aliases: [etppos]
tptoggle:
description: Blocks all forms of teleportation.
- usage: /<command>
+ usage: /<command> [player [on|off]]
aliases: [etptoggle]
tree:
description: Spawn a tree where you are looking.
@@ -454,4 +458,4 @@ commands:
permissions:
essentials.*:
default: op
- description: Give players with op everything by default \ No newline at end of file
+ description: Give players with op everything by default
diff --git a/Essentials/test/com/earth2me/essentials/FakeServer.java b/Essentials/test/com/earth2me/essentials/FakeServer.java
index c86068eb8..5d2ff0c88 100644
--- a/Essentials/test/com/earth2me/essentials/FakeServer.java
+++ b/Essentials/test/com/earth2me/essentials/FakeServer.java
@@ -16,10 +16,7 @@ import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.help.HelpMap;
-import org.bukkit.inventory.Inventory;
-import org.bukkit.inventory.InventoryHolder;
-import org.bukkit.inventory.ItemStack;
-import org.bukkit.inventory.Recipe;
+import org.bukkit.inventory.*;
import org.bukkit.map.MapView;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
@@ -119,6 +116,12 @@ public class FakeServer implements Server
}
@Override
+ public boolean isHardcore()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
public Player getPlayer(String string)
{
for (Player player : players)
@@ -240,6 +243,42 @@ public class FakeServer implements Server
{
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ @Override
+ public BukkitTask runTask(Plugin plugin, Runnable r) throws IllegalArgumentException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public BukkitTask runTaskAsynchronously(Plugin plugin, Runnable r) throws IllegalArgumentException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public BukkitTask runTaskLater(Plugin plugin, Runnable r, long l) throws IllegalArgumentException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public BukkitTask runTaskLaterAsynchronously(Plugin plugin, Runnable r, long l) throws IllegalArgumentException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public BukkitTask runTaskTimer(Plugin plugin, Runnable r, long l, long l1) throws IllegalArgumentException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public BukkitTask runTaskTimerAsynchronously(Plugin plugin, Runnable r, long l, long l1) throws IllegalArgumentException
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
};
}
@@ -759,4 +798,22 @@ public class FakeServer implements Server
{
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ @Override
+ public int getAmbientSpawnLimit()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public String getShutdownMessage()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public ItemFactory getItemFactory()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}
diff --git a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java
index d2f46586f..67995c955 100644
--- a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java
+++ b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java
@@ -7,14 +7,15 @@ import java.util.logging.Level;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
+import org.bukkit.entity.EntityType;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.*;
+import org.bukkit.event.hanging.HangingBreakByEntityEvent;
import org.bukkit.event.inventory.CraftItemEvent;
-import org.bukkit.event.painting.PaintingBreakByEntityEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
@@ -36,6 +37,10 @@ public class EssentialsAntiBuildListener implements Listener
{
if (block == null)
{
+ if (ess.getSettings().isDebug())
+ {
+ ess.getLogger().log(Level.INFO, "AntiBuild permission check failed, invalid block.");
+ }
return false;
}
return metaPermCheck(user, action, block.getTypeId(), block.getData());
@@ -47,7 +52,7 @@ public class EssentialsAntiBuildListener implements Listener
return user.isAuthorized(blockPerm);
}
- private boolean metaPermCheck(final User user, final String action, final int blockId, final byte data)
+ private boolean metaPermCheck(final User user, final String action, final int blockId, final short data)
{
final String blockPerm = "essentials.build." + action + "." + blockId;
final String dataPerm = blockPerm + ":" + data;
@@ -141,20 +146,32 @@ public class EssentialsAntiBuildListener implements Listener
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
- public void onPaintingBreak(final PaintingBreakByEntityEvent event)
+ public void onHangingBreak(final HangingBreakByEntityEvent event)
{
final Entity entity = event.getRemover();
if (entity instanceof Player)
{
final User user = ess.getUser(entity);
- if (prot.getSettingBool(AntiBuildConfig.disable_build) && !user.canBuild() && !user.isAuthorized("essentials.build")
- && !metaPermCheck(user, "break", Material.PAINTING.getId()))
+ final EntityType type = event.getEntity().getType();
+ final boolean warn = ess.getSettings().warnOnBuildDisallow();
+ if (prot.getSettingBool(AntiBuildConfig.disable_build) && !user.canBuild() && !user.isAuthorized("essentials.build"))
{
- if (ess.getSettings().warnOnBuildDisallow())
+ if (type == EntityType.PAINTING && !metaPermCheck(user, "break", Material.PAINTING.getId()))
{
- user.sendMessage(_("antiBuildBreak", Material.PAINTING.toString()));
+ if (warn)
+ {
+ user.sendMessage(_("antiBuildBreak", Material.PAINTING.toString()));
+ }
+ event.setCancelled(true);
+ }
+ else if(type == EntityType.ITEM_FRAME && !metaPermCheck(user, "break", Material.ITEM_FRAME.getId()))
+ {
+ if (warn)
+ {
+ user.sendMessage(_("antiBuildBreak", Material.ITEM_FRAME.toString()));
+ }
+ event.setCancelled(true);
}
- event.setCancelled(true);
}
}
}
@@ -215,7 +232,7 @@ public class EssentialsAntiBuildListener implements Listener
if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build"))
{
- if (event.hasItem() && !metaPermCheck(user, "interact", item.getTypeId(), item.getData().getData()))
+ if (event.hasItem() && !metaPermCheck(user, "interact", item.getTypeId(), item.getDurability()))
{
event.setCancelled(true);
if (ess.getSettings().warnOnBuildDisallow())
@@ -247,7 +264,7 @@ public class EssentialsAntiBuildListener implements Listener
if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build"))
{
- if (!metaPermCheck(user, "craft", item.getTypeId(), item.getData().getData()))
+ if (!metaPermCheck(user, "craft", item.getTypeId(), item.getDurability()))
{
event.setCancelled(true);
if (ess.getSettings().warnOnBuildDisallow())
@@ -268,7 +285,7 @@ public class EssentialsAntiBuildListener implements Listener
if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build"))
{
- if (!metaPermCheck(user, "pickup", item.getTypeId(), item.getData().getData()))
+ if (!metaPermCheck(user, "pickup", item.getTypeId(), item.getDurability()))
{
event.setCancelled(true);
event.getItem().setPickupDelay(50);
@@ -285,7 +302,7 @@ public class EssentialsAntiBuildListener implements Listener
if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build"))
{
- if (!metaPermCheck(user, "drop", item.getTypeId(), item.getData().getData()))
+ if (!metaPermCheck(user, "drop", item.getTypeId(), item.getDurability()))
{
event.setCancelled(true);
user.updateInventory();
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
index 2324c65d9..8ca1e0726 100644
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java
@@ -134,14 +134,10 @@ public abstract class EssentialsChatPlayer implements Listener
return;
}
- for (Player onlinePlayer : server.getOnlinePlayers())
+ for (Player onlinePlayer : event.getRecipients())
{
String type = _("chatTypeLocal");
final User onlineUser = ess.getUser(onlinePlayer);
- if (onlineUser.isIgnoredPlayer(sender))
- {
- continue;
- }
if (!onlineUser.equals(sender))
{
boolean abort = false;
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
index 8298988e6..a148ed728 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
@@ -394,6 +394,11 @@ public class GroupManager extends JavaPlugin {
return true;
}
+ if (sender.getClass().getName().equals("org.bukkit.craftbukkit.command.CraftBlockCommandSender")) {
+ sender.sendMessage(ChatColor.RED + "GM Commands can not be called from CommandBlocks");
+ return true;
+ }
+
// DETERMINING PLAYER INFORMATION
if (sender instanceof Player) {
senderPlayer = (Player) sender;
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java
index 06dc03656..0ccf6917f 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java
@@ -1,9 +1,11 @@
package com.earth2me.essentials.protect;
import com.earth2me.essentials.protect.data.IProtectedBlock;
+import com.mchange.v2.log.MLevel;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
+import java.util.Properties;
import java.util.logging.Filter;
import java.util.logging.Level;
import java.util.logging.LogRecord;
@@ -27,14 +29,20 @@ public class EssentialsProtect extends JavaPlugin implements IProtect
@Override
public void onLoad()
{
- C3P0logger = com.mchange.v2.log.MLog.getLogger(com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.class);
- C3P0logger.setFilter(new Filter()
+ try
+ {
+ // Simple fix for the case that log4j is on the class path by another plugin
+ Class propertyConfiguratorClass = Class.forName("org.apache.log4j.PropertyConfigurator");
+ Properties properties = new Properties();
+ properties.load(this.getClass().getResourceAsStream("log4j.properties"));
+ propertyConfiguratorClass.getMethod("configure", Properties.class).invoke(null, properties);
+ }
+ catch (Exception ex)
{
- public boolean isLoggable(LogRecord lr)
- {
- return lr.getLevel() != Level.INFO;
- }
- });
+ //Ignore me, log4j not found on classloader.
+ }
+ C3P0logger = com.mchange.v2.log.MLog.getLogger(com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.class);
+ C3P0logger.setLevel(MLevel.WARNING);
}
public void onEnable()
@@ -65,7 +73,7 @@ public class EssentialsProtect extends JavaPlugin implements IProtect
{
final EmergencyListener emListener = new EmergencyListener();
pm.registerEvents(emListener, this);
-
+
for (Player player : getServer().getOnlinePlayers())
{
player.sendMessage("Essentials Protect is in emergency mode. Check your log for errors.");
@@ -89,7 +97,7 @@ public class EssentialsProtect extends JavaPlugin implements IProtect
{
return ess;
}
-
+
public Map<ProtectConfig, Boolean> getSettingsBoolean()
{
return settingsBoolean;
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
index ef556c9bd..4770248b9 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java
@@ -10,9 +10,9 @@ import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
+import org.bukkit.event.entity.*;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
-import org.bukkit.event.entity.*;
public class EssentialsProtectEntityListener implements Listener
@@ -38,33 +38,27 @@ public class EssentialsProtectEntityListener implements Listener
}
final User user = ess.getUser(target);
+ final DamageCause cause = event.getCause();
+
if (event instanceof EntityDamageByBlockEvent)
{
- final DamageCause cause = event.getCause();
-
if (prot.getSettingBool(ProtectConfig.disable_contactdmg)
&& cause == DamageCause.CONTACT
- && !(target instanceof Player
- && user.isAuthorized("essentials.protect.damage.contact")
- && !user.isAuthorized("essentials.protect.damage.disable")))
+ && !(target instanceof Player && shouldBeDamaged(user, "contact")))
{
event.setCancelled(true);
return;
}
if (prot.getSettingBool(ProtectConfig.disable_lavadmg)
&& cause == DamageCause.LAVA
- && !(target instanceof Player
- && user.isAuthorized("essentials.protect.damage.lava")
- && !user.isAuthorized("essentials.protect.damage.disable")))
+ && !(target instanceof Player && shouldBeDamaged(user, "lava")))
{
event.setCancelled(true);
return;
}
if (prot.getSettingBool(ProtectConfig.prevent_tnt_explosion)
&& cause == DamageCause.BLOCK_EXPLOSION
- && !(target instanceof Player
- && user.isAuthorized("essentials.protect.damage.tnt")
- && !user.isAuthorized("essentials.protect.damage.disable")))
+ && !(target instanceof Player && shouldBeDamaged(user, "tnt")))
{
event.setCancelled(true);
return;
@@ -77,48 +71,43 @@ public class EssentialsProtectEntityListener implements Listener
final Entity eAttack = edEvent.getDamager();
final User attacker = ess.getUser(eAttack);
- // PVP Settings
- if (target instanceof Player && eAttack instanceof Player
- && prot.getSettingBool(ProtectConfig.disable_pvp)
- && (!user.isAuthorized("essentials.protect.pvp") || !attacker.isAuthorized("essentials.protect.pvp")))
+ //Creeper explode prevention
+ if (eAttack instanceof Creeper
+ && (prot.getSettingBool(ProtectConfig.prevent_creeper_explosion)
+ || prot.getSettingBool(ProtectConfig.prevent_creeper_playerdmg))
+ && !(target instanceof Player && shouldBeDamaged(user, "creeper")))
{
event.setCancelled(true);
return;
}
- //Creeper explode prevention
- if (eAttack instanceof Creeper && prot.getSettingBool(ProtectConfig.prevent_creeper_explosion)
- && !(target instanceof Player
- && user.isAuthorized("essentials.protect.damage.creeper")
- && !user.isAuthorized("essentials.protect.damage.disable")))
+ if ((event.getEntity() instanceof Fireball || event.getEntity() instanceof SmallFireball)
+ && prot.getSettingBool(ProtectConfig.prevent_fireball_playerdmg)
+ && !(target instanceof Player && shouldBeDamaged(user, "fireball")))
{
event.setCancelled(true);
return;
}
- if (eAttack instanceof Creeper && prot.getSettingBool(ProtectConfig.prevent_creeper_playerdmg)
- && !(target instanceof Player
- && user.isAuthorized("essentials.protect.damage.creeper")
- && !user.isAuthorized("essentials.protect.damage.disable")))
+ if (event.getEntity() instanceof WitherSkull
+ && prot.getSettingBool(ProtectConfig.prevent_witherskull_playerdmg)
+ && !(target instanceof Player && shouldBeDamaged(user, "witherskull")))
{
event.setCancelled(true);
return;
}
- if ((event.getEntity() instanceof Fireball || event.getEntity() instanceof SmallFireball)
- && prot.getSettingBool(ProtectConfig.prevent_fireball_playerdmg)
- && !(target instanceof Player
- && user.isAuthorized("essentials.protect.damage.fireball")
- && !user.isAuthorized("essentials.protect.damage.disable")))
+ if (eAttack instanceof TNTPrimed && prot.getSettingBool(ProtectConfig.prevent_tnt_playerdmg)
+ && !(target instanceof Player && shouldBeDamaged(user, "tnt")))
{
event.setCancelled(true);
return;
}
- if (eAttack instanceof TNTPrimed && prot.getSettingBool(ProtectConfig.prevent_tnt_playerdmg)
- && !(target instanceof Player
- && user.isAuthorized("essentials.protect.damage.tnt")
- && !user.isAuthorized("essentials.protect.damage.disable")))
+ // PVP Settings
+ if (target instanceof Player && eAttack instanceof Player
+ && prot.getSettingBool(ProtectConfig.disable_pvp)
+ && (!user.isAuthorized("essentials.protect.pvp") || !attacker.isAuthorized("essentials.protect.pvp")))
{
event.setCancelled(true);
return;
@@ -126,9 +115,7 @@ public class EssentialsProtectEntityListener implements Listener
if (edEvent.getDamager() instanceof Projectile
&& target instanceof Player
- && ((prot.getSettingBool(ProtectConfig.disable_projectiles)
- && !(user.isAuthorized("essentials.protect.damage.projectiles")
- && !user.isAuthorized("essentials.protect.damage.disable")))
+ && ((prot.getSettingBool(ProtectConfig.disable_projectiles) && !shouldBeDamaged(user, "projectiles"))
|| (((Projectile)edEvent.getDamager()).getShooter() instanceof Player
&& prot.getSettingBool(ProtectConfig.disable_pvp)
&& (!user.isAuthorized("essentials.protect.pvp")
@@ -139,13 +126,11 @@ public class EssentialsProtectEntityListener implements Listener
}
}
- final DamageCause cause = event.getCause();
if (target instanceof Player)
{
if (cause == DamageCause.FALL
&& prot.getSettingBool(ProtectConfig.disable_fall)
- && !(user.isAuthorized("essentials.protect.damage.fall")
- && !user.isAuthorized("essentials.protect.damage.disable")))
+ && !shouldBeDamaged(user, "fall"))
{
event.setCancelled(true);
return;
@@ -153,33 +138,35 @@ public class EssentialsProtectEntityListener implements Listener
if (cause == DamageCause.SUFFOCATION
&& prot.getSettingBool(ProtectConfig.disable_suffocate)
- && !(user.isAuthorized("essentials.protect.damage.suffocation")
- && !user.isAuthorized("essentials.protect.damage.disable")))
+ && !shouldBeDamaged(user, "suffocation"))
{
event.setCancelled(true);
return;
}
- if ((cause == DamageCause.FIRE
- || cause == DamageCause.FIRE_TICK)
+ if ((cause == DamageCause.FIRE || cause == DamageCause.FIRE_TICK)
&& prot.getSettingBool(ProtectConfig.disable_firedmg)
- && !(user.isAuthorized("essentials.protect.damage.fire")
- && !user.isAuthorized("essentials.protect.damage.disable")))
+ && !shouldBeDamaged(user, "fire"))
{
event.setCancelled(true);
return;
}
if (cause == DamageCause.DROWNING
&& prot.getSettingBool(ProtectConfig.disable_drown)
- && !(user.isAuthorized("essentials.protect.damage.drowning")
- && !user.isAuthorized("essentials.protect.damage.disable")))
+ && !shouldBeDamaged(user, "drowning"))
{
event.setCancelled(true);
return;
}
if (cause == DamageCause.LIGHTNING
&& prot.getSettingBool(ProtectConfig.disable_lightning)
- && !(user.isAuthorized("essentials.protect.damage.lightning")
- && !user.isAuthorized("essentials.protect.damage.disable")))
+ && !shouldBeDamaged(user, "lightning"))
+ {
+ event.setCancelled(true);
+ return;
+ }
+ if (cause == DamageCause.WITHER
+ && prot.getSettingBool(ProtectConfig.disable_wither)
+ && !shouldBeDamaged(user, "wither"))
{
event.setCancelled(true);
return;
@@ -187,6 +174,12 @@ public class EssentialsProtectEntityListener implements Listener
}
}
+ private boolean shouldBeDamaged(final User user, final String type)
+ {
+ return (user.isAuthorized("essentials.protect.damage.".concat(type))
+ && !user.isAuthorized("essentials.protect.damage.disable"));
+ }
+
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEntityExplode(final EntityExplodeEvent event)
{
@@ -206,6 +199,12 @@ public class EssentialsProtectEntityListener implements Listener
}
return;
}
+ if (event.getEntity() instanceof Wither
+ && prot.getSettingBool(ProtectConfig.prevent_wither_spawnexplosion))
+ {
+ event.setCancelled(true);
+ return;
+ }
else if (event.getEntity() instanceof Creeper
&& (prot.getSettingBool(ProtectConfig.prevent_creeper_explosion)
|| prot.getSettingBool(ProtectConfig.prevent_creeper_blockdmg)
@@ -228,6 +227,13 @@ public class EssentialsProtectEntityListener implements Listener
event.setCancelled(true);
return;
}
+ else if ((event.getEntity() instanceof WitherSkull)
+ && prot.getSettingBool(ProtectConfig.prevent_witherskull_explosion))
+ {
+ event.setCancelled(true);
+ return;
+ }
+
// This code will prevent explosions near protected rails, signs or protected chests
// TODO: Use protect db instead of this code
@@ -294,6 +300,7 @@ public class EssentialsProtectEntityListener implements Listener
|| event.getReason() == TargetReason.TARGET_ATTACKED_ENTITY
|| event.getReason() == TargetReason.PIG_ZOMBIE_TARGET
|| event.getReason() == TargetReason.RANDOM_TARGET
+ || event.getReason() == TargetReason.DEFEND_VILLAGE
|| event.getReason() == TargetReason.TARGET_ATTACKED_OWNER
|| event.getReason() == TargetReason.OWNER_ATTACKED_TARGET)
&& prot.getSettingBool(ProtectConfig.prevent_entitytarget)
@@ -322,5 +329,10 @@ public class EssentialsProtectEntityListener implements Listener
event.setCancelled(true);
return;
}
+ if (event.getEntityType() == EntityType.WITHER && prot.getSettingBool(ProtectConfig.prevent_wither_blockreplace))
+ {
+ event.setCancelled(true);
+ return;
+ }
}
}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java
index 31141d7e7..d7f428539 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectConfig.java
@@ -17,6 +17,7 @@ public enum ProtectConfig
disable_firedmg("protect.disable.firedmg", false),
disable_lightning("protect.disable.lightning", false),
disable_drown("protect.disable.drown", false),
+ disable_wither("protect.disable.wither", false),
disable_weather_storm("protect.disable.weather.storm", false),
disable_weather_lightning("protect.disable.weather.lightning", false),
disable_weather_thunder("protect.disable.weather.thunder", false),
@@ -34,6 +35,10 @@ public enum ProtectConfig
prevent_fireball_explosion("protect.prevent.fireball-explosion", false),
prevent_fireball_fire("protect.prevent.fireball-fire", false),
prevent_fireball_playerdmg("protect.prevent.fireball-playerdamage", false),
+ prevent_witherskull_explosion("protect.prevent.witherskull-explosion", false),
+ prevent_witherskull_playerdmg("protect.prevent.witherskull-playerdamage", false),
+ prevent_wither_spawnexplosion("protect.prevent.wither-spawnexplosion", false),
+ prevent_wither_blockreplace("protect.prevent.wither-blockreplace", false),
prevent_creeper_explosion("protect.prevent.creeper-explosion", true),
prevent_creeper_playerdmg("protect.prevent.creeper-playerdamage", false),
prevent_creeper_blockdmg("protect.prevent.creeper-blockdamage", false),
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/log4j.properties b/EssentialsProtect/src/com/earth2me/essentials/protect/log4j.properties
new file mode 100644
index 000000000..2642ee541
--- /dev/null
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/log4j.properties
@@ -0,0 +1,4 @@
+log4j.rootLogger=INFO, A1
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n \ No newline at end of file
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
index 0dcf9843a..6fdd4a6a5 100644
--- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
+++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
@@ -97,6 +97,7 @@ public class EssentialsSpawnPlayerListener implements Listener
ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user), 1L);
}
+ //This method allows for multiple line player announce messages using multiline yaml syntax #EasterEgg
if (ess.getSettings().getAnnounceNewPlayers())
{
final IText output = new KeywordReplacer(ess.getSettings().getAnnounceNewPlayerFormat(), user, ess);
diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java
index 164f40c2a..582c8cbef 100644
--- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java
+++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/XMPPManager.java
@@ -11,9 +11,10 @@ import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
+import java.util.logging.SimpleFormatter;
import org.bukkit.entity.Player;
-import org.jivesoftware.smack.Roster.SubscriptionMode;
import org.jivesoftware.smack.*;
+import org.jivesoftware.smack.Roster.SubscriptionMode;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.util.StringUtils;
@@ -22,6 +23,7 @@ import org.jivesoftware.smack.util.StringUtils;
public class XMPPManager extends Handler implements MessageListener, ChatManagerListener, IConf
{
private static final Logger LOGGER = Logger.getLogger("Minecraft");
+ private static final SimpleFormatter formatter = new SimpleFormatter();
private final transient EssentialsConf config;
private transient XMPPConnection connection;
private transient ChatManager chatManager;
@@ -262,8 +264,8 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager
XMPPManager.this.startChat(user);
for (LogRecord logRecord : copy)
{
- final String message = String.format("[" + logRecord.getLevel().getLocalizedName() + "] " + logRecord.getMessage(), logRecord.getParameters());
- if (!XMPPManager.this.sendMessage(user, message))
+ final String message = formatter.format(logRecord);
+ if (!XMPPManager.this.sendMessage(user, Util.stripLogColorFormat(message)))
{
failedUsers.add(user);
break;