diff --git a/.gitignore b/.gitignore
index 9035e9eae..2170d897b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,4 +22,7 @@
/EssentialsXMPP/dist/
/EssentialsXMPP/build/
/EssentialsProtect/dist/
-/EssentialsProtect/build/
\ No newline at end of file
+/EssentialsProtect/build/
+/EssentialsPermissionsCommands/nbproject/private/
+/EssentialsPermissionsCommands/build/
+/EssentialsPermissionsCommands/dist/
\ No newline at end of file
diff --git a/BuildAll/nbproject/build-impl.xml b/BuildAll/nbproject/build-impl.xml
index 2d4272990..4d03d5c8d 100644
--- a/BuildAll/nbproject/build-impl.xml
+++ b/BuildAll/nbproject/build-impl.xml
@@ -636,6 +636,13 @@ is divided into following sections:
+
+
+
+
+
+
+
@@ -650,6 +657,13 @@ is divided into following sections:
+
+
+
+
+
+
+
@@ -1121,6 +1135,13 @@ is divided into following sections:
+
+
+
+
+
+
+
@@ -1135,6 +1156,13 @@ is divided into following sections:
+
+
+
+
+
+
+
diff --git a/BuildAll/nbproject/genfiles.properties b/BuildAll/nbproject/genfiles.properties
index b2e08c5de..cd7a3420b 100644
--- a/BuildAll/nbproject/genfiles.properties
+++ b/BuildAll/nbproject/genfiles.properties
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=c4188209
+build.xml.data.CRC32=2bd2dd75
build.xml.script.CRC32=7a797370
build.xml.stylesheet.CRC32=28e38971@1.43.1.45
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=c4188209
-nbproject/build-impl.xml.script.CRC32=73a4865f
+nbproject/build-impl.xml.data.CRC32=2bd2dd75
+nbproject/build-impl.xml.script.CRC32=769e541b
nbproject/build-impl.xml.stylesheet.CRC32=0c01fd8e@1.43.1.45
diff --git a/BuildAll/nbproject/project.properties b/BuildAll/nbproject/project.properties
index ca7ee69ad..fa00f6f0c 100644
--- a/BuildAll/nbproject/project.properties
+++ b/BuildAll/nbproject/project.properties
@@ -31,11 +31,13 @@ jar.compress=false
javac.classpath=\
${reference.Essentials.jar}:\
${reference.EssentialsChat.jar}:\
- ${reference.EssentialsGroupBridge.jar}:\
- ${reference.EssentialsGroupManager.jar}:\
${reference.EssentialsProtect.jar}:\
+ ${reference.EssentialsPermissionsCommands.jar}:\
${reference.EssentialsSpawn.jar}:\
- ${reference.EssentialsGeoIP.jar}
+ ${reference.EssentialsGeoIP.jar}:\
+ ${reference.EssentialsXMPP.jar}:\
+ ${reference.EssentialsGroupBridge.jar}:\
+ ${reference.EssentialsGroupManager.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
@@ -69,15 +71,19 @@ project.EssentialsChat=../EssentialsChat
project.EssentialsGeoIP=../EssentialsGeoIP
project.EssentialsGroupBridge=../EssentialsGroupBridge
project.EssentialsGroupManager=../EssentialsGroupManager
+project.EssentialsPermissionsCommands=../EssentialsPermissionsCommands
project.EssentialsProtect=../EssentialsProtect
project.EssentialsSpawn=../EssentialsSpawn
+project.EssentialsXMPP=../EssentialsXMPP
reference.Essentials.jar=${project.Essentials}/dist/Essentials.jar
reference.EssentialsChat.jar=${project.EssentialsChat}/dist/EssentialsChat.jar
reference.EssentialsGeoIP.jar=${project.EssentialsGeoIP}/dist/EssentialsGeoIP.jar
reference.EssentialsGroupBridge.jar=${project.EssentialsGroupBridge}/dist/EssentialsGroupBridge.jar
reference.EssentialsGroupManager.jar=${project.EssentialsGroupManager}/dist/EssentialsGroupManager.jar
+reference.EssentialsPermissionsCommands.jar=${project.EssentialsPermissionsCommands}/dist/EssentialsPermissionsCommands.jar
reference.EssentialsProtect.jar=${project.EssentialsProtect}/dist/EssentialsProtect.jar
reference.EssentialsSpawn.jar=${project.EssentialsSpawn}/dist/EssentialsSpawn.jar
+reference.EssentialsXMPP.jar=${project.EssentialsXMPP}/dist/EssentialsXMPP.jar
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
diff --git a/BuildAll/nbproject/project.xml b/BuildAll/nbproject/project.xml
index e00554632..cda8261b6 100644
--- a/BuildAll/nbproject/project.xml
+++ b/BuildAll/nbproject/project.xml
@@ -55,6 +55,14 @@
clean
jar
+
+ EssentialsPermissionsCommands
+ jar
+
+ jar
+ clean
+ jar
+
EssentialsProtect
jar
@@ -71,6 +79,14 @@
clean
jar
+
+ EssentialsXMPP
+ jar
+
+ jar
+ clean
+ jar
+
diff --git a/Essentials/nbproject/project.properties b/Essentials/nbproject/project.properties
index 0f92879ab..850d0d4d8 100644
--- a/Essentials/nbproject/project.properties
+++ b/Essentials/nbproject/project.properties
@@ -31,11 +31,11 @@ file.reference.craftbukkit-0.0.1-SNAPSHOT.jar=..\\lib\\craftbukkit-0.0.1-SNAPSHO
file.reference.iCo4.jar=../lib/iCo4.jar
file.reference.iCo5.jar=../lib/iCo5.jar
file.reference.junit-4.5.jar=..\\lib\\junit_4\\junit-4.5.jar
-file.reference.Permissions.jar=..\\lib\\Permissions.jar
+file.reference.Permissions3.jar=../lib/Permissions3.jar
includes=**
jar.compress=false
javac.classpath=\
- ${file.reference.Permissions.jar}:\
+ ${file.reference.Permissions3.jar}:\
${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}:\
${file.reference.BOSEconomy.jar}:\
${file.reference.iCo4.jar}:\
diff --git a/Essentials/src/com/earth2me/essentials/BanWorkaround.java b/Essentials/src/com/earth2me/essentials/BanWorkaround.java
new file mode 100644
index 000000000..bf9c47899
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/BanWorkaround.java
@@ -0,0 +1,157 @@
+package com.earth2me.essentials;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import net.minecraft.server.ServerConfigurationManager;
+import org.bukkit.craftbukkit.CraftServer;
+
+
+public class BanWorkaround implements IConf
+{
+ private transient final IEssentials ess;
+ private transient final ServerConfigurationManager scm;
+ private static final Logger LOGGER = Logger.getLogger("Minecraft");
+ private transient final Set bans = new HashSet();
+ private transient final Set bannedIps = new HashSet();
+
+ public BanWorkaround(final IEssentials ess)
+ {
+ this.ess = ess;
+ this.scm = ((CraftServer)ess.getServer()).getHandle();
+ }
+
+ public void banByName(final String name)
+ {
+ scm.a(name);
+ reloadConfig();
+ }
+
+ public void unbanByName(String name)
+ {
+ scm.b(name);
+ reloadConfig();
+ }
+
+ public void banByIp(final String ip)
+ {
+ scm.c(ip);
+ reloadConfig();
+ }
+
+ public void unbanByIp(final String ip)
+ {
+ scm.d(ip);
+ reloadConfig();
+ }
+
+ public boolean isNameBanned(final String name)
+ {
+ return bans.contains(name.toLowerCase());
+ }
+
+ public boolean isIpBanned(final String ip)
+ {
+ return bannedIps.contains(ip.toLowerCase());
+ }
+
+ public void reloadConfig()
+ {
+ //I don't like this but it needs to be done until CB fixors
+ final File file = new File(ess.getDataFolder().getParentFile().getParentFile(), "banned-players.txt");
+ try
+ {
+ if (!file.exists())
+ {
+ throw new FileNotFoundException(Util.i18n("bannedPlayersFileNotFound"));
+ }
+
+ final BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
+ try
+ {
+ bans.clear();
+ while (bufferedReader.ready())
+ {
+
+ final String line = bufferedReader.readLine().trim().toLowerCase();
+ if (line.length() > 0 && line.charAt(0) == '#')
+ {
+ continue;
+ }
+ bans.add(line);
+
+ }
+ }
+ catch (IOException io)
+ {
+ LOGGER.log(Level.SEVERE, Util.i18n("bannedPlayersFileError"), io);
+ }
+ finally
+ {
+ try
+ {
+ bufferedReader.close();
+ }
+ catch (IOException ex)
+ {
+ LOGGER.log(Level.SEVERE, Util.i18n("bannedPlayersFileError"), ex);
+ }
+ }
+ }
+ catch (FileNotFoundException ex)
+ {
+ LOGGER.log(Level.SEVERE, Util.i18n("bannedPlayersFileError"), ex);
+ }
+
+ final File ipFile = new File(ess.getDataFolder().getParentFile().getParentFile(), "banned-ips.txt");
+ try
+ {
+ if (!ipFile.exists())
+ {
+ throw new FileNotFoundException(Util.i18n("bannedIpsFileNotFound"));
+ }
+
+ final BufferedReader bufferedReader = new BufferedReader(new FileReader(ipFile));
+ try
+ {
+ bannedIps.clear();
+ while (bufferedReader.ready())
+ {
+
+ final String line = bufferedReader.readLine().trim().toLowerCase();
+ if (line.length() > 0 && line.charAt(0) == '#')
+ {
+ continue;
+ }
+ bannedIps.add(line);
+
+ }
+ }
+ catch (IOException io)
+ {
+ LOGGER.log(Level.SEVERE, Util.i18n("bannedIpsFileError"), io);
+ }
+ finally
+ {
+ try
+ {
+ bufferedReader.close();
+ }
+ catch (IOException ex)
+ {
+ LOGGER.log(Level.SEVERE, Util.i18n("bannedIpsFileError"), ex);
+ }
+ }
+ }
+ catch (FileNotFoundException ex)
+ {
+ LOGGER.log(Level.SEVERE, Util.i18n("bannedIpsFileError"), ex);
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/Charge.java b/Essentials/src/com/earth2me/essentials/Charge.java
deleted file mode 100644
index 5098b3b1f..000000000
--- a/Essentials/src/com/earth2me/essentials/Charge.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package com.earth2me.essentials;
-
-import org.bukkit.inventory.ItemStack;
-
-
-public class Charge
-{
- private final String command;
- private final Double costs;
- private final ItemStack items;
- private final IEssentials ess;
-
- public Charge(String command, IEssentials ess)
- {
- this(command, null, null, ess);
- }
-
- public Charge(double money, IEssentials ess)
- {
- this(null, money, null, ess);
- }
-
- public Charge(ItemStack items, IEssentials ess)
- {
- this(null, null, items, ess);
- }
-
- private Charge(String command, Double money, ItemStack item, IEssentials ess)
- {
- this.command = command;
- this.costs = money;
- this.items = item;
- this.ess = ess;
- }
-
- public void isAffordableFor(IUser user) throws Exception
- {
- double mon = user.getMoney();
- if (costs != null)
- {
- if (mon < costs && !user.isAuthorized("essentials.eco.loan"))
- {
- throw new Exception(Util.i18n("notEnoughMoney"));
- }
- }
- if (items != null)
- {
- if (!InventoryWorkaround.containsItem(user.getInventory(), true, items))
- {
- throw new Exception(Util.format("missingItems", items.getAmount(), items.getType().toString().toLowerCase().replace("_", " ")));
- }
- }
- if (command != null && !command.isEmpty())
- {
- if (user.isAuthorized("essentials.nocommandcost.all")
- || user.isAuthorized("essentials.nocommandcost." + command))
- {
- return;
- }
- double cost = ess.getSettings().getCommandCost(command.startsWith("/") ? command.substring(1) : command);
- if (mon < cost && !user.isAuthorized("essentials.eco.loan"))
- {
- throw new Exception(Util.i18n("notEnoughMoney"));
- }
- }
- }
-
- public void charge(IUser user) throws Exception
- {
- double mon = user.getMoney();
- if (costs != null)
- {
- if (mon < costs && !user.isAuthorized("essentials.eco.loan"))
- {
- throw new Exception(Util.i18n("notEnoughMoney"));
- }
- user.takeMoney(costs);
- }
- if (items != null)
- {
- if (!InventoryWorkaround.containsItem(user.getInventory(), true, items))
- {
- throw new Exception(Util.format("missingItems", items.getAmount(), items.getType().toString().toLowerCase().replace("_", " ")));
- }
- InventoryWorkaround.removeItem(user.getInventory(), true, items);
- user.updateInventory();
- }
- if (command != null && !command.isEmpty())
- {
- if (user.isAuthorized("essentials.nocommandcost.all")
- || user.isAuthorized("essentials.nocommandcost." + command))
- {
- return;
- }
-
- double cost = ess.getSettings().getCommandCost(command.startsWith("/") ? command.substring(1) : command);
- if (mon < cost && !user.isAuthorized("essentials.eco.loan"))
- {
- throw new Exception(Util.i18n("notEnoughMoney"));
- }
- user.takeMoney(cost);
- }
- }
-}
diff --git a/Essentials/src/com/earth2me/essentials/ChargeException.java b/Essentials/src/com/earth2me/essentials/ChargeException.java
new file mode 100644
index 000000000..2fa4c7289
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/ChargeException.java
@@ -0,0 +1,15 @@
+package com.earth2me.essentials;
+
+
+public class ChargeException extends Exception
+{
+ public ChargeException(final String message)
+ {
+ super(message);
+ }
+
+ public ChargeException(final String message, final Throwable throwable)
+ {
+ super(message, throwable);
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/ConfigPermissionsHandler.java b/Essentials/src/com/earth2me/essentials/ConfigPermissionsHandler.java
new file mode 100644
index 000000000..200aa34f8
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/ConfigPermissionsHandler.java
@@ -0,0 +1,46 @@
+package com.earth2me.essentials;
+
+import org.bukkit.entity.Player;
+
+
+public class ConfigPermissionsHandler implements IPermissionsHandler
+{
+ private final transient IEssentials ess;
+
+ public ConfigPermissionsHandler(final IEssentials ess)
+ {
+ this.ess = ess;
+ }
+
+ public String getGroup(final Player base)
+ {
+ return "default";
+ }
+
+ public boolean canBuild(final Player base, final String group)
+ {
+ return true;
+ }
+
+ public boolean inGroup(final Player base, final String group)
+ {
+ return false;
+ }
+
+ public boolean hasPermission(final Player base, final String node)
+ {
+ final String[] cmds = node.split("\\.", 2);
+ return !ess.getSettings().isCommandRestricted(cmds[cmds.length - 1])
+ && ess.getSettings().isPlayerCommand(cmds[cmds.length - 1]);
+ }
+
+ public String getPrefix(final Player base)
+ {
+ return "";
+ }
+
+ public String getSuffix(final Player base)
+ {
+ return "";
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java
index 40325ba97..a7252b1c5 100644
--- a/Essentials/src/com/earth2me/essentials/Essentials.java
+++ b/Essentials/src/com/earth2me/essentials/Essentials.java
@@ -17,6 +17,7 @@
*/
package com.earth2me.essentials;
+import com.earth2me.essentials.api.Economy;
import com.earth2me.essentials.commands.EssentialsCommand;
import java.io.*;
import java.util.*;
@@ -27,10 +28,13 @@ import org.bukkit.command.CommandSender;
import com.earth2me.essentials.commands.IEssentialsCommand;
import com.earth2me.essentials.commands.NotEnoughArgumentsException;
import com.earth2me.essentials.register.payment.Methods;
+import com.earth2me.essentials.signs.SignBlockListener;
+import com.earth2me.essentials.signs.SignEntityListener;
+import com.earth2me.essentials.signs.SignPlayerListener;
import java.math.BigInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.bukkit.craftbukkit.entity.CraftPlayer;
+import org.bukkit.command.PluginCommand;
import org.bukkit.craftbukkit.scheduler.CraftScheduler;
import org.bukkit.entity.Player;
import org.bukkit.event.Event.Priority;
@@ -42,119 +46,130 @@ import org.bukkit.plugin.java.*;
public class Essentials extends JavaPlugin implements IEssentials
{
- public static final String AUTHORS = "Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans and Xeology";
- public static final int minBukkitBuildVersion = 953;
- private static final Logger logger = Logger.getLogger("Minecraft");
- private Settings settings;
- private EssentialsPlayerListener playerListener;
- private EssentialsBlockListener blockListener;
- private EssentialsEntityListener entityListener;
- private JailPlayerListener jailPlayerListener;
- private static Essentials instance = null;
- private Spawn spawn;
- private Jail jail;
- private Warps warps;
- private Worth worth;
- private List confList;
- public ArrayList bans = new ArrayList();
- public ArrayList bannedIps = new ArrayList();
- private Backup backup;
- private final Map users = new HashMap();
- private EssentialsTimer timer;
- private EssentialsUpdateTimer updateTimer;
- private boolean registerFallback = true;
- private final Methods paymentMethod = new Methods();
- private final static boolean enableErrorLogging = false;
- private final EssentialsErrorHandler errorHandler = new EssentialsErrorHandler();
+ public static final int BUKKIT_VERSION = 974;
+ private static final Logger LOGGER = Logger.getLogger("Minecraft");
+ private transient ISettings settings;
+ private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this);
+ private transient Spawn spawn;
+ private transient Jail jail;
+ private transient Warps warps;
+ private transient Worth worth;
+ private transient List confList;
+ private transient Backup backup;
+ private transient BanWorkaround bans;
+ private transient ItemDb itemDb;
+ private transient final Map users = new HashMap();
+ private transient EssentialsUpdateTimer updateTimer;
+ private transient final Methods paymentMethod = new Methods();
+ private transient final static boolean enableErrorLogging = false;
+ private transient final EssentialsErrorHandler errorHandler = new EssentialsErrorHandler();
+ private transient IPermissionsHandler permissionsHandler;
- public static IEssentials getStatic()
- {
- return instance;
- }
-
- public Settings getSettings()
+ public ISettings getSettings()
{
return settings;
}
- public void setupForTesting(Server server) throws IOException, InvalidDescriptionException
+ public void setupForTesting(final Server server) throws IOException, InvalidDescriptionException
{
- File dataFolder = File.createTempFile("essentialstest", "");
- dataFolder.delete();
- dataFolder.mkdir();
- logger.log(Level.INFO, Util.i18n("usingTempFolderForTesting"));
- logger.log(Level.INFO, dataFolder.toString());
+ final File dataFolder = File.createTempFile("essentialstest", "");
+ if (!dataFolder.delete())
+ {
+ throw new IOException();
+ }
+ if (!dataFolder.mkdir())
+ {
+ throw new IOException();
+ }
+ LOGGER.log(Level.INFO, Util.i18n("usingTempFolderForTesting"));
+ LOGGER.log(Level.INFO, dataFolder.toString());
this.initialize(null, server, new PluginDescriptionFile(new FileReader(new File("src" + File.separator + "plugin.yml"))), dataFolder, null, null);
- settings = new Settings(dataFolder);
- setStatic();
- }
-
- public void setStatic()
- {
- instance = this;
+ settings = new Settings(this);
+ permissionsHandler = new ConfigPermissionsHandler(this);
+ Economy.setEss(this);
}
public void onEnable()
{
- if (!Thread.currentThread().getStackTrace()[5].getMethodName().equals("loadPlugin")) {
- logger.log(Level.SEVERE, "Another plugin is trying to enable Essentials manually. Don't do this! It's probably "
- + Thread.currentThread().getStackTrace()[5].getClassName());
+ final String[] javaversion = System.getProperty("java.version").split("\\.", 3);
+ if (javaversion == null || javaversion.length < 2 || Integer.parseInt(javaversion[1]) < 6)
+ {
+ LOGGER.log(Level.SEVERE, "Java version not supported! Please install Java 1.6. You have " + System.getProperty("java.version"));
}
if (enableErrorLogging)
{
- logger.addHandler(errorHandler);
+ LOGGER.addHandler(errorHandler);
}
- setStatic();
EssentialsUpgrade upgrade = new EssentialsUpgrade(this.getDescription().getVersion(), this);
upgrade.beforeSettings();
confList = new ArrayList();
- settings = new Settings(this.getDataFolder());
+ settings = new Settings(this);
confList.add(settings);
upgrade.afterSettings();
- Util.updateLocale(settings.getLocale(), this.getDataFolder());
+ Util.updateLocale(settings.getLocale(), this);
spawn = new Spawn(getServer(), this.getDataFolder());
confList.add(spawn);
warps = new Warps(getServer(), this.getDataFolder());
confList.add(warps);
worth = new Worth(this.getDataFolder());
confList.add(worth);
+ bans = new BanWorkaround(this);
+ confList.add(bans);
+ itemDb = new ItemDb(this);
+ confList.add(itemDb);
reload();
backup = new Backup(this);
- PluginManager pm = getServer().getPluginManager();
+ final PluginManager pm = getServer().getPluginManager();
for (Plugin plugin : pm.getPlugins())
{
- if (plugin.getDescription().getName().startsWith("Essentials"))
+ if (plugin.getDescription().getName().startsWith("Essentials")
+ && !plugin.getDescription().getVersion().equals(this.getDescription().getVersion()))
{
- if (!plugin.getDescription().getVersion().equals(this.getDescription().getVersion()))
- {
- logger.log(Level.WARNING, Util.format("versionMismatch", plugin.getDescription().getName()));
- }
+ LOGGER.log(Level.WARNING, Util.format("versionMismatch", plugin.getDescription().getName()));
}
}
- Matcher versionMatch = Pattern.compile("git-Bukkit-([0-9]+).([0-9]+).([0-9]+)-[0-9]+-[0-9a-z]+-b([0-9]+)jnks.*").matcher(getServer().getVersion());
+ final Matcher versionMatch = Pattern.compile("git-Bukkit-([0-9]+).([0-9]+).([0-9]+)-[0-9]+-[0-9a-z]+-b([0-9]+)jnks.*").matcher(getServer().getVersion());
if (versionMatch.matches())
{
- int versionNumber = Integer.parseInt(versionMatch.group(4));
- if (versionNumber < minBukkitBuildVersion)
+ final int versionNumber = Integer.parseInt(versionMatch.group(4));
+ if (versionNumber < BUKKIT_VERSION)
{
- logger.log(Level.WARNING, Util.i18n("notRecommendedBukkit"));
+ LOGGER.log(Level.WARNING, Util.i18n("notRecommendedBukkit"));
}
}
else
{
- logger.log(Level.INFO, Util.i18n("bukkitFormatChanged"));
+ LOGGER.log(Level.INFO, Util.i18n("bukkitFormatChanged"));
}
+ final Plugin permissionsPlugin = pm.getPlugin("Permissions");
- ServerListener serverListener = new EssentialsPluginListener(paymentMethod);
+ if (permissionsPlugin != null)
+ {
+ if (permissionsPlugin.getDescription().getVersion().charAt(0) == '3')
+ {
+ this.permissionsHandler = new Permissions3Handler(permissionsPlugin);
+ }
+ else
+ {
+ this.permissionsHandler = new Permissions2Handler(permissionsPlugin);
+ }
+ }
+ else
+ {
+ this.permissionsHandler = new ConfigPermissionsHandler(this);
+ }
+
+ final ServerListener serverListener = new EssentialsPluginListener(paymentMethod);
pm.registerEvent(Type.PLUGIN_ENABLE, serverListener, Priority.Low, this);
pm.registerEvent(Type.PLUGIN_DISABLE, serverListener, Priority.Low, this);
- playerListener = new EssentialsPlayerListener(this);
+ final EssentialsPlayerListener playerListener = new EssentialsPlayerListener(this);
pm.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this);
pm.registerEvent(Type.PLAYER_QUIT, playerListener, Priority.Monitor, this);
pm.registerEvent(Type.PLAYER_CHAT, playerListener, Priority.Lowest, this);
+ pm.registerEvent(Type.PLAYER_COMMAND_PREPROCESS, playerListener, Priority.Lowest, this);
if (getSettings().getNetherPortalsEnabled())
{
pm.registerEvent(Type.PLAYER_MOVE, playerListener, Priority.High, this);
@@ -166,57 +181,71 @@ public class Essentials extends JavaPlugin implements IEssentials
pm.registerEvent(Type.PLAYER_BUCKET_EMPTY, playerListener, Priority.High, this);
pm.registerEvent(Type.PLAYER_ANIMATION, playerListener, Priority.High, this);
- blockListener = new EssentialsBlockListener(this);
- pm.registerEvent(Type.SIGN_CHANGE, blockListener, Priority.Low, this);
- pm.registerEvent(Type.BLOCK_BREAK, blockListener, Priority.Lowest, this);
+ final EssentialsBlockListener blockListener = new EssentialsBlockListener(this);
pm.registerEvent(Type.BLOCK_PLACE, blockListener, Priority.Lowest, this);
- entityListener = new EssentialsEntityListener(this);
+ final SignBlockListener signBlockListener = new SignBlockListener(this);
+ pm.registerEvent(Type.SIGN_CHANGE, signBlockListener, Priority.Highest, this);
+ pm.registerEvent(Type.BLOCK_PLACE, signBlockListener, Priority.Low, this);
+ pm.registerEvent(Type.BLOCK_BREAK, signBlockListener, Priority.Highest, this);
+ pm.registerEvent(Type.BLOCK_IGNITE, signBlockListener, Priority.Low, this);
+ pm.registerEvent(Type.BLOCK_BURN, signBlockListener, Priority.Low, this);
+
+ final SignPlayerListener signPlayerListener = new SignPlayerListener(this);
+ pm.registerEvent(Type.PLAYER_INTERACT, signPlayerListener, Priority.Low, this);
+
+ final SignEntityListener signEntityListener = new SignEntityListener(this);
+ pm.registerEvent(Type.ENTITY_EXPLODE, signEntityListener, Priority.Low, this);
+
+ final EssentialsEntityListener entityListener = new EssentialsEntityListener(this);
pm.registerEvent(Type.ENTITY_DAMAGE, entityListener, Priority.Lowest, this);
pm.registerEvent(Type.ENTITY_COMBUST, entityListener, Priority.Lowest, this);
pm.registerEvent(Type.ENTITY_DEATH, entityListener, Priority.Lowest, this);
jail = new Jail(this);
- jailPlayerListener = new JailPlayerListener(this);
+ final JailPlayerListener jailPlayerListener = new JailPlayerListener(this);
confList.add(jail);
- pm.registerEvent(Type.BLOCK_BREAK, jail, Priority.High, this);
- pm.registerEvent(Type.BLOCK_DAMAGE, jail, Priority.High, this);
- pm.registerEvent(Type.BLOCK_PLACE, jail, Priority.High, this);
- pm.registerEvent(Type.PLAYER_INTERACT, jailPlayerListener, Priority.High, this);
- attachEcoListeners();
+ pm.registerEvent(Type.BLOCK_BREAK, jail, Priority.Low, this);
+ pm.registerEvent(Type.BLOCK_DAMAGE, jail, Priority.Low, this);
+ pm.registerEvent(Type.BLOCK_PLACE, jail, Priority.Low, this);
+ pm.registerEvent(Type.PLAYER_INTERACT, jailPlayerListener, Priority.Low, this);
+ pm.registerEvent(Type.PLAYER_RESPAWN, jailPlayerListener, Priority.High, this);
+ pm.registerEvent(Type.PLAYER_TELEPORT, jailPlayerListener, Priority.High, this);
if (settings.isNetherEnabled() && getServer().getWorlds().size() < 2)
{
- logger.log(Level.WARNING, "Old nether is disabled until multiworld support in bukkit is fixed.");
getServer().createWorld(settings.getNetherName(), World.Environment.NETHER);
}
- timer = new EssentialsTimer(this);
+ pm.registerEvent(Type.ENTITY_EXPLODE, tntListener, Priority.High, this);
+
+ final EssentialsTimer timer = new EssentialsTimer(this);
getScheduler().scheduleSyncRepeatingTask(this, timer, 1, 50);
+ Economy.setEss(this);
if (enableErrorLogging)
{
updateTimer = new EssentialsUpdateTimer(this);
getScheduler().scheduleAsyncRepeatingTask(this, updateTimer, 50, 50 * 60 * (this.getDescription().getVersion().startsWith("Dev") ? 60 : 360));
}
- logger.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), AUTHORS));
+ LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), Util.joinList(this.getDescription().getAuthors())));
}
public void onDisable()
{
- instance = null;
- logger.removeHandler(errorHandler);
+ Trade.closeLog();
+ LOGGER.removeHandler(errorHandler);
}
public void reload()
{
- loadBanList();
+ Trade.closeLog();
for (IConf iConf : confList)
{
iConf.reloadConfig();
}
- Util.updateLocale(settings.getLocale(), this.getDataFolder());
+ Util.updateLocale(settings.getLocale(), this);
for (User user : users.values())
{
@@ -225,15 +254,6 @@ public class Essentials extends JavaPlugin implements IEssentials
// for motd
getConfiguration().load();
-
- try
- {
- ItemDb.load(getDataFolder(), "items.csv");
- }
- catch (Exception ex)
- {
- logger.log(Level.WARNING, Util.i18n("itemsCsvNotLoaded"), ex);
- }
}
public String[] getMotd(CommandSender sender, String def)
@@ -250,7 +270,7 @@ public class Essentials extends JavaPlugin implements IEssentials
}
String[] retval = new String[lines.size()];
- if (lines == null || lines.isEmpty() || lines.get(0) == null)
+ if (lines.isEmpty() || lines.get(0) == null)
{
try
{
@@ -264,7 +284,7 @@ public class Essentials extends JavaPlugin implements IEssentials
}
catch (Throwable ex2)
{
- logger.log(Level.WARNING, Util.format("corruptNodeInConfig", node));
+ LOGGER.log(Level.WARNING, Util.format("corruptNodeInConfig", node));
return new String[0];
}
}
@@ -332,39 +352,14 @@ public class Essentials extends JavaPlugin implements IEssentials
return retval;
}
- @SuppressWarnings("LoggerStringConcat")
- public static void previewCommand(CommandSender sender, Command command, String commandLabel, String[] args)
- {
- if (sender instanceof Player)
- {
- logger.info(ChatColor.BLUE + "[PLAYER_COMMAND] " + ((Player)sender).getName() + ": /" + commandLabel + " " + EssentialsCommand.getFinalArg(args, 0));
- }
- }
-
@Override
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args)
{
- return onCommandEssentials(sender, command, commandLabel, args, Essentials.class.getClassLoader(), "com.earth2me.essentials.commands.Command");
+ return onCommandEssentials(sender, command, commandLabel, args, Essentials.class.getClassLoader(), "com.earth2me.essentials.commands.Command", "essentials.");
}
- public boolean onCommandEssentials(CommandSender sender, Command command, String commandLabel, String[] args, ClassLoader classLoader, String commandPath)
+ public boolean onCommandEssentials(CommandSender sender, Command command, String commandLabel, String[] args, ClassLoader classLoader, String commandPath, String permissionPrefix)
{
- if (("msg".equals(commandLabel.toLowerCase()) || "r".equals(commandLabel.toLowerCase()) || "mail".equals(commandLabel.toLowerCase())) && sender instanceof Player)
- {
- StringBuilder str = new StringBuilder();
- str.append(commandLabel).append(" ");
- for (String a : args)
- {
- str.append(a).append(" ");
- }
- for (Player player : getServer().getOnlinePlayers())
- {
- if (getUser(player).isSocialSpyEnabled())
- {
- player.sendMessage(getUser(sender).getDisplayName() + " : " + str);
- }
- }
- }
// Allow plugins to override the command via onCommand
if (!getSettings().isCommandOverridden(command.getName()) && !commandLabel.startsWith("e"))
{
@@ -386,24 +381,22 @@ public class Essentials extends JavaPlugin implements IEssentials
continue;
}
- if (!(desc.getCommands() instanceof Map))
+ PluginCommand pc = getServer().getPluginCommand(desc.getName() + ":" + commandLabel);
+ if (pc != null)
{
- continue;
+ return pc.execute(sender, commandLabel, args);
}
-
- Map cmds = (Map)desc.getCommands();
- if (!cmds.containsKey(command.getName()))
- {
- continue;
- }
- return p.onCommand(sender, command, commandLabel, args);
}
}
try
{
- previewCommand(sender, command, commandLabel, args);
- User user = sender instanceof Player ? getUser(sender) : null;
+ User user = null;
+ if (sender instanceof Player)
+ {
+ user = getUser(sender);
+ LOGGER.log(Level.INFO, String.format("[PLAYER_COMMAND] %s: /%s %s ", ((Player)sender).getName(), commandLabel, EssentialsCommand.getFinalArg(args, 0)));
+ }
// New mail notification
if (user != null && !getSettings().isCommandDisabled("mail") && !commandLabel.equals("mail") && user.isAuthorized("essentials.mail"))
@@ -430,14 +423,14 @@ public class Essentials extends JavaPlugin implements IEssentials
catch (Exception ex)
{
sender.sendMessage(Util.format("commandNotLoaded", commandLabel));
- logger.log(Level.SEVERE, Util.format("commandNotLoaded", commandLabel), ex);
+ LOGGER.log(Level.SEVERE, Util.format("commandNotLoaded", commandLabel), ex);
return true;
}
// Check authorization
- if (user != null && !user.isAuthorized(cmd))
+ if (user != null && !user.isAuthorized(cmd, permissionPrefix))
{
- logger.log(Level.WARNING, Util.format("deniedAccessCommand", user.getName()));
+ LOGGER.log(Level.WARNING, Util.format("deniedAccessCommand", user.getName()));
user.sendMessage(Util.i18n("noAccessCommand"));
return true;
}
@@ -463,133 +456,34 @@ public class Essentials extends JavaPlugin implements IEssentials
}
catch (Throwable ex)
{
- sender.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
- LogRecord lr = new LogRecord(Level.WARNING, Util.format("errorCallingCommand", commandLabel));
- lr.setThrown(ex);
- if (getSettings().isDebug())
- {
- logger.log(lr);
- }
- else
- {
- if (enableErrorLogging)
- {
- errorHandler.publish(lr);
- errorHandler.flush();
- }
- }
+ showError(sender, ex, commandLabel);
return true;
}
}
catch (Throwable ex)
{
- logger.log(Level.SEVERE, Util.format("commandFailed", commandLabel), ex);
+ LOGGER.log(Level.SEVERE, Util.format("commandFailed", commandLabel), ex);
return true;
}
}
- public void loadBanList()
+ public void showError(final CommandSender sender, final Throwable exception, final String commandLabel)
{
- //I don't like this but it needs to be done until CB fixors
- File file = new File("banned-players.txt");
- File ipFile = new File("banned-ips.txt");
- try
+ sender.sendMessage(Util.format("errorWithMessage", exception.getMessage()));
+ final LogRecord logRecord = new LogRecord(Level.WARNING, Util.format("errorCallingCommand", commandLabel));
+ logRecord.setThrown(exception);
+ if (getSettings().isDebug())
{
- if (!file.exists())
+ LOGGER.log(logRecord);
+ }
+ else
+ {
+ if (enableErrorLogging)
{
- throw new FileNotFoundException(Util.i18n("bannedPlayersFileNotFound"));
- }
-
- final BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
- try
- {
- bans.clear();
- while (bufferedReader.ready())
- {
-
- final String line = bufferedReader.readLine().trim().toLowerCase();
- if (line.length() > 0 && line.charAt(0) == '#')
- {
- continue;
- }
- bans.add(line);
-
- }
- }
- catch (IOException io)
- {
- logger.log(Level.SEVERE, Util.i18n("bannedPlayersFileError"), io);
- }
- finally
- {
- try
- {
- bufferedReader.close();
- }
- catch (IOException ex)
- {
- logger.log(Level.SEVERE, Util.i18n("bannedPlayersFileError"), ex);
- }
+ errorHandler.publish(logRecord);
+ errorHandler.flush();
}
}
- catch (FileNotFoundException ex)
- {
- logger.log(Level.SEVERE, Util.i18n("bannedPlayersFileError"), ex);
- }
-
- try
- {
- if (!ipFile.exists())
- {
- throw new FileNotFoundException(Util.i18n("bannedIpsFileNotFound"));
- }
-
- final BufferedReader bufferedReader = new BufferedReader(new FileReader(ipFile));
- try
- {
- bannedIps.clear();
- while (bufferedReader.ready())
- {
-
- final String line = bufferedReader.readLine().trim().toLowerCase();
- if (line.length() > 0 && line.charAt(0) == '#')
- {
- continue;
- }
- bannedIps.add(line);
-
- }
- }
- catch (IOException io)
- {
- logger.log(Level.SEVERE, Util.i18n("bannedIpsFileError"), io);
- }
- finally
- {
- try
- {
- bufferedReader.close();
- }
- catch (IOException ex)
- {
- logger.log(Level.SEVERE, Util.i18n("bannedIpsFileError"), ex);
- }
- }
- }
- catch (FileNotFoundException ex)
- {
- logger.log(Level.SEVERE, Util.i18n("bannedIpsFileError"), ex);
- }
- }
-
- private void attachEcoListeners()
- {
- PluginManager pm = getServer().getPluginManager();
- EssentialsEcoBlockListener ecoBlockListener = new EssentialsEcoBlockListener(this);
- EssentialsEcoPlayerListener ecoPlayerListener = new EssentialsEcoPlayerListener(this);
- pm.registerEvent(Type.PLAYER_INTERACT, ecoPlayerListener, Priority.High, this);
- pm.registerEvent(Type.BLOCK_BREAK, ecoBlockListener, Priority.High, this);
- pm.registerEvent(Type.SIGN_CHANGE, ecoBlockListener, Priority.Monitor, this);
}
public CraftScheduler getScheduler()
@@ -653,47 +547,37 @@ public class Essentials extends JavaPlugin implements IEssentials
return u;
}
+ public Map getAllUsers()
+ {
+ return users;
+ }
+
public User getOfflineUser(String name)
{
File userFolder = new File(getDataFolder(), "userdata");
File userFile = new File(userFolder, Util.sanitizeFileName(name) + ".yml");
if (userFile.exists())
{ //Users do not get offline changes saved without being reproccessed as Users! ~ Xeology :)
- return getUser((Player)new OfflinePlayer(name));
+ return getUser((Player)new OfflinePlayer(name, this));
}
return null;
}
- public World getWorld(String name)
+ public World getWorld(final String name)
{
if (name.matches("[0-9]+"))
{
- int id = Integer.parseInt(name);
+ final int id = Integer.parseInt(name);
if (id < getServer().getWorlds().size())
{
return getServer().getWorlds().get(id);
}
}
- World w = getServer().getWorld(name);
- if (w != null)
- {
- return w;
- }
- return null;
+ return getServer().getWorld(name);
}
- public void setRegisterFallback(boolean registerFallback)
- {
- this.registerFallback = registerFallback;
- }
-
- public boolean isRegisterFallbackEnabled()
- {
- return registerFallback;
- }
-
- public void addReloadListener(IConf listener)
+ public void addReloadListener(final IConf listener)
{
confList.add(listener);
}
@@ -703,7 +587,7 @@ public class Essentials extends JavaPlugin implements IEssentials
return paymentMethod;
}
- public int broadcastMessage(String name, String message)
+ public int broadcastMessage(final String name, final String message)
{
Player[] players = getServer().getOnlinePlayers();
@@ -734,18 +618,33 @@ public class Essentials extends JavaPlugin implements IEssentials
return this.getScheduler().scheduleSyncDelayedTask(this, run);
}
- public int scheduleSyncRepeatingTask(final Runnable run, long delay, long period)
+ public int scheduleSyncDelayedTask(final Runnable run, final long delay)
+ {
+ return this.getScheduler().scheduleSyncDelayedTask(this, run, delay);
+ }
+
+ public int scheduleSyncRepeatingTask(final Runnable run, final long delay, final long period)
{
return this.getScheduler().scheduleSyncRepeatingTask(this, run, delay, period);
}
- public List getBans()
+ public TNTExplodeListener getTNTListener()
+ {
+ return tntListener;
+ }
+
+ public IPermissionsHandler getPermissionsHandler()
+ {
+ return permissionsHandler;
+ }
+
+ public BanWorkaround getBans()
{
return bans;
}
-
- public List getBannedIps()
+
+ public ItemDb getItemDb()
{
- return bannedIps;
+ return itemDb;
}
}
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java
index 7abe500f8..7cd15180b 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java
@@ -1,15 +1,9 @@
package com.earth2me.essentials;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Material;
-import org.bukkit.block.Block;
-import org.bukkit.block.BlockFace;
-import org.bukkit.block.Sign;
-import org.bukkit.craftbukkit.block.CraftSign;
-import org.bukkit.event.block.*;
+import org.bukkit.event.block.BlockListener;
+import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.inventory.ItemStack;
@@ -17,374 +11,99 @@ public class EssentialsBlockListener extends BlockListener
{
private final IEssentials ess;
private static final Logger logger = Logger.getLogger("Minecraft");
- public final static List protectedBlocks = new ArrayList(4);
-
- static
- {
- protectedBlocks.add(Material.CHEST);
- protectedBlocks.add(Material.BURNING_FURNACE);
- protectedBlocks.add(Material.FURNACE);
- protectedBlocks.add(Material.DISPENSER);
- }
public EssentialsBlockListener(IEssentials ess)
{
this.ess = ess;
}
- @Override
- public void onBlockBreak(BlockBreakEvent event)
- {
- if (event.isCancelled()) return;
- if (ess.getSettings().areSignsDisabled()) return;
- User user = ess.getUser(event.getPlayer());
- if (protectedBlocks.contains(event.getBlock().getType()) && !user.isAuthorized("essentials.signs.protection.override"))
- {
- if (isBlockProtected(event.getBlock(), user))
- {
- event.setCancelled(true);
- user.sendMessage(Util.format("noDestroyPermission", event.getBlock().getType().toString().toLowerCase()));
- return;
- }
- }
-
- if (checkProtectionSign(event.getBlock(), user) != NOSIGN &&
- checkProtectionSign(event.getBlock(), user) != OWNER)
- {
- event.setCancelled(true);
- user.sendMessage(Util.format("noDestroyPermission", event.getBlock().getType().toString().toLowerCase()));
- }
- }
-
- @Override
- public void onSignChange(SignChangeEvent event)
- {
- if (event.isCancelled()) return;
- if (ess.getSettings().areSignsDisabled()) return;
- User user = ess.getUser(event.getPlayer());
- String username = user.getName().substring(0, user.getName().length() > 14 ? 14 : user.getName().length());
-
- try
- {
- if (event.getLine(0).equalsIgnoreCase("[Protection]"))
- {
- Block block = event.getBlock();
- if (user.isAuthorized("essentials.signs.protection.create") && hasAdjacentChest(block) && !isBlockProtected(block, user))
- event.setLine(0, "§1[Protection]");
- else
- event.setLine(0, "§4[Protection]");
- event.setLine(3, username);
- return;
- }
- if (event.getLine(0).equalsIgnoreCase("[Disposal]"))
- {
- if (user.isAuthorized("essentials.signs.disposal.create"))
- event.setLine(0, "§1[Disposal]");
- else
- event.setLine(0, "§4[Disposal]");
- return;
- }
- if (event.getLine(0).equalsIgnoreCase("[Heal]"))
- {
- event.setLine(0, "§4[Heal]");
- if (user.isAuthorized("essentials.signs.heal.create"))
- {
- if (!event.getLine(1).isEmpty())
- {
- String[] l1 = event.getLine(1).split("[ :-]+", 2);
- boolean m1 = l1[0].matches("^[^0-9][\\.0-9]+");
- double q1 = Double.parseDouble(m1 ? l1[0].substring(1) : l1[0]);
- if (q1 < 1 || (!m1 && (int)q1 < 1)) throw new Exception(Util.i18n("moreThanZero"));
- if (!m1) ItemDb.get(l1[1]);
- event.setLine(1, (m1 ? Util.formatCurrency(q1) : (int)q1 + " " + l1[1]));
- }
- event.setLine(0, "§1[Heal]");
- }
- return;
- }
- if (event.getLine(0).equalsIgnoreCase("[Free]"))
- {
- event.setLine(0, "§4[Free]");
- ItemDb.get(event.getLine(1));
- if (user.isAuthorized("essentials.signs.free.create"))
- event.setLine(0, "§1[Free]");
- return;
- }
- if (event.getLine(0).equalsIgnoreCase("[Mail]"))
- {
- if (user.isAuthorized("essentials.signs.mail.create"))
- event.setLine(0, "§1[Mail]");
- else
- event.setLine(0, "§4[Mail]");
- return;
- }
- if (event.getLine(0).equalsIgnoreCase("[Balance]"))
- {
- if (user.isAuthorized("essentials.signs.balance.create"))
- event.setLine(0, "§1[Balance]");
- else
- event.setLine(0, "§4[Balance]");
- return;
- }
- if (event.getLine(0).equalsIgnoreCase("[Warp]"))
- {
- event.setLine(0, "§4[Warp]");
- if (user.isAuthorized("essentials.signs.warp.create")) {
- if (!event.getLine(3).isEmpty())
- {
- String[] l1 = event.getLine(3).split("[ :-]+", 2);
- boolean m1 = l1[0].matches("^[^0-9][\\.0-9]+");
- if (!m1 && l1.length != 2)
- {
- throw new Exception(Util.format("invalidSignLine", 4));
- }
- double q1 = Double.parseDouble(m1 ? l1[0].substring(1) : l1[0]);
- if ((int)q1 < 1) throw new Exception(Util.i18n("moreThanZero"));
- if (!m1) ItemDb.get(l1[1]);
- event.setLine(3, (m1 ? Util.formatCurrency(q1) : (int)q1 + " " + l1[1]));
- }
- if (event.getLine(1).isEmpty()) {
- event.setLine(1, "§dWarp name!");
- return;
- } else {
- ess.getWarps().getWarp(event.getLine(1));
- if (event.getLine(2).equalsIgnoreCase("Everyone")) {
- event.setLine(2, "§2Everyone");
- }
- event.setLine(0, "§1[Warp]");
- }
- }
- return;
- }
- }
- catch (Throwable ex)
- {
- user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
- if (ess.getSettings().isDebug())
- {
- logger.log(Level.WARNING, ex.getMessage(), ex);
- }
- }
- }
-
@Override
public void onBlockPlace(BlockPlaceEvent event)
{
- if (event.isCancelled()) return;
- Block signBlock = event.getBlockAgainst();
- if (signBlock.getType() == Material.WALL_SIGN || signBlock.getType() == Material.SIGN_POST)
+ if (event.isCancelled())
{
- Sign sign = new CraftSign(signBlock);
- if (sign.getLine(0).matches("§1\\[[a-zA-Z]+\\]"))
- {
- event.setCancelled(true);
- return;
- }
+ return;
}
final User user = ess.getUser(event.getPlayer());
// Do not rely on getItemInHand();
// http://leaky.bukkit.org/issues/663
final ItemStack is = new ItemStack(event.getBlockPlaced().getType(), 1, (short)0, event.getBlockPlaced().getData());
- switch(is.getType()) {
- case WOODEN_DOOR:
- is.setType(Material.WOOD_DOOR);
- is.setDurability((short)0);
- break;
- case IRON_DOOR_BLOCK:
- is.setType(Material.IRON_DOOR);
- is.setDurability((short)0);
- break;
- case SIGN_POST:
- case WALL_SIGN:
- is.setType(Material.SIGN);
- is.setDurability((short)0);
- break;
- case CROPS:
- is.setType(Material.SEEDS);
- is.setDurability((short)0);
- break;
- case CAKE_BLOCK:
- is.setType(Material.CAKE);
- is.setDurability((short)0);
- break;
- case BED_BLOCK:
- is.setType(Material.BED);
- is.setDurability((short)0);
- break;
- case REDSTONE_WIRE:
- is.setType(Material.REDSTONE);
- is.setDurability((short)0);
- break;
- case REDSTONE_TORCH_OFF:
- case REDSTONE_TORCH_ON:
- is.setType(Material.REDSTONE_TORCH_ON);
- is.setDurability((short)0);
- break;
- case DIODE_BLOCK_OFF:
- case DIODE_BLOCK_ON:
- is.setType(Material.DIODE);
- is.setDurability((short)0);
- break;
- case DOUBLE_STEP:
- is.setType(Material.STEP);
- break;
- case TORCH:
- case RAILS:
- case LADDER:
- case WOOD_STAIRS:
- case COBBLESTONE_STAIRS:
- case LEVER:
- case STONE_BUTTON:
- case FURNACE:
- case DISPENSER:
- case PUMPKIN:
- case JACK_O_LANTERN:
- case WOOD_PLATE:
- case STONE_PLATE:
- case PISTON_STICKY_BASE:
- case PISTON_BASE:
- is.setDurability((short)0);
- break;
+ switch (is.getType())
+ {
+ case WOODEN_DOOR:
+ is.setType(Material.WOOD_DOOR);
+ is.setDurability((short)0);
+ break;
+ case IRON_DOOR_BLOCK:
+ is.setType(Material.IRON_DOOR);
+ is.setDurability((short)0);
+ break;
+ case SIGN_POST:
+ case WALL_SIGN:
+ is.setType(Material.SIGN);
+ is.setDurability((short)0);
+ break;
+ case CROPS:
+ is.setType(Material.SEEDS);
+ is.setDurability((short)0);
+ break;
+ case CAKE_BLOCK:
+ is.setType(Material.CAKE);
+ is.setDurability((short)0);
+ break;
+ case BED_BLOCK:
+ is.setType(Material.BED);
+ is.setDurability((short)0);
+ break;
+ case REDSTONE_WIRE:
+ is.setType(Material.REDSTONE);
+ is.setDurability((short)0);
+ break;
+ case REDSTONE_TORCH_OFF:
+ case REDSTONE_TORCH_ON:
+ is.setType(Material.REDSTONE_TORCH_ON);
+ is.setDurability((short)0);
+ break;
+ case DIODE_BLOCK_OFF:
+ case DIODE_BLOCK_ON:
+ is.setType(Material.DIODE);
+ is.setDurability((short)0);
+ break;
+ case DOUBLE_STEP:
+ is.setType(Material.STEP);
+ break;
+ case TORCH:
+ case RAILS:
+ case LADDER:
+ case WOOD_STAIRS:
+ case COBBLESTONE_STAIRS:
+ case LEVER:
+ case STONE_BUTTON:
+ case FURNACE:
+ case DISPENSER:
+ case PUMPKIN:
+ case JACK_O_LANTERN:
+ case WOOD_PLATE:
+ case STONE_PLATE:
+ case PISTON_STICKY_BASE:
+ case PISTON_BASE:
+ is.setDurability((short)0);
+ break;
+ case FIRE:
+ return;
}
boolean unlimitedForUser = user.hasUnlimited(is);
- if (unlimitedForUser) {
+ if (unlimitedForUser)
+ {
ess.scheduleSyncDelayedTask(
- new Runnable() {
-
- public void run() {
- user.getInventory().addItem(is);
- user.updateInventory();
- }
- });
- }
- }
-
- public boolean hasAdjacentChest(Block block)
- {
- Block[] faces = getAdjacentBlocks(block);
- for (Block b : faces)
- {
- if (protectedBlocks.contains(b.getType()))
- {
- return true;
- }
- }
- return false;
- }
- private static final int NOT_ALLOWED = 0;
- private static final int ALLOWED = 1;
- private static final int NOSIGN = 2;
- private static final int OWNER = 3;
-
- private int checkProtectionSign(Block block, User user)
- {
- String username = user.getName().substring(0, user.getName().length() > 14 ? 14 : user.getName().length());
- if (block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN)
- {
- Sign sign = new CraftSign(block);
- if (sign.getLine(0).equalsIgnoreCase("§1[Protection]") && !user.isAuthorized("essentials.signs.protection.override"))
- {
- for (int i = 1; i <= 2; i++) {
- String line = sign.getLine(i);
- if (line.startsWith("(") && line.endsWith(")")) {
- line = line.substring(1, line.length() - 1);
- if (user.inGroup(line)) {
- return ALLOWED;
- }
- } else if (line.equalsIgnoreCase(username)) {
- return ALLOWED;
- }
- }
- if (sign.getLine(3).equalsIgnoreCase(username))
- {
- return OWNER;
- }
- return NOT_ALLOWED;
- }
- }
- return NOSIGN;
- }
-
- private static Block[] getAdjacentBlocks(Block block)
- {
- return new Block[]
- {
- block.getFace(BlockFace.NORTH),
- block.getFace(BlockFace.SOUTH),
- block.getFace(BlockFace.EAST),
- block.getFace(BlockFace.WEST),
- block.getFace(BlockFace.DOWN),
- block.getFace(BlockFace.UP)
- };
- }
-
- public boolean isBlockProtected(Block block, User user)
- {
- Block[] faces = getAdjacentBlocks(block);
- boolean protect = false;
- for (Block b : faces)
- {
- int check = checkProtectionSign(b, user);
- if (check == NOT_ALLOWED)
- {
- protect = true;
- }
- if (check == ALLOWED || check == OWNER)
- {
- return false;
- }
-
- if (protectedBlocks.contains(b.getType()))
- {
- Block[] faceChest = getAdjacentBlocks(b);
-
- for (Block a : faceChest)
- {
- check = checkProtectionSign(a, user);
- if (check == NOT_ALLOWED)
+ new Runnable()
{
- protect = true;
- }
- if (check == ALLOWED || check == OWNER)
- {
- return false;
- }
- }
- }
- }
- return protect;
- }
-
- public static boolean isBlockProtected(Block block)
- {
- Block[] faces = getAdjacentBlocks(block);
- for (Block b : faces)
- {
- if (b.getType() == Material.SIGN_POST || b.getType() == Material.WALL_SIGN)
- {
- Sign sign = new CraftSign(b);
- if (sign.getLine(0).equalsIgnoreCase("§1[Protection]"))
- {
- return true;
- }
- }
- if (protectedBlocks.contains(b.getType()))
- {
- Block[] faceChest = getAdjacentBlocks(b);
-
- for (Block a : faceChest)
- {
- if (a.getType() == Material.SIGN_POST || a.getType() == Material.WALL_SIGN)
- {
- Sign sign = new CraftSign(a);
- if (sign.getLine(0).equalsIgnoreCase("§1[Protection]"))
+ public void run()
{
- return true;
+ user.getInventory().addItem(is);
+ user.updateInventory();
}
- }
- }
- }
+ });
}
- return false;
}
}
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java
deleted file mode 100644
index 630b9b23d..000000000
--- a/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java
+++ /dev/null
@@ -1,250 +0,0 @@
-package com.earth2me.essentials;
-
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.bukkit.Material;
-import org.bukkit.block.Sign;
-import org.bukkit.craftbukkit.block.CraftSign;
-import org.bukkit.event.block.BlockBreakEvent;
-import org.bukkit.event.block.BlockListener;
-import org.bukkit.event.block.SignChangeEvent;
-import org.bukkit.inventory.ItemStack;
-
-
-public class EssentialsEcoBlockListener extends BlockListener
-{
- private final IEssentials ess;
- private static final Logger logger = Logger.getLogger("Minecraft");
-
- public EssentialsEcoBlockListener(Essentials ess)
- {
- this.ess = ess;
- }
-
- @Override
- public void onBlockBreak(BlockBreakEvent event)
- {
- if (event.isCancelled())
- {
- return;
- }
- if (ess.getSettings().areSignsDisabled())
- {
- return;
- }
- User user = ess.getUser(event.getPlayer());
- String username = user.getName().substring(0, user.getName().length() > 13 ? 13 : user.getName().length());
- if (event.getBlock().getType() != Material.WALL_SIGN && event.getBlock().getType() != Material.SIGN_POST)
- {
- return;
- }
- Sign sign = new CraftSign(event.getBlock());
-
- if (sign.getLine(0).equals("§1[Trade]"))
- {
- if (!sign.getLine(3).substring(2).equals(username))
- {
- if (!user.isOp())
- {
- event.setCancelled(true);
- }
- return;
- }
- try
- {
- String[] l1 = sign.getLines()[1].split("[ :-]+");
- String[] l2 = sign.getLines()[2].split("[ :-]+");
- boolean m1 = l1[0].matches("[^0-9][0-9]+(\\.[0-9]+)?");
- boolean m2 = l2[0].matches("[^0-9][0-9]+(\\.[0-9]+)?");
- double q1 = Double.parseDouble(m1 ? l1[0].substring(1) : l1[0]);
- double q2 = Double.parseDouble(m2 ? l2[0].substring(1) : l2[0]);
- double r1 = Double.parseDouble(l1[m1 ? 1 : 2]);
- double r2 = Double.parseDouble(l2[m2 ? 1 : 2]);
- if ((!m1 & q1 < 1) || (!m2 & q2 < 1))
- {
- throw new Exception(Util.i18n("moreThanZero"));
- }
-
- ItemStack i1 = m1 || r1 <= 0 ? null : ItemDb.get(l1[1], (int)r1);
- ItemStack i2 = m2 || r2 <= 0 ? null : ItemDb.get(l2[1], (int)r2);
-
- if (m1)
- {
- user.giveMoney(r1);
- }
- else if (i1 != null)
- {
- Map leftOver = user.getInventory().addItem(i1);
- for (ItemStack itemStack : leftOver.values())
- {
- InventoryWorkaround.dropItem(user.getLocation(), itemStack);
- }
- }
-
- if (m2)
- {
- user.giveMoney(r2);
- }
- else if (i2 != null)
- {
- Map leftOver = user.getInventory().addItem(i2);
- for (ItemStack itemStack : leftOver.values())
- {
- InventoryWorkaround.dropItem(user.getLocation(), itemStack);
- }
- }
- user.updateInventory();
-
- sign.setType(Material.AIR);
- }
- catch (Throwable ex)
- {
- user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
- if (ess.getSettings().isDebug())
- {
- logger.log(Level.WARNING, ex.getMessage(), ex);
- }
- }
- return;
- }
- }
-
- @Override
- public void onSignChange(SignChangeEvent event)
- {
- if (ess.getSettings().areSignsDisabled())
- {
- return;
- }
- User user = ess.getUser(event.getPlayer());
- String username = user.getName().substring(0, user.getName().length() > 13 ? 13 : user.getName().length());
-
- if ((event.getLine(0).equalsIgnoreCase("[Buy]") || event.getLine(0).equalsIgnoreCase("#1[Buy]")) && user.isAuthorized("essentials.signs.buy.create"))
- {
- try
- {
- event.setLine(0, "§1[Buy]");
- event.setLine(1, "" + Math.abs(Integer.parseInt(event.getLine(1))));
- ItemStack is = ItemDb.get(event.getLine(2));
- if (is.getTypeId() == 0 || Math.abs(Integer.parseInt(event.getLine(1))) == 0)
- {
- throw new Exception("Don't sell air.");
- }
- double price = Double.parseDouble(event.getLine(3).replaceAll("[^0-9\\.]", ""));
- event.setLine(3, Util.formatCurrency(price));
- }
- catch (Throwable ex)
- {
- user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
- if (ess.getSettings().isDebug())
- {
- logger.log(Level.WARNING, ex.getMessage(), ex);
- }
- event.setLine(0, "§4[Buy]");
- event.setLine(1, "#");
- event.setLine(2, "Item");
- event.setLine(3, "$Price");
- }
- return;
- }
-
- if ((event.getLine(0).equalsIgnoreCase("[Sell]") || event.getLine(0).equalsIgnoreCase("#1[Sell]")) && user.isAuthorized("essentials.signs.sell.create"))
- {
- try
- {
- event.setLine(0, "§1[Sell]");
- event.setLine(1, "" + Math.abs(Integer.parseInt(event.getLine(1))));
- ItemStack is = ItemDb.get(event.getLine(2));
- if (is.getTypeId() == 0 || Math.abs(Integer.parseInt(event.getLine(1))) == 0)
- {
- throw new Exception("Can't buy air.");
- }
- double price = Double.parseDouble(event.getLine(3).replaceAll("[^0-9\\.]", ""));
- event.setLine(3, Util.formatCurrency(price));
- }
- catch (Throwable ex)
- {
- user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
- if (ess.getSettings().isDebug())
- {
- logger.log(Level.WARNING, ex.getMessage(), ex);
- }
- event.setLine(0, "§4[Sell]");
- event.setLine(1, "#");
- event.setLine(2, "Item");
- event.setLine(3, "$Price");
- }
- return;
- }
-
- if ((event.getLine(0).equalsIgnoreCase("[Trade]") || event.getLine(0).equalsIgnoreCase("#1[Trade]")) && user.isAuthorized("essentials.signs.trade.create"))
- {
- try
- {
- String[] l1 = event.getLine(1).split("[ :-]+");
- String[] l2 = event.getLine(2).split("[ :-]+");
- boolean m1 = l1[0].matches("[^0-9][0-9]+(\\.[0-9]+)?");
- boolean m2 = l2[0].matches("[^0-9][0-9]+(\\.[0-9]+)?");
- double q1 = Double.parseDouble(m1 ? l1[0].substring(1) : l1[0]);
- double q2 = Double.parseDouble(m2 ? l2[0].substring(1) : l2[0]);
- if (m1 ? l1.length != 1 : l1.length != 2)
- {
- throw new Exception(Util.format("invalidSignLine", 2));
- }
- if (m2 ? l2.length != 2 : l2.length != 3)
- {
- throw new Exception(Util.format("invalidSignLine", 3));
- }
- double r2 = Double.parseDouble(l2[m2 ? 1 : 2]);
- r2 = m2 ? r2 : r2 - r2 % q2;
- if ((!m1 & q1 < 1) || (!m2 & q2 < 1) || r2 < 1)
- {
- throw new Exception(Util.i18n("moreThanZero"));
- }
- if (!m1)
- {
- ItemDb.get(l1[1]);
- }
-
- if (m2)
- {
- if (user.getMoney() < r2)
- {
- throw new Exception(Util.i18n("notEnoughMoney"));
- }
- user.takeMoney(r2);
- //user.sendMessage("r2: " + r2 + " q2: " + q2);
- }
- else
- {
- ItemStack i2 = ItemDb.get(l2[1], (int)r2);
- if (!InventoryWorkaround.containsItem(user.getInventory(), true, i2))
- {
- throw new Exception(Util.format("missingItems", (int)r2, l2[1]));
- }
- InventoryWorkaround.removeItem(user.getInventory(), true, i2);
- user.updateInventory();
- }
-
- event.setLine(0, "§1[Trade]");
- event.setLine(1, (m1 ? Util.formatCurrency(q1) : (int)q1 + " " + l1[1]) + ":0");
- event.setLine(2, (m2 ? Util.formatCurrency(q2) : (int)q2 + " " + l2[1]) + ":" + (m2 ? Util.roundDouble(r2) : "" + (int)r2));
- event.setLine(3, "§8" + username);
- }
- catch (Throwable ex)
- {
- user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
- if (ess.getSettings().isDebug())
- {
- logger.log(Level.WARNING, ex.getMessage(), ex);
- }
- event.setLine(0, "§4[Trade]");
- event.setLine(1, "# ItemOr" + ess.getSettings().getCurrencySymbol());
- event.setLine(2, "# ItemOr" + ess.getSettings().getCurrencySymbol() + ":#");
- event.setLine(3, "§8" + username);
- }
- return;
- }
- }
-}
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java
deleted file mode 100644
index f3e01bd83..000000000
--- a/Essentials/src/com/earth2me/essentials/EssentialsEcoPlayerListener.java
+++ /dev/null
@@ -1,211 +0,0 @@
-package com.earth2me.essentials;
-
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.bukkit.Material;
-import org.bukkit.block.Sign;
-import org.bukkit.craftbukkit.block.CraftSign;
-import org.bukkit.event.block.Action;
-import org.bukkit.event.player.PlayerInteractEvent;
-import org.bukkit.event.player.PlayerListener;
-import org.bukkit.inventory.ItemStack;
-
-
-public class EssentialsEcoPlayerListener extends PlayerListener
-{
- private final IEssentials ess;
- private static final Logger logger = Logger.getLogger("Minecraft");
-
- EssentialsEcoPlayerListener(IEssentials ess)
- {
- this.ess = ess;
- }
-
- @Override
- public void onPlayerInteract(PlayerInteractEvent event)
- {
- if (ess.getSettings().areSignsDisabled())
- {
- return;
- }
- if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
- {
- return;
- }
- User user = ess.getUser(event.getPlayer());
- String username = user.getName().substring(0, user.getName().length() > 13 ? 13 : user.getName().length());
- if (event.getClickedBlock().getType() != Material.WALL_SIGN && event.getClickedBlock().getType() != Material.SIGN_POST)
- {
- return;
- }
- Sign sign = new CraftSign(event.getClickedBlock());
-
- if (sign.getLine(0).equals("§1[Buy]") && user.isAuthorized("essentials.signs.buy.use"))
- {
- try
- {
- int amount = Integer.parseInt(sign.getLine(1));
- ItemStack item = ItemDb.get(sign.getLine(2), amount);
- double cost = Double.parseDouble(sign.getLine(3).substring(1));
- if (user.getMoney() < cost)
- {
- throw new Exception(Util.i18n("notEnoughMoney"));
- }
- user.takeMoney(cost);
- Map leftOver = user.getInventory().addItem(item);
- for (ItemStack itemStack : leftOver.values())
- {
- InventoryWorkaround.dropItem(user.getLocation(), itemStack);
- }
- user.updateInventory();
- }
- catch (Throwable ex)
- {
- user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
- if (ess.getSettings().isDebug())
- {
- logger.log(Level.WARNING, ex.getMessage(), ex);
- }
- }
- return;
- }
-
- if (sign.getLine(0).equals("§1[Sell]") && user.isAuthorized("essentials.signs.sell.use"))
- {
- try
- {
- int amount = Integer.parseInt(sign.getLine(1));
- ItemStack item = ItemDb.get(sign.getLine(2), amount);
- double cost = Double.parseDouble(sign.getLine(3).substring(1));
-
- if (!InventoryWorkaround.containsItem(user.getInventory(), true, item))
- {
- throw new Exception(Util.format("missingItems", amount, sign.getLine(2)));
- }
- user.giveMoney(cost);
- InventoryWorkaround.removeItem(user.getInventory(), true, item);
- user.updateInventory();
- }
- catch (Throwable ex)
- {
- user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
- if (ess.getSettings().isDebug())
- {
- logger.log(Level.WARNING, ex.getMessage(), ex);
- }
- }
- return;
- }
-
- if (sign.getLine(0).equals("§1[Trade]") && user.isAuthorized("essentials.signs.trade.use"))
- {
- try
- {
- String[] l1 = sign.getLine(1).split("[ :-]+");
- String[] l2 = sign.getLine(2).split("[ :-]+");
- boolean m1 = l1[0].matches("[^0-9][0-9]+(\\.[0-9]+)?");
- boolean m2 = l2[0].matches("[^0-9][0-9]+(\\.[0-9]+)?");
- double q1 = Double.parseDouble(m1 ? l1[0].substring(1) : l1[0]);
- double q2 = Double.parseDouble(m2 ? l2[0].substring(1) : l2[0]);
- double r1 = Double.parseDouble(l1[m1 ? 1 : 2]);
- double r2 = Double.parseDouble(l2[m2 ? 1 : 2]);
- r1 = m1 ? r1 : r1 - r1 % q1;
- r2 = m2 ? r2 : r2 - r2 % q2;
- if ((!m1 & q1 < 1) || (!m2 & q2 < 1))
- {
- throw new Exception(Util.i18n("moreThanZero"));
- }
-
- ItemStack i1 = m1 || r1 <= 0 ? null : ItemDb.get(l1[1], (int)r1);
- ItemStack qi1 = m1 ? null : ItemDb.get(l1[1], (int)q1);
- ItemStack qi2 = m2 ? null : ItemDb.get(l2[1], (int)q2);
-
- if (username.equals(sign.getLine(3).substring(2)))
- {
- if (m1)
- {
- user.giveMoney(r1);
- }
- else if (i1 != null)
- {
- Map leftOver = user.getInventory().addItem(i1);
- for (ItemStack itemStack : leftOver.values())
- {
- InventoryWorkaround.dropItem(user.getLocation(), itemStack);
- }
- user.updateInventory();
- }
- r1 = 0;
- sign.setLine(1, (m1 ? Util.formatCurrency(q1) : ((int)q1) + " " + l1[1]) + ":0");
- sign.update();
- }
- else
- {
- if (m1)
- {
- if (user.getMoney() < q1)
- {
- throw new Exception(Util.i18n("notEnoughMoney"));
- }
- }
- else
- {
- if (!InventoryWorkaround.containsItem(user.getInventory(), true, qi1))
- {
- throw new Exception(Util.format("missingItems", (int)q1, l1[1]));
- }
- }
-
- if (r2 < q2)
- {
- throw new Exception(Util.i18n("tradeSignEmpty"));
- }
-
- if (m1)
- {
- user.takeMoney(q1);
- }
- else
- {
- InventoryWorkaround.removeItem(user.getInventory(), true, qi1);
- }
-
- if (m2)
- {
- user.giveMoney(q2);
- }
- else
- {
- Map leftOver = user.getInventory().addItem(qi2);
- for (ItemStack itemStack : leftOver.values())
- {
- InventoryWorkaround.dropItem(user.getLocation(), itemStack);
- }
- }
-
- user.updateInventory();
-
- r1 += q1;
- r2 -= q2;
-
-
- sign.setLine(0, "§1[Trade]");
- sign.setLine(1, (m1 ? Util.formatCurrency(q1) : ((int)q1) + " " + l1[1]) + ":" + (m1 ? Util.roundDouble(r1) : "" + (int)r1));
- sign.setLine(2, (m2 ? Util.formatCurrency(q2) : ((int)q2) + " " + l2[1]) + ":" + (m2 ? Util.roundDouble(r2) : "" + (int)r2));
- sign.update();
- user.sendMessage(Util.i18n("tradeCompleted"));
- }
- }
- catch (Throwable ex)
- {
- user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
- if (ess.getSettings().isDebug())
- {
- logger.log(Level.WARNING, ex.getMessage(), ex);
- }
- }
- return;
- }
- }
-}
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
index 81e24311d..64905a4bc 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
@@ -4,21 +4,18 @@ import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
-import net.minecraft.server.InventoryPlayer;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.block.Block;
-import org.bukkit.block.Sign;
-import org.bukkit.craftbukkit.block.CraftSign;
-import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerAnimationEvent;
import org.bukkit.event.player.PlayerAnimationType;
import org.bukkit.event.player.PlayerBucketEmptyEvent;
import org.bukkit.event.player.PlayerChatEvent;
+import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerEggThrowEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
@@ -34,57 +31,59 @@ import org.bukkit.inventory.ItemStack;
public class EssentialsPlayerListener extends PlayerListener
{
- private static final Logger logger = Logger.getLogger("Minecraft");
- private final Server server;
- private final IEssentials ess;
- private final EssentialsBlockListener essBlockListener;
+ private static final Logger LOGGER = Logger.getLogger("Minecraft");
+ private final transient Server server;
+ private final transient IEssentials ess;
- public EssentialsPlayerListener(IEssentials parent)
+ public EssentialsPlayerListener(final IEssentials parent)
{
this.ess = parent;
this.server = parent.getServer();
- essBlockListener = new EssentialsBlockListener(parent);
}
@Override
- public void onPlayerRespawn(PlayerRespawnEvent event)
+ public void onPlayerRespawn(final PlayerRespawnEvent event)
{
- User user = ess.getUser(event.getPlayer());
+ final User user = ess.getUser(event.getPlayer());
user.setDisplayName(user.getNick());
updateCompass(user);
- if (user.isJailed() && user.getJail() != null && !user.getJail().isEmpty()) {
- try
- {
- event.setRespawnLocation(ess.getJail().getJail(user.getJail()));
- }
- catch (Exception ex)
- {
- }
+ if (ess.getSettings().changeDisplayName())
+ {
+ user.setDisplayName(user.getNick());
}
}
@Override
- public void onPlayerChat(PlayerChatEvent event)
+ public void onPlayerChat(final PlayerChatEvent event)
{
- User user = ess.getUser(event.getPlayer());
+ final User user = ess.getUser(event.getPlayer());
if (user.isMuted())
{
event.setCancelled(true);
- logger.info(Util.format("mutedUserSpeaks", user.getName()));
+ LOGGER.info(Util.format("mutedUserSpeaks", user.getName()));
}
- Iterator it = event.getRecipients().iterator();
+ final Iterator it = event.getRecipients().iterator();
while (it.hasNext())
{
- User u = ess.getUser(it.next());
+ final User u = ess.getUser(it.next());
if (u.isIgnoredPlayer(user.getName()))
{
it.remove();
}
}
+ if (user.isAfk())
+ {
+ user.setAfk(false);
+ ess.broadcastMessage(user.getName(), Util.format("userIsNotAway", user.getDisplayName()));
+ }
+ if (ess.getSettings().changeDisplayName())
+ {
+ user.setDisplayName(user.getNick());
+ }
}
@Override
- public void onPlayerMove(PlayerMoveEvent event)
+ public void onPlayerMove(final PlayerMoveEvent event)
{
if (event.isCancelled())
{
@@ -92,13 +91,19 @@ public class EssentialsPlayerListener extends PlayerListener
}
final User user = ess.getUser(event.getPlayer());
+ if (user.isAfk())
+ {
+ user.setAfk(false);
+ ess.broadcastMessage(user.getName(), Util.format("userIsNotAway", user.getDisplayName()));
+ }
+
if (!ess.getSettings().getNetherPortalsEnabled())
{
return;
}
final Block block = event.getPlayer().getWorld().getBlockAt(event.getTo().getBlockX(), event.getTo().getBlockY(), event.getTo().getBlockZ());
- List worlds = server.getWorlds();
+ final List worlds = server.getWorlds();
if (block.getType() == Material.PORTAL && worlds.size() > 1 && user.isAuthorized("essentials.portal"))
{
@@ -107,17 +112,19 @@ public class EssentialsPlayerListener extends PlayerListener
return;
}
- Location loc = event.getTo();
World nether = server.getWorld(ess.getSettings().getNetherName());
- if (nether == null) {
+ if (nether == null)
+ {
for (World world : worlds)
{
- if (world.getEnvironment() == World.Environment.NETHER) {
+ if (world.getEnvironment() == World.Environment.NETHER)
+ {
nether = world;
break;
}
}
- if (nether == null) {
+ if (nether == null)
+ {
return;
}
}
@@ -128,7 +135,7 @@ public class EssentialsPlayerListener extends PlayerListener
{
factor = ess.getSettings().getNetherRatio();
}
- else if (user.getWorld().getEnvironment() != world.getEnvironment())
+ else if (user.getWorld().getEnvironment() == World.Environment.NORMAL && world.getEnvironment() == World.Environment.NETHER)
{
factor = 1.0 / ess.getSettings().getNetherRatio();
}
@@ -137,6 +144,7 @@ public class EssentialsPlayerListener extends PlayerListener
factor = 1.0;
}
+ Location loc = event.getTo();
int x = loc.getBlockX();
int y = loc.getBlockY();
int z = loc.getBlockZ();
@@ -161,14 +169,14 @@ public class EssentialsPlayerListener extends PlayerListener
if (world.getEnvironment() == World.Environment.NETHER || ess.getSettings().getGenerateExitPortals())
{
portal = NetherPortal.createPortal(dest);
- logger.info(Util.format("userCreatedPortal", event.getPlayer().getName()));
+ LOGGER.info(Util.format("userCreatedPortal", event.getPlayer().getName()));
user.sendMessage(Util.i18n("generatingPortal"));
loc = portal.getSpawn();
}
}
else
{
- logger.info(Util.format("userUsedPortal", event.getPlayer().getName()));
+ LOGGER.info(Util.format("userUsedPortal", event.getPlayer().getName()));
user.sendMessage(Util.i18n("usingPortal"));
loc = portal.getSpawn();
}
@@ -177,7 +185,7 @@ public class EssentialsPlayerListener extends PlayerListener
event.setTo(loc);
try
{
- user.getTeleport().now(loc, new Charge("portal", ess));
+ user.getTeleport().now(loc, new Trade("portal", ess));
}
catch (Exception ex)
{
@@ -194,10 +202,13 @@ public class EssentialsPlayerListener extends PlayerListener
}
@Override
- public void onPlayerQuit(PlayerQuitEvent event)
+ public void onPlayerQuit(final PlayerQuitEvent event)
{
- User user = ess.getUser(event.getPlayer());
-
+ final User user = ess.getUser(event.getPlayer());
+ if (ess.getSettings().removeGodOnDisconnect() && user.isGodModeEnabled())
+ {
+ user.toggleGodModeEnabled();
+ }
if (user.getSavedInventory() != null)
{
user.getInventory().setContents(user.getSavedInventory());
@@ -208,7 +219,7 @@ public class EssentialsPlayerListener extends PlayerListener
return;
}
user.dispose();
- Thread thread = new Thread(new Runnable()
+ final Thread thread = new Thread(new Runnable()
{
public void run()
{
@@ -221,7 +232,7 @@ public class EssentialsPlayerListener extends PlayerListener
rt.gc();
mem = rt.freeMemory() - mem;
mem /= 1024 * 1024;
- logger.log(Level.INFO, Util.format("freedMemory", mem));
+ LOGGER.log(Level.INFO, Util.format("freedMemory", mem));
}
catch (InterruptedException ex)
{
@@ -234,20 +245,28 @@ public class EssentialsPlayerListener extends PlayerListener
}
@Override
- public void onPlayerJoin(PlayerJoinEvent event)
+ public void onPlayerJoin(final PlayerJoinEvent event)
{
ess.getBackup().onPlayerJoin();
- User user = ess.getUser(event.getPlayer());
+ final User user = ess.getUser(event.getPlayer());
//we do not know the ip address on playerlogin so we need to do this here.
if (user.isIpBanned())
{
- String banReason = user.getBanReason();
+ final String banReason = user.getBanReason();
user.kickPlayer(banReason != null && !banReason.isEmpty() ? banReason : Util.i18n("defaultBanReason"));
return;
}
- user.setDisplayName(user.getNick());
+ if (ess.getSettings().changeDisplayName())
+ {
+ user.setDisplayName(user.getNick());
+ }
+ user.setAfk(false);
+ if (user.isAuthorized("essentials.sleepingignored"))
+ {
+ user.setSleepingIgnored(true);
+ }
if (!ess.getSettings().isCommandDisabled("motd") && user.isAuthorized("essentials.motd"))
{
@@ -263,7 +282,7 @@ public class EssentialsPlayerListener extends PlayerListener
if (!ess.getSettings().isCommandDisabled("mail") && user.isAuthorized("essentials.mail"))
{
- List mail = user.getMails();
+ final List mail = user.getMails();
if (mail.isEmpty())
{
user.sendMessage(Util.i18n("noNewMail"));
@@ -276,18 +295,18 @@ public class EssentialsPlayerListener extends PlayerListener
}
@Override
- public void onPlayerLogin(PlayerLoginEvent event)
+ public void onPlayerLogin(final PlayerLoginEvent event)
{
if (event.getResult() != Result.ALLOWED)
{
return;
}
- User user = ess.getUser(event.getPlayer());
+ final User user = ess.getUser(event.getPlayer());
user.setNPC(false);
if (user.isBanned())
{
- String banReason = user.getBanReason();
+ final String banReason = user.getBanReason();
event.disallow(Result.KICK_BANNED, banReason != null && !banReason.isEmpty() ? banReason : Util.i18n("defaultBanReason"));
return;
}
@@ -302,7 +321,7 @@ public class EssentialsPlayerListener extends PlayerListener
updateCompass(user);
}
- private void updateCompass(User user)
+ private void updateCompass(final User user)
{
try
{
@@ -320,24 +339,16 @@ public class EssentialsPlayerListener extends PlayerListener
{
return;
}
- User user = ess.getUser(event.getPlayer());
- if (!user.isJailed() || user.getJail() == null || user.getJail().isEmpty())
+ final User user = ess.getUser(event.getPlayer());
+ if (ess.getSettings().changeDisplayName())
{
- return;
+ user.setDisplayName(user.getNick());
}
- try
- {
- event.setTo(ess.getJail().getJail(user.getJail()));
- }
- catch (Exception ex)
- {
- logger.log(Level.WARNING, Util.i18n("returnPlayerToJailError"), ex);
- }
- user.sendMessage(Util.i18n("jailMessage"));
+ updateCompass(user);
}
@Override
- public void onPlayerInteract(PlayerInteractEvent event)
+ public void onPlayerInteract(final PlayerInteractEvent event)
{
if (event.isCancelled())
{
@@ -347,29 +358,12 @@ public class EssentialsPlayerListener extends PlayerListener
{
return;
}
- User user = ess.getUser(event.getPlayer());
- if (user.isJailed())
- {
- event.setCancelled(true);
- return;
- }
- if (!ess.getSettings().areSignsDisabled() && EssentialsBlockListener.protectedBlocks.contains(event.getClickedBlock().getType()))
- {
- if (!user.isAuthorized("essentials.signs.protection.override"))
- {
- if (essBlockListener.isBlockProtected(event.getClickedBlock(), user))
- {
- event.setCancelled(true);
- user.sendMessage(Util.format("noAccessPermission", event.getClickedBlock().getType().toString().toLowerCase()));
- return;
- }
- }
- }
if (ess.getSettings().getBedSetsHome() && event.getClickedBlock().getType() == Material.BED_BLOCK)
{
try
{
+ final User user = ess.getUser(event.getPlayer());
user.setHome();
user.sendMessage(Util.i18n("homeSetToBed"));
}
@@ -377,158 +371,13 @@ public class EssentialsPlayerListener extends PlayerListener
{
}
}
-
-
- if (ess.getSettings().areSignsDisabled())
- {
- return;
- }
- if (event.getClickedBlock().getType() != Material.WALL_SIGN && event.getClickedBlock().getType() != Material.SIGN_POST)
- {
- return;
- }
- Sign sign = new CraftSign(event.getClickedBlock());
-
- try
- {
- if (sign.getLine(0).equals("§1[Free]") && user.isAuthorized("essentials.signs.free.use"))
- {
- ItemStack item = ItemDb.get(sign.getLine(1));
- CraftInventoryPlayer inv = new CraftInventoryPlayer(new InventoryPlayer(user.getHandle()));
- inv.clear();
- item.setAmount(9 * 4 * 64);
- inv.addItem(item);
- user.showInventory(inv);
- return;
- }
- if (sign.getLine(0).equals("§1[Disposal]") && user.isAuthorized("essentials.signs.disposal.use"))
- {
- CraftInventoryPlayer inv = new CraftInventoryPlayer(new InventoryPlayer(user.getHandle()));
- inv.clear();
- user.showInventory(inv);
- return;
- }
- if (sign.getLine(0).equals("§1[Heal]") && user.isAuthorized("essentials.signs.heal.use"))
- {
- if (!sign.getLine(1).isEmpty())
- {
- String[] l1 = sign.getLine(1).split("[ :-]+");
- boolean m1 = l1[0].matches("^[^0-9][\\.0-9]+");
- double q1 = Double.parseDouble(m1 ? l1[0].substring(1) : l1[0]);
- if (!m1 && (int)q1 < 1)
- {
- throw new Exception(Util.i18n("moreThanZero"));
- }
- if (m1)
- {
- if (user.getMoney() < q1)
- {
- throw new Exception(Util.i18n("notEnoughMoney"));
- }
- user.takeMoney(q1);
- user.sendMessage(Util.format("moneyTaken", Util.formatCurrency(q1)));
- }
- else
- {
- ItemStack i = ItemDb.get(l1[1], (int)q1);
- if (!InventoryWorkaround.containsItem(user.getInventory(), true, i))
- {
- throw new Exception(Util.format("missingItems", (int)q1, l1[1]));
- }
- InventoryWorkaround.removeItem(user.getInventory(), true, i);
- user.updateInventory();
- }
- }
- user.setHealth(20);
- user.sendMessage(Util.i18n("youAreHealed"));
- return;
- }
- if (sign.getLine(0).equals("§1[Mail]") && user.isAuthorized("essentials.signs.mail.use") && user.isAuthorized("essentials.mail"))
- {
- List mail = user.getMails();
- if (mail.isEmpty())
- {
- user.sendMessage(Util.i18n("noNewMail"));
- return;
- }
- for (String s : mail)
- {
- user.sendMessage(s);
- }
- user.sendMessage(Util.i18n("markMailAsRead"));
- return;
- }
- if (sign.getLine(0).equals("§1[Balance]") && user.isAuthorized("essentials.signs.balance.use"))
- {
- user.sendMessage(Util.format("balance", user.getMoney()));
- return;
- }
- if (sign.getLine(0).equals("§1[Warp]"))
- {
-
- if (!sign.getLine(2).isEmpty())
- {
- if (sign.getLine(2).equals("§2Everyone"))
- {
- Charge charge = chargeUserForWarp(sign, user);
- user.getTeleport().warp(sign.getLine(1), charge);
- return;
- }
- if (user.inGroup(sign.getLine(2)))
- {
- Charge charge = chargeUserForWarp(sign, user);
- user.getTeleport().warp(sign.getLine(1), charge);
- return;
- }
- }
- if (user.isAuthorized("essentials.signs.warp.use")
- && (!ess.getSettings().getPerWarpPermission() || user.isAuthorized("essentials.warp." + sign.getLine(1))))
- {
- Charge charge = chargeUserForWarp(sign, user);
- user.getTeleport().warp(sign.getLine(1), charge);
- }
- return;
- }
- }
- catch (Throwable ex)
- {
- user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
- if (ess.getSettings().isDebug())
- {
- logger.log(Level.WARNING, ex.getMessage(), ex);
- }
- }
- }
-
- private Charge chargeUserForWarp(Sign sign, User user) throws Exception
- {
- if (!sign.getLine(3).isEmpty())
- {
- String[] l1 = sign.getLine(3).split("[ :-]+");
- boolean m1 = l1[0].matches("^[^0-9][\\.0-9]+");
- double q1 = Double.parseDouble(m1 ? l1[0].substring(1) : l1[0]);
- if (!m1 && (int)q1 < 1)
- {
- throw new Exception(Util.i18n("moreThanZero"));
- }
- if (m1)
- {
- return new Charge(q1, ess);
- }
- else
- {
- ItemStack i = ItemDb.get(l1[1], (int)q1);
- return new Charge(i, ess);
- }
- }
- return new Charge("warpsign", ess);
}
@Override
- public void onPlayerEggThrow(PlayerEggThrowEvent event)
+ public void onPlayerEggThrow(final PlayerEggThrowEvent event)
{
- User user = ess.getUser(event.getPlayer());
- ItemStack is = new ItemStack(Material.EGG, 1);
+ final User user = ess.getUser(event.getPlayer());
+ final ItemStack is = new ItemStack(Material.EGG, 1);
if (user.hasUnlimited(is))
{
user.getInventory().addItem(is);
@@ -537,7 +386,7 @@ public class EssentialsPlayerListener extends PlayerListener
}
@Override
- public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event)
+ public void onPlayerBucketEmpty(final PlayerBucketEmptyEvent event)
{
final User user = ess.getUser(event.getPlayer());
if (user.hasUnlimited(new ItemStack(event.getBucket())))
@@ -554,24 +403,24 @@ public class EssentialsPlayerListener extends PlayerListener
}
@Override
- public void onPlayerAnimation(PlayerAnimationEvent event)
+ public void onPlayerAnimation(final PlayerAnimationEvent event)
{
usePowertools(event);
}
- private void usePowertools(PlayerAnimationEvent event)
+ private void usePowertools(final PlayerAnimationEvent event)
{
if (event.getAnimationType() != PlayerAnimationType.ARM_SWING)
{
return;
}
- User user = ess.getUser(event.getPlayer());
- ItemStack is = user.getItemInHand();
+ final User user = ess.getUser(event.getPlayer());
+ final ItemStack is = user.getItemInHand();
if (is == null || is.getType() == Material.AIR)
{
return;
}
- String command = user.getPowertool(is);
+ final String command = user.getPowertool(is);
if (command == null || command.isEmpty())
{
return;
@@ -593,4 +442,30 @@ public class EssentialsPlayerListener extends PlayerListener
user.getServer().dispatchCommand(user, command);
}
}
+
+ @Override
+ public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event)
+ {
+ if (event.isCancelled())
+ {
+ return;
+ }
+ final User user = ess.getUser(event.getPlayer());
+ final String cmd = event.getMessage().toLowerCase().split(" ")[0].replace("/", "").toLowerCase();
+ if (("msg".equals(cmd) || "r".equals(cmd) || "mail".equals(cmd)))
+ {
+ for (Player player : ess.getServer().getOnlinePlayers())
+ {
+ if (ess.getUser(player).isSocialSpyEnabled())
+ {
+ player.sendMessage(user.getDisplayName() + " : " + event.getMessage());
+ }
+ }
+ }
+ if (user.isAfk())
+ {
+ user.setAfk(false);
+ ess.broadcastMessage(user.getName(), Util.format("userIsNotAway", user.getDisplayName()));
+ }
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsTimer.java b/Essentials/src/com/earth2me/essentials/EssentialsTimer.java
index db01619b5..320c86cfe 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsTimer.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsTimer.java
@@ -3,7 +3,6 @@ package com.earth2me.essentials;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
-import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Player;
@@ -25,7 +24,7 @@ public class EssentialsTimer implements Runnable, IConf
continue;
}
String name = string.substring(0, string.length()-4);
- User u = ess.getUser(new OfflinePlayer(name));
+ User u = ess.getUser(new OfflinePlayer(name, ess));
allUsers.add(u);
}
}
@@ -43,8 +42,7 @@ public class EssentialsTimer implements Runnable, IConf
for (User user: allUsers) {
if (user.getBanTimeout() > 0 && user.getBanTimeout() < currentTime) {
user.setBanTimeout(0);
- ((CraftServer)ess.getServer()).getHandle().b(user.getName());
- ess.loadBanList();
+ ess.getBans().unbanByName(user.getName());
}
if (user.getMuteTimeout() > 0 && user.getMuteTimeout() < currentTime && user.isMuted()) {
user.setMuteTimeout(0);
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java
index 4d26d270f..31a4f8492 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java
@@ -192,7 +192,7 @@ public class EssentialsUpgrade
usersConfig.load();
for (String username : usersConfig.getKeys(null))
{
- User user = new User(new OfflinePlayer(username), ess);
+ User user = new User(new OfflinePlayer(username, ess), ess);
String nickname = usersConfig.getString(username + ".nickname");
if (nickname != null && !nickname.isEmpty() && !nickname.equals(username))
{
diff --git a/Essentials/src/com/earth2me/essentials/FakeWorld.java b/Essentials/src/com/earth2me/essentials/FakeWorld.java
index 30ef75639..976566704 100644
--- a/Essentials/src/com/earth2me/essentials/FakeWorld.java
+++ b/Essentials/src/com/earth2me/essentials/FakeWorld.java
@@ -391,5 +391,10 @@ public class FakeWorld implements World
{
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ public long getUID()
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/IEssentials.java b/Essentials/src/com/earth2me/essentials/IEssentials.java
index 8cc905355..b1c420e7d 100644
--- a/Essentials/src/com/earth2me/essentials/IEssentials.java
+++ b/Essentials/src/com/earth2me/essentials/IEssentials.java
@@ -1,68 +1,67 @@
package com.earth2me.essentials;
import com.earth2me.essentials.register.payment.Methods;
-import java.io.File;
-import java.util.List;
-import org.bukkit.Server;
+import java.util.Map;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.craftbukkit.scheduler.CraftScheduler;
-import org.bukkit.plugin.PluginDescriptionFile;
+import org.bukkit.plugin.Plugin;
-public interface IEssentials
+
+public interface IEssentials extends Plugin
{
void addReloadListener(IConf listener);
-
+
void reload();
-
- boolean onCommandEssentials(CommandSender sender, Command command, String commandLabel, String[] args, ClassLoader classLoader, String commandPath);
-
+
+ boolean onCommandEssentials(CommandSender sender, Command command, String commandLabel, String[] args, ClassLoader classLoader, String commandPath, String permissionPrefix);
+
User getUser(Object base);
-
+
User getOfflineUser(String name);
-
+
World getWorld(String name);
-
+
int broadcastMessage(String name, String message);
- Settings getSettings();
-
+ ISettings getSettings();
+
CraftScheduler getScheduler();
-
+
String[] getMotd(CommandSender sender, String def);
-
+
String[] getLines(CommandSender sender, String node, String def);
-
+
Jail getJail();
-
+
Warps getWarps();
-
+
Worth getWorth();
-
+
Backup getBackup();
-
+
Spawn getSpawn();
-
- void loadBanList();
-
- public boolean isRegisterFallbackEnabled();
-
- public Methods getPaymentMethod();
-
- Server getServer();
-
- File getDataFolder();
-
- PluginDescriptionFile getDescription();
-
+
+ Methods getPaymentMethod();
+
int scheduleAsyncDelayedTask(Runnable run);
-
+
int scheduleSyncDelayedTask(Runnable run);
-
+
+ int scheduleSyncDelayedTask(Runnable run, long delay);
+
int scheduleSyncRepeatingTask(final Runnable run, long delay, long period);
- List getBans();
+ BanWorkaround getBans();
- List getBannedIps();
+ TNTExplodeListener getTNTListener();
+
+ IPermissionsHandler getPermissionsHandler();
+
+ void showError(final CommandSender sender, final Throwable exception, final String commandLabel);
+
+ Map getAllUsers();
+
+ ItemDb getItemDb();
}
diff --git a/Essentials/src/com/earth2me/essentials/IPermissionsHandler.java b/Essentials/src/com/earth2me/essentials/IPermissionsHandler.java
new file mode 100644
index 000000000..a7bcc80b7
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/IPermissionsHandler.java
@@ -0,0 +1,21 @@
+package com.earth2me.essentials;
+
+import org.bukkit.entity.Player;
+
+
+public interface IPermissionsHandler
+{
+
+ String getGroup(Player base);
+
+ boolean canBuild(Player base, String group);
+
+ boolean inGroup(Player base, String group);
+
+ boolean hasPermission(Player base, String node);
+
+ String getPrefix(Player base);
+
+ String getSuffix(Player base);
+
+}
diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java
new file mode 100644
index 000000000..638f0593a
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/ISettings.java
@@ -0,0 +1,131 @@
+package com.earth2me.essentials;
+
+import com.earth2me.essentials.commands.IEssentialsCommand;
+import java.util.List;
+import java.util.Map;
+import org.bukkit.ChatColor;
+
+
+public interface ISettings extends IConf
+{
+
+ boolean areSignsDisabled();
+
+ String format(String format, IUser user);
+
+ String getAnnounceNewPlayerFormat(IUser user);
+
+ boolean getAnnounceNewPlayers();
+
+ String getBackupCommand();
+
+ long getBackupInterval();
+
+ boolean getBedSetsHome();
+
+ String getChatFormat(String group);
+
+ int getChatRadius();
+
+ double getCommandCost(IEssentialsCommand cmd);
+
+ double getCommandCost(String label);
+
+ String getCurrencySymbol();
+
+ int getDefaultStackSize();
+
+ boolean getGenerateExitPortals();
+
+ double getHealCooldown();
+
+ Object getKit(String name);
+
+ Map getKits();
+
+ String getLocale();
+
+ String getNetherName();
+
+ boolean getNetherPortalsEnabled();
+
+ double getNetherRatio();
+
+ String getNewbieSpawn();
+
+ String getNicknamePrefix();
+
+ ChatColor getOperatorColor() throws Exception;
+
+ boolean getPerWarpPermission();
+
+ boolean getProtectBoolean(final String configName, boolean def);
+
+ int getProtectCreeperMaxHeight();
+
+ List getProtectList(final String configName);
+
+ boolean getProtectPreventSpawn(final String creatureName);
+
+ String getProtectString(final String configName);
+
+ boolean getReclaimSetting();
+
+ boolean getRespawnAtHome();
+
+ boolean getSortListByGroups();
+
+ int getSpawnMobLimit();
+
+ int getStartingBalance();
+
+ double getTeleportCooldown();
+
+ double getTeleportDelay();
+
+ boolean hidePermissionlessHelp();
+
+ boolean isCommandDisabled(final IEssentialsCommand cmd);
+
+ boolean isCommandDisabled(String label);
+
+ boolean isCommandOverridden(String name);
+
+ boolean isCommandRestricted(IEssentialsCommand cmd);
+
+ boolean isCommandRestricted(String label);
+
+ boolean isDebug();
+
+ boolean isEcoDisabled();
+
+ boolean isNetherEnabled();
+
+ boolean isTradeInStacks(int id);
+
+ List itemSpawnBlacklist();
+
+ boolean permissionBasedItemSpawn();
+
+ void reloadConfig();
+
+ boolean showNonEssCommandsInHelp();
+
+ boolean spawnIfNoHome();
+
+ boolean use1to1RatioInNether();
+
+ boolean warnOnBuildDisallow();
+
+ boolean warnOnSmite();
+
+ double getMaxMoney();
+
+ boolean isEcoLogEnabled();
+
+ boolean removeGodOnDisconnect();
+
+ boolean changeDisplayName();
+
+ boolean isPlayerCommand(String string);
+}
diff --git a/Essentials/src/com/earth2me/essentials/IUser.java b/Essentials/src/com/earth2me/essentials/IUser.java
index 4cb69d7d7..5b2e7075e 100644
--- a/Essentials/src/com/earth2me/essentials/IUser.java
+++ b/Essentials/src/com/earth2me/essentials/IUser.java
@@ -22,6 +22,8 @@ public interface IUser
boolean isAuthorized(String node);
boolean isAuthorized(IEssentialsCommand cmd);
+
+ boolean isAuthorized(IEssentialsCommand cmd, String permissionPrefix);
void setLastTeleportTimestamp(long time);
@@ -33,6 +35,8 @@ public interface IUser
void takeMoney(double value);
+ void giveMoney(double value);
+
PlayerInventory getInventory();
void updateInventory();
diff --git a/Essentials/src/com/earth2me/essentials/InventoryWorkaround.java b/Essentials/src/com/earth2me/essentials/InventoryWorkaround.java
index 425113daf..3cbcd1b2e 100644
--- a/Essentials/src/com/earth2me/essentials/InventoryWorkaround.java
+++ b/Essentials/src/com/earth2me/essentials/InventoryWorkaround.java
@@ -1,7 +1,9 @@
package com.earth2me.essentials;
import java.util.HashMap;
+import java.util.Map;
import org.bukkit.Location;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.entity.Item;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
@@ -17,18 +19,18 @@ public final class InventoryWorkaround
private InventoryWorkaround()
{
}
-
- public static int first(Inventory ci, ItemStack item, boolean forceDurability, boolean forceAmount)
+
+ public static int first(final Inventory inventory, final ItemStack item, final boolean forceDurability, final boolean forceAmount)
{
- return next(ci, item, 0, forceDurability, forceAmount);
+ return next(inventory, item, 0, forceDurability, forceAmount);
}
- public static int next(Inventory ci, ItemStack item, int start, boolean forceDurability, boolean forceAmount)
+ public static int next(final Inventory cinventory, final ItemStack item, final int start, final boolean forceDurability, final boolean forceAmount)
{
- ItemStack[] inventory = ci.getContents();
+ final ItemStack[] inventory = cinventory.getContents();
for (int i = start; i < inventory.length; i++)
{
- ItemStack cItem = inventory[i];
+ final ItemStack cItem = inventory[i];
if (cItem == null)
{
continue;
@@ -41,15 +43,133 @@ public final class InventoryWorkaround
return -1;
}
- public static HashMap removeItem(Inventory ci, boolean forceDurability, ItemStack... items)
+ public static int firstPartial(final Inventory cinventory, final ItemStack item, final boolean forceDurability)
{
- HashMap leftover = new HashMap();
+ if (item == null)
+ {
+ return -1;
+ }
+ final ItemStack[] inventory = cinventory.getContents();
+ for (int i = 0; i < inventory.length; i++)
+ {
+ final ItemStack cItem = inventory[i];
+ if (cItem == null)
+ {
+ continue;
+ }
+ if (item.getTypeId() == cItem.getTypeId() && cItem.getAmount() < cItem.getType().getMaxStackSize() && (!forceDurability || cItem.getDurability() == item.getDurability()))
+ {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ public static Map addItem(final Inventory cinventory, final boolean forceDurability, final ItemStack... items)
+ {
+ final Map leftover = new HashMap();
+
+ /* TODO: some optimization
+ * - Create a 'firstPartial' with a 'fromIndex'
+ * - Record the lastPartial per Material
+ * - Cache firstEmpty result
+ */
+
+ // combine items
+
+ ItemStack[] combined = new ItemStack[items.length];
+ for (int i = 0; i < items.length; i++)
+ {
+ if (items[i] == null || items[i].getAmount() < 1)
+ {
+ continue;
+ }
+ for (int j = 0; j < combined.length; j++)
+ {
+ if (combined[j] == null)
+ {
+ combined[j] = new ItemStack(items[i].getType(), items[i].getAmount(), items[i].getDurability());
+ break;
+ }
+ if (combined[j].getTypeId() == items[i].getTypeId() && (!forceDurability || combined[j].getDurability() == items[i].getDurability()))
+ {
+ combined[j].setAmount(combined[j].getAmount() + items[i].getAmount());
+ break;
+ }
+ }
+ }
+
+
+ for (int i = 0; i < items.length; i++)
+ {
+ final ItemStack item = items[i];
+ while (true)
+ {
+ // Do we already have a stack of it?
+ final int firstPartial = firstPartial(cinventory, item, forceDurability);
+
+ // Drat! no partial stack
+ if (firstPartial == -1)
+ {
+ // Find a free spot!
+ final int firstFree = cinventory.firstEmpty();
+
+ if (firstFree == -1)
+ {
+ // No space at all!
+ leftover.put(i, item);
+ break;
+ }
+ else
+ {
+ // More than a single stack!
+ if (item.getAmount() > item.getType().getMaxStackSize())
+ {
+ cinventory.setItem(firstFree, new CraftItemStack(item.getTypeId(), item.getType().getMaxStackSize(), item.getDurability()));
+ item.setAmount(item.getAmount() - item.getType().getMaxStackSize());
+ }
+ else
+ {
+ // Just store it
+ cinventory.setItem(firstFree, item);
+ break;
+ }
+ }
+ }
+ else
+ {
+ // So, apparently it might only partially fit, well lets do just that
+ final ItemStack partialItem = cinventory.getItem(firstPartial);
+
+ final int amount = item.getAmount();
+ final int partialAmount = partialItem.getAmount();
+ final int maxAmount = partialItem.getType().getMaxStackSize();
+
+ // Check if it fully fits
+ if (amount + partialAmount <= maxAmount)
+ {
+ partialItem.setAmount(amount + partialAmount);
+ break;
+ }
+
+ // It fits partially
+ partialItem.setAmount(maxAmount);
+ item.setAmount(amount + partialAmount - maxAmount);
+ }
+ }
+ }
+ return leftover;
+ }
+
+ public static Map removeItem(final Inventory cinventory, final boolean forceDurability, final ItemStack... items)
+ {
+ final Map leftover = new HashMap();
// TODO: optimization
for (int i = 0; i < items.length; i++)
{
- ItemStack item = items[i];
+ final ItemStack item = items[i];
if (item == null)
{
continue;
@@ -66,7 +186,7 @@ public final class InventoryWorkaround
}
// get first Item, ignore the amount
- int first = first(ci, item, forceDurability, false);
+ final int first = first(cinventory, item, forceDurability, false);
// Drat! we don't have this type in the inventory
if (first == -1)
@@ -77,20 +197,20 @@ public final class InventoryWorkaround
}
else
{
- ItemStack itemStack = ci.getItem(first);
- int amount = itemStack.getAmount();
+ final ItemStack itemStack = cinventory.getItem(first);
+ final int amount = itemStack.getAmount();
if (amount <= toDelete)
{
toDelete -= amount;
// clear the slot, all used up
- ci.clear(first);
+ cinventory.clear(first);
}
else
{
// split the stack and store
itemStack.setAmount(amount - toDelete);
- ci.setItem(first, itemStack);
+ cinventory.setItem(first, itemStack);
toDelete = 0;
}
}
@@ -99,9 +219,9 @@ public final class InventoryWorkaround
return leftover;
}
- public static boolean containsItem(Inventory ci, boolean forceDurability, ItemStack... items)
+ public static boolean containsItem(final Inventory cinventory, final boolean forceDurability, final ItemStack... items)
{
- HashMap leftover = new HashMap();
+ final Map leftover = new HashMap();
// TODO: optimization
@@ -131,7 +251,7 @@ public final class InventoryWorkaround
for (int i = 0; i < combined.length; i++)
{
- ItemStack item = combined[i];
+ final ItemStack item = combined[i];
if (item == null)
{
continue;
@@ -147,7 +267,7 @@ public final class InventoryWorkaround
break;
}
- int slot = next(ci, item, position, forceDurability, false);
+ final int slot = next(cinventory, item, position, forceDurability, false);
// Drat! we don't have this type in the inventory
if (slot == -1)
@@ -157,8 +277,8 @@ public final class InventoryWorkaround
}
else
{
- ItemStack itemStack = ci.getItem(slot);
- int amount = itemStack.getAmount();
+ final ItemStack itemStack = cinventory.getItem(slot);
+ final int amount = itemStack.getAmount();
if (amount <= mustHave)
{
@@ -175,17 +295,19 @@ public final class InventoryWorkaround
return leftover.isEmpty();
}
- public static Item[] dropItem(Location loc, ItemStack itm)
+ public static Item[] dropItem(final Location loc, final ItemStack itm)
{
- int maxStackSize = itm.getType().getMaxStackSize();
- int stacks = itm.getAmount() / maxStackSize;
- int leftover = itm.getAmount() % maxStackSize;
+ final int maxStackSize = itm.getType().getMaxStackSize();
+ final int stacks = itm.getAmount() / maxStackSize;
+ final int leftover = itm.getAmount() % maxStackSize;
Item[] itemStacks = new Item[stacks + (leftover > 0 ? 1 : 0)];
- for (int i = 0; i < stacks; i++) {
- itemStacks[i] = loc.getWorld().dropItem(loc, new ItemStack(itm.getType(), maxStackSize, itm.getDurability()));
+ for (int i = 0; i < stacks; i++)
+ {
+ itemStacks[i] = loc.getWorld().dropItem(loc, new ItemStack(itm.getType(), maxStackSize, itm.getDurability()));
}
- if (leftover > 0) {
- itemStacks[stacks] = loc.getWorld().dropItem(loc, new ItemStack(itm.getType(), leftover, itm.getDurability()));
+ if (leftover > 0)
+ {
+ itemStacks[stacks] = loc.getWorld().dropItem(loc, new ItemStack(itm.getType(), leftover, itm.getDurability()));
}
return itemStacks;
}
diff --git a/Essentials/src/com/earth2me/essentials/ItemDb.java b/Essentials/src/com/earth2me/essentials/ItemDb.java
index 8e42f3cb6..d7e534341 100644
--- a/Essentials/src/com/earth2me/essentials/ItemDb.java
+++ b/Essentials/src/com/earth2me/essentials/ItemDb.java
@@ -7,30 +7,31 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
+import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
-public final class ItemDb
+public class ItemDb implements IConf
{
- private ItemDb()
- {
- }
-
- private final static Logger logger = Logger.getLogger("Minecraft");
- private static Map items = new HashMap();
- private static Map durabilities = new HashMap();
+ private final transient IEssentials ess;
- public static void load(File folder, String fname) throws IOException
+ public ItemDb(IEssentials ess)
{
- folder.mkdirs();
- File file = new File(folder, fname);
+ this.ess = ess;
+ }
+ private final static Logger LOGGER = Logger.getLogger("Minecraft");
+ private final transient Map items = new HashMap();
+ private final transient Map durabilities = new HashMap();
+
+ public void reloadConfig()
+ {
+ final File file = new File(ess.getDataFolder(), "items.csv");
if (!file.exists())
{
- file.createNewFile();
- InputStream res = ItemDb.class.getResourceAsStream("/items.csv");
+ final InputStream res = ItemDb.class.getResourceAsStream("/items.csv");
FileWriter tx = null;
try
{
@@ -41,6 +42,11 @@ public final class ItemDb
}
tx.flush();
}
+ catch (IOException ex)
+ {
+ LOGGER.log(Level.SEVERE, Util.i18n("itemsCsvNotLoaded"), ex);
+ return;
+ }
finally
{
try
@@ -63,52 +69,67 @@ public final class ItemDb
}
}
- BufferedReader rx = new BufferedReader(new FileReader(file));
+ BufferedReader rx = null;
try
{
+ rx = new BufferedReader(new FileReader(file));
+ durabilities.clear();
items.clear();
for (int i = 0; rx.ready(); i++)
{
try
{
- String line = rx.readLine().trim().toLowerCase();
+ final String line = rx.readLine().trim().toLowerCase();
if (line.startsWith("#"))
{
continue;
}
- String[] parts = line.split("[^a-z0-9]");
+ final String[] parts = line.split("[^a-z0-9]");
if (parts.length < 2)
{
continue;
}
- int numeric = Integer.parseInt(parts[1]);
+ final int numeric = Integer.parseInt(parts[1]);
durabilities.put(parts[0].toLowerCase(), parts.length > 2 && !parts[2].equals("0") ? Short.parseShort(parts[2]) : 0);
items.put(parts[0].toLowerCase(), numeric);
}
catch (Exception ex)
{
- logger.warning(Util.format("parseError", fname, i));
+ LOGGER.warning(Util.format("parseError", "items.csv", i));
}
}
}
+ catch (IOException ex)
+ {
+ LOGGER.log(Level.SEVERE, Util.i18n("itemsCsvNotLoaded"), ex);
+ }
finally
{
- rx.close();
+ if (rx != null) {
+ try
+ {
+ rx.close();
+ }
+ catch (IOException ex)
+ {
+ LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
+ }
+ }
}
}
- public static ItemStack get(String id, int quantity) throws Exception
+ public ItemStack get(final String id, final int quantity) throws Exception
{
- ItemStack retval = get(id.toLowerCase());
+ final ItemStack retval = get(id.toLowerCase());
retval.setAmount(quantity);
return retval;
}
- public static ItemStack get(String id) throws Exception
+ public ItemStack get(final String id) throws Exception
{
int itemid = 0;
String itemname = null;
@@ -127,11 +148,11 @@ public final class ItemDb
itemname = id.split("[:+',;.]")[0].toLowerCase();
metaData = Short.parseShort(id.split("[:+',;.]")[1]);
}
- else
+ else
{
itemname = id.toLowerCase();
}
-
+
if (itemname != null)
{
if (items.containsKey(itemname))
@@ -148,13 +169,13 @@ public final class ItemDb
}
}
- Material mat = Material.getMaterial(itemid);
+ final Material mat = Material.getMaterial(itemid);
if (mat == null)
{
throw new Exception(Util.format("unknownItemId", itemid));
}
- ItemStack retval = new ItemStack(mat);
- retval.setAmount(Essentials.getStatic().getSettings().getDefaultStackSize());
+ final ItemStack retval = new ItemStack(mat);
+ retval.setAmount(ess.getSettings().getDefaultStackSize());
retval.setDurability(metaData);
return retval;
}
diff --git a/Essentials/src/com/earth2me/essentials/JailPlayerListener.java b/Essentials/src/com/earth2me/essentials/JailPlayerListener.java
index 865485d8b..5ba333952 100644
--- a/Essentials/src/com/earth2me/essentials/JailPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/JailPlayerListener.java
@@ -1,11 +1,16 @@
package com.earth2me.essentials;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerListener;
+import org.bukkit.event.player.PlayerRespawnEvent;
+import org.bukkit.event.player.PlayerTeleportEvent;
public class JailPlayerListener extends PlayerListener
{
+ private static final Logger LOGGER = Logger.getLogger("Minecraft");
private final IEssentials ess;
public JailPlayerListener(IEssentials parent)
@@ -16,10 +21,47 @@ public class JailPlayerListener extends PlayerListener
@Override
public void onPlayerInteract(PlayerInteractEvent event)
{
- User user = ess.getUser(event.getPlayer());
+ final User user = ess.getUser(event.getPlayer());
if (user.isJailed())
{
event.setCancelled(true);
}
}
+
+ @Override
+ public void onPlayerRespawn(PlayerRespawnEvent event)
+ {
+ final User user = ess.getUser(event.getPlayer());
+ if (user.isJailed() && user.getJail() != null && !user.getJail().isEmpty())
+ {
+ try
+ {
+ event.setRespawnLocation(ess.getJail().getJail(user.getJail()));
+ }
+ catch (Exception ex)
+ {
+ }
+ }
+ }
+
+ @Override
+ public void onPlayerTeleport(PlayerTeleportEvent event)
+ {
+ final User user = ess.getUser(event.getPlayer());
+ if (!user.isJailed() || user.getJail() == null || user.getJail().isEmpty())
+ {
+ return;
+ }
+ try
+ {
+ event.setTo(ess.getJail().getJail(user.getJail()));
+ }
+ catch (Exception ex)
+ {
+ LOGGER.log(Level.WARNING, Util.i18n("returnPlayerToJailError"), ex);
+ }
+ user.sendMessage(Util.i18n("jailMessage"));
+ }
+
+
}
diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java
index 56a8a00a2..ff0b73fbd 100644
--- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java
+++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java
@@ -29,13 +29,16 @@ import org.bukkit.util.Vector;
public class OfflinePlayer implements Player
{
private final String name;
+ final transient IEssentials ess;
private Location location = new Location(null, 0, 0, 0, 0, 0);
- private World world = null;
+ private World world;
private UUID uniqueId = UUID.randomUUID();
- public OfflinePlayer(String name)
+ public OfflinePlayer(String name, IEssentials ess)
{
this.name = name;
+ this.ess = ess;
+ this.world = ess.getServer().getWorlds().get(0);
}
public boolean isOnline()
@@ -141,7 +144,7 @@ public class OfflinePlayer implements Player
{
return world;
}
-
+
public void setLocation(Location loc)
{
location = loc;
@@ -258,7 +261,7 @@ public class OfflinePlayer implements Player
public Server getServer()
{
- return Essentials.getStatic() == null ? null : Essentials.getStatic().getServer();
+ return ess == null ? null : ess.getServer();
}
public Vector getMomentum()
@@ -296,7 +299,8 @@ public class OfflinePlayer implements Player
throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
}
- public void sendRawMessage(String string) {
+ public void sendRawMessage(String string)
+ {
throw new UnsupportedOperationException(Util.i18n("notSupportedYet"));
}
diff --git a/Essentials/src/com/earth2me/essentials/Permissions2Handler.java b/Essentials/src/com/earth2me/essentials/Permissions2Handler.java
new file mode 100644
index 000000000..c588bb5fa
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/Permissions2Handler.java
@@ -0,0 +1,48 @@
+package com.earth2me.essentials;
+
+import com.nijiko.permissions.PermissionHandler;
+import com.nijikokun.bukkit.Permissions.Permissions;
+import org.bukkit.entity.Player;
+import org.bukkit.plugin.Plugin;
+
+
+public class Permissions2Handler implements IPermissionsHandler
+{
+ private final transient PermissionHandler permissionHandler;
+
+ Permissions2Handler(final Plugin permissionsPlugin)
+ {
+ permissionHandler = ((Permissions)permissionsPlugin).getHandler();
+ }
+
+ public String getGroup(final Player base)
+ {
+ return permissionHandler.getGroup(base.getWorld().getName(), base.getName());
+ }
+
+ public boolean canBuild(final Player base, final String group)
+ {
+ return permissionHandler.canGroupBuild(base.getWorld().getName(), getGroup(base));
+ }
+
+ public boolean inGroup(final Player base, final String group)
+ {
+ return permissionHandler.inGroup(base.getWorld().getName(), base.getName(), group);
+ }
+
+ public boolean hasPermission(final Player base, final String node)
+ {
+ return permissionHandler.permission(base, node);
+ }
+
+ public String getPrefix(final Player base)
+ {
+ return permissionHandler.getGroupPrefix(base.getWorld().getName(), getGroup(base));
+ }
+
+ public String getSuffix(final Player base)
+ {
+ return permissionHandler.getGroupSuffix(base.getWorld().getName(), getGroup(base));
+ }
+
+}
diff --git a/Essentials/src/com/earth2me/essentials/Permissions3Handler.java b/Essentials/src/com/earth2me/essentials/Permissions3Handler.java
new file mode 100644
index 000000000..99c95da0a
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/Permissions3Handler.java
@@ -0,0 +1,48 @@
+package com.earth2me.essentials;
+
+import com.nijiko.permissions.PermissionHandler;
+import com.nijikokun.bukkit.Permissions.Permissions;
+import org.bukkit.entity.Player;
+import org.bukkit.plugin.Plugin;
+
+
+public class Permissions3Handler implements IPermissionsHandler
+{
+ private final transient PermissionHandler permissionHandler;
+
+ Permissions3Handler(final Plugin permissionsPlugin)
+ {
+ permissionHandler = ((Permissions)permissionsPlugin).getHandler();
+ }
+
+ public String getGroup(final Player base)
+ {
+ return permissionHandler.getPrimaryGroup(base.getWorld().getName(), base.getName());
+ }
+
+ public boolean canBuild(final Player base, final String group)
+ {
+ return permissionHandler.canUserBuild(base.getWorld().getName(), base.getName());
+ }
+
+ public boolean inGroup(final Player base, final String group)
+ {
+ return permissionHandler.inGroup(base.getWorld().getName(), base.getName(), group);
+ }
+
+ public boolean hasPermission(final Player base, final String node)
+ {
+ return permissionHandler.has(base, node);
+ }
+
+ public String getPrefix(final Player base)
+ {
+ return permissionHandler.getUserPrefix(base.getWorld().getName(), base.getName());
+ }
+
+ public String getSuffix(final Player base)
+ {
+ return permissionHandler.getUserSuffix(base.getWorld().getName(), base.getName());
+ }
+
+}
diff --git a/Essentials/src/com/earth2me/essentials/PlayerExtension.java b/Essentials/src/com/earth2me/essentials/PlayerExtension.java
index 901edd345..e72cf25f4 100644
--- a/Essentials/src/com/earth2me/essentials/PlayerExtension.java
+++ b/Essentials/src/com/earth2me/essentials/PlayerExtension.java
@@ -19,12 +19,12 @@ public class PlayerExtension extends PlayerWrapper
public boolean isBanned()
{
- return ess.getBans().contains(getName());
+ return ess.getBans().isNameBanned(this.getName());
}
public boolean isIpBanned()
{
- return ess.getBannedIps().contains(getAddress().getAddress().toString().replace("/", ""));
+ return ess.getBans().isIpBanned(getAddress().getAddress().getHostAddress());
}
public float getCorrectedYaw()
@@ -53,38 +53,17 @@ public class PlayerExtension extends PlayerWrapper
public String getGroup()
{
- try
- {
- return com.nijikokun.bukkit.Permissions.Permissions.Security.getGroup(getWorld().getName(), getName());
- }
- catch (Throwable ex)
- {
- return "default";
- }
+ return ess.getPermissionsHandler().getGroup(base);
}
public boolean inGroup(String group)
{
- try
- {
- return com.nijikokun.bukkit.Permissions.Permissions.Security.inGroup(getWorld().getName(), getName(), group);
- }
- catch (Throwable ex)
- {
- return false;
- }
+ return ess.getPermissionsHandler().inGroup(base, group);
}
public boolean canBuild()
{
- try
- {
- return isOp() || com.nijikokun.bukkit.Permissions.Permissions.Security.canGroupBuild(getWorld().getName(), getGroup());
- }
- catch (Throwable ex)
- {
- return true;
- }
+ return ess.getPermissionsHandler().canBuild(base, getGroup());
}
public EntityPlayer getHandle()
diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java
index 461f8908f..d63bc7194 100644
--- a/Essentials/src/com/earth2me/essentials/Settings.java
+++ b/Essentials/src/com/earth2me/essentials/Settings.java
@@ -6,65 +6,74 @@ import org.bukkit.ChatColor;
import com.earth2me.essentials.commands.IEssentialsCommand;
import java.io.File;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.bukkit.entity.CreatureType;
import org.bukkit.inventory.ItemStack;
-public class Settings implements IConf
+public class Settings implements ISettings
{
- private final EssentialsConf config;
+ private final transient EssentialsConf config;
private final static Logger logger = Logger.getLogger("Minecraft");
+ private final transient IEssentials ess;
- public Settings(File dataFolder)
+ public Settings(IEssentials ess)
{
- config = new EssentialsConf(new File(dataFolder, "config.yml"));
+ this.ess = ess;
+ config = new EssentialsConf(new File(ess.getDataFolder(), "config.yml"));
config.setTemplateName("/config.yml");
- config.load();
+ reloadConfig();
}
+ @Override
public boolean getRespawnAtHome()
{
return config.getBoolean("respawn-at-home", false);
}
+ @Override
public boolean getBedSetsHome()
{
return config.getBoolean("bed-sethome", false);
}
+ @Override
public int getChatRadius()
{
return config.getInt("chat.radius", config.getInt("chat-radius", 0));
}
+ @Override
public double getTeleportDelay()
{
return config.getDouble("teleport-delay", 0);
}
+ @Override
public int getDefaultStackSize()
{
return config.getInt("default-stack-size", 64);
}
+ @Override
public int getStartingBalance()
{
return config.getInt("starting-balance", 0);
}
+ @Override
public boolean getNetherPortalsEnabled()
{
return isNetherEnabled() && config.getBoolean("nether.portals-enabled", false);
}
+ @Override
public boolean isCommandDisabled(final IEssentialsCommand cmd)
{
return isCommandDisabled(cmd.getName());
}
+ @Override
public boolean isCommandDisabled(String label)
{
for (String c : config.getStringList("disabled-commands", new ArrayList(0)))
@@ -75,11 +84,13 @@ public class Settings implements IConf
return config.getBoolean("disable-" + label.toLowerCase(), false);
}
+ @Override
public boolean isCommandRestricted(IEssentialsCommand cmd)
{
return isCommandRestricted(cmd.getName());
}
+ @Override
public boolean isCommandRestricted(String label)
{
for (String c : config.getStringList("restricted-commands", new ArrayList(0)))
@@ -89,7 +100,19 @@ public class Settings implements IConf
}
return config.getBoolean("restrict-" + label.toLowerCase(), false);
}
+
+ @Override
+ public boolean isPlayerCommand(String label)
+ {
+ for (String c : config.getStringList("player-commands", new ArrayList(0)))
+ {
+ if (!c.equalsIgnoreCase(label)) continue;
+ return true;
+ }
+ return false;
+ }
+ @Override
public boolean isCommandOverridden(String name)
{
List defaultList = new ArrayList(1);
@@ -103,11 +126,13 @@ public class Settings implements IConf
return config.getBoolean("override-" + name.toLowerCase(), false);
}
+ @Override
public double getCommandCost(IEssentialsCommand cmd)
{
return getCommandCost(cmd.getName());
}
+ @Override
public double getCommandCost(String label)
{
double cost = config.getDouble("command-costs." + label, 0.0);
@@ -116,26 +141,25 @@ public class Settings implements IConf
return cost;
}
- public String getCommandPrefix()
- {
- return config.getString("command-prefix", "");
- }
-
+ @Override
public String getNicknamePrefix()
{
return config.getString("nickname-prefix", "~");
}
+ @Override
public double getTeleportCooldown()
{
return config.getDouble("teleport-cooldown", 60);
}
+ @Override
public double getHealCooldown()
{
return config.getDouble("heal-cooldown", 60);
}
+ @Override
public Object getKit(String name)
{
Map kits = (Map)config.getProperty("kits");
@@ -148,11 +172,13 @@ public class Settings implements IConf
return null;
}
+ @Override
public Map getKits()
{
return (Map)config.getProperty("kits");
}
+ @Override
public ChatColor getOperatorColor() throws Exception
{
String colorName = config.getString("ops-name-color", null);
@@ -173,257 +199,123 @@ public class Settings implements IConf
return ChatColor.getByCode(Integer.parseInt(colorName, 16));
}
+ @Override
public boolean getReclaimSetting()
{
return config.getBoolean("reclaim-onlogout", true);
}
+ @Override
public String getNetherName()
{
return config.getString("nether.folder", "nether");
}
+ @Override
public boolean isNetherEnabled()
{
return config.getBoolean("nether.enabled", true);
}
+ @Override
public int getSpawnMobLimit()
{
return config.getInt("spawnmob-limit", 10);
}
-
+
+ @Override
public boolean showNonEssCommandsInHelp()
{
return config.getBoolean("non-ess-in-help", true);
}
-
- public Map getEpSettings()
+
+ @Override
+ public boolean hidePermissionlessHelp()
{
- Map epSettings = new HashMap();
+ return config.getBoolean("hide-permissionless-help", true);
+ }
- epSettings.put("protect.protect.signs", config.getBoolean("protect.protect.signs", true));
- epSettings.put("protect.protect.rails", config.getBoolean("protect.protect.rails", true));
- epSettings.put("protect.protect.block-below", config.getBoolean("protect.protect.block-below", true));
- epSettings.put("protect.protect.prevent-block-on-rails", config.getBoolean("protect.protect.prevent-block-on-rails", false));
- return epSettings;
- }
-
- public Map getEpDBSettings()
- {
- Map epSettings = new HashMap();
- epSettings.put("protect.datatype", config.getString("protect.datatype", "sqlite"));
- epSettings.put("protect.username", config.getString("protect.username", "root"));
- epSettings.put("protect.password", config.getString("protect.password", "root"));
- epSettings.put("protect.mysqlDb", config.getString("protect.mysqlDb", "jdbc:mysql://localhost:3306/minecraft"));
- return epSettings;
- }
-
- public List getEpAlertOnPlacement()
- {
- final List epAlertPlace = new ArrayList();
- for (String itemName : config.getString("protect.alert.on-placement", "").split(",")) {
- itemName = itemName.trim();
- if (itemName.isEmpty()) {
- continue;
- }
- ItemStack is;
- try {
- is = ItemDb.get(itemName);
- epAlertPlace.add(is.getTypeId());
- } catch (Exception ex) {
- logger.log(Level.SEVERE, Util.format("unknownItemInList", itemName, "alert.on-placement"));
- }
- }
- return epAlertPlace;
- }
-
- public List getEpAlertOnUse()
- {
- final List epAlertUse = new ArrayList();
- for (String itemName : config.getString("protect.alert.on-use", "").split(",")) {
- itemName = itemName.trim();
- if (itemName.isEmpty()) {
- continue;
- }
- ItemStack is;
- try {
- is = ItemDb.get(itemName);
- epAlertUse.add(is.getTypeId());
- } catch (Exception ex) {
- logger.log(Level.SEVERE, Util.format("unknownItemInList", itemName, "alert.on-use"));
- }
- }
- return epAlertUse;
- }
-
- public List getEpAlertOnBreak()
- {
- final List epAlertPlace = new ArrayList();
- for (String itemName : config.getString("protect.alert.on-break", "").split(",")) {
- itemName = itemName.trim();
- if (itemName.isEmpty()) {
- continue;
- }
- ItemStack is;
- try {
- is = ItemDb.get(itemName);
- epAlertPlace.add(is.getTypeId());
- } catch (Exception ex) {
- logger.log(Level.SEVERE, Util.format("unknownItemInList", itemName, "alert.on-break"));
- }
- }
- return epAlertPlace;
- }
-
- public List epBlackListPlacement()
- {
- final List epBlacklistPlacement = new ArrayList();
- for (String itemName : config.getString("protect.blacklist.placement", "").split(",")) {
- itemName = itemName.trim();
- if (itemName.isEmpty()) {
- continue;
- }
- ItemStack is;
- try {
- is = ItemDb.get(itemName);
- epBlacklistPlacement.add(is.getTypeId());
- } catch (Exception ex) {
- logger.log(Level.SEVERE, Util.format("unknownItemInList", itemName, "blacklist.placement"));
- }
- }
- return epBlacklistPlacement;
- }
-
- public List epBlackListUsage()
- {
- final List epBlackListUsage = new ArrayList();
- for (String itemName : config.getString("protect.blacklist.usage", "").split(",")) {
- itemName = itemName.trim();
- if (itemName.isEmpty()) {
- continue;
- }
- ItemStack is;
- try {
- is = ItemDb.get(itemName);
- epBlackListUsage.add(is.getTypeId());
- } catch (Exception ex) {
- logger.log(Level.SEVERE, Util.format("unknownItemInList", itemName, "blacklist.usage"));
- }
- }
- return epBlackListUsage;
- }
-
- public Map getEpGuardSettings()
- {
- final Map epSettings = new HashMap();
- epSettings.put("protect.prevent.lava-flow", config.getBoolean("protect.prevent.lava-flow", false));
- epSettings.put("protect.prevent.water-flow", config.getBoolean("protect.prevent.water-flow", false));
- epSettings.put("protect.prevent.water-bucket-flow", config.getBoolean("protect.prevent.water-bucket-flow", false));
- epSettings.put("protect.prevent.fire-spread", config.getBoolean("protect.prevent.fire-spread", true));
- epSettings.put("protect.prevent.flint-fire", config.getBoolean("protect.prevent.flint-fire", false));
- epSettings.put("protect.prevent.portal-creation", config.getBoolean("protect.prevent.portal-creation", false));
- epSettings.put("protect.prevent.lava-fire-spread", config.getBoolean("protect.prevent.lava-fire-spread", true));
- epSettings.put("protect.prevent.tnt-explosion", config.getBoolean("protect.prevent.tnt-explosion", false));
- epSettings.put("protect.prevent.creeper-explosion", config.getBoolean("protect.prevent.creeper-explosion", false));
- epSettings.put("protect.prevent.creeper-playerdamage", config.getBoolean("protect.prevent.creeper-playerdamage", false));
- epSettings.put("protect.prevent.creeper-blockdamage", config.getBoolean("protect.prevent.creeper-blockdamage", false));
- epSettings.put("protect.prevent.entitytarget", config.getBoolean("protect.prevent.entitytarget", false));
- for (CreatureType ct : CreatureType.values()) {
- final String name = ct.toString().toLowerCase();
- epSettings.put("protect.prevent.spawn."+name, config.getBoolean("protect.prevent.spawn."+name, false));
- }
- epSettings.put("protect.prevent.lightning-fire-spread", config.getBoolean("protect.prevent.lightning-fire-spread", true));
- return epSettings;
- }
-
- public Map getEpPlayerSettings()
- {
- final Map epPlayerSettings = new HashMap();
- epPlayerSettings.put("protect.disable.fall", config.getBoolean("protect.disable.fall", false));
- epPlayerSettings.put("protect.disable.pvp", config.getBoolean("protect.disable.pvp", false));
- epPlayerSettings.put("protect.disable.drown", config.getBoolean("protect.disable.drown", false));
- epPlayerSettings.put("protect.disable.suffocate", config.getBoolean("protect.disable.suffocate", false));
- epPlayerSettings.put("protect.disable.lavadmg", config.getBoolean("protect.disable.lavadmg", false));
- epPlayerSettings.put("protect.disable.projectiles", config.getBoolean("protect.disable.projectiles", false));
- epPlayerSettings.put("protect.disable.contactdmg", config.getBoolean("protect.disable.contactdmg", false));
- epPlayerSettings.put("protect.disable.firedmg", config.getBoolean("protect.disable.firedmg", false));
- epPlayerSettings.put("protect.disable.build", config.getBoolean("protect.disable.build", false));
- epPlayerSettings.put("protect.disable.lightning", config.getBoolean("protect.disable.lightning", false));
- epPlayerSettings.put("protect.disable.weather.lightning", config.getBoolean("protect.disable.weather.lightning", false));
- epPlayerSettings.put("protect.disable.weather.storm", config.getBoolean("protect.disable.weather.storm", false));
- epPlayerSettings.put("protect.disable.weather.thunder", config.getBoolean("protect.disable.weather.thunder", false));
- return epPlayerSettings;
-
- }
-
- public int getEpCreeperMaxHeight()
+ @Override
+ public int getProtectCreeperMaxHeight()
{
return config.getInt("protect.creeper.max-height", -1);
}
+ @Override
public boolean areSignsDisabled()
{
return config.getBoolean("signs-disabled", false);
}
+ @Override
public long getBackupInterval()
{
return config.getInt("backup.interval", 1440); // 1440 = 24 * 60
}
+ @Override
public String getBackupCommand()
{
return config.getString("backup.command", null);
}
+ @Override
public String getChatFormat(String group)
{
return config.getString("chat.group-formats." + (group == null ? "Default" : group),
config.getString("chat.format", "&7[{GROUP}]&f {DISPLAYNAME}&7:&f {MESSAGE}"));
}
+ @Override
public boolean getGenerateExitPortals()
{
return config.getBoolean("nether.generate-exit-portals", true);
}
+ @Override
public boolean getAnnounceNewPlayers()
{
return !config.getString("newbies.announce-format", "-").isEmpty();
}
+ @Override
public String getAnnounceNewPlayerFormat(IUser user)
{
return format(config.getString("newbies.announce-format", "&dWelcome {DISPLAYNAME} to the server!"), user);
}
+ @Override
public String format(String format, IUser user)
{
return format.replace('&', '§').replace("§§", "&").replace("{PLAYER}", user.getDisplayName()).replace("{DISPLAYNAME}", user.getDisplayName()).replace("{GROUP}", user.getGroup()).replace("{USERNAME}", user.getName()).replace("{ADDRESS}", user.getAddress().toString());
}
+ @Override
public String getNewbieSpawn()
{
return config.getString("newbies.spawnpoint", "default");
}
+ @Override
public boolean getPerWarpPermission()
{
return config.getBoolean("per-warp-permission", false);
}
+ @Override
public boolean getSortListByGroups()
{
return config.getBoolean("sort-list-by-groups", true);
}
+ @Override
public void reloadConfig() {
config.load();
}
- public ArrayList itemSpawnBlacklist()
+ @Override
+ public List itemSpawnBlacklist()
{
- ArrayList epItemSpwn = new ArrayList();
+ final List epItemSpwn = new ArrayList();
for (String itemName : config.getString("item-spawn-blacklist", "").split(",")) {
itemName = itemName.trim();
if (itemName.isEmpty()) {
@@ -431,7 +323,7 @@ public class Settings implements IConf
}
ItemStack is;
try {
- is = ItemDb.get(itemName);
+ is = ess.getItemDb().get(itemName);
epItemSpwn.add(is.getTypeId());
} catch (Exception ex) {
logger.log(Level.SEVERE, Util.format("unknownItemInList", itemName, "item-spawn-blacklist"));
@@ -440,40 +332,25 @@ public class Settings implements IConf
return epItemSpwn;
}
- public ArrayList epBlockBreakingBlacklist()
- {
- ArrayList epBreakList = new ArrayList();
- for (String itemName : config.getString("protect.blacklist.break", "").split(",")) {
- itemName = itemName.trim();
- if (itemName.isEmpty()) {
- continue;
- }
- ItemStack is;
- try {
- is = ItemDb.get(itemName);
- epBreakList.add(is.getTypeId());
- } catch (Exception ex) {
- logger.log(Level.SEVERE, Util.format("unknownItemInList", itemName, "blacklist.break"));
- }
- }
- return epBreakList;
- }
-
+ @Override
public boolean spawnIfNoHome()
{
return config.getBoolean("spawn-if-no-home", false);
}
+ @Override
public boolean warnOnBuildDisallow()
{
return config.getBoolean("protect.disable.warn-on-build-disallow", false);
}
+ @Override
public boolean use1to1RatioInNether()
{
return config.getBoolean("nether.use-1to1-ratio", false);
}
+ @Override
public double getNetherRatio()
{
if (config.getBoolean("nether.use-1to1-ratio", false)) {
@@ -482,38 +359,109 @@ public class Settings implements IConf
return config.getDouble("nether.ratio", 16.0);
}
+ @Override
public boolean isDebug()
{
return config.getBoolean("debug", false);
}
+ @Override
public boolean warnOnSmite()
{
return config.getBoolean("warn-on-smite" ,true);
}
+ @Override
public boolean permissionBasedItemSpawn()
{
return config.getBoolean("permission-based-item-spawn", false);
}
+ @Override
public String getLocale()
{
return config.getString("locale", "");
}
+ @Override
public String getCurrencySymbol()
{
return config.getString("currency-symbol", "$").substring(0, 1).replaceAll("[0-9]", "$");
}
+ @Override
public boolean isTradeInStacks(int id)
{
return config.getBoolean("trade-in-stacks-" + id, false);
}
+ @Override
public boolean isEcoDisabled()
{
return config.getBoolean("disable-eco", false);
}
+
+ @Override
+ public boolean getProtectPreventSpawn(final String creatureName)
+ {
+ return config.getBoolean("protect.prevent.spawn."+creatureName, false);
+ }
+
+ @Override
+ public List getProtectList(final String configName)
+ {
+ final List list = new ArrayList();
+ for (String itemName : config.getString(configName, "").split(",")) {
+ itemName = itemName.trim();
+ if (itemName.isEmpty()) {
+ continue;
+ }
+ ItemStack itemStack;
+ try {
+ itemStack = ess.getItemDb().get(itemName);
+ list.add(itemStack.getTypeId());
+ } catch (Exception ex) {
+ logger.log(Level.SEVERE, Util.format("unknownItemInList", itemName, configName));
+ }
+ }
+ return list;
+ }
+
+ @Override
+ public String getProtectString(final String configName)
+ {
+ return config.getString(configName, null);
+ }
+
+ @Override
+ public boolean getProtectBoolean(final String configName, boolean def)
+ {
+ return config.getBoolean(configName, def);
+ }
+
+ private final static double MAXMONEY = 10000000000000.0;
+ public double getMaxMoney()
+ {
+ double max = config.getDouble("max-money", MAXMONEY);
+ if (Math.abs(max) > MAXMONEY) {
+ max = max < 0 ? -MAXMONEY : MAXMONEY;
+ }
+ return max;
+ }
+
+ public boolean isEcoLogEnabled()
+ {
+ return config.getBoolean("economy-log-enabled", false);
+ }
+
+ public boolean removeGodOnDisconnect()
+ {
+ return config.getBoolean("remove-god-on-disconnect", false);
+ }
+
+ public boolean changeDisplayName()
+ {
+ return config.getBoolean("change-displayname", true);
+ }
+
}
diff --git a/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java b/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java
new file mode 100644
index 000000000..bdd453266
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java
@@ -0,0 +1,82 @@
+package com.earth2me.essentials;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import net.minecraft.server.ChunkPosition;
+import net.minecraft.server.Packet60Explosion;
+import org.bukkit.Location;
+import org.bukkit.block.Block;
+import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.CraftWorld;
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.entity.Player;
+import org.bukkit.event.entity.EntityExplodeEvent;
+import org.bukkit.event.entity.EntityListener;
+
+
+public class TNTExplodeListener extends EntityListener implements Runnable
+{
+ private final IEssentials ess;
+ private boolean enabled = false;
+ private int timer = -1;
+
+ public TNTExplodeListener(IEssentials ess)
+ {
+ this.ess = ess;
+ }
+
+ public void enable()
+ {
+ if (!enabled)
+ {
+ enabled = true;
+ timer = ess.scheduleSyncDelayedTask(this, 1000);
+ return;
+ }
+ if (timer != -1) {
+ ess.getScheduler().cancelTask(timer);
+ timer = ess.scheduleSyncDelayedTask(this, 1000);
+ }
+ }
+
+ @Override
+ public void onEntityExplode(final EntityExplodeEvent event)
+ {
+ if (!enabled)
+ {
+ return;
+ }
+ if (event.getEntity() instanceof LivingEntity)
+ {
+ return;
+ }
+ final Set set = new HashSet(event.blockList().size());
+ final Player[] players = ess.getServer().getOnlinePlayers();
+ final List blocksUnderPlayers = new ArrayList(players.length);
+ final Location loc = event.getLocation();
+ for (Player player : players)
+ {
+ if (player.getWorld().equals(loc.getWorld()))
+ {
+ blocksUnderPlayers.add(new ChunkPosition(player.getLocation().getBlockX(), player.getLocation().getBlockY() - 1, player.getLocation().getBlockZ()));
+ }
+ }
+ for (Block block : event.blockList())
+ {
+ final ChunkPosition cp = new ChunkPosition(block.getX(), block.getY(), block.getZ());
+ if (!blocksUnderPlayers.contains(cp))
+ {
+ set.add(cp);
+ }
+ }
+ ((CraftServer)ess.getServer()).getHandle().sendPacketNearby(loc.getX(), loc.getY(), loc.getZ(), 64.0, ((CraftWorld)loc.getWorld()).getHandle().worldProvider.dimension, new Packet60Explosion(loc.getX(), loc.getY(), loc.getZ(), 3.0F, set));
+ event.setCancelled(true);
+ }
+
+ public void run()
+ {
+ enabled = false;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/TargetBlock.java b/Essentials/src/com/earth2me/essentials/TargetBlock.java
index ec9cd796e..d1f2e5cbb 100644
--- a/Essentials/src/com/earth2me/essentials/TargetBlock.java
+++ b/Essentials/src/com/earth2me/essentials/TargetBlock.java
@@ -1,599 +1,526 @@
package com.earth2me.essentials;
-import java.util.ArrayList;
+import java.util.List;
import org.bukkit.block.Block;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
+
+
/**
- * @author toi
- * Thanks to Raphfrk for optimization of this class.
+ * Original authors: toi & Raphfrk
*/
-public class TargetBlock {
+public class TargetBlock
+{
+ private transient final Location location;
+ private transient final double viewHeight;
+ private transient final int maxDistance;
+ private transient final int[] blockToIgnore;
+ private transient final double checkDistance;
+ private transient double curDistance;
+ private transient double targetPositionX;
+ private transient double targetPositionY;
+ private transient double targetPositionZ;
+ private transient int itargetPositionX;
+ private transient int itargetPositionY;
+ private transient int itargetPositionZ;
+ private transient int prevPositionX;
+ private transient int prevPositionY;
+ private transient int prevPositionZ;
+ private transient final double offsetX;
+ private transient final double offsetY;
+ private transient final double offsetZ;
- private Location loc;
- private double viewHeight;
- private int maxDistance;
- private int[] blockToIgnore;
- private double checkDistance, curDistance;
- private double xRotation, yRotation;
- private Vector targetPos = new Vector();
- private Vector targetPosDouble = new Vector();
- private Vector prevPos = new Vector();
- private final Vector offset = new Vector();
+ /**
+ * Constructor requiring a player, uses default values
+ *
+ * @param player Player to work with
+ */
+ public TargetBlock(final Player player)
+ {
+ this(player.getLocation(), 300, 1.65, 0.2, null);
+ }
- /**
- * Constructor requiring a player, uses default values
- *
- * @param player Player to work with
- */
- public TargetBlock(Player player)
- {
- this.setValues(player.getLocation(), 300, 1.65, 0.2, null);
- }
+ /**
+ * Constructor requiring a location, uses default values
+ *
+ * @param loc Location to work with
+ */
+ public TargetBlock(final Location loc)
+ {
+ this(loc, 300, 0, 0.2, null);
+ }
- /**
- * Constructor requiring a location, uses default values
- *
- * @param loc Location to work with
- */
- public TargetBlock(Location loc)
- {
- this.setValues(loc, 300, 0, 0.2, null);
- }
+ /**
+ * Constructor requiring a player, max distance and a checking distance
+ *
+ * @param player Player to work with
+ * @param maxDistance How far it checks for blocks
+ * @param checkDistance How often to check for blocks, the smaller the more precise
+ */
+ public TargetBlock(final Player player, final int maxDistance, final double checkDistance)
+ {
+ this(player.getLocation(), maxDistance, 1.65, checkDistance, null);
+ }
- /**
- * Constructor requiring a player, max distance and a checking distance
- *
- * @param player Player to work with
- * @param maxDistance How far it checks for blocks
- * @param checkDistance How often to check for blocks, the smaller the more precise
- */
- public TargetBlock(Player player, int maxDistance, double checkDistance)
- {
- this.setValues(player.getLocation(), maxDistance, 1.65, checkDistance, null);
- }
+ /**
+ * Constructor requiring a location, max distance and a checking distance
+ *
+ * @param loc What location to work with
+ * @param maxDistance How far it checks for blocks
+ * @param checkDistance How often to check for blocks, the smaller the more precise
+ */
+ public TargetBlock(final Location loc, final int maxDistance, final double checkDistance)
+ {
+ this(loc, maxDistance, 0, checkDistance, null);
+ }
- /**
- * Constructor requiring a location, max distance and a checking distance
- *
- * @param loc What location to work with
- * @param maxDistance How far it checks for blocks
- * @param checkDistance How often to check for blocks, the smaller the more precise
- */
- public TargetBlock(Location loc, int maxDistance, double checkDistance) {
- this.setValues(loc, maxDistance, 0, checkDistance, null);
- }
+ /**
+ * Constructor requiring a player, max distance, checking distance and an array of blocks to ignore
+ *
+ * @param player What player to work with
+ * @param maxDistance How far it checks for blocks
+ * @param checkDistance How often to check for blocks, the smaller the more precise
+ * @param blocksToIgnore Integer array of what block ids to ignore while checking for viable targets
+ */
+ public TargetBlock(final Player player, final int maxDistance, final double checkDistance, final int[] blocksToIgnore)
+ {
+ this(player.getLocation(), maxDistance, 1.65, checkDistance, blocksToIgnore);
+ }
- /**
- * Constructor requiring a player, max distance, checking distance and an array of blocks to ignore
- *
- * @param player What player to work with
- * @param maxDistance How far it checks for blocks
- * @param checkDistance How often to check for blocks, the smaller the more precise
- * @param blocksToIgnore Integer array of what block ids to ignore while checking for viable targets
- */
- public TargetBlock (Player player, int maxDistance, double checkDistance, int[] blocksToIgnore)
- {
- this.setValues(player.getLocation(), maxDistance, 1.65, checkDistance, blocksToIgnore);
- }
+ /**
+ * Constructor requiring a location, max distance, checking distance and an array of blocks to ignore
+ *
+ * @param loc What location to work with
+ * @param maxDistance How far it checks for blocks
+ * @param checkDistance How often to check for blocks, the smaller the more precise
+ * @param blocksToIgnore Array of what block ids to ignore while checking for viable targets
+ */
+ public TargetBlock(final Location loc, final int maxDistance, final double checkDistance, final int[] blocksToIgnore)
+ {
+ this(loc, maxDistance, 0, checkDistance, blocksToIgnore);
+ }
- /**
- * Constructor requiring a location, max distance, checking distance and an array of blocks to ignore
- *
- * @param loc What location to work with
- * @param maxDistance How far it checks for blocks
- * @param checkDistance How often to check for blocks, the smaller the more precise
- * @param blocksToIgnore Array of what block ids to ignore while checking for viable targets
- */
- public TargetBlock (Location loc, int maxDistance, double checkDistance, int[] blocksToIgnore)
- {
- this.setValues(loc, maxDistance, 0, checkDistance, blocksToIgnore);
- }
+ /**
+ * Constructor requiring a player, max distance, checking distance and an array of blocks to ignore
+ *
+ * @param player What player to work with
+ * @param maxDistance How far it checks for blocks
+ * @param checkDistance How often to check for blocks, the smaller the more precise
+ * @param blocksToIgnore String ArrayList of what block ids to ignore while checking for viable targets
+ */
+ public TargetBlock(final Player player, final int maxDistance, final double checkDistance, final List blocksToIgnore)
+ {
+ this(player.getLocation(), maxDistance, 1.65, checkDistance, TargetBlock.convertStringArraytoIntArray(blocksToIgnore));
+ }
- /**
- * Constructor requiring a player, max distance, checking distance and an array of blocks to ignore
- *
- * @param player What player to work with
- * @param maxDistance How far it checks for blocks
- * @param checkDistance How often to check for blocks, the smaller the more precise
- * @param blocksToIgnore String ArrayList of what block ids to ignore while checking for viable targets
- */
- public TargetBlock (Player player, int maxDistance, double checkDistance, ArrayList blocksToIgnore)
- {
- int[] bti = this.convertStringArraytoIntArray(blocksToIgnore);
- this.setValues(player.getLocation(), maxDistance, 1.65, checkDistance, bti);
- }
+ /**
+ * Constructor requiring a location, max distance, checking distance and an array of blocks to ignore
+ *
+ * @param loc What location to work with
+ * @param maxDistance How far it checks for blocks
+ * @param checkDistance How often to check for blocks, the smaller the more precise
+ * @param blocksToIgnore String ArrayList of what block ids to ignore while checking for viable targets
+ */
+ public TargetBlock(final Location loc, final int maxDistance, final double checkDistance, final List blocksToIgnore)
+ {
+ this(loc, maxDistance, 0, checkDistance, TargetBlock.convertStringArraytoIntArray(blocksToIgnore));
+ }
- /**
- * Constructor requiring a location, max distance, checking distance and an array of blocks to ignore
- *
- * @param loc What location to work with
- * @param maxDistance How far it checks for blocks
- * @param checkDistance How often to check for blocks, the smaller the more precise
- * @param blocksToIgnore String ArrayList of what block ids to ignore while checking for viable targets
- */
- public TargetBlock (Location loc, int maxDistance, double checkDistance, ArrayList blocksToIgnore)
- {
- int[] bti = this.convertStringArraytoIntArray(blocksToIgnore);
- this.setValues(loc, maxDistance, 0, checkDistance, bti);
- }
+ /**
+ * Set the values, all constructors uses this function
+ *
+ * @param loc Location of the view
+ * @param maxDistance How far it checks for blocks
+ * @param viewPos Where the view is positioned in y-axis
+ * @param checkDistance How often to check for blocks, the smaller the more precise
+ * @param blocksToIgnore Ids of blocks to ignore while checking for viable targets
+ */
+ private TargetBlock(final Location loc, final int maxDistance, final double viewHeight, final double checkDistance, final int[] blocksToIgnore)
+ {
+ this.location = loc;
+ this.maxDistance = maxDistance;
+ this.viewHeight = viewHeight;
+ this.checkDistance = checkDistance;
+ if (blocksToIgnore == null || blocksToIgnore.length == 0)
+ {
+ this.blockToIgnore = new int[0];
+ }
+ else
+ {
+ this.blockToIgnore = new int[blocksToIgnore.length];
+ System.arraycopy(blocksToIgnore, 0, this.blockToIgnore, 0, this.blockToIgnore.length);
+ }
- /**
- * Set the values, all constructors uses this function
- *
- * @param loc Location of the view
- * @param maxDistance How far it checks for blocks
- * @param viewPos Where the view is positioned in y-axis
- * @param checkDistance How often to check for blocks, the smaller the more precise
- * @param blocksToIgnore Ids of blocks to ignore while checking for viable targets
- */
- private void setValues(Location loc, int maxDistance, double viewHeight, double checkDistance, int[] blocksToIgnore)
- {
- this.loc = loc;
- this.maxDistance = maxDistance;
- this.viewHeight = viewHeight;
- this.checkDistance = checkDistance;
- this.blockToIgnore = blocksToIgnore;
- this.curDistance = 0;
- xRotation = (loc.getYaw() + 90) % 360;
- yRotation = loc.getPitch() * -1;
+ final double xRotation = (loc.getYaw() + 90) % 360;
+ final double yRotation = loc.getPitch() * -1;
- double h = (checkDistance * Math.cos(Math.toRadians(yRotation)));
- offset.setY((checkDistance * Math.sin(Math.toRadians(yRotation))));
- offset.setX((h * Math.cos(Math.toRadians(xRotation))));
- offset.setZ((h * Math.sin(Math.toRadians(xRotation))));
+ final double hypotenuse = (checkDistance * Math.cos(Math.toRadians(yRotation)));
+ offsetX = hypotenuse * Math.cos(Math.toRadians(xRotation));
+ offsetY = checkDistance * Math.sin(Math.toRadians(yRotation));
+ offsetZ = hypotenuse * Math.sin(Math.toRadians(xRotation));
- targetPosDouble = new Vector(loc.getX(), loc.getY() + viewHeight, loc.getZ());
- targetPos = new Vector( targetPosDouble.getBlockX(), targetPosDouble.getBlockY(), targetPosDouble.getBlockZ());
- prevPos = targetPos.clone();
- }
+ reset();
+ }
- /**
- * Call this to reset checking position to allow you to check for a new target with the same TargetBlock instance.
- */
- public void reset()
- {
- targetPosDouble = new Vector(loc.getX(), loc.getY() + viewHeight, loc.getZ());
- targetPos = new Vector( targetPosDouble.getBlockX(), targetPosDouble.getBlockY(), targetPosDouble.getBlockZ());
- prevPos = targetPos.clone();
- this.curDistance = 0;
- }
+ /**
+ * Call this to reset checking position to allow you to check for a new target with the same TargetBlock instance.
+ */
+ public final void reset()
+ {
+ targetPositionX = location.getX();
+ targetPositionY = location.getY() + viewHeight;
+ targetPositionZ = location.getZ();
+ itargetPositionX = (int)Math.floor(targetPositionX);
+ itargetPositionY = (int)Math.floor(targetPositionY);
+ itargetPositionZ = (int)Math.floor(targetPositionZ);
+ prevPositionX = itargetPositionX;
+ prevPositionY = itargetPositionY;
+ prevPositionZ = itargetPositionZ;
+ this.curDistance = 0;
+ }
- /**
- * Gets the distance to a block. Measures from the block underneath the player to the targetblock
- * Should only be used when passing player as an constructor parameter
- *
- * @return double
- */
- public double getDistanceToBlock()
- {
- Vector blockUnderPlayer = new Vector(
- (int) Math.floor(loc.getX() + 0.5),
- (int) Math.floor(loc.getY() - 0.5),
- (int) Math.floor(loc.getZ() + 0.5));
+ /**
+ * Gets the distance to a block. Measures from the block underneath the player to the targetblock
+ * Should only be used when passing player as an constructor parameter
+ *
+ * @return double
+ */
+ public double getDistanceToBlock()
+ {
+ final double blockUnderPlayerX = Math.floor(location.getX() + 0.5);
+ final double blockUnderPlayerY = Math.floor(location.getY() - 0.5);
+ final double blockUnderPlayerZ = Math.floor(location.getZ() + 0.5);
- Block blk = getTargetBlock();
- double x = blk.getX() - blockUnderPlayer.getBlockX();
- double y = blk.getY() - blockUnderPlayer.getBlockY();
- double z = blk.getZ() - blockUnderPlayer.getBlockZ();
+ final Block block = getTargetBlock();
+ final double distX = block.getX() - blockUnderPlayerX;
+ final double distY = block.getY() - blockUnderPlayerY;
+ final double distZ = block.getZ() - blockUnderPlayerZ;
- return Math.sqrt((Math.pow(x, 2) + Math.pow(y, 2) + Math.pow(z, 2)));
- }
+ return Math.sqrt(distX*distX + distY*distY + distZ*distZ);
+ }
- /**
- * Gets the rounded distance to a block. Measures from the block underneath the player to the targetblock
- * Should only be used when passing player as an constructor parameter
- *
- * @return int
- */
- public int getDistanceToBlockRounded()
- {
- Vector blockUnderPlayer = new Vector(
- (int) Math.floor(loc.getX() + 0.5),
- (int) Math.floor(loc.getY() - 0.5),
- (int) Math.floor(loc.getZ() + 0.5));
+ /**
+ * Gets the rounded distance to a block. Measures from the block underneath the player to the targetblock
+ * Should only be used when passing player as an constructor parameter
+ *
+ * @return int
+ */
+ public int getDistanceToBlockRounded()
+ {
+ return (int)Math.round(getDistanceToBlock());
+ }
- Block blk = getTargetBlock();
- double x = blk.getX() - blockUnderPlayer.getBlockX();
- double y = blk.getY() - blockUnderPlayer.getBlockY();
- double z = blk.getZ() - blockUnderPlayer.getBlockZ();
+ /**
+ * Gets the floored x distance to a block.
+ *
+ * @return int
+ */
+ public int getXDistanceToBlock()
+ {
+ return (int)Math.floor(getTargetBlock().getX() - location.getBlockX() + 0.5);
+ }
- return (int) Math.round((Math.sqrt((Math.pow(x, 2) + Math.pow(y, 2) + Math.pow(z, 2)))));
- }
+ /**
+ * Gets the floored y distance to a block
+ *
+ * @return int
+ */
+ public int getYDistanceToBlock()
+ {
+ return (int)Math.floor(getTargetBlock().getY() - location.getBlockY() + viewHeight);
+ }
- /**
- * Gets the floored x distance to a block.
- *
- * @return int
- */
- public int getXDistanceToBlock()
- {
- this.reset();
- return (int) Math.floor(getTargetBlock().getX() - loc.getBlockX() + 0.5);
- }
+ /**
+ * Gets the floored z distance to a block
+ *
+ * @return int
+ */
+ public int getZDistanceToBlock()
+ {
+ return (int)Math.floor(getTargetBlock().getZ() - location.getBlockZ() + 0.5);
+ }
- /**
- * Gets the floored y distance to a block
- *
- * @return int
- */
- public int getYDistanceToBlock()
- {
- this.reset();
- return (int) Math.floor(getTargetBlock().getY() - loc.getBlockY() + viewHeight);
- }
+ /**
+ * Returns the block at the sight. Returns null if out of range or if no viable target was found
+ *
+ * @return Block
+ */
+ public Block getTargetBlock()
+ {
+ this.reset();
+ Block block;
+ do
+ {
+ block = getNextBlock();
+ }
+ while (block != null && ((block.getTypeId() == 0) || this.blockIsIgnored(block.getTypeId())));
- /**
- * Gets the floored z distance to a block
- *
- * @return int
- */
- public int getZDistanceToBlock()
- {
- this.reset();
- return (int) Math.floor(getTargetBlock().getZ() - loc.getBlockZ() + 0.5);
- }
+ return block;
+ }
- /**
- * Returns the block at the sight. Returns null if out of range or if no viable target was found
- *
- * @return Block
- */
+ /**
+ * Sets the type of the block at the sight. Returns false if the block wasn't set.
+ *
+ * @param typeID ID of type to set the block to
+ * @return boolean
+ */
+ public boolean setTargetBlock(final int typeID)
+ {
+ return setTargetBlock(Material.getMaterial(typeID));
+ }
+
+ /**
+ * Sets the type of the block at the sight. Returns false if the block wasn't set.
+ *
+ * @param type Material to set the block to
+ * @return boolean
+ */
@SuppressWarnings("empty-statement")
- public Block getTargetBlock()
- {
- this.reset();
- while ((getNextBlock() != null) && ((getCurrentBlock().getTypeId() == 0) || this.blockToIgnoreHasValue(getCurrentBlock().getTypeId())));
- return getCurrentBlock();
- }
+ public boolean setTargetBlock(final Material type)
+ {
+ if (type == null)
+ {
+ return false;
+ }
+ final Block block = getTargetBlock();
+ if (block != null)
+ {
+ block.setType(type);
+ return true;
+ }
+ return false;
+ }
- /**
- * Sets the type of the block at the sight. Returns false if the block wasn't set.
- *
- * @param typeID ID of type to set the block to
- * @return boolean
- */
- @SuppressWarnings("empty-statement")
- public boolean setTargetBlock(int typeID)
- {
- if (Material.getMaterial(typeID) != null)
- {
- this.reset();
- while (getNextBlock() != null && getCurrentBlock().getTypeId() == 0);
- if (getCurrentBlock() != null)
- {
- Block blk = loc.getWorld().getBlockAt(targetPos.getBlockX(), targetPos.getBlockY(), targetPos.getBlockZ());
- blk.setTypeId(typeID);
- return true;
- }
- }
- return false;
- }
+ /**
+ * Sets the type of the block at the sight. Returns false if the block wasn't set.
+ * Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
+ *
+ * @param type Name of type to set the block to
+ * @return boolean
+ */
+ public boolean setTargetBlock(final String type)
+ {
+ return setTargetBlock(Material.valueOf(type));
+ }
- /**
- * Sets the type of the block at the sight. Returns false if the block wasn't set.
- *
- * @param type Material to set the block to
- * @return boolean
- */
- @SuppressWarnings("empty-statement")
- public boolean setTargetBlock(Material type)
- {
- this.reset();
- while ((getNextBlock() != null) && ((getCurrentBlock().getTypeId() == 0) || this.blockToIgnoreHasValue(getCurrentBlock().getTypeId())));
- if (getCurrentBlock() != null)
- {
- Block blk = loc.getWorld().getBlockAt(targetPos.getBlockX(), targetPos.getBlockY(), targetPos.getBlockZ());
- blk.setType(type);
- return true;
- }
- return false;
- }
+ /**
+ * Returns the block attached to the face at the sight. Returns null if out of range or if no viable target was found
+ *
+ * @return Block
+ */
+ public Block getFaceBlock()
+ {
+ final Block block = getTargetBlock();
+ if (block == null)
+ {
+ return null;
+ }
+ return getPreviousBlock();
+ }
- /**
- * Sets the type of the block at the sight. Returns false if the block wasn't set.
- * Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
- *
- * @param type Name of type to set the block to
- * @return boolean
- */
- @SuppressWarnings("empty-statement")
- public boolean setTargetBlock(String type)
- {
- Material mat = Material.valueOf(type);
- if (mat != null)
- {
- this.reset();
- while ((getNextBlock() != null) && ((getCurrentBlock().getTypeId() == 0) || this.blockToIgnoreHasValue(getCurrentBlock().getTypeId())));
- if (getCurrentBlock() != null)
- {
- Block blk = loc.getWorld().getBlockAt(targetPos.getBlockX(), targetPos.getBlockY(), targetPos.getBlockZ());
- blk.setType(mat);
- return true;
- }
- }
- return false;
- }
+ /**
+ * Sets the type of the block attached to the face at the sight. Returns false if the block wasn't set.
+ *
+ * @param typeID
+ * @return boolean
+ */
+ public boolean setFaceBlock(final int typeID)
+ {
+ return setFaceBlock(Material.getMaterial(typeID));
+ }
- /**
- * Returns the block attached to the face at the sight. Returns null if out of range or if no viable target was found
- *
- * @return Block
- */
- @SuppressWarnings("empty-statement")
- public Block getFaceBlock()
- {
- while ((getNextBlock() != null) && ((getCurrentBlock().getTypeId() == 0) || this.blockToIgnoreHasValue(getCurrentBlock().getTypeId())));
- if (getCurrentBlock() != null)
- {
- return getPreviousBlock();
- }
- else
- {
- return null;
- }
- }
+ /**
+ * Sets the type of the block attached to the face at the sight. Returns false if the block wasn't set.
+ *
+ * @param type
+ * @return boolean
+ */
+ public boolean setFaceBlock(final Material type)
+ {
+ if (type == null)
+ {
+ return false;
+ }
+ if (getCurrentBlock() != null)
+ {
+ final Block blk = location.getWorld().getBlockAt(prevPositionX, prevPositionY, prevPositionZ);
+ blk.setType(type);
+ return true;
+ }
+ return false;
+ }
- /**
- * Sets the type of the block attached to the face at the sight. Returns false if the block wasn't set.
- *
- * @param typeID
- * @return boolean
- */
- public boolean setFaceBlock(int typeID)
- {
- if (Material.getMaterial(typeID) != null)
- {
- if (getCurrentBlock() != null)
- {
- Block blk = loc.getWorld().getBlockAt(prevPos.getBlockX(), prevPos.getBlockY(), prevPos.getBlockZ());
- blk.setTypeId(typeID);
- return true;
- }
- }
- return false;
- }
+ /**
+ * Sets the type of the block attached to the face at the sight. Returns false if the block wasn't set.
+ * Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
+ *
+ * @param type
+ * @return boolean
+ */
+ public boolean setFaceBlock(final String type)
+ {
+ return setFaceBlock(Material.valueOf(type));
+ }
- /**
- * Sets the type of the block attached to the face at the sight. Returns false if the block wasn't set.
- *
- * @param type
- * @return boolean
- */
- public boolean setFaceBlock(Material type)
- {
- if (getCurrentBlock() != null)
- {
- Block blk = loc.getWorld().getBlockAt(prevPos.getBlockX(), prevPos.getBlockY(), prevPos.getBlockZ());
- blk.setType(type);
- return true;
- }
- return false;
- }
+ /**
+ * Get next block
+ *
+ * @return Block
+ */
+ public Block getNextBlock()
+ {
+ prevPositionX = itargetPositionX;
+ prevPositionY = itargetPositionY;
+ prevPositionZ = itargetPositionZ;
+ do
+ {
+ curDistance += checkDistance;
- /**
- * Sets the type of the block attached to the face at the sight. Returns false if the block wasn't set.
- * Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
- *
- * @param type
- * @return boolean
- */
- public boolean setFaceBlock(String type)
- {
- Material mat = Material.valueOf(type);
- if (mat != null)
- {
- if (getCurrentBlock() != null)
- {
- Block blk = loc.getWorld().getBlockAt(prevPos.getBlockX(), prevPos.getBlockY(), prevPos.getBlockZ());
- blk.setType(mat);
- return true;
- }
- }
- return false;
- }
+ targetPositionX += offsetX;
+ targetPositionY += offsetY;
+ targetPositionZ += offsetZ;
+ itargetPositionX = (int)Math.floor(targetPositionX);
+ itargetPositionY = (int)Math.floor(targetPositionY);
+ itargetPositionZ = (int)Math.floor(targetPositionZ);
+ }
+ while (curDistance <= maxDistance && itargetPositionX == prevPositionX && itargetPositionY == prevPositionY && itargetPositionZ == prevPositionZ);
+ if (curDistance > maxDistance)
+ {
+ return null;
+ }
- /**
- * Get next block
- *
- * @return Block
- */
- public Block getNextBlock()
- {
- prevPos = targetPos.clone();
- do
- {
- curDistance += checkDistance;
+ return this.location.getWorld().getBlockAt(itargetPositionX, itargetPositionY, itargetPositionZ);
+ }
- targetPosDouble.setX(offset.getX() + targetPosDouble.getX());
- targetPosDouble.setY(offset.getY() + targetPosDouble.getY());
- targetPosDouble.setZ(offset.getZ() + targetPosDouble.getZ());
- targetPos = new Vector( targetPosDouble.getBlockX(), targetPosDouble.getBlockY(), targetPosDouble.getBlockZ());
- }
- while (curDistance <= maxDistance && targetPos.getBlockX() == prevPos.getBlockX() && targetPos.getBlockY() == prevPos.getBlockY() && targetPos.getBlockZ() == prevPos.getBlockZ());
- if (curDistance > maxDistance)
- {
- return null;
- }
+ /**
+ * Returns the current block along the line of vision
+ *
+ * @return Block
+ */
+ public Block getCurrentBlock()
+ {
+ Block block;
+ if (curDistance <= maxDistance)
+ {
+ block = this.location.getWorld().getBlockAt(itargetPositionX, itargetPositionY, itargetPositionZ);
+ }
+ else
+ {
+ block = null;
+ }
+ return block;
+ }
- return this.loc.getWorld().getBlockAt(this.targetPos.getBlockX(), this.targetPos.getBlockY(), this.targetPos.getBlockZ());
- }
+ /**
+ * Sets current block type. Returns false if the block wasn't set.
+ *
+ * @param typeID
+ */
+ public boolean setCurrentBlock(final int typeID)
+ {
+ return setCurrentBlock(Material.getMaterial(typeID));
+ }
- /**
- * Returns the current block along the line of vision
- *
- * @return Block
- */
- public Block getCurrentBlock()
- {
- if (curDistance > maxDistance)
- {
- return null;
- }
- else
- {
- return this.loc.getWorld().getBlockAt(this.targetPos.getBlockX(), this.targetPos.getBlockY(), this.targetPos.getBlockZ());
- }
- }
+ /**
+ * Sets current block type. Returns false if the block wasn't set.
+ *
+ * @param type
+ */
+ public boolean setCurrentBlock(final Material type)
+ {
+ final Block blk = getCurrentBlock();
+ if (blk != null && type != null)
+ {
+ blk.setType(type);
+ return true;
+ }
+ return false;
+ }
- /**
- * Sets current block type. Returns false if the block wasn't set.
- *
- * @param typeID
- */
- public boolean setCurrentBlock(int typeID)
- {
- if (Material.getMaterial(typeID) != null)
- {
- Block blk = getCurrentBlock();
- if (blk != null)
- {
- blk.setTypeId(typeID);
- return true;
- }
- }
- return false;
- }
+ /**
+ * Sets current block type. Returns false if the block wasn't set.
+ * Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
+ *
+ * @param type
+ */
+ public boolean setCurrentBlock(final String type)
+ {
+ return setCurrentBlock(Material.valueOf(type));
+ }
- /**
- * Sets current block type. Returns false if the block wasn't set.
- *
- * @param type
- */
- public boolean setCurrentBlock(Material type)
- {
- Block blk = getCurrentBlock();
- if (blk != null)
- {
- blk.setType(type);
- return true;
- }
- return false;
- }
+ /**
+ * Returns the previous block in the aimed path
+ *
+ * @return Block
+ */
+ public Block getPreviousBlock()
+ {
+ return this.location.getWorld().getBlockAt(prevPositionX, prevPositionY, prevPositionZ);
+ }
- /**
- * Sets current block type. Returns false if the block wasn't set.
- * Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
- *
- * @param type
- */
- public boolean setCurrentBlock(String type)
- {
- Material mat = Material.valueOf(type);
- if (mat != null)
- {
- Block blk = getCurrentBlock();
- if (blk != null)
- {
- blk.setType(mat);
- return true;
- }
- }
- return false;
- }
+ /**
+ * Sets previous block type id. Returns false if the block wasn't set.
+ *
+ * @param typeID
+ */
+ public boolean setPreviousBlock(final int typeID)
+ {
+ return setPreviousBlock(Material.getMaterial(typeID));
+ }
- /**
- * Returns the previous block in the aimed path
- *
- * @return Block
- */
- public Block getPreviousBlock()
- {
- return this.loc.getWorld().getBlockAt(prevPos.getBlockX(), prevPos.getBlockY(), prevPos.getBlockZ());
- }
+ /**
+ * Sets previous block type id. Returns false if the block wasn't set.
+ *
+ * @param type
+ */
+ public boolean setPreviousBlock(final Material type)
+ {
+ final Block blk = getPreviousBlock();
+ if (blk != null && type != null)
+ {
+ blk.setType(type);
+ return true;
+ }
+ return false;
+ }
- /**
- * Sets previous block type id. Returns false if the block wasn't set.
- *
- * @param typeID
- */
- public boolean setPreviousBlock(int typeID)
- {
- if (Material.getMaterial(typeID) != null)
- {
- Block blk = getPreviousBlock();
- if (blk != null)
- {
- blk.setTypeId(typeID);
- return true;
- }
- }
- return false;
- }
+ /**
+ * Sets previous block type id. Returns false if the block wasn't set.
+ * Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
+ *
+ * @param type
+ */
+ public boolean setPreviousBlock(final String type)
+ {
+ return setPreviousBlock(Material.valueOf(type));
+ }
- /**
- * Sets previous block type id. Returns false if the block wasn't set.
- *
- * @param type
- */
- public boolean setPreviousBlock(Material type)
- {
- Block blk = getPreviousBlock();
- if (blk != null)
- {
- blk.setType(type);
- return true;
- }
- return false;
- }
+ private static int[] convertStringArraytoIntArray(final List array)
+ {
+ final int intarray[] = new int[array == null ? 0 : array.size()];
+ for (int i = 0; i < intarray.length; i++)
+ {
+ try
+ {
+ intarray[i] = Integer.parseInt(array.get(i));
+ }
+ catch (NumberFormatException nfe)
+ {
+ }
+ }
+ return intarray;
+ }
- /**
- * Sets previous block type id. Returns false if the block wasn't set.
- * Observe! At the moment this function is using the built-in enumerator function .valueOf(String) but would preferably be changed to smarter function, when implemented
- *
- * @param type
- */
- public boolean setPreviousBlock(String type)
- {
- Material mat = Material.valueOf(type);
- if (mat != null)
- {
- Block blk = getPreviousBlock();
- if (blk != null)
- {
- blk.setType(mat);
- return true;
- }
- }
- return false;
- }
-
- private int[] convertStringArraytoIntArray(ArrayList array)
- {
- if (array != null)
- {
- int intarray[] = new int[array.size()];
- for (int i = 0; i < array.size(); i++)
- {
- try
- {
- intarray[i] = Integer.parseInt(array.get(i));
- }
- catch (NumberFormatException nfe)
- {
- intarray[i] = 0;
- }
- }
- return intarray;
- }
- return null;
- }
-
- private boolean blockToIgnoreHasValue(int value)
- {
- if (this.blockToIgnore != null)
- {
- if (this.blockToIgnore.length > 0)
- {
- for (int i : this.blockToIgnore)
- {
- if (i == value)
- return true;
- }
- }
- }
- return false;
- }
+ private boolean blockIsIgnored(final int value)
+ {
+ for (int i : this.blockToIgnore)
+ {
+ if (i == value)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
}
\ No newline at end of file
diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java
index 404319ca8..9fb9b7433 100644
--- a/Essentials/src/com/earth2me/essentials/Teleport.java
+++ b/Essentials/src/com/earth2me/essentials/Teleport.java
@@ -2,7 +2,6 @@ package com.earth2me.essentials;
import java.util.Calendar;
import java.util.GregorianCalendar;
-import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
@@ -10,6 +9,7 @@ import org.bukkit.entity.Entity;
public class Teleport implements Runnable
{
+ private static final double MOVE_CONSTANT = 0.3;
private static class Target
{
private final Location location;
@@ -48,18 +48,18 @@ public class Teleport implements Runnable
private long initY;
private long initZ;
private Target teleportTarget;
- private Charge chargeFor;
+ private Trade chargeFor;
private final IEssentials ess;
private static final Logger logger = Logger.getLogger("Minecraft");
- private void initTimer(long delay, Target target, Charge chargeFor)
+ private void initTimer(long delay, Target target, Trade chargeFor)
{
this.started = System.currentTimeMillis();
this.delay = delay;
this.health = user.getHealth();
- this.initX = Math.round(user.getLocation().getX() * 10000);
- this.initY = Math.round(user.getLocation().getY() * 10000);
- this.initZ = Math.round(user.getLocation().getZ() * 10000);
+ this.initX = Math.round(user.getLocation().getX()*MOVE_CONSTANT);
+ this.initY = Math.round(user.getLocation().getY()*MOVE_CONSTANT);
+ this.initZ = Math.round(user.getLocation().getZ()*MOVE_CONSTANT);
this.teleportTarget = target;
this.chargeFor = chargeFor;
}
@@ -72,9 +72,9 @@ public class Teleport implements Runnable
cancel();
return;
}
- if (Math.round(user.getLocation().getX() * 10000) != initX
- || Math.round(user.getLocation().getY() * 10000) != initY
- || Math.round(user.getLocation().getZ() * 10000) != initZ
+ if (Math.round(user.getLocation().getX()*MOVE_CONSTANT) != initX
+ || Math.round(user.getLocation().getY()*MOVE_CONSTANT) != initY
+ || Math.round(user.getLocation().getZ()*MOVE_CONSTANT) != initZ
|| user.getHealth() < health)
{ // user moved, cancel teleport
cancel(true);
@@ -101,11 +101,7 @@ public class Teleport implements Runnable
}
catch (Throwable ex)
{
- user.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
- if (ess.getSettings().isDebug())
- {
- logger.log(Level.WARNING, ex.getMessage(), ex);
- }
+ ess.showError(user.getBase(), ex, "teleport");
}
return;
}
@@ -122,12 +118,12 @@ public class Teleport implements Runnable
this.ess = ess;
}
- public void respawn(Spawn spawn, Charge chargeFor) throws Exception
+ public void respawn(Spawn spawn, Trade chargeFor) throws Exception
{
teleport(new Target(spawn.getSpawn(user.getGroup())), chargeFor);
}
- public void warp(String warp, Charge chargeFor) throws Exception
+ public void warp(String warp, Trade chargeFor) throws Exception
{
Location loc = ess.getWarps().getWarp(warp);
teleport(new Target(loc), chargeFor);
@@ -181,17 +177,17 @@ public class Teleport implements Runnable
cancel(false);
}
- public void teleport(Location loc, Charge chargeFor) throws Exception
+ public void teleport(Location loc, Trade chargeFor) throws Exception
{
teleport(new Target(loc), chargeFor);
}
- public void teleport(Entity entity, Charge chargeFor) throws Exception
+ public void teleport(Entity entity, Trade chargeFor) throws Exception
{
teleport(new Target(entity), chargeFor);
}
- private void teleport(Target target, Charge chargeFor) throws Exception
+ private void teleport(Target target, Trade chargeFor) throws Exception
{
double delay = ess.getSettings().getTeleportDelay();
@@ -234,20 +230,23 @@ public class Teleport implements Runnable
now(new Target(loc));
}
- public void now(Location loc, Charge chargeFor) throws Exception
+ public void now(Location loc, Trade chargeFor) throws Exception
{
cooldown(false);
chargeFor.charge(user);
now(new Target(loc));
}
- public void now(Entity entity) throws Exception
+ public void now(Entity entity, boolean cooldown) throws Exception
{
- cooldown(false);
+ if (cooldown)
+ {
+ cooldown(false);
+ }
now(new Target(entity));
}
- public void back(Charge chargeFor) throws Exception
+ public void back(Trade chargeFor) throws Exception
{
teleport(new Target(user.getLastLocation()), chargeFor);
}
@@ -257,12 +256,12 @@ public class Teleport implements Runnable
back(null);
}
- public void home(Charge chargeFor) throws Exception
+ public void home(Trade chargeFor) throws Exception
{
home(user, chargeFor);
}
- public void home(IUser user, Charge chargeFor) throws Exception
+ public void home(IUser user, Trade chargeFor) throws Exception
{
Location loc = user.getHome(this.user.getLocation());
if (loc == null)
diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java
new file mode 100644
index 000000000..0be445032
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/Trade.java
@@ -0,0 +1,230 @@
+package com.earth2me.essentials;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.bukkit.inventory.ItemStack;
+
+
+public class Trade
+{
+ private final transient String command;
+ private final transient Double money;
+ private final transient ItemStack itemStack;
+ private final transient IEssentials ess;
+
+ public Trade(final String command, final IEssentials ess)
+ {
+ this(command, null, null, ess);
+ }
+
+ public Trade(final double money, final IEssentials ess)
+ {
+ this(null, money, null, ess);
+ }
+
+ public Trade(final ItemStack items, final IEssentials ess)
+ {
+ this(null, null, items, ess);
+ }
+
+ private Trade(final String command, final Double money, final ItemStack item, final IEssentials ess)
+ {
+ this.command = command;
+ this.money = money;
+ this.itemStack = item;
+ this.ess = ess;
+ }
+
+ public void isAffordableFor(final IUser user) throws ChargeException
+ {
+ final double mon = user.getMoney();
+ if (getMoney() != null
+ && mon < getMoney()
+ && getMoney() > 0
+ && !user.isAuthorized("essentials.eco.loan"))
+ {
+ throw new ChargeException(Util.i18n("notEnoughMoney"));
+ }
+
+ if (getItemStack() != null
+ && !InventoryWorkaround.containsItem(user.getInventory(), true, itemStack))
+ {
+ throw new ChargeException(Util.format("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase().replace("_", " ")));
+ }
+
+ if (command != null && !command.isEmpty()
+ && !user.isAuthorized("essentials.nocommandcost.all")
+ && !user.isAuthorized("essentials.nocommandcost." + command)
+ && mon < ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command)
+ && 0 < ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command)
+ && !user.isAuthorized("essentials.eco.loan"))
+ {
+ throw new ChargeException(Util.i18n("notEnoughMoney"));
+ }
+ }
+
+ public void pay(final IUser user)
+ {
+ if (getMoney() != null && getMoney() > 0)
+ {
+ user.giveMoney(getMoney());
+ }
+ if (getItemStack() != null)
+ {
+ final Map leftOver = InventoryWorkaround.addItem(user.getInventory(), true, getItemStack());
+ for (ItemStack itemStack : leftOver.values())
+ {
+ InventoryWorkaround.dropItem(user.getLocation(), itemStack);
+ }
+ user.updateInventory();
+ }
+ }
+
+ public void charge(final IUser user) throws ChargeException
+ {
+ if (getMoney() != null)
+ {
+ final double mon = user.getMoney();
+ if (mon < getMoney() && getMoney() > 0 && !user.isAuthorized("essentials.eco.loan"))
+ {
+ throw new ChargeException(Util.i18n("notEnoughMoney"));
+ }
+ user.takeMoney(getMoney());
+ }
+ if (getItemStack() != null)
+ {
+ if (!InventoryWorkaround.containsItem(user.getInventory(), true, itemStack))
+ {
+ throw new ChargeException(Util.format("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase().replace("_", " ")));
+ }
+ InventoryWorkaround.removeItem(user.getInventory(), true, getItemStack());
+ user.updateInventory();
+ }
+ if (command != null && !command.isEmpty()
+ && !user.isAuthorized("essentials.nocommandcost.all")
+ && !user.isAuthorized("essentials.nocommandcost." + command))
+ {
+ final double mon = user.getMoney();
+ final double cost = ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command);
+ if (mon < cost && cost > 0 && !user.isAuthorized("essentials.eco.loan"))
+ {
+ throw new ChargeException(Util.i18n("notEnoughMoney"));
+ }
+ user.takeMoney(cost);
+ }
+ }
+
+ public Double getMoney()
+ {
+ return money;
+ }
+
+ public ItemStack getItemStack()
+ {
+ return itemStack;
+ }
+ private static FileWriter fw = null;
+
+ public static void log(String type, String subtype, String event, String sender, Trade charge, String receiver, Trade pay, IEssentials ess)
+ {
+ if (!ess.getSettings().isEcoLogEnabled())
+ {
+ return;
+ }
+ if (fw == null)
+ {
+ try
+ {
+ fw = new FileWriter(new File(ess.getDataFolder(), "trade.log"), true);
+ }
+ catch (IOException ex)
+ {
+ Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
+ }
+ }
+ StringBuilder sb = new StringBuilder();
+ sb.append(type).append(",").append(subtype).append(",").append("event").append(",\"");
+ sb.append(DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(new Date()));
+ sb.append("\",\"");
+ if (sender != null)
+ {
+ sb.append(sender);
+ }
+ sb.append("\",");
+ if (charge == null)
+ {
+ sb.append("\"\",\"\",\"\"");
+ }
+ else
+ {
+ if (charge.getItemStack() != null)
+ {
+ sb.append(charge.getItemStack().getAmount()).append(",");
+ sb.append(charge.getItemStack().getType().toString()).append(",");
+ sb.append(charge.getItemStack().getDurability());
+ }
+ if (charge.getMoney() != null)
+ {
+ sb.append(charge.getMoney()).append(",");
+ sb.append("money").append(",");
+ sb.append(ess.getSettings().getCurrencySymbol());
+ }
+ }
+ sb.append(",\"");
+ if (receiver != null)
+ {
+ sb.append(receiver);
+ }
+ sb.append("\",");
+ if (pay == null)
+ {
+ sb.append("\"\",\"\",\"\"");
+ }
+ else
+ {
+ if (pay.getItemStack() != null)
+ {
+ sb.append(pay.getItemStack().getAmount()).append(",");
+ sb.append(pay.getItemStack().getType().toString()).append(",");
+ sb.append(pay.getItemStack().getDurability());
+ }
+ if (pay.getMoney() != null)
+ {
+ sb.append(pay.getMoney()).append(",");
+ sb.append("money").append(",");
+ sb.append(ess.getSettings().getCurrencySymbol());
+ }
+ }
+ sb.append("\n");
+ try
+ {
+ fw.write(sb.toString());
+ fw.flush();
+ }
+ catch (IOException ex)
+ {
+ Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
+ }
+ }
+
+ public static void closeLog()
+ {
+ if (fw != null) {
+ try
+ {
+ fw.close();
+ }
+ catch (IOException ex)
+ {
+ Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex);
+ }
+ fw = null;
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java
index 8365aabe3..22d8a5705 100644
--- a/Essentials/src/com/earth2me/essentials/User.java
+++ b/Essentials/src/com/earth2me/essentials/User.java
@@ -34,7 +34,12 @@ public class User extends UserData implements Comparable, IReplyTo, IUser
public boolean isAuthorized(IEssentialsCommand cmd)
{
- return isAuthorized("essentials." + (cmd.getName().equals("r") ? "msg" : cmd.getName()));
+ return isAuthorized(cmd, "essentials.");
+ }
+
+ public boolean isAuthorized(IEssentialsCommand cmd, String permissionPrefix)
+ {
+ return isAuthorized(permissionPrefix + (cmd.getName().equals("r") ? "msg" : cmd.getName()));
}
public boolean isAuthorized(String node)
@@ -49,15 +54,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser
return false;
}
- try
- {
- return com.nijikokun.bukkit.Permissions.Permissions.Security.permission(base, node);
- }
- catch (Throwable ex)
- {
- String[] cmds = node.split("\\.", 2);
- return !ess.getSettings().isCommandRestricted(cmds[cmds.length - 1]);
- }
+ return ess.getPermissionsHandler().hasPermission(this, node);
}
public void healCooldown() throws Exception
@@ -79,13 +76,22 @@ public class User extends UserData implements Comparable, IReplyTo, IUser
}
public void giveMoney(double value)
+ {
+ giveMoney(value, null);
+ }
+
+ public void giveMoney(double value, CommandSender initiator)
{
if (value == 0)
{
return;
}
setMoney(getMoney() + value);
- sendMessage(Util.format("addedToAccount", Util.formatCurrency(value)));
+ sendMessage(Util.format("addedToAccount", Util.formatCurrency(value, ess)));
+ if (initiator != null)
+ {
+ initiator.sendMessage((Util.format("addedToOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName())));
+ }
}
public void payUser(User reciever, double value) throws Exception
@@ -102,19 +108,28 @@ public class User extends UserData implements Comparable, IReplyTo, IUser
{
setMoney(getMoney() - value);
reciever.setMoney(reciever.getMoney() + value);
- sendMessage(Util.format("moneySentTo", Util.formatCurrency(value), reciever.getDisplayName()));
- reciever.sendMessage(Util.format("moneyRecievedFrom", Util.formatCurrency(value), getDisplayName()));
+ sendMessage(Util.format("moneySentTo", Util.formatCurrency(value, ess), reciever.getDisplayName()));
+ reciever.sendMessage(Util.format("moneyRecievedFrom", Util.formatCurrency(value, ess), getDisplayName()));
}
}
public void takeMoney(double value)
+ {
+ takeMoney(value, null);
+ }
+
+ public void takeMoney(double value, CommandSender initiator)
{
if (value == 0)
{
return;
}
setMoney(getMoney() - value);
- sendMessage(Util.format("takenFromAccount", Util.formatCurrency(value)));
+ sendMessage(Util.format("takenFromAccount", Util.formatCurrency(value, ess)));
+ if (initiator != null)
+ {
+ initiator.sendMessage((Util.format("takenFromOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName())));
+ }
}
public boolean canAfford(double cost)
@@ -125,7 +140,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser
public void dispose()
{
- this.base = new OfflinePlayer(getName());
+ this.base = new OfflinePlayer(getName(), ess);
}
public boolean getJustPortaled()
@@ -160,8 +175,8 @@ public class User extends UserData implements Comparable, IReplyTo, IUser
{
return false;
}
- return ChatColor.stripColor(this.getDisplayName()).equalsIgnoreCase(ChatColor.stripColor(((User) o).getDisplayName()));
-
+ return ChatColor.stripColor(this.getDisplayName()).equalsIgnoreCase(ChatColor.stripColor(((User)o).getDisplayName()));
+
}
@Override
@@ -208,26 +223,39 @@ public class User extends UserData implements Comparable, IReplyTo, IUser
public String getNick()
{
- String nickname = getNickname();
- if (ess.getSettings().isCommandDisabled("nick") || nickname == null || nickname.isEmpty() || nickname.equals(getName()))
+ final StringBuilder nickname = new StringBuilder();
+ final String nick = getNickname();
+ if (ess.getSettings().isCommandDisabled("nick") || nick == null || nick.isEmpty() || nick.equals(getName()))
{
- nickname = getName();
+ nickname.append(getName());
}
else
{
- nickname = ess.getSettings().getNicknamePrefix() + nickname;
+ nickname.append(ess.getSettings().getNicknamePrefix()).append(nick);
}
if (isOp())
{
try
{
- nickname = ess.getSettings().getOperatorColor().toString() + nickname + "§f";
+ nickname.insert(0, ess.getSettings().getOperatorColor().toString());
+ nickname.append("§f");
}
- catch(Exception e)
+ catch (Exception e)
{
}
}
- return nickname;
+
+ final String prefix = ess.getPermissionsHandler().getPrefix(this).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
+ final String suffix = ess.getPermissionsHandler().getSuffix(this).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName());
+
+ nickname.insert(0, prefix);
+ nickname.append(suffix);
+ if (suffix.length() > 1 && suffix.substring(suffix.length() - 2, suffix.length() - 1).equals("§"))
+ {
+ nickname.append("§f");
+ }
+
+ return nickname.toString();
}
public Teleport getTeleport()
@@ -248,19 +276,20 @@ public class User extends UserData implements Comparable, IReplyTo, IUser
@Override
public double getMoney()
{
- if (ess.isRegisterFallbackEnabled() && ess.getPaymentMethod().hasMethod())
+ if (ess.getPaymentMethod().hasMethod())
{
try
{
Method method = ess.getPaymentMethod().getMethod();
- if (!method.hasAccount(this.getName())) {
+ if (!method.hasAccount(this.getName()))
+ {
throw new Exception();
}
Method.MethodAccount account = ess.getPaymentMethod().getMethod().getAccount(this.getName());
return account.balance();
}
catch (Throwable ex)
- {
+ {
}
}
return super.getMoney();
@@ -269,12 +298,13 @@ public class User extends UserData implements Comparable, IReplyTo, IUser
@Override
public void setMoney(double value)
{
- if (ess.isRegisterFallbackEnabled() && ess.getPaymentMethod().hasMethod())
+ if (ess.getPaymentMethod().hasMethod())
{
try
{
Method method = ess.getPaymentMethod().getMethod();
- if (!method.hasAccount(this.getName())) {
+ if (!method.hasAccount(this.getName()))
+ {
throw new Exception();
}
Method.MethodAccount account = ess.getPaymentMethod().getMethod().getAccount(this.getName());
@@ -286,4 +316,19 @@ public class User extends UserData implements Comparable, IReplyTo, IUser
}
super.setMoney(value);
}
-}
\ No newline at end of file
+
+ @Override
+ public void setAfk(boolean set)
+ {
+ this.setSleepingIgnored(this.isAuthorized("essentials.sleepingignored") ? true : set);
+ super.setAfk(set);
+ }
+
+ @Override
+ public boolean toggleAfk()
+ {
+ boolean now = super.toggleAfk();
+ this.setSleepingIgnored(this.isAuthorized("essentials.sleepingignored") ? true : now);
+ return now;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java
index 5aa98eeb4..896339642 100644
--- a/Essentials/src/com/earth2me/essentials/UserData.java
+++ b/Essentials/src/com/earth2me/essentials/UserData.java
@@ -58,18 +58,20 @@ public abstract class UserData extends PlayerExtension implements IConf
isSocialSpyEnabled = _isSocialSpyEnabled();
isNPC = _isNPC();
}
-
private double money;
-
- private double _getMoney() {
+
+ private double _getMoney()
+ {
+ double money = ess.getSettings().getStartingBalance();
if (config.hasProperty("money"))
{
- return config.getDouble("money", ess.getSettings().getStartingBalance());
+ money = config.getDouble("money", money);
}
- else
+ if (Math.abs(money) > ess.getSettings().getMaxMoney())
{
- return ess.getSettings().getStartingBalance();
+ money = money < 0 ? -ess.getSettings().getMaxMoney() : ess.getSettings().getMaxMoney();
}
+ return money;
}
public double getMoney()
@@ -80,6 +82,10 @@ public abstract class UserData extends PlayerExtension implements IConf
public void setMoney(double value)
{
money = value;
+ if (Math.abs(money) > ess.getSettings().getMaxMoney())
+ {
+ money = money < 0 ? -ess.getSettings().getMaxMoney() : ess.getSettings().getMaxMoney();
+ }
config.setProperty("money", value);
config.save();
}
@@ -92,7 +98,7 @@ public abstract class UserData extends PlayerExtension implements IConf
}
return false;
}
-
+
public Location getHome(Location location)
{
if (!hasHome())
@@ -383,6 +389,7 @@ public abstract class UserData extends PlayerExtension implements IConf
setTeleportEnabled(ret);
return ret;
}
+
public boolean toggleSocialSpy()
{
boolean ret = !isSocialSpyEnabled();
@@ -622,7 +629,6 @@ public abstract class UserData extends PlayerExtension implements IConf
setAfk(ret);
return ret;
}
-
private boolean newplayer;
private boolean getNew()
@@ -641,7 +647,6 @@ public abstract class UserData extends PlayerExtension implements IConf
config.setProperty("newplayer", set);
config.save();
}
-
private String geolocation;
private String _getGeoLocation()
@@ -668,38 +673,36 @@ public abstract class UserData extends PlayerExtension implements IConf
}
config.save();
}
-
private boolean isSocialSpyEnabled;
-
+
private boolean _isSocialSpyEnabled()
{
return config.getBoolean("socialspy", false);
}
-
+
public boolean isSocialSpyEnabled()
{
return isSocialSpyEnabled;
}
-
+
public void setSocialSpyEnabled(boolean status)
{
isSocialSpyEnabled = status;
config.setProperty("socialspy", status);
config.save();
}
-
private boolean isNPC;
-
+
private boolean _isNPC()
{
return config.getBoolean("npc", false);
}
-
+
public boolean isNPC()
{
return isNPC;
}
-
+
public void setNPC(boolean set)
{
isNPC = set;
diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java
index 442150fa3..515ef83a5 100644
--- a/Essentials/src/com/earth2me/essentials/Util.java
+++ b/Essentials/src/com/earth2me/essentials/Util.java
@@ -284,9 +284,9 @@ public class Util
}
private static DecimalFormat df = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.US));
- public static String formatCurrency(double value)
+ public static String formatCurrency(final double value, final IEssentials ess)
{
- String str = Essentials.getStatic().getSettings().getCurrencySymbol() + df.format(value);
+ String str = ess.getSettings().getCurrencySymbol() + df.format(value);
if (str.endsWith(".00"))
{
str = str.substring(0, str.length() - 3);
@@ -307,19 +307,21 @@ public class Util
private static class ConfigClassLoader extends ClassLoader
{
- private final File dataFolder;
- private final ClassLoader cl;
+ private final transient File dataFolder;
+ private final transient ClassLoader cl;
+ private final transient IEssentials ess;
- public ConfigClassLoader(File dataFolder, ClassLoader cl)
+ public ConfigClassLoader(final ClassLoader cl, final IEssentials ess)
{
- this.dataFolder = dataFolder;
+ this.ess = ess;
+ this.dataFolder = ess.getDataFolder();
this.cl = cl;
}
@Override
- public URL getResource(String string)
+ public URL getResource(final String string)
{
- File file = new File(dataFolder, string);
+ final File file = new File(dataFolder, string);
if (file.exists())
{
try
@@ -341,17 +343,18 @@ public class Util
}
@Override
- public InputStream getResourceAsStream(String string)
+ public InputStream getResourceAsStream(final String string)
{
- File file = new File(dataFolder, string);
+ final File file = new File(dataFolder, string);
if (file.exists())
{
+ BufferedReader br = null;
try
{
- BufferedReader br = new BufferedReader(new FileReader(file));
- String version = br.readLine();
- br.close();
- if (version == null || !version.equals("#version: " + Essentials.getStatic().getDescription().getVersion()))
+ br = new BufferedReader(new FileReader(file));
+ final String version = br.readLine();
+
+ if (version == null || !version.equals("#version: " + ess.getDescription().getVersion()))
{
logger.log(Level.WARNING, String.format("Translation file %s is not updated for Essentials version. Will use default.", file));
return cl.getResourceAsStream(string);
@@ -362,36 +365,50 @@ public class Util
{
return cl.getResourceAsStream(string);
}
+ finally
+ {
+ if (br != null)
+ {
+ try
+ {
+ br.close();
+ }
+ catch (IOException ex)
+ {
+ return cl.getResourceAsStream(string);
+ }
+ }
+ }
}
return cl.getResourceAsStream(string);
}
@Override
- public Enumeration getResources(String string) throws IOException
+ public Enumeration getResources(final String string) throws IOException
{
return cl.getResources(string);
}
@Override
- public Class> loadClass(String string) throws ClassNotFoundException
+ public Class> loadClass(final String string) throws ClassNotFoundException
{
return cl.loadClass(string);
}
@Override
- public synchronized void setClassAssertionStatus(String string, boolean bln)
+ public synchronized void setClassAssertionStatus(final String string, final boolean bln)
{
cl.setClassAssertionStatus(string, bln);
}
@Override
- public synchronized void setDefaultAssertionStatus(boolean bln)
+ public synchronized void setDefaultAssertionStatus(final boolean bln)
{
cl.setDefaultAssertionStatus(bln);
}
@Override
- public synchronized void setPackageAssertionStatus(String string, boolean bln)
+ public synchronized void setPackageAssertionStatus(final String string, final boolean bln)
{
cl.setPackageAssertionStatus(string, bln);
}
@@ -420,7 +437,7 @@ public class Util
return mf.format(objects);
}
- public static void updateLocale(String loc, File dataFolder)
+ public static void updateLocale(String loc, IEssentials ess)
{
if (loc == null || loc.isEmpty())
{
@@ -440,10 +457,27 @@ public class Util
currentLocale = new Locale(parts[0], parts[1], parts[2]);
}
logger.log(Level.INFO, String.format("Using locale %s", currentLocale.toString()));
- bundle = ResourceBundle.getBundle("messages", currentLocale, new ConfigClassLoader(dataFolder, Util.class.getClassLoader()));
+ bundle = ResourceBundle.getBundle("messages", currentLocale, new ConfigClassLoader(Util.class.getClassLoader(), ess));
if (!bundle.keySet().containsAll(defaultBundle.keySet()))
{
logger.log(Level.WARNING, String.format("Translation file %s does not contain all translation keys.", currentLocale.toString()));
}
}
+
+ public static String joinList(Object... list)
+ {
+ final StringBuilder buf = new StringBuilder();
+ boolean first = true;
+ for (Object each : list)
+ {
+ if (!first)
+ {
+ buf.append(", ");
+
+ }
+ first = false;
+ buf.append(each);
+ }
+ return buf.toString();
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/api/Economy.java b/Essentials/src/com/earth2me/essentials/api/Economy.java
index bf071b733..fcab616be 100644
--- a/Essentials/src/com/earth2me/essentials/api/Economy.java
+++ b/Essentials/src/com/earth2me/essentials/api/Economy.java
@@ -1,7 +1,7 @@
package com.earth2me.essentials.api;
-import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.EssentialsConf;
+import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.io.File;
@@ -9,6 +9,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.entity.Player;
+
/**
* Instead of using this api directly, we recommend to use the register plugin:
* http://bit.ly/RegisterMethod
@@ -19,10 +20,19 @@ public final class Economy
{
}
private static final Logger logger = Logger.getLogger("Minecraft");
+ private static IEssentials ess;
+
+ /**
+ * @param aEss the ess to set
+ */
+ public static void setEss(IEssentials aEss)
+ {
+ ess = aEss;
+ }
private static void createNPCFile(String name)
{
- File folder = new File(Essentials.getStatic().getDataFolder(), "userdata");
+ File folder = new File(ess.getDataFolder(), "userdata");
if (!folder.exists())
{
folder.mkdirs();
@@ -30,13 +40,13 @@ public final class Economy
EssentialsConf npcConfig = new EssentialsConf(new File(folder, Util.sanitizeFileName(name) + ".yml"));
npcConfig.load();
npcConfig.setProperty("npc", true);
- npcConfig.setProperty("money", Essentials.getStatic().getSettings().getStartingBalance());
+ npcConfig.setProperty("money", ess.getSettings().getStartingBalance());
npcConfig.save();
}
-
+
private static void deleteNPC(String name)
{
- File folder = new File(Essentials.getStatic().getDataFolder(), "userdata");
+ File folder = new File(ess.getDataFolder(), "userdata");
if (!folder.exists())
{
folder.mkdirs();
@@ -44,24 +54,26 @@ public final class Economy
File config = new File(folder, Util.sanitizeFileName(name) + ".yml");
EssentialsConf npcConfig = new EssentialsConf(config);
npcConfig.load();
- if (npcConfig.hasProperty("npc") && npcConfig.getBoolean("npc", false)) {
- if (!config.delete()) {
+ if (npcConfig.hasProperty("npc") && npcConfig.getBoolean("npc", false))
+ {
+ if (!config.delete())
+ {
logger.log(Level.WARNING, Util.format("deleteFileError", config));
}
}
}
-
+
private static User getUserByName(String name)
{
User user;
- Player player = Essentials.getStatic().getServer().getPlayer(name);
+ Player player = ess.getServer().getPlayer(name);
if (player != null)
{
- user = Essentials.getStatic().getUser(player);
+ user = ess.getUser(player);
}
else
{
- user = Essentials.getStatic().getOfflineUser(name);
+ user = ess.getOfflineUser(name);
}
return user;
}
@@ -75,7 +87,8 @@ public final class Economy
public static double getMoney(String name) throws UserDoesNotExistException
{
User user = getUserByName(name);
- if (user == null) {
+ if (user == null)
+ {
throw new UserDoesNotExistException(name);
}
return user.getMoney();
@@ -91,7 +104,8 @@ public final class Economy
public static void setMoney(String name, double balance) throws UserDoesNotExistException, NoLoanPermittedException
{
User user = getUserByName(name);
- if (user == null) {
+ if (user == null)
+ {
throw new UserDoesNotExistException(name);
}
if (balance < 0.0 && !user.isAuthorized("essentials.eco.loan"))
@@ -113,7 +127,7 @@ public final class Economy
double result = getMoney(name) + amount;
setMoney(name, result);
}
-
+
/**
* Substracts money from the balance of a user
* @param name Name of the user
@@ -161,7 +175,7 @@ public final class Economy
*/
public static void resetBalance(String name) throws UserDoesNotExistException, NoLoanPermittedException
{
- setMoney(name, Essentials.getStatic().getSettings().getStartingBalance());
+ setMoney(name, ess.getSettings().getStartingBalance());
}
/**
@@ -216,18 +230,19 @@ public final class Economy
*/
public static String format(double amount)
{
- return Util.formatCurrency(amount);
+ return Util.formatCurrency(amount, ess);
}
-
+
/**
* Test if a player exists to avoid the UserDoesNotExistException
* @param name Name of the user
* @return true, if the user exists
*/
- public static boolean playerExists(String name) {
+ public static boolean playerExists(String name)
+ {
return getUserByName(name) != null;
}
-
+
/**
* Test if a player is a npc
* @param name Name of the player
@@ -237,12 +252,13 @@ public final class Economy
public static boolean isNPC(String name) throws UserDoesNotExistException
{
User user = getUserByName(name);
- if (user == null) {
+ if (user == null)
+ {
throw new UserDoesNotExistException(name);
}
return user.isNPC();
}
-
+
/**
* Creates dummy files for a npc, if there is no player yet with that name.
* @param name Name of the player
@@ -251,7 +267,8 @@ public final class Economy
public static boolean createNPC(String name)
{
User user = getUserByName(name);
- if (user == null) {
+ if (user == null)
+ {
createNPCFile(name);
return true;
}
@@ -266,7 +283,8 @@ public final class Economy
public static void removeNPC(String name) throws UserDoesNotExistException
{
User user = getUserByName(name);
- if (user == null) {
+ if (user == null)
+ {
throw new UserDoesNotExistException(name);
}
deleteNPC(name);
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java
index 24ff9758b..03950966c 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java
@@ -17,11 +17,29 @@ public class Commandafk extends EssentialsCommand
{
charge(user);
+ if (args.length > 0 && user.isAuthorized("essentials.afk.others"))
+ {
+ User afkUser = ess.getUser(ess.getServer().matchPlayer(args[0]));
+ if (afkUser != null)
+ {
+ toggleAfk(afkUser);
+ }
+ }
+ else
+ {
+ toggleAfk(user);
+ }
+ }
+
+ private final void toggleAfk(User user)
+ {
if (!user.toggleAfk())
{
user.sendMessage(Util.i18n("markedAsNotAway"));
ess.broadcastMessage(user.getName(), Util.format("userIsNotAway", user.getDisplayName()));
- } else {
+ }
+ else
+ {
user.sendMessage(Util.i18n("markedAsAway"));
ess.broadcastMessage(user.getName(), Util.format("userIsAway", user.getDisplayName()));
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java b/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java
index a7d778921..4dd3042d0 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java
@@ -1,12 +1,10 @@
package com.earth2me.essentials.commands;
-import net.minecraft.server.EntityTNTPrimed;
-import net.minecraft.server.World;
import org.bukkit.Location;
import org.bukkit.Server;
-import org.bukkit.craftbukkit.CraftWorld;
import com.earth2me.essentials.User;
import com.earth2me.essentials.TargetBlock;
+import org.bukkit.entity.TNTPrimed;
public class Commandantioch extends EssentialsCommand
@@ -17,17 +15,13 @@ public class Commandantioch extends EssentialsCommand
}
@Override
- public void run(Server server, User user, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
charge(user);
ess.broadcastMessage(user.getName(), "...lobbest thou thy Holy Hand Grenade of Antioch towards thy foe,");
ess.broadcastMessage(user.getName(), "who being naughty in My sight, shall snuff it.");
- Location loc = user.getLocation();
- World world = ((CraftWorld)user.getWorld()).getHandle();
- loc = new TargetBlock(user).getTargetBlock().getLocation();
- EntityTNTPrimed tnt = new EntityTNTPrimed(world, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
- world.addEntity(tnt);
- world.makeSound(tnt, "random.fuse", 1.0F, 1.0F);
+ final Location loc = new TargetBlock(user).getTargetBlock().getLocation();
+ loc.getWorld().spawn(loc, TNTPrimed.class);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandback.java b/Essentials/src/com/earth2me/essentials/commands/Commandback.java
index c852a7f99..26456a5d7 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandback.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandback.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Charge;
+import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.Server;
@@ -16,7 +16,7 @@ public class Commandback extends EssentialsCommand
@Override
protected void run(Server server, User user, String commandLabel, String[] args) throws Exception
{
- Charge charge = new Charge(this.getName(), ess);
+ Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
user.sendMessage(Util.i18n("backUsageMsg"));
user.getTeleport().back(charge);
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java
index 13a722d0e..7dd1fb449 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java
@@ -20,7 +20,7 @@ public class Commandbalance extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
- sender.sendMessage(Util.format("balance", Util.formatCurrency(getPlayer(server, args, 0).getMoney())));
+ sender.sendMessage(Util.format("balance", Util.formatCurrency(getPlayer(server, args, 0, true).getMoney(), ess)));
}
@Override
@@ -31,7 +31,7 @@ public class Commandbalance extends EssentialsCommand
|| !(user.isAuthorized("essentials.balance.others")
|| user.isAuthorized("essentials.balance.other"))
? user
- : getPlayer(server, args, 0)).getMoney();
- user.sendMessage(Util.format("balance", Util.formatCurrency(bal)));
+ : getPlayer(server, args, 0, true)).getMoney();
+ user.sendMessage(Util.format("balance", Util.formatCurrency(bal, ess)));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java
new file mode 100644
index 000000000..1d8b2e619
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java
@@ -0,0 +1,67 @@
+package com.earth2me.essentials.commands;
+
+import java.util.Map.Entry;
+import org.bukkit.Server;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandbalancetop extends EssentialsCommand
+{
+ public Commandbalancetop()
+ {
+ super("balancetop");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ int max = 10;
+ if (args.length > 0)
+ {
+ try
+ {
+ if (Integer.parseInt(args[0]) < 10)
+ {
+ max = Integer.parseInt(args[0]);
+ }
+ }
+ catch (NumberFormatException ex)
+ {
+ //catch it because they tried to enter a string not number.
+ }
+ }
+ final Map balances = new HashMap();
+ for (User u : ess.getAllUsers().values())
+ {
+ balances.put(u, u.getMoney());
+ }
+
+ final List> sortedEntries = new ArrayList>(balances.entrySet());
+ Collections.sort(sortedEntries, new Comparator>()
+ {
+ public int compare(final Entry entry1, final Entry entry2)
+ {
+ return -entry1.getValue().compareTo(entry2.getValue());
+ }
+ });
+ int count = 0;
+ sender.sendMessage(Util.format("balanceTop", max));
+ for (Map.Entry entry : sortedEntries)
+ {
+ if (count == max)
+ {
+ break;
+ }
+ sender.sendMessage(entry.getKey().getDisplayName() + ", " + Util.formatCurrency(entry.getValue(), ess));
+ count++;
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java
index 777fe08e1..1499b10ac 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java
@@ -2,7 +2,6 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import org.bukkit.craftbukkit.CraftServer;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
@@ -15,31 +14,32 @@ public class Commandban extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
-
- User p = null;
- if (server.matchPlayer(args[0]).isEmpty())
+ final User player = getPlayer(server, args, 0, true);
+ if (player.isAuthorized("essentials.ban.exempt"))
{
- ((CraftServer)server).getHandle().a(args[0]);
- sender.sendMessage(Util.format("playerBanned",args[0]));
+ sender.sendMessage(Util.i18n("banExempt"));
+ return;
+ }
+
+ String banReason;
+ if (args.length > 1)
+ {
+ banReason = getFinalArg(args, 1);
+ player.setBanReason(commandLabel);
}
else
{
- p = ess.getUser(server.matchPlayer(args[0]).get(0));
- String banReason = Util.i18n("defaultBanReason");
- if(args.length > 1) {
- banReason = getFinalArg(args, 1);
- p.setBanReason(commandLabel);
- }
- p.kickPlayer(banReason);
- ((CraftServer)server).getHandle().a(p.getName());
- sender.sendMessage(Util.format("playerBanned", p.getName()));
+ banReason = Util.i18n("defaultBanReason");
}
- ess.loadBanList();
+ player.kickPlayer(banReason);
+ ess.getBans().banByName(player.getName());
+ server.broadcastMessage(Util.format("playerBanned", player.getName(), banReason));
}
}
+
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
index affa869df..77c268988 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
@@ -3,7 +3,6 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import org.bukkit.craftbukkit.CraftServer;
public class Commandbanip extends EssentialsCommand
@@ -21,9 +20,7 @@ public class Commandbanip extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- ((CraftServer)server).getHandle().c(args[0]);
+ ess.getBans().banByIp(args[0]);
sender.sendMessage(Util.i18n("banIpAddress"));
- ess.loadBanList();
-
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java b/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java
index 00686c9b7..f02b99b15 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java
@@ -17,7 +17,7 @@ public class Commandbigtree extends EssentialsCommand
@Override
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
{
- TreeType tree = TreeType.TREE;
+ TreeType tree;
if (args.length > 0 && args[0].equalsIgnoreCase("redwood"))
{
tree = TreeType.TALL_REDWOOD;
@@ -36,7 +36,7 @@ public class Commandbigtree extends EssentialsCommand
double z = user.getLocation().getZ();
// offset tree in direction player is facing
- int r = (int)user.getCorrectedYaw();
+ final int r = (int)user.getCorrectedYaw();
if (r < 68 || r > 292) // north
{
x -= 3.0D;
@@ -54,8 +54,8 @@ public class Commandbigtree extends EssentialsCommand
z += 3.0D;
}
- Location safeLocation = Util.getSafeDestination(new Location(user.getWorld(), x, y, z));
- boolean success = user.getWorld().generateTree(safeLocation, (TreeType)tree);
+ final Location safeLocation = Util.getSafeDestination(new Location(user.getWorld(), x, y, z));
+ final boolean success = user.getWorld().generateTree(safeLocation, (TreeType)tree);
if (success)
{
charge(user);
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java b/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java
index 1fd974691..df9ff6a59 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java
@@ -6,7 +6,6 @@ import org.bukkit.entity.Player;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.List;
-import org.bukkit.ChatColor;
public class Commandclearinventory extends EssentialsCommand
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java
index 085fac900..2aa883bbf 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java
@@ -2,7 +2,6 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import com.earth2me.essentials.Essentials;
import org.bukkit.entity.Player;
import com.earth2me.essentials.User;
@@ -56,28 +55,24 @@ public class Commandeco extends EssentialsCommand
}
else
{
- for (Player p : server.matchPlayer(args[1]))
+ User u = getPlayer(server, args, 1, true);
+ switch (cmd)
{
- User u = ess.getUser(p);
- switch (cmd)
- {
- case GIVE:
- u.giveMoney(amount);
- break;
+ case GIVE:
+ u.giveMoney(amount, sender);
+ break;
- case TAKE:
- u.takeMoney(amount);
- break;
+ case TAKE:
+ u.takeMoney(amount, sender);
+ break;
- case RESET:
- u.setMoney(amount == 0 ? ess.getSettings().getStartingBalance() : amount);
- break;
- }
+ case RESET:
+ u.setMoney(amount == 0 ? ess.getSettings().getStartingBalance() : amount);
+ break;
}
}
}
-
private enum EcoCommands
{
GIVE, TAKE, RESET
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
index 84daceba0..bf0226138 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
@@ -1,8 +1,14 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.Util;
+import java.util.HashMap;
+import java.util.Map;
+import org.bukkit.Location;
+import org.bukkit.Material;
import org.bukkit.Server;
+import org.bukkit.block.Block;
import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
public class Commandessentials extends EssentialsCommand
@@ -11,12 +17,102 @@ public class Commandessentials extends EssentialsCommand
{
super("essentials");
}
+ private transient int taskid;
+ private final transient Map noteBlocks = new HashMap();
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
+ final Map noteMap = new HashMap();
+ noteMap.put("1F#", (byte)0x0);
+ noteMap.put("1G", (byte)0x1);
+ noteMap.put("1G#", (byte)0x2);
+ noteMap.put("1A", (byte)0x3);
+ noteMap.put("1A#", (byte)0x4);
+ noteMap.put("1B", (byte)0x5);
+ noteMap.put("1C", (byte)0x6);
+ noteMap.put("1C#", (byte)0x7);
+ noteMap.put("1D", (byte)0x8);
+ noteMap.put("1D#", (byte)0x9);
+ noteMap.put("1E", (byte)0xA);
+ noteMap.put("1F", (byte)0xB);
+ noteMap.put("2F#", (byte)(0x0 + 0xC));
+ noteMap.put("2G", (byte)(0x1 + 0xC));
+ noteMap.put("2G#", (byte)(0x2 + 0xC));
+ noteMap.put("2A", (byte)(0x3 + 0xC));
+ noteMap.put("2A#", (byte)(0x4 + 0xC));
+ noteMap.put("2B", (byte)(0x5 + 0xC));
+ noteMap.put("2C", (byte)(0x6 + 0xC));
+ noteMap.put("2C#", (byte)(0x7 + 0xC));
+ noteMap.put("2D", (byte)(0x8 + 0xC));
+ noteMap.put("2D#", (byte)(0x9 + 0xC));
+ noteMap.put("2E", (byte)(0xA + 0xC));
+ noteMap.put("2F", (byte)(0xB + 0xC));
+ if (args.length > 0 && args[0].equalsIgnoreCase("nya"))
+ {
+ if (!noteBlocks.isEmpty())
+ {
+ return;
+ }
+ final String tuneStr = "1D#,1E,2F#,,2A#,1E,1D#,1E,2F#,2B,2D#,2E,2D#,2A#,2B,,2F#,,1D#,1E,2F#,2B,2C#,2A#,2B,2C#,2E,2D#,2E,2C#,,2F#,,2G#,,1D,1D#,,1C#,1D,1C#,1B,,1B,,1C#,,1D,,1D,1C#,1B,1C#,1D#,2F#,2G#,1D#,2F#,1C#,1D#,1B,1C#,1B,1D#,,2F#,,2G#,1D#,2F#,1C#,1D#,1B,1D,1D#,1D,1C#,1B,1C#,1D,,1B,1C#,1D#,2F#,1C#,1D,1C#,1B,1C#,,1B,,1C#,,2F#,,2G#,,1D,1D#,,1C#,1D,1C#,1B,,1B,,1C#,,1D,,1D,1C#,1B,1C#,1D#,2F#,2G#,1D#,2F#,1C#,1D#,1B,1C#,1B,1D#,,2F#,,2G#,1D#,2F#,1C#,1D#,1B,1D,1D#,1D,1C#,1B,1C#,1D,,1B,1C#,1D#,2F#,1C#,1D,1C#,1B,1C#,,1B,,1B,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1B,,";
+ final String[] tune = tuneStr.split(",");
+
+ for (Player player : server.getOnlinePlayers())
+ {
+ final Location loc = player.getLocation();
+ loc.add(0, 3, 0);
+ while (loc.getBlockY() < player.getLocation().getBlockY() + 10 && loc.getBlock().getTypeId() != 0)
+ {
+ loc.add(0, 1, 0);
+ }
+ if (loc.getBlock().getTypeId() == 0)
+ {
+ noteBlocks.put(player, loc.getBlock());
+ loc.getBlock().setType(Material.NOTE_BLOCK);
+ }
+ }
+ taskid = ess.scheduleSyncRepeatingTask(new Runnable()
+ {
+ int i = 0;
+
+ public void run()
+ {
+ final String note = tune[i];
+ i++;
+ if (i >= tune.length)
+ {
+ Commandessentials.this.stopTune();
+ }
+ if (note.isEmpty())
+ {
+ return;
+ }
+ Map noteBlocks = Commandessentials.this.noteBlocks;
+ for (Player player : server.getOnlinePlayers())
+ {
+ Block block = noteBlocks.get(player);
+ if (block == null)
+ {
+ continue;
+ }
+ player.playNote(block.getLocation(), (byte)0, noteMap.get(note));
+ }
+ }
+ }, 20, 2);
+ return;
+ }
ess.reload();
charge(sender);
sender.sendMessage(Util.format("essentialsReload", ess.getDescription().getVersion()));
}
+
+ private void stopTune()
+ {
+ ess.getScheduler().cancelTask(taskid);
+ for (Block block : noteBlocks.values())
+ {
+ block.setType(Material.AIR);
+ }
+ noteBlocks.clear();
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java b/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java
new file mode 100644
index 000000000..73c314935
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java
@@ -0,0 +1,24 @@
+package com.earth2me.essentials.commands;
+
+import com.earth2me.essentials.User;
+import org.bukkit.Server;
+import org.bukkit.entity.Fireball;
+import org.bukkit.util.Vector;
+
+
+public class Commandfireball extends EssentialsCommand
+{
+
+ public Commandfireball()
+ {
+ super("fireball");
+ }
+
+ @Override
+ protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
+ {
+ charge(user);
+ final Vector direction = user.getEyeLocation().getDirection().multiply(2);
+ user.getWorld().spawn(user.getEyeLocation().add(direction.getX(), direction.getY(), direction.getZ()), Fireball.class);
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
index 3bc0488cd..dd3cf35f4 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
@@ -18,7 +18,8 @@ public class Commandgc extends EssentialsCommand
{
charge(sender);
sender.sendMessage(Util.format("gcmax", (Runtime.getRuntime().maxMemory() / 1024 / 1024)));
- sender.sendMessage(Util.format("gcmin", (Runtime.getRuntime().freeMemory() / 1024 / 1024)));
+ sender.sendMessage(Util.format("gcfree", (Runtime.getRuntime().freeMemory() / 1024 / 1024)));
+ sender.sendMessage(Util.format("gctotal", (Runtime.getRuntime().totalMemory() / 1024 / 1024)));
for (World w : server.getWorlds())
{
sender.sendMessage(
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
index eeba116e3..b029df098 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
@@ -2,7 +2,6 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import com.earth2me.essentials.ItemDb;
import com.earth2me.essentials.User;
import org.bukkit.ChatColor;
import org.bukkit.Material;
@@ -25,7 +24,7 @@ public class Commandgive extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- ItemStack stack = ItemDb.get(args[1]);
+ ItemStack stack = ess.getItemDb().get(args[1]);
String itemname = stack.getType().toString().toLowerCase().replace("_", "");
if (sender instanceof Player
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java
index 52277b1fa..c105e2e41 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java
@@ -30,24 +30,44 @@ public class Commandhelp extends EssentialsCommand
@Override
protected void run(Server server, User user, String commandLabel, String[] args) throws Exception
{
- int page;
+ int page = 1;
+ String match = "";
try
{
- page = args.length > 0 ? Integer.parseInt(args[0]) : 1;
+ if (args.length > 0)
+ {
+ match = args[0].toLowerCase();
+ page = Integer.parseInt(args[args.length - 1]);
+ if (args.length == 1)
+ {
+ match = "";
+ }
+ }
+
}
catch (Exception ex)
{
- page = 1;
+ if (args.length == 1)
+ {
+ match = args[0].toLowerCase();
+ }
}
- List lines = getHelpLines(user);
- int start = (page - 1) * 9;
- int pages = lines.size() / 9 + (lines.size() % 9 > 0 ? 1 : 0);
-
- user.sendMessage(Util.format("helpPages", page, pages));
- for (int i = start; i < lines.size() && i < start + 9; i++)
+ List lines = getHelpLines(user, match);
+ if (lines.size() > 0)
{
- user.sendMessage(lines.get(i));
+ int start = (page - 1) * 9;
+ int pages = lines.size() / 9 + (lines.size() % 9 > 0 ? 1 : 0);
+
+ user.sendMessage(Util.format("helpPages", page, pages));
+ for (int i = start; i < lines.size() && i < start + 9; i++)
+ {
+ user.sendMessage(lines.get(i));
+ }
+ }
+ else
+ {
+ user.sendMessage(Util.i18n("noHelpFound"));
}
}
@@ -58,13 +78,13 @@ public class Commandhelp extends EssentialsCommand
}
@SuppressWarnings("CallToThreadDumpStack")
- private List getHelpLines(User user) throws Exception
+ private List getHelpLines(User user, String match) throws Exception
{
List retval = new ArrayList();
- File helpFile = new File(ess.getDataFolder(), "help_"+Util.sanitizeFileName(user.getName()) +".txt");
+ File helpFile = new File(ess.getDataFolder(), "help_" + Util.sanitizeFileName(user.getName()) + ".txt");
if (!helpFile.exists())
{
- helpFile = new File(ess.getDataFolder(), "help_"+Util.sanitizeFileName(user.getGroup()) +".txt");
+ helpFile = new File(ess.getDataFolder(), "help_" + Util.sanitizeFileName(user.getGroup()) + ".txt");
}
if (!helpFile.exists())
{
@@ -73,8 +93,9 @@ public class Commandhelp extends EssentialsCommand
if (helpFile.exists())
{
final BufferedReader bufferedReader = new BufferedReader(new FileReader(helpFile));
- try {
-
+ try
+ {
+
while (bufferedReader.ready())
{
final String line = bufferedReader.readLine();
@@ -98,6 +119,12 @@ public class Commandhelp extends EssentialsCommand
final HashMap> cmds = (HashMap>)desc.getCommands();
for (Entry> k : cmds.entrySet())
{
+ if ((!match.equalsIgnoreCase("")) && (!k.getKey().toLowerCase().contains(match))
+ && (!k.getValue().get("description").toLowerCase().contains(match)))
+ {
+ continue;
+ }
+
if (p.getDescription().getName().toLowerCase().contains("essentials"))
{
final String node = "essentials." + k.getKey();
@@ -119,9 +146,19 @@ public class Commandhelp extends EssentialsCommand
retval.add("§c" + k.getKey() + "§7: " + value.get("description"));
}
}
+ else if (value.containsKey("permissions") && value.get("permissions") != null && !(value.get("permissions").equals("")))
+ {
+ if (user.isAuthorized(value.get("permissions")))
+ {
+ retval.add("§c" + k.getKey() + "§7: " + value.get("description"));
+ }
+ }
else
{
- retval.add("§c" + k.getKey() + "§7: " + value.get("description"));
+ if (!ess.getSettings().hidePermissionlessHelp())
+ {
+ retval.add("§c" + k.getKey() + "§7: " + value.get("description"));
+ }
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
index c71ba4b0e..2649a9cb0 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Charge;
+import com.earth2me.essentials.Trade;
import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
@@ -16,7 +16,7 @@ public class Commandhome extends EssentialsCommand
@Override
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
{
- Charge charge = new Charge(this.getName(), ess);
+ Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
if(args.length > 0 && user.isAuthorized("essentials.home.others"))
{
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java
index 0bcf25ac3..4961f714d 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java
@@ -1,10 +1,8 @@
package com.earth2me.essentials.commands;
import org.bukkit.Server;
-import com.earth2me.essentials.ItemDb;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
-import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
@@ -23,7 +21,7 @@ public class Commanditem extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
- ItemStack stack = ItemDb.get(args[0]);
+ ItemStack stack = ess.getItemDb().get(args[0]);
String itemname = stack.getType().toString().toLowerCase().replace("_", "");
if (ess.getSettings().permissionBasedItemSpawn()
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandjump.java b/Essentials/src/com/earth2me/essentials/commands/Commandjump.java
index 42ef0d424..5cdcbb2f2 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandjump.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandjump.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Charge;
+import com.earth2me.essentials.Trade;
import org.bukkit.Location;
import org.bukkit.Server;
import com.earth2me.essentials.TargetBlock;
@@ -36,7 +36,7 @@ public class Commandjump extends EssentialsCommand
throw new Exception(Util.i18n("jumpError"), ex);
}
- Charge charge = new Charge(this.getName(), ess);
+ Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
user.getTeleport().teleport(loc, charge);
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java
index ba9c2153a..6bae4e713 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java
@@ -4,7 +4,6 @@ import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
-import org.bukkit.ChatColor;
public class Commandkick extends EssentialsCommand
@@ -13,7 +12,7 @@ public class Commandkick extends EssentialsCommand
{
super("kick");
}
-
+
@Override
public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
{
@@ -21,19 +20,16 @@ public class Commandkick extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
-
- User u;
- try
+
+ User u = getPlayer(server, args, 0);
+ if (u.isAuthorized("essentials.kick.exempt"))
{
- u = ess.getUser(server.matchPlayer(args[0]).get(0));
- }
- catch (Throwable ex)
- {
- sender.sendMessage(Util.i18n("playerNotFound"));
+ sender.sendMessage(Util.i18n("kickExempt"));
return;
}
-
charge(sender);
- u.kickPlayer(args.length > 1 ? getFinalArg(args, 1) : Util.i18n("kickDefault"));
+ final String kickReason = args.length > 1 ? getFinalArg(args, 1) : Util.i18n("kickDefault");
+ u.kickPlayer(kickReason);
+ server.broadcastMessage(Util.format("playerKicked", u.getName(), kickReason));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
index e02a6d766..849ec2398 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Charge;
+import com.earth2me.essentials.Trade;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
@@ -109,7 +109,7 @@ public class Commandkit extends EssentialsCommand
items = (List)kit;
}
- Charge charge = new Charge("kit-" + kitName, ess);
+ Trade charge = new Trade("kit-" + kitName, ess);
try
{
charge.isAffordableFor(user);
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java
index 39b0723fc..b14136070 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java
@@ -2,7 +2,6 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import com.earth2me.essentials.Essentials;
import org.bukkit.entity.Player;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java
new file mode 100644
index 000000000..9aa4f8ac0
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java
@@ -0,0 +1,58 @@
+package com.earth2me.essentials.commands;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.bukkit.Location;
+import org.bukkit.Server;
+import org.bukkit.World;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+import org.bukkit.entity.TNTPrimed;
+
+
+public class Commandnuke extends EssentialsCommand
+{
+ public Commandnuke()
+ {
+ super("nuke");
+ }
+
+ @Override
+ protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws NoSuchFieldException, NotEnoughArgumentsException
+ {
+ List targets;
+ if (args.length > 0)
+ {
+ targets = new ArrayList();
+ int pos = 0;
+ for (String arg : args)
+ {
+ targets.add(getPlayer(server, args, pos));
+ pos++;
+ }
+ }
+ else
+ {
+ targets = Arrays.asList(server.getOnlinePlayers());
+ }
+ ess.getTNTListener().enable();
+ for (Player player : targets)
+ {
+ if (player == null) {
+ continue;
+ }
+ player.sendMessage("May death rain upon them");
+ final Location loc = player.getLocation();
+ final World world = loc.getWorld();
+ for (int x = -10; x <= 10; x += 5)
+ {
+ for (int z = -10; z <= 10; z += 5)
+ {
+ final Location tntloc = new Location(world, loc.getBlockX() + x, 127, loc.getBlockZ() + z);
+ final TNTPrimed tnt = world.spawn(tntloc, TNTPrimed.class);
+ }
+ }
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java
index 4d5ad8e9b..ce327b204 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java
@@ -4,6 +4,7 @@ import org.bukkit.Server;
import org.bukkit.entity.Player;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
+import org.bukkit.ChatColor;
public class Commandrealname extends EssentialsCommand
@@ -20,15 +21,15 @@ public class Commandrealname extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
- String whois = args[0].toLowerCase();
+ final String whois = args[0].toLowerCase();
charge(user);
for (Player p : server.getOnlinePlayers())
{
- User u = ess.getUser(p);
- String dn = u.getDisplayName().toLowerCase();
- if (!whois.equals(dn)
- && !whois.equals(ess.getSettings().getNicknamePrefix() + dn)
- && !whois.equals(u.getName().toLowerCase()))
+ final User u = ess.getUser(p);
+ final String displayName = ChatColor.stripColor(u.getDisplayName()).toLowerCase();
+ if (!whois.equals(displayName)
+ && !displayName.equals(ChatColor.stripColor(ess.getSettings().getNicknamePrefix()) + whois)
+ && !whois.equalsIgnoreCase(u.getName()))
{
continue;
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
index 155ee695c..66b838051 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java
@@ -1,9 +1,8 @@
package com.earth2me.essentials.commands;
import org.bukkit.Server;
-import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.InventoryWorkaround;
-import com.earth2me.essentials.ItemDb;
+import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.logging.Level;
@@ -68,7 +67,7 @@ public class Commandsell extends EssentialsCommand
}
if (is == null)
{
- is = ItemDb.get(args[0]);
+ is = ess.getItemDb().get(args[0]);
}
sellItem(user, is, args, false);
}
@@ -151,11 +150,13 @@ public class Commandsell extends EssentialsCommand
}
charge(user);
- InventoryWorkaround.removeItem(user.getInventory(), true, new ItemStack(is.getType(), amount, is.getDurability()));
+ final ItemStack ris = new ItemStack(is.getType(), amount, is.getDurability());
+ InventoryWorkaround.removeItem(user.getInventory(), true, ris);
user.updateInventory();
+ Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(worth*amount, ess), ess);
user.giveMoney(worth * amount);
- user.sendMessage(Util.format("itemSold", Util.formatCurrency(worth * amount), amount, Util.formatCurrency(worth)));
- logger.log(Level.INFO, Util.format("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(), Util.formatCurrency(worth * amount), amount, Util.formatCurrency(worth)));
+ user.sendMessage(Util.format("itemSold", Util.formatCurrency(worth * amount, ess), amount, Util.formatCurrency(worth, ess)));
+ logger.log(Level.INFO, Util.format("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(), Util.formatCurrency(worth * amount, ess), amount, Util.formatCurrency(worth, ess)));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
index fcd451dd4..e07572f95 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
@@ -11,12 +11,35 @@ public class Commandsethome extends EssentialsCommand
{
super("sethome");
}
-
+
@Override
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
{
- user.setHome(args.length > 0 && args[0].equalsIgnoreCase("default"));
+ if (args.length > 0)
+ {
+ if (args.length < 2)
+ {
+ user.setHome(args[0].equalsIgnoreCase("default"));
+ }
+ else
+ {
+ if (user.isAuthorized("essentials.sethome.others"))
+ {
+ User usersHome = ess.getUser(ess.getServer().getPlayer(args[0]));
+ if(usersHome == null)
+ {
+ usersHome = ess.getOfflineUser(args[0]);
+ }
+ usersHome.setHome(user.getLocation(), args[1].equalsIgnoreCase("default"));
+ }
+ }
+ }
+ else
+ {
+ user.setHome(false);
+ }
charge(user);
user.sendMessage(Util.i18n("homeSet"));
+
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java
index 047f1d28b..42b5a1953 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java
@@ -1,7 +1,6 @@
package com.earth2me.essentials.commands;
import org.bukkit.Server;
-import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
index c62403292..4e799d6c0 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
@@ -2,7 +2,6 @@ package com.earth2me.essentials.commands;
import org.bukkit.Location;
import org.bukkit.Server;
-import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java
index 764198828..e6b741c43 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java
@@ -1,8 +1,6 @@
package com.earth2me.essentials.commands;
import org.bukkit.Server;
-import com.earth2me.essentials.Essentials;
-import com.earth2me.essentials.ItemDb;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.inventory.ItemStack;
@@ -23,7 +21,7 @@ public class Commandsetworth extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- ItemStack stack = ItemDb.get(args[0]);
+ ItemStack stack = ess.getItemDb().get(args[0]);
charge(user);
ess.getWorth().setPrice(stack, Double.parseDouble(args[1]));
user.sendMessage(Util.i18n("worthSet"));
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java
index df2f7f954..1acbf13b8 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java
@@ -5,7 +5,10 @@ import com.earth2me.essentials.Util;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.block.Block;
+<<<<<<< HEAD
import org.bukkit.block.CreatureSpawner;
+=======
+>>>>>>> master
import org.bukkit.craftbukkit.block.CraftCreatureSpawner;
import org.bukkit.entity.CreatureType;
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
index 36beaad5d..c15fd6656 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
@@ -1,6 +1,5 @@
package com.earth2me.essentials.commands;
-import net.minecraft.server.WorldServer;
import org.bukkit.Location;
import org.bukkit.Server;
import com.earth2me.essentials.User;
@@ -13,7 +12,6 @@ import net.minecraft.server.PathEntity;
import org.bukkit.DyeColor;
import org.bukkit.Material;
import org.bukkit.block.Block;
-import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.entity.CraftCreeper;
import org.bukkit.craftbukkit.entity.CraftSheep;
import org.bukkit.craftbukkit.entity.CraftSlime;
@@ -60,6 +58,12 @@ public class Commandspawnmob extends EssentialsCommand
}
}
+ if (ess.getSettings().getProtectPreventSpawn(mobType.toLowerCase())
+ || (mountType != null && ess.getSettings().getProtectPreventSpawn(mountType.toLowerCase())))
+ {
+ user.sendMessage(Util.i18n("unableToSpawnMob"));
+ return;
+ }
Entity spawnedMob = null;
Mob mob = null;
@@ -85,7 +89,7 @@ public class Commandspawnmob extends EssentialsCommand
loc.setY(loc.getY() + 1);
block = user.getWorld().getBlockAt(loc);
}
-
+
try
{
spawnedMob = mob.spawn(user, server, loc);
@@ -224,7 +228,8 @@ public class Commandspawnmob extends EssentialsCommand
{
((CraftWolf)spawned).setAngry(true);
}
- if ("Creeper".equalsIgnoreCase(type) && data.equalsIgnoreCase("powered")) {
+ if ("Creeper".equalsIgnoreCase(type) && data.equalsIgnoreCase("powered"))
+ {
((CraftCreeper)spawned).setPowered(true);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
index 57f346f9c..639c2bda0 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
@@ -2,8 +2,6 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import org.bukkit.craftbukkit.CraftServer;
-import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
@@ -16,37 +14,26 @@ public class Commandtempban extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 2)
{
throw new NotEnoughArgumentsException();
}
-
- User p = null;
- try
+ final User player = getPlayer(server, args, 0, true);
+ if (player.isAuthorized("essentials.tempban.exempt"))
{
- p = getPlayer(server, args, 0);
- }
- catch (NoSuchFieldException ex)
- {
- p = ess.getOfflineUser(args[0]);
- }
- if (p == null)
- {
- sender.sendMessage(Util.format("playerNotFound"));
+ sender.sendMessage(Util.i18n("tempbanExempt"));
+ return;
}
+ final String time = getFinalArg(args, 1);
+ final long banTimestamp = Util.parseDateDiff(time, true);
- String time = getFinalArg(args, 1);
- long banTimestamp = Util.parseDateDiff(time, true);
-
- p = ess.getUser(server.matchPlayer(args[0]).get(0));
- String banReason = Util.format("tempBanned", Util.formatDateDiff(banTimestamp));
- p.setBanReason(banReason);
- p.setBanTimeout(banTimestamp);
- p.kickPlayer(banReason);
- ((CraftServer)server).getHandle().a(p.getName());
- sender.sendMessage(Util.format("playerBanned", p.getName()));
- Essentials.getStatic().loadBanList();
+ final String banReason = Util.format("tempBanned", Util.formatDateDiff(banTimestamp));
+ player.setBanReason(banReason);
+ player.setBanTimeout(banTimestamp);
+ player.kickPlayer(banReason);
+ ess.getBans().banByName(player.getName());
+ server.broadcastMessage(Util.format("playerBanned", player.getName(), banReason));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java
index 71bfb5965..d05f8890c 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java
@@ -21,33 +21,28 @@ public class Commandtime extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
- if (user.isAuthorized("essentials.time.world"))
+ if (args.length < 2)
{
- final World world = user.getWorld();
+ if (user.isAuthorized("essentials.time.world"))
+ {
+ final World world = user.getWorld();
- charge(user);
- setWorldTime(world, args[0]);
+ charge(user);
+ setWorldTime(world, args[0]);
+ }
+ else
+ {
+ charge(user);
+ setPlayerTime(user, commandLabel);
+ }
}
else
{
- if (user.isAuthorized("essentials.time.player"))
+ if (user.isAuthorized("essentials.time.others"))
{
-
- long time = user.getPlayerTime();
- time -= time % 24000;
- if ("day".equalsIgnoreCase(args[0]))
- {
- final World world = user.getWorld();
- user.setPlayerTime(time + 24000 - world.getTime(), true);
- return;
- }
- if ("night".equalsIgnoreCase(args[0]))
- {
- final World world = user.getWorld();
- user.setPlayerTime(time + 37700 - world.getTime(), true);
- return;
- }
- throw new Exception(Util.i18n("onlyDayNight"));
+ User u = getPlayer(server, args, 1);
+ charge(user);
+ setPlayerTime(u, args[0]);
}
}
}
@@ -59,9 +54,17 @@ public class Commandtime extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
- for (World world : server.getWorlds())
+ if (args.length < 2)
{
- setWorldTime(world, args[0]);
+ for (World world : server.getWorlds())
+ {
+ setWorldTime(world, args[0]);
+ }
+ }
+ else
+ {
+ User u = getPlayer(server, args, 1);
+ setPlayerTime(u, args[0]);
}
sender.sendMessage(Util.i18n("timeSet"));
@@ -83,4 +86,27 @@ public class Commandtime extends EssentialsCommand
}
throw new Exception(Util.i18n("onlyDayNight"));
}
+
+ private void setPlayerTime(final User user, final String timeString) throws Exception
+ {
+ long time = user.getPlayerTime();
+ time -= time % 24000;
+ if ("day".equalsIgnoreCase(timeString))
+ {
+ final World world = user.getWorld();
+ user.setPlayerTime(time + 24000 - world.getTime(), true);
+ return;
+ }
+ if ("night".equalsIgnoreCase(timeString))
+ {
+ final World world = user.getWorld();
+ user.setPlayerTime(time + 37700 - world.getTime(), true);
+ return;
+ }
+ if ("reset".equalsIgnoreCase(timeString))
+ {
+ user.resetPlayerTime();
+ }
+ throw new Exception(Util.i18n("onlyDayNight"));
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java
index acd06bf5a..899ac37dd 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java
@@ -2,7 +2,6 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
@@ -22,8 +21,7 @@ public class Commandtogglejail extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- User p = getPlayer(server, args, 0);
-
+ User p = getPlayer(server, args, 0, true);
if (p.isAuthorized("essentials.jail.exempt"))
{
sender.sendMessage(Util.i18n("mayNotJail"));
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtop.java b/Essentials/src/com/earth2me/essentials/commands/Commandtop.java
index 9704d4a59..8c0c687d0 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtop.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtop.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Charge;
+import com.earth2me.essentials.Trade;
import org.bukkit.Location;
import org.bukkit.Server;
import com.earth2me.essentials.User;
@@ -21,7 +21,7 @@ public class Commandtop extends EssentialsCommand
int topZ = user.getLocation().getBlockZ();
int topY = user.getWorld().getHighestBlockYAt(topX, topZ);
charge(user);
- user.getTeleport().teleport(new Location(user.getWorld(), user.getLocation().getX(), topY + 1, user.getLocation().getZ()), new Charge(this.getName(), ess));
+ user.getTeleport().teleport(new Location(user.getWorld(), user.getLocation().getX(), topY + 1, user.getLocation().getZ()), new Trade(this.getName(), ess));
user.sendMessage(Util.i18n("teleportTop"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
index 64f7f8d08..c147c5d25 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Charge;
+import com.earth2me.essentials.Trade;
import com.earth2me.essentials.Console;
import org.bukkit.Server;
import com.earth2me.essentials.User;
@@ -30,7 +30,7 @@ public class Commandtp extends EssentialsCommand
throw new Exception(Util.format("teleportDisabled", p.getDisplayName()));
}
user.sendMessage(Util.i18n("teleporting"));
- Charge charge = new Charge(this.getName(), ess);
+ Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
user.getTeleport().teleport(p, charge);
break;
@@ -44,7 +44,7 @@ public class Commandtp extends EssentialsCommand
charge(user);
User target = getPlayer(server, args, 0);
User toPlayer = getPlayer(server, args, 1);
- target.getTeleport().now(toPlayer);
+ target.getTeleport().now(toPlayer, false);
target.sendMessage(Util.format("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName()));
break;
}
@@ -61,7 +61,7 @@ public class Commandtp extends EssentialsCommand
sender.sendMessage(Util.i18n("teleporting"));
User target = getPlayer(server, args, 0);
User toPlayer = getPlayer(server, args, 1);
- target.getTeleport().now(toPlayer);
+ target.getTeleport().now(toPlayer, false);
target.sendMessage(Util.format("teleportAtoB", Console.NAME, toPlayer.getDisplayName()));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
index 1aab32cdf..0cba80020 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Charge;
+import com.earth2me.essentials.Trade;
import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
@@ -23,7 +23,7 @@ public class Commandtpaccept extends EssentialsCommand
throw new Exception(Util.i18n("noPendingRequest"));
}
- Charge charge = new Charge(this.getName(), ess);
+ Trade charge = new Trade(this.getName(), ess);
if (user.isTeleportRequestHere())
{
charge.isAffordableFor(user);
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
index 86311cd2e..cc58944d7 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
@@ -3,7 +3,6 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
-import java.util.logging.Level;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -46,15 +45,11 @@ public class Commandtpall extends EssentialsCommand
}
try
{
- u.getTeleport().now(p);
+ u.getTeleport().now(p, false);
}
catch (Exception ex)
{
- sender.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
- if (ess.getSettings().isDebug())
- {
- logger.log(Level.WARNING, ex.getMessage(), ex);
- }
+ ess.showError(sender, ex, getName());
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java
index 3710b121b..036c4be27 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Charge;
+import com.earth2me.essentials.Trade;
import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
@@ -21,7 +21,7 @@ public class Commandtphere extends EssentialsCommand
{
throw new Exception(Util.format("teleportDisabled", p.getDisplayName()));
}
- p.getTeleport().teleport(user, new Charge(this.getName(), ess));
+ p.getTeleport().teleport(user, new Trade(this.getName(), ess));
user.sendMessage(Util.i18n("teleporting"));
p.sendMessage(Util.i18n("teleporting"));
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java
index 6b74f5062..2a9e34da8 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java
@@ -23,7 +23,7 @@ public class Commandtpo extends EssentialsCommand
//Just basically the old tp command
User p = getPlayer(server, args, 0);
charge(user);
- user.getTeleport().now(p);
+ user.getTeleport().now(p, false);
user.sendMessage(Util.i18n("teleporting"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java
index 5dc7a4478..593d17b59 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java
@@ -23,7 +23,7 @@ public class Commandtpohere extends EssentialsCommand
//Just basically the old tphere command
User p = getPlayer(server, args, 0);
charge(user);
- p.getTeleport().now(user);
+ p.getTeleport().now(user, false);
user.sendMessage(Util.i18n("teleporting"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
index 05f95bc40..805aefaca 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Charge;
+import com.earth2me.essentials.Trade;
import org.bukkit.Location;
import org.bukkit.Server;
import com.earth2me.essentials.User;
@@ -26,7 +26,7 @@ public class Commandtppos extends EssentialsCommand
int y = Integer.parseInt(args[1]);
int z = Integer.parseInt(args[2]);
Location l = new Location(user.getWorld(), x, y, z);
- Charge charge = new Charge(this.getName(), ess);
+ Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
user.sendMessage(Util.i18n("teleporting"));
user.getTeleport().teleport(l, charge);
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
index dbad49f40..88e7f10ba 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
@@ -1,9 +1,9 @@
package com.earth2me.essentials.commands;
+import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import org.bukkit.craftbukkit.CraftServer;
public class Commandunban extends EssentialsCommand
@@ -14,15 +14,15 @@ public class Commandunban extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- ((CraftServer)server).getHandle().b(args[0]);
+ User u = getPlayer(server, args, 0, true);
+ ess.getBans().unbanByName(u.getName());
sender.sendMessage(Util.i18n("unbannedPlayer"));
- ess.loadBanList();
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java
index c7ec57985..aa6327f49 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java
@@ -3,7 +3,6 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
-import org.bukkit.craftbukkit.CraftServer;
public class Commandunbanip extends EssentialsCommand
@@ -14,15 +13,14 @@ public class Commandunbanip extends EssentialsCommand
}
@Override
- public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
- ((CraftServer)server).getHandle().d(args[0]);
+ ess.getBans().unbanByIp(args[0]);
sender.sendMessage(Util.i18n("unbannedIP"));
- ess.loadBanList();
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java b/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
index b6941d5e6..cc519113c 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
@@ -1,7 +1,6 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.InventoryWorkaround;
-import com.earth2me.essentials.ItemDb;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.List;
@@ -56,7 +55,7 @@ public class Commandunlimited extends EssentialsCommand
return;
}
- ItemStack stack = ItemDb.get(args[0], 1);
+ ItemStack stack = ess.getItemDb().get(args[0], 1);
String itemname = stack.getType().toString().toLowerCase().replace("_", "");
if (!user.isAuthorized("essentials.unlimited.item-all")
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java
index f4e710aaf..50a8ff0cf 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Charge;
+import com.earth2me.essentials.Trade;
import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
@@ -73,7 +73,7 @@ public class Commandwarp extends EssentialsCommand
private void warpUser(User user, String name) throws Exception
{
- Charge charge = new Charge(this.getName(), ess);
+ Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
if (ess.getSettings().getPerWarpPermission())
{
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java
index e923bc70e..1dcd59131 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java
@@ -41,7 +41,7 @@ public class Commandwhois extends EssentialsCommand
sender.sendMessage(Util.format("whoisLocation", u.getLocation().getWorld().getName(), u.getLocation().getBlockX(), u.getLocation().getBlockY(), u.getLocation().getBlockZ()));
if (!ess.getSettings().isEcoDisabled())
{
- sender.sendMessage(Util.format("whoisMoney", Util.formatCurrency(u.getMoney())));
+ sender.sendMessage(Util.format("whoisMoney", Util.formatCurrency(u.getMoney(), ess)));
}
sender.sendMessage(u.isAfk()
? Util.i18n("whoisStatusAway")
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java
index bdbe83798..0a315b1d4 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Charge;
+import com.earth2me.essentials.Trade;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.Server;
@@ -68,7 +68,7 @@ public class Commandworld extends EssentialsCommand
Location loc = user.getLocation();
loc = new Location(world, loc.getBlockX() * factor + .5, loc.getBlockY(), loc.getBlockZ() * factor + .5);
- Charge charge = new Charge(this.getName(), ess);
+ Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user);
user.getTeleport().teleport(loc, charge);
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
index 2ce428cfb..f2d6ed954 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
@@ -1,7 +1,6 @@
package com.earth2me.essentials.commands;
import org.bukkit.Server;
-import com.earth2me.essentials.ItemDb;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.inventory.ItemStack;
@@ -22,7 +21,7 @@ public class Commandworth extends EssentialsCommand
if (args.length > 0)
{
- is = ItemDb.get(args[0]);
+ is = ess.getItemDb().get(args[0]);
}
try
@@ -49,13 +48,13 @@ public class Commandworth extends EssentialsCommand
? Util.format("worthMeta",
is.getType().toString().toLowerCase().replace("_", ""),
is.getDurability(),
- Util.formatCurrency(worth * amount),
+ Util.formatCurrency(worth * amount, ess),
amount,
- Util.formatCurrency(worth))
+ Util.formatCurrency(worth, ess))
: Util.format("worth",
is.getType().toString().toLowerCase().replace("_", ""),
- Util.formatCurrency(worth * amount),
+ Util.formatCurrency(worth * amount, ess),
amount,
- Util.formatCurrency(worth)));
+ Util.formatCurrency(worth, ess)));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
index 12c9258c0..ac19f7d74 100644
--- a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
+++ b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
@@ -1,11 +1,10 @@
package com.earth2me.essentials.commands;
-import com.earth2me.essentials.Charge;
+import com.earth2me.essentials.Trade;
import java.util.List;
import org.bukkit.Server;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
-import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.IEssentials;
import org.bukkit.entity.Player;
import com.earth2me.essentials.User;
@@ -23,7 +22,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand
{
this.name = name;
}
-
+
public void setEssentials(IEssentials ess)
{
this.ess = ess;
@@ -35,10 +34,23 @@ public abstract class EssentialsCommand implements IEssentialsCommand
}
protected User getPlayer(Server server, String[] args, int pos) throws NoSuchFieldException, NotEnoughArgumentsException
+ {
+ return getPlayer(server, args, pos, false);
+ }
+
+ protected User getPlayer(Server server, String[] args, int pos, boolean getOffline) throws NoSuchFieldException, NotEnoughArgumentsException
{
if (args.length <= pos) throw new NotEnoughArgumentsException();
List matches = server.matchPlayer(args[pos]);
- if (matches.size() < 1) throw new NoSuchFieldException(Util.i18n("playerNotFound"));
+
+ if (matches.size() < 1)
+ {
+ if (!getOffline) throw new NoSuchFieldException(Util.i18n("playerNotFound"));
+ User u = ess.getOfflineUser(args[pos]);
+ if (u == null) throw new NoSuchFieldException(Util.i18n("playerNotFound"));
+ return u;
+ }
+
for (Player p : matches)
{
if (p.getDisplayName().startsWith(args[pos]))
@@ -89,7 +101,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand
{
if (sender instanceof Player)
{
- Charge charge = new Charge(this.getName(), ess);
+ Trade charge = new Trade(this.getName(), ess);
charge.charge(ess.getUser((Player)sender));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/register/payment/Methods.java b/Essentials/src/com/earth2me/essentials/register/payment/Methods.java
index e5ba9a991..71e0adae0 100644
--- a/Essentials/src/com/earth2me/essentials/register/payment/Methods.java
+++ b/Essentials/src/com/earth2me/essentials/register/payment/Methods.java
@@ -68,6 +68,14 @@ public class Methods {
if(method.getDescription().getName().equals(name)) plugin = method; else plugin = manager.getPlugin(name);
if(plugin == null) continue;
+ if(!plugin.isEnabled()) {
+ this.self = true;
+ //Logger.getLogger("Minecraft").log(Level.SEVERE, name + " Plugin was found, but not enabled before Essentials. Read the Essentials thread for help.");
+ //manager.enablePlugin(plugin);
+ }
+
+ if(plugin == null) continue;
+
Method current = this.createMethod(plugin);
if(current == null) continue;
@@ -91,7 +99,9 @@ public class Methods {
break;
}
- if(count != 0) {
+ if(this.preferred.isEmpty()) this.Method = attached;
+
+ if(count == 0) {
if(this.preferred.equalsIgnoreCase(attached.getName()))
this.Method = attached;
} else {
diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE.java
index 444735b65..cce5691b9 100644
--- a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE.java
+++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE.java
@@ -78,7 +78,6 @@ public class BOSE implements Method {
public boolean add(double amount) {
int IntAmount = (int)Math.ceil(amount);
- int balance = (int)this.balance();
return this.BOSEconomy.addPlayerMoney(this.name, IntAmount, false);
}
diff --git a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java
new file mode 100644
index 000000000..c4853c31e
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java
@@ -0,0 +1,475 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.ChargeException;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import java.util.HashSet;
+import java.util.Set;
+import org.bukkit.Material;
+import org.bukkit.block.Block;
+import org.bukkit.block.BlockFace;
+import org.bukkit.block.Sign;
+import org.bukkit.craftbukkit.block.CraftSign;
+import org.bukkit.entity.Player;
+import org.bukkit.event.block.SignChangeEvent;
+import org.bukkit.inventory.ItemStack;
+
+
+public class EssentialsSign
+{
+ private static final Set EMPTY_SET = new HashSet();
+ protected transient final String signName;
+ private static final String FORMAT_SUCCESS = "§1[%s]";
+ private static final String FORMAT_TEMPLATE = "[%s]";
+ private static final String FORMAT_FAIL = "§4[%s]";
+
+ public EssentialsSign(final String signName)
+ {
+ this.signName = signName;
+ }
+
+ public final boolean onSignCreate(final SignChangeEvent event, final IEssentials ess)
+ {
+ final ISign sign = new EventSign(event);
+ sign.setLine(0, String.format(FORMAT_FAIL, this.signName));
+ final User user = ess.getUser(event.getPlayer());
+ if (!(user.isAuthorized("essentials.signs." + signName.toLowerCase() + ".create")
+ || user.isAuthorized("essentials.signs.create." + signName.toLowerCase())))
+ {
+ return false;
+ }
+ try
+ {
+ final boolean ret = onSignCreate(sign, user, getUsername(user), ess);
+ if (ret)
+ {
+ sign.setLine(0, getSuccessName());
+ }
+ return ret;
+ }
+ catch (ChargeException ex)
+ {
+ ess.showError(user, ex, signName);
+ }
+ catch (SignException ex)
+ {
+ ess.showError(user, ex, signName);
+ }
+ return false;
+ }
+
+ public String getSuccessName()
+ {
+ return String.format(FORMAT_SUCCESS, this.signName);
+ }
+
+ public String getTemplateName()
+ {
+ return String.format(FORMAT_TEMPLATE, this.signName);
+ }
+
+ private String getUsername(final User user)
+ {
+ return user.getName().substring(0, user.getName().length() > 14 ? 14 : user.getName().length());
+ }
+
+ public final boolean onSignInteract(final Block block, final Player player, final IEssentials ess)
+ {
+ final ISign sign = new BlockSign(block);
+ final User user = ess.getUser(player);
+ try
+ {
+ return (user.isAuthorized("essentials.signs." + signName.toLowerCase() + ".use")
+ || user.isAuthorized("essentials.signs.use." + signName.toLowerCase()))
+ && onSignInteract(sign, user, getUsername(user), ess);
+ }
+ catch (ChargeException ex)
+ {
+ ess.showError(user, ex, signName);
+ return false;
+ }
+ catch (SignException ex)
+ {
+ ess.showError(user, ex, signName);
+ return false;
+ }
+ }
+
+ public final boolean onSignBreak(final Block block, final Player player, final IEssentials ess)
+ {
+ final ISign sign = new BlockSign(block);
+ final User user = ess.getUser(player);
+ try
+ {
+ return (user.isAuthorized("essentials.signs." + signName.toLowerCase() + ".break")
+ || user.isAuthorized("essentials.signs.break." + signName.toLowerCase()))
+ && onSignBreak(sign, user, getUsername(user), ess);
+ }
+ catch (SignException ex)
+ {
+ ess.showError(user, ex, signName);
+ return false;
+ }
+ }
+
+ protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ return true;
+ }
+
+ protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ return true;
+ }
+
+ protected boolean onSignBreak(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ return true;
+ }
+
+ public final boolean onBlockPlace(final Block block, final Player player, final IEssentials ess)
+ {
+ User user = ess.getUser(player);
+ try
+ {
+ return onBlockPlace(block, user, getUsername(user), ess);
+ }
+ catch (ChargeException ex)
+ {
+ ess.showError(user, ex, signName);
+ }
+ catch (SignException ex)
+ {
+ ess.showError(user, ex, signName);
+ }
+ return false;
+ }
+
+ public final boolean onBlockInteract(final Block block, final Player player, final IEssentials ess)
+ {
+ User user = ess.getUser(player);
+ try
+ {
+ return onBlockInteract(block, user, getUsername(user), ess);
+ }
+ catch (ChargeException ex)
+ {
+ ess.showError(user, ex, signName);
+ }
+ catch (SignException ex)
+ {
+ ess.showError(user, ex, signName);
+ }
+ return false;
+ }
+
+ public final boolean onBlockBreak(final Block block, final Player player, final IEssentials ess)
+ {
+ User user = ess.getUser(player);
+ try
+ {
+ return onBlockBreak(block, user, getUsername(user), ess);
+ }
+ catch (SignException ex)
+ {
+ ess.showError(user, ex, signName);
+ }
+ return false;
+ }
+
+ public boolean onBlockExplode(final Block block, final IEssentials ess)
+ {
+ return true;
+ }
+
+ public boolean onBlockBurn(final Block block, final IEssentials ess)
+ {
+ return true;
+ }
+
+ public static boolean checkIfBlockBreaksSigns(final Block block)
+ {
+ if (block.getFace(BlockFace.UP).getType() == Material.SIGN_POST)
+ {
+ return true;
+ }
+ final BlockFace[] directions = new BlockFace[]
+ {
+ BlockFace.NORTH,
+ BlockFace.EAST,
+ BlockFace.SOUTH,
+ BlockFace.WEST
+ };
+ for (BlockFace blockFace : directions)
+ {
+ final Block signblock = block.getFace(blockFace);
+ if (signblock.getType() == Material.WALL_SIGN)
+ {
+ final org.bukkit.material.Sign sign = (org.bukkit.material.Sign)signblock.getState().getData();
+ if (sign.getFacing() == blockFace)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ protected boolean onBlockPlace(final Block block, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ return true;
+ }
+
+ protected boolean onBlockInteract(final Block block, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ return true;
+ }
+
+ protected boolean onBlockBreak(final Block block, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ return true;
+ }
+
+ public Set getBlocks()
+ {
+ return EMPTY_SET;
+ }
+
+ protected final void validateTrade(final ISign sign, final int index, final IEssentials ess) throws SignException
+ {
+ final String line = sign.getLine(index).trim();
+ if (line.isEmpty())
+ {
+ return;
+ }
+ final Trade trade = getTrade(sign, index, 0, ess);
+ final Double money = trade.getMoney();
+ if (money != null)
+ {
+ sign.setLine(index, Util.formatCurrency(money, ess));
+ }
+ }
+
+ protected final void validateTrade(final ISign sign, final int amountIndex, final int itemIndex,
+ final User player, final IEssentials ess) throws SignException
+ {
+ final Trade trade = getTrade(sign, amountIndex, itemIndex, player, ess);
+ final ItemStack item = trade.getItemStack();
+ sign.setLine(amountIndex, Integer.toString(item.getAmount()));
+ sign.setLine(itemIndex, sign.getLine(itemIndex).trim());
+ }
+
+ protected final Trade getTrade(final ISign sign, final int amountIndex, final int itemIndex,
+ final User player, final IEssentials ess) throws SignException
+ {
+
+ final ItemStack item = getItemStack(sign.getLine(itemIndex), 1, ess);
+ final int amount = Math.min(getIntegerPositive(sign.getLine(amountIndex)), item.getType().getMaxStackSize() * player.getInventory().getSize());
+ if (item.getTypeId() == 0 || amount < 1)
+ {
+ throw new SignException(Util.i18n("moreThanZero"));
+ }
+ item.setAmount(amount);
+ return new Trade(item, ess);
+ }
+
+ protected final void validateInteger(final ISign sign, final int index) throws SignException
+ {
+ final String line = sign.getLine(index).trim();
+ if (line.isEmpty())
+ {
+ throw new SignException("Empty line " + index);
+ }
+ final int quantity = getIntegerPositive(line);
+ sign.setLine(index, Integer.toString(quantity));
+ }
+
+ protected final int getIntegerPositive(final String line) throws SignException
+ {
+ final int quantity = getInteger(line);
+ if (quantity < 1)
+ {
+ throw new SignException(Util.i18n("moreThanZero"));
+ }
+ return quantity;
+ }
+
+ protected final int getInteger(final String line) throws SignException
+ {
+ try
+ {
+ final int quantity = Integer.parseInt(line);
+
+ return quantity;
+ }
+ catch (NumberFormatException ex)
+ {
+ throw new SignException("Invalid sign", ex);
+ }
+ }
+
+ protected final ItemStack getItemStack(final String itemName, final int quantity, final IEssentials ess) throws SignException
+ {
+ try
+ {
+ final ItemStack item = ess.getItemDb().get(itemName);
+ item.setAmount(quantity);
+ return item;
+ }
+ catch (Exception ex)
+ {
+ throw new SignException(ex.getMessage(), ex);
+ }
+ }
+
+ protected final Double getMoney(final String line) throws SignException
+ {
+ final boolean isMoney = line.matches("^[^0-9-\\.][\\.0-9]+$");
+ return isMoney ? getDoublePositive(line.substring(1)) : null;
+ }
+
+ protected final Double getDoublePositive(final String line) throws SignException
+ {
+ final double quantity = getDouble(line);
+ if (Math.round(quantity*100.0) < 1.0)
+ {
+ throw new SignException(Util.i18n("moreThanZero"));
+ }
+ return quantity;
+ }
+
+ protected final Double getDouble(final String line) throws SignException
+ {
+ try
+ {
+ return Double.parseDouble(line);
+ }
+ catch (NumberFormatException ex)
+ {
+ throw new SignException(ex.getMessage(), ex);
+ }
+ }
+
+ protected final Trade getTrade(final ISign sign, final int index, final IEssentials ess) throws SignException
+ {
+ return getTrade(sign, index, 1, ess);
+ }
+
+ protected final Trade getTrade(final ISign sign, final int index, final int decrement, final IEssentials ess) throws SignException
+ {
+ final String line = sign.getLine(index).trim();
+ if (line.isEmpty())
+ {
+ return new Trade(signName.toLowerCase() + "sign", ess);
+ }
+
+ final Double money = getMoney(line);
+ if (money == null)
+ {
+ final String[] split = line.split("[ :]+", 2);
+ if (split.length != 2)
+ {
+ throw new SignException(Util.i18n("invalidCharge"));
+ }
+ final int quantity = getIntegerPositive(split[0]);
+
+ final String item = split[1].toLowerCase();
+ if (item.equalsIgnoreCase("times"))
+ {
+ sign.setLine(index, (quantity - decrement) + " times");
+ return new Trade(signName.toLowerCase() + "sign", ess);
+ }
+ else
+ {
+ final ItemStack stack = getItemStack(item, quantity, ess);
+ sign.setLine(index, quantity + " " + item);
+ return new Trade(stack, ess);
+ }
+ }
+ else
+ {
+ return new Trade(money, ess);
+ }
+ }
+
+
+ static class EventSign implements ISign
+ {
+ private final transient SignChangeEvent event;
+ private final transient Block block;
+
+ public EventSign(final SignChangeEvent event)
+ {
+ this.event = event;
+ this.block = event.getBlock();
+ }
+
+ public final String getLine(final int index)
+ {
+ return event.getLine(index);
+ }
+
+ public final void setLine(final int index, final String text)
+ {
+ event.setLine(index, text);
+ }
+
+ public Block getBlock()
+ {
+ return block;
+ }
+
+ public void updateSign()
+ {
+ return;
+ }
+
+ }
+
+
+ static class BlockSign implements ISign
+ {
+ private final transient Sign sign;
+ private final transient Block block;
+
+ public BlockSign(final Block block)
+ {
+ this.block = block;
+ this.sign = new CraftSign(block);
+ }
+
+ public final String getLine(final int index)
+ {
+ return sign.getLine(index);
+ }
+
+ public final void setLine(final int index, final String text)
+ {
+ sign.setLine(index, text);
+ }
+
+ public final Block getBlock()
+ {
+ return block;
+ }
+
+ public final void updateSign()
+ {
+ sign.update();
+ }
+ }
+
+
+ public interface ISign
+ {
+ String getLine(final int index);
+
+ void setLine(final int index, final String text);
+
+ public Block getBlock();
+
+ void updateSign();
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBalance.java b/Essentials/src/com/earth2me/essentials/signs/SignBalance.java
new file mode 100644
index 000000000..3b961eef6
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignBalance.java
@@ -0,0 +1,21 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+
+
+public class SignBalance extends EssentialsSign
+{
+ public SignBalance()
+ {
+ super("Balance");
+ }
+
+ @Override
+ protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ player.sendMessage(Util.format("balance", player.getMoney()));
+ return true;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java
new file mode 100644
index 000000000..c452e1b63
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java
@@ -0,0 +1,187 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.bukkit.Material;
+import org.bukkit.block.Block;
+import org.bukkit.block.Sign;
+import org.bukkit.craftbukkit.block.CraftSign;
+import org.bukkit.entity.Player;
+import org.bukkit.event.block.BlockBreakEvent;
+import org.bukkit.event.block.BlockBurnEvent;
+import org.bukkit.event.block.BlockIgniteEvent;
+import org.bukkit.event.block.BlockListener;
+import org.bukkit.event.block.BlockPlaceEvent;
+import org.bukkit.event.block.SignChangeEvent;
+
+
+public class SignBlockListener extends BlockListener
+{
+ private final transient IEssentials ess;
+ private final static Logger LOGGER = Logger.getLogger("Minecraft");
+
+ public SignBlockListener(IEssentials ess)
+ {
+ this.ess = ess;
+ }
+
+ @Override
+ public void onBlockBreak(final BlockBreakEvent event)
+ {
+ if (event.isCancelled() || ess.getSettings().areSignsDisabled())
+ {
+ return;
+ }
+
+ if (protectSignsAndBlocks(event.getBlock(), event.getPlayer()))
+ {
+ event.setCancelled(true);
+ }
+ }
+
+ public boolean protectSignsAndBlocks(final Block block, final Player player)
+ {
+ final int mat = block.getTypeId();
+ if (mat == Material.SIGN_POST.getId() || mat == Material.WALL_SIGN.getId())
+ {
+ final Sign csign = new CraftSign(block);
+ for (Signs signs : Signs.values())
+ {
+ final EssentialsSign sign = signs.getSign();
+ if (csign.getLine(0).equalsIgnoreCase(sign.getSuccessName())
+ && !sign.onSignBreak(block, player, ess))
+ {
+ return true;
+ }
+ }
+ }
+ else
+ {
+ // 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 (Signs signs : Signs.values())
+ {
+ final EssentialsSign sign = signs.getSign();
+ if (sign.getBlocks().contains(block.getType())
+ && !sign.onBlockBreak(block, player, ess))
+ {
+ LOGGER.log(Level.INFO, "A block was protected by a sign.");
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void onSignChange(final SignChangeEvent event)
+ {
+ if (event.isCancelled() || ess.getSettings().areSignsDisabled())
+ {
+ return;
+ }
+ for (Signs signs : Signs.values())
+ {
+ final EssentialsSign sign = signs.getSign();
+ if (event.getLine(0).equalsIgnoreCase(sign.getSuccessName()))
+ {
+ event.setCancelled(true);
+ return;
+ }
+ if (event.getLine(0).equalsIgnoreCase(sign.getTemplateName())
+ && !sign.onSignCreate(event, ess))
+ {
+ event.setCancelled(true);
+ return;
+ }
+ }
+ User user = ess.getUser(event.getPlayer());
+ if (user.isAuthorized("essentials.signs.color"))
+ {
+ for (int i = 0; i < 4; i++) {
+ event.setLine(i, event.getLine(i).replaceAll("&([0-9a-f])", "§$1"));
+ }
+ }
+ }
+
+ @Override
+ public void onBlockPlace(final BlockPlaceEvent event)
+ {
+ if (event.isCancelled() || ess.getSettings().areSignsDisabled())
+ {
+ return;
+ }
+
+ final Block against = event.getBlockAgainst();
+ if (against.getType() == Material.WALL_SIGN
+ || against.getType() == Material.SIGN_POST)
+ {
+ event.setCancelled(true);
+ return;
+ }
+ final Block block = event.getBlock();
+ if (block.getType() == Material.WALL_SIGN
+ || block.getType() == Material.SIGN_POST)
+ {
+ return;
+ }
+ for (Signs signs : Signs.values())
+ {
+ final EssentialsSign sign = signs.getSign();
+ if (sign.getBlocks().contains(block.getType())
+ && !sign.onBlockPlace(block, event.getPlayer(), ess))
+ {
+ event.setCancelled(true);
+ return;
+ }
+ }
+ }
+
+ @Override
+ public void onBlockBurn(final BlockBurnEvent event)
+ {
+ if (event.isCancelled() || ess.getSettings().areSignsDisabled())
+ {
+ return;
+ }
+
+ final Block block = event.getBlock();
+ if ((block.getType() == Material.WALL_SIGN
+ || block.getType() == Material.SIGN_POST
+ || EssentialsSign.checkIfBlockBreaksSigns(block)))
+ {
+ event.setCancelled(true);
+ return;
+ }
+ for (Signs signs : Signs.values())
+ {
+ final EssentialsSign sign = signs.getSign();
+ if (sign.getBlocks().contains(block.getType())
+ && !sign.onBlockBurn(block, ess))
+ {
+ event.setCancelled(true);
+ return;
+ }
+ }
+ }
+
+ @Override
+ public void onBlockIgnite(final BlockIgniteEvent event)
+ {
+ if (event.isCancelled() || ess.getSettings().areSignsDisabled())
+ {
+ return;
+ }
+
+ if (protectSignsAndBlocks(event.getBlock(), event.getPlayer()))
+ {
+ event.setCancelled(true);
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBuy.java b/Essentials/src/com/earth2me/essentials/signs/SignBuy.java
new file mode 100644
index 000000000..4249342e1
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignBuy.java
@@ -0,0 +1,35 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.ChargeException;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+
+
+public class SignBuy extends EssentialsSign
+{
+ public SignBuy()
+ {
+ super("Buy");
+ }
+
+ @Override
+ protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ validateTrade(sign, 1, 2, player, ess);
+ validateTrade(sign, 3, ess);
+ return true;
+ }
+
+ @Override
+ protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ final Trade items = getTrade(sign, 1, 2, player, ess);
+ final Trade charge = getTrade(sign, 3, ess);
+ charge.isAffordableFor(player);
+ items.pay(player);
+ charge.charge(player);
+ Trade.log("Sign", "Buy", "Interact", username, charge, username, items, ess);
+ return true;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java
new file mode 100644
index 000000000..e4d050305
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java
@@ -0,0 +1,24 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import net.minecraft.server.InventoryPlayer;
+import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
+
+
+public class SignDisposal extends EssentialsSign
+{
+ public SignDisposal()
+ {
+ super("Disposal");
+ }
+
+ @Override
+ protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess)
+ {
+ final CraftInventoryPlayer inv = new CraftInventoryPlayer(new InventoryPlayer(player.getHandle()));
+ inv.clear();
+ player.showInventory(inv);
+ return true;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java b/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java
new file mode 100644
index 000000000..4528c040d
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java
@@ -0,0 +1,43 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.IEssentials;
+import org.bukkit.Material;
+import org.bukkit.block.Block;
+import org.bukkit.event.entity.EntityExplodeEvent;
+import org.bukkit.event.entity.EntityListener;
+
+
+public class SignEntityListener extends EntityListener
+{
+ private final transient IEssentials ess;
+
+ public SignEntityListener(IEssentials ess)
+ {
+ this.ess = ess;
+ }
+
+
+ @Override
+ public void onEntityExplode(EntityExplodeEvent event)
+ {
+ for (Block block : event.blockList())
+ {
+ if ((block.getType() == Material.WALL_SIGN
+ || block.getType() == Material.SIGN_POST
+ || EssentialsSign.checkIfBlockBreaksSigns(block)))
+ {
+ event.setCancelled(true);
+ return;
+ }
+ for (Signs signs : Signs.values())
+ {
+ final EssentialsSign sign = signs.getSign();
+ if (sign.getBlocks().contains(block.getType()))
+ {
+ event.setCancelled(!sign.onBlockExplode(block, ess));
+ return;
+ }
+ }
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignException.java b/Essentials/src/com/earth2me/essentials/signs/SignException.java
new file mode 100644
index 000000000..9c9ab44a2
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignException.java
@@ -0,0 +1,15 @@
+package com.earth2me.essentials.signs;
+
+
+public class SignException extends Exception
+{
+ public SignException(final String message)
+ {
+ super(message);
+ }
+
+ public SignException(final String message, final Throwable throwable)
+ {
+ super(message, throwable);
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java
new file mode 100644
index 000000000..55ea1d241
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java
@@ -0,0 +1,38 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.InventoryWorkaround;
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.User;
+import net.minecraft.server.InventoryPlayer;
+import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
+import org.bukkit.inventory.ItemStack;
+
+
+public class SignFree extends EssentialsSign
+{
+ public SignFree()
+ {
+ super("Free");
+ }
+
+ @Override
+ protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ getItemStack(sign.getLine(1), 1, ess);
+ return true;
+ }
+
+ @Override
+ protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ final ItemStack item = getItemStack(sign.getLine(1), 1, ess);
+ item.setAmount(item.getType().getMaxStackSize()*9*4);
+ final CraftInventoryPlayer inv = new CraftInventoryPlayer(new InventoryPlayer(player.getHandle()));
+ inv.clear();
+ InventoryWorkaround.addItem(inv, true, item);
+ player.showInventory(inv);
+ Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), ess);
+ return true;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignHeal.java b/Essentials/src/com/earth2me/essentials/signs/SignHeal.java
new file mode 100644
index 000000000..190dfe07c
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignHeal.java
@@ -0,0 +1,34 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.ChargeException;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+
+
+public class SignHeal extends EssentialsSign
+{
+ public SignHeal()
+ {
+ super("Heal");
+ }
+
+ @Override
+ protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ validateTrade(sign, 1, ess);
+ return true;
+ }
+
+ @Override
+ protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ final Trade charge = getTrade(sign, 1, ess);
+ charge.isAffordableFor(player);
+ player.setHealth(20);
+ player.sendMessage(Util.i18n("youAreHealed"));
+ charge.charge(player);
+ return true;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignMail.java b/Essentials/src/com/earth2me/essentials/signs/SignMail.java
new file mode 100644
index 000000000..1c3d162c4
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignMail.java
@@ -0,0 +1,32 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import java.util.List;
+
+
+public class SignMail extends EssentialsSign
+{
+ public SignMail()
+ {
+ super("Mail");
+ }
+
+ @Override
+ protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ final List mail = player.getMails();
+ if (mail.isEmpty())
+ {
+ player.sendMessage(Util.i18n("noNewMail"));
+ return false;
+ }
+ for (String s : mail)
+ {
+ player.sendMessage(s);
+ }
+ player.sendMessage(Util.i18n("markMailAsRead"));
+ return true;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java b/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java
new file mode 100644
index 000000000..1df9e3640
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java
@@ -0,0 +1,65 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.IEssentials;
+import org.bukkit.Material;
+import org.bukkit.block.Block;
+import org.bukkit.block.Sign;
+import org.bukkit.craftbukkit.block.CraftSign;
+import org.bukkit.event.block.Action;
+import org.bukkit.event.player.PlayerInteractEvent;
+import org.bukkit.event.player.PlayerListener;
+
+
+public class SignPlayerListener extends PlayerListener
+{
+ private final transient IEssentials ess;
+
+ public SignPlayerListener(IEssentials ess)
+ {
+ this.ess = ess;
+ }
+
+ @Override
+ public void onPlayerInteract(PlayerInteractEvent event)
+ {
+ if (event.isCancelled() || ess.getSettings().areSignsDisabled())
+ {
+ return;
+ }
+
+ final Block block = event.getClickedBlock();
+ final int mat = block.getTypeId();
+ if (mat == Material.SIGN_POST.getId() || mat == Material.WALL_SIGN.getId())
+ {
+ if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
+ {
+ return;
+ }
+ final Sign csign = new CraftSign(block);
+ for (Signs signs : Signs.values())
+ {
+ final EssentialsSign sign = signs.getSign();
+ if (csign.getLine(0).equalsIgnoreCase(sign.getSuccessName()))
+ {
+ sign.onSignInteract(block, event.getPlayer(), ess);
+ event.setCancelled(true);
+ return;
+ }
+ }
+ }
+ else
+ {
+ for (Signs signs : Signs.values())
+ {
+ final EssentialsSign sign = signs.getSign();
+ if (sign.getBlocks().contains(block.getType())
+ && !sign.onBlockInteract(block, event.getPlayer(), ess))
+ {
+ event.setCancelled(true);
+ return;
+
+ }
+ }
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignProtection.java b/Essentials/src/com/earth2me/essentials/signs/SignProtection.java
new file mode 100644
index 000000000..555bb0114
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignProtection.java
@@ -0,0 +1,314 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.ChargeException;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import org.bukkit.Location;
+import org.bukkit.Material;
+import org.bukkit.block.Block;
+import org.bukkit.block.BlockFace;
+import org.bukkit.block.Sign;
+import org.bukkit.craftbukkit.block.CraftSign;
+import org.bukkit.inventory.ItemStack;
+
+
+public class SignProtection extends EssentialsSign
+{
+ private final transient Set protectedBlocks = EnumSet.noneOf(Material.class);
+
+ public SignProtection()
+ {
+ super("Protection");
+ protectedBlocks.add(Material.CHEST);
+ protectedBlocks.add(Material.BURNING_FURNACE);
+ protectedBlocks.add(Material.FURNACE);
+ protectedBlocks.add(Material.DISPENSER);
+ }
+
+ @Override
+ protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ sign.setLine(3, "§4" + username);
+ if (hasAdjacentBlock(sign.getBlock()) && isBlockProtected(sign.getBlock(), player, username, true) != SignProtectionState.NOT_ALLOWED)
+ {
+ sign.setLine(3, "§1" + username);
+ return true;
+ }
+ player.sendMessage("§4You are not allowed to create sign here.");
+ return false;
+ }
+
+ @Override
+ protected boolean onSignBreak(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ final SignProtectionState state = checkProtectionSign(sign, player, username);
+ return state == SignProtectionState.OWNER;
+ }
+
+ public boolean hasAdjacentBlock(final Block block, final Block... ignoredBlocks)
+ {
+ final Block[] faces = getAdjacentBlocks(block);
+ for (Block b : faces)
+ {
+ for (Block ignoredBlock : ignoredBlocks)
+ {
+ if (b.getLocation().equals(ignoredBlock.getLocation()))
+ {
+ continue;
+ }
+ }
+ if (protectedBlocks.contains(b.getType()))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void checkIfSignsAreBroken(final Block block, final User player, final String username, final IEssentials ess)
+ {
+ final Map signs = getConnectedSigns(block, player, username, false);
+ for (Map.Entry entry : signs.entrySet())
+ {
+ if (entry.getValue() != SignProtectionState.NOSIGN)
+ {
+ final Block sign = entry.getKey().getBlock();
+ if (!hasAdjacentBlock(sign, block))
+ {
+ block.setType(Material.AIR);
+ final Trade trade = new Trade(new ItemStack(Material.SIGN, 1), ess);
+ trade.pay(player);
+ }
+ }
+ }
+ }
+
+ private Map getConnectedSigns(final Block block, final User user, final String username, boolean secure)
+ {
+ final Map signs = new HashMap();
+ getConnectedSigns(block, signs, user, username, secure ? 4 : 2);
+ return signs;
+ }
+
+ private void getConnectedSigns(final Block block, final Map signs, final User user, final String username, final int depth)
+ {
+ final Block[] faces = getAdjacentBlocks(block);
+ for (Block b : faces)
+ {
+ final Location loc = b.getLocation();
+ if (signs.containsKey(loc))
+ {
+ continue;
+ }
+ final SignProtectionState check = checkProtectionSign(b, user, username);
+ signs.put(loc, check);
+
+ if (protectedBlocks.contains(b.getType()) && depth > 0)
+ {
+ getConnectedSigns(b, signs, user, username, depth - 1);
+ }
+ }
+ }
+
+
+ public enum SignProtectionState
+ {
+ NOT_ALLOWED, ALLOWED, NOSIGN, OWNER
+ }
+
+ private SignProtectionState checkProtectionSign(final Block block, final User user, final String username)
+ {
+ if (block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN)
+ {
+ final BlockSign sign = new BlockSign(block);
+ if (sign.getLine(0).equalsIgnoreCase(this.getSuccessName()))
+ {
+ return checkProtectionSign(sign, user, username);
+ }
+ }
+ return SignProtectionState.NOSIGN;
+ }
+
+ private SignProtectionState checkProtectionSign(final ISign sign, final User user, final String username)
+ {
+ if (user == null || username == null)
+ {
+ return SignProtectionState.NOT_ALLOWED;
+ }
+ if (user.isAuthorized("essentials.signs.protection.override"))
+ {
+ return SignProtectionState.OWNER;
+ }
+ for (int i = 1; i <= 2; i++)
+ {
+ final String line = sign.getLine(i);
+ if (line.startsWith("(") && line.endsWith(")") && user.inGroup(line.substring(1, line.length() - 1)))
+ {
+ return SignProtectionState.ALLOWED;
+ }
+ else if (line.equalsIgnoreCase(username))
+ {
+ return SignProtectionState.ALLOWED;
+ }
+ }
+ if (sign.getLine(3).substring(2).equalsIgnoreCase(username))
+ {
+ return SignProtectionState.OWNER;
+ }
+ return SignProtectionState.NOT_ALLOWED;
+ }
+
+ private Block[] getAdjacentBlocks(final Block block)
+ {
+ return new Block[]
+ {
+ block.getFace(BlockFace.NORTH),
+ block.getFace(BlockFace.SOUTH),
+ block.getFace(BlockFace.EAST),
+ block.getFace(BlockFace.WEST),
+ block.getFace(BlockFace.DOWN),
+ block.getFace(BlockFace.UP)
+ };
+ }
+
+ public SignProtectionState isBlockProtected(final Block block, final User user, final String username, boolean secure)
+ {
+ final Map signs = getConnectedSigns(block, user, username, secure);
+ SignProtectionState retstate = SignProtectionState.NOSIGN;
+ for (SignProtectionState state : signs.values())
+ {
+ if (state == SignProtectionState.OWNER || state == SignProtectionState.ALLOWED)
+ {
+ return state;
+ }
+ if (state == SignProtectionState.NOT_ALLOWED)
+ {
+ retstate = state;
+ }
+ }
+ return retstate;
+ }
+
+ public boolean isBlockProtected(final Block block)
+ {
+ final Block[] faces = getAdjacentBlocks(block);
+ for (Block b : faces)
+ {
+ if (b.getType() == Material.SIGN_POST || b.getType() == Material.WALL_SIGN)
+ {
+ final Sign sign = new CraftSign(b);
+ if (sign.getLine(0).equalsIgnoreCase("§1[Protection]"))
+ {
+ return true;
+ }
+ }
+ if (protectedBlocks.contains(b.getType()))
+ {
+ final Block[] faceChest = getAdjacentBlocks(b);
+
+ for (Block a : faceChest)
+ {
+ if (a.getType() == Material.SIGN_POST || a.getType() == Material.WALL_SIGN)
+ {
+ final Sign sign = new CraftSign(a);
+ if (sign.getLine(0).equalsIgnoreCase("§1[Protection]"))
+ {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public Set getBlocks()
+ {
+ return protectedBlocks;
+ }
+
+ @Override
+ protected boolean onBlockPlace(final Block block, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ for (Block adjBlock : getAdjacentBlocks(block))
+ {
+ final SignProtectionState state = isBlockProtected(adjBlock, player, username, true);
+
+ if ((state == SignProtectionState.ALLOWED || state == SignProtectionState.NOT_ALLOWED)
+ && !player.isAuthorized("essentials.signs.protection.override"))
+ {
+ player.sendMessage(Util.format("noPlacePermission", block.getType().toString().toLowerCase()));
+ return false;
+ }
+ }
+ return true;
+
+ }
+
+ @Override
+ protected boolean onBlockInteract(final Block block, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ final SignProtectionState state = isBlockProtected(block, player, username, false);
+
+ if (state == SignProtectionState.OWNER || state == SignProtectionState.NOSIGN || state == SignProtectionState.ALLOWED)
+ {
+ return true;
+ }
+
+ if (state == SignProtectionState.NOT_ALLOWED
+ && player.isAuthorized("essentials.signs.protection.override"))
+ {
+ return true;
+ }
+
+
+ player.sendMessage(Util.format("noAccessPermission", block.getType().toString().toLowerCase()));
+ return false;
+ }
+
+ @Override
+ protected boolean onBlockBreak(final Block block, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ final SignProtectionState state = isBlockProtected(block, player, username, false);
+
+ if (state == SignProtectionState.OWNER || state == SignProtectionState.NOSIGN)
+ {
+ checkIfSignsAreBroken(block, player, username, ess);
+ return true;
+ }
+
+ if ((state == SignProtectionState.ALLOWED || state == SignProtectionState.NOT_ALLOWED)
+ && player.isAuthorized("essentials.signs.protection.override"))
+ {
+ checkIfSignsAreBroken(block, player, username, ess);
+ return true;
+ }
+
+
+ player.sendMessage(Util.format("noDestroyPermission", block.getType().toString().toLowerCase()));
+ return false;
+ }
+
+ @Override
+ public boolean onBlockExplode(final Block block, final IEssentials ess)
+ {
+ final SignProtectionState state = isBlockProtected(block, null, null, false);
+
+ return state == SignProtectionState.NOSIGN;
+ }
+
+ @Override
+ public boolean onBlockBurn(final Block block, final IEssentials ess)
+ {
+ final SignProtectionState state = isBlockProtected(block, null, null, false);
+
+ return state == SignProtectionState.NOSIGN;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignSell.java b/Essentials/src/com/earth2me/essentials/signs/SignSell.java
new file mode 100644
index 000000000..9df1ec874
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignSell.java
@@ -0,0 +1,35 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.ChargeException;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+
+
+public class SignSell extends EssentialsSign
+{
+ public SignSell()
+ {
+ super("Sell");
+ }
+
+ @Override
+ protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ validateTrade(sign, 1, 2, player, ess);
+ validateTrade(sign, 3, ess);
+ return true;
+ }
+
+ @Override
+ protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ final Trade charge = getTrade(sign, 1, 2, player, ess);
+ final Trade money = getTrade(sign, 3, ess);
+ charge.isAffordableFor(player);
+ money.pay(player);
+ charge.charge(player);
+ Trade.log("Sign", "Sell", "Interact", username, charge, username, money, ess);
+ return true;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignTime.java b/Essentials/src/com/earth2me/essentials/signs/SignTime.java
new file mode 100644
index 000000000..120347467
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignTime.java
@@ -0,0 +1,57 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.ChargeException;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+
+
+public class SignTime extends EssentialsSign
+{
+ public SignTime()
+ {
+ super("Time");
+ }
+
+ @Override
+ protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ validateTrade(sign, 2, ess);
+ final String timeString = sign.getLine(1);
+ if ("Day".equalsIgnoreCase(timeString))
+ {
+ sign.setLine(1, "§2Day");
+ return true;
+ }
+ if ("Night".equalsIgnoreCase(timeString))
+ {
+ sign.setLine(1, "§2Night");
+ return true;
+ }
+ throw new SignException(Util.i18n("onlyDayNight"));
+ }
+
+ @Override
+ protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ final Trade charge = getTrade(sign, 2, ess);
+ charge.isAffordableFor(player);
+ final String timeString = sign.getLine(1);
+ long time = player.getWorld().getTime();
+ time -= time % 24000;
+ if ("§2Day".equalsIgnoreCase(timeString))
+ {
+ player.getWorld().setTime(time + 24000);
+ charge.charge(player);
+ return true;
+ }
+ if ("§2Night".equalsIgnoreCase(timeString))
+ {
+ player.getWorld().setTime(time + 37700);
+ charge.charge(player);
+ return true;
+ }
+ throw new SignException(Util.i18n("onlyDayNight"));
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java
new file mode 100644
index 000000000..544c3216e
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java
@@ -0,0 +1,235 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.ChargeException;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import org.bukkit.inventory.ItemStack;
+
+
+public class SignTrade extends EssentialsSign
+{
+ public SignTrade()
+ {
+ super("Trade");
+ }
+
+ @Override
+ protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ validateTrade(sign, 1, false, ess);
+ validateTrade(sign, 2, true, ess);
+ final Trade charge = getTrade(sign, 2, true, true, ess);
+ charge.isAffordableFor(player);
+ sign.setLine(3, "§8" + username);
+ charge.charge(player);
+ Trade.log("Sign", "Trade", "Create", username, charge, username, null, ess);
+ return true;
+ }
+
+ @Override
+ protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ if (sign.getLine(3).substring(2).equalsIgnoreCase(username))
+ {
+ final Trade stored = getTrade(sign, 1, true, true, ess);
+ substractAmount(sign, 1, stored, ess);
+ stored.pay(player);
+ Trade.log("Sign", "Trade", "OwnerInteract", username, null, username, stored, ess);
+ }
+ else
+ {
+ final Trade charge = getTrade(sign, 1, false, false, ess);
+ final Trade trade = getTrade(sign, 2, false, true, ess);
+ charge.isAffordableFor(player);
+ substractAmount(sign, 2, trade, ess);
+ trade.pay(player);
+ addAmount(sign, 1, charge, ess);
+ charge.charge(player);
+ Trade.log("Sign", "Trade", "Interact", sign.getLine(3), charge, username, trade, ess);
+ }
+ sign.updateSign();
+ return true;
+ }
+
+ @Override
+ protected boolean onSignBreak(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ if ((sign.getLine(3).length() > 3 && sign.getLine(3).substring(2).equalsIgnoreCase(username))
+ || player.isAuthorized("essentials.signs.trade.override"))
+ {
+ final Trade stored1 = getTrade(sign, 1, true, false, ess);
+ final Trade stored2 = getTrade(sign, 2, true, false, ess);
+ stored1.pay(player);
+ stored2.pay(player);
+ Trade.log("Sign", "Trade", "Break", username, stored2, username, stored1, ess);
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ protected final void validateTrade(final ISign sign, final int index, final boolean amountNeeded, final IEssentials ess) throws SignException
+ {
+ final String line = sign.getLine(index).trim();
+ if (line.isEmpty())
+ {
+ throw new SignException("Empty line");
+ }
+ final String[] split = line.split("[ :]+");
+
+ if (split.length == 1 && !amountNeeded)
+ {
+ final Double money = getMoney(split[0]);
+ if (money != null)
+ {
+ if (Util.formatCurrency(money, ess).length() * 2 > 15)
+ {
+ throw new SignException("Line can be too long!");
+ }
+ sign.setLine(index, Util.formatCurrency(money, ess) + ":0");
+ return;
+ }
+ }
+
+ if (split.length == 2 && amountNeeded)
+ {
+ final Double money = getMoney(split[0]);
+ final Double amount = getDoublePositive(split[1]);
+ if (money != null && amount != null)
+ {
+ sign.setLine(index, Util.formatCurrency(money, ess) + ":" + Util.formatCurrency(amount, ess).substring(1));
+ return;
+ }
+ }
+
+ if (split.length == 2 && !amountNeeded)
+ {
+ final int amount = getIntegerPositive(split[0]);
+ final ItemStack item = getItemStack(split[1], amount, ess);
+ if (amount < 1 || item.getTypeId() == 0)
+ {
+ throw new SignException(Util.i18n("moreThanZero"));
+ }
+ String newline = amount + " " + split[1] + ":0";
+ if ((newline + amount).length() > 16)
+ {
+ throw new SignException("Line can be too long!");
+ }
+ sign.setLine(index, newline);
+ return;
+ }
+
+ if (split.length == 3 && amountNeeded)
+ {
+ final int stackamount = getIntegerPositive(split[0]);
+ final ItemStack item = getItemStack(split[1], stackamount, ess);
+ int amount = getIntegerPositive(split[2]);
+ amount -= amount % stackamount;
+ if (amount < 1 || stackamount < 1 || item.getTypeId() == 0)
+ {
+ throw new SignException(Util.i18n("moreThanZero"));
+ }
+ sign.setLine(index, stackamount + " " + split[1] + ":" + amount);
+ return;
+ }
+ throw new SignException(Util.format("invalidSignLine", index+1));
+ }
+
+ protected final Trade getTrade(final ISign sign, final int index, final boolean fullAmount, final boolean notEmpty, final IEssentials ess) throws SignException
+ {
+ final String line = sign.getLine(index).trim();
+ if (line.isEmpty())
+ {
+ throw new SignException("Empty line");
+ }
+ final String[] split = line.split("[ :]+");
+
+ if (split.length == 2)
+ {
+ final Double money = getMoney(split[0]);
+ final Double amount = notEmpty ? getDoublePositive(split[1]) : getDouble(split[1]);
+ if (money != null && amount != null)
+ {
+ return new Trade(fullAmount ? amount : money, ess);
+ }
+ }
+
+ if (split.length == 3)
+ {
+ final int stackamount = getIntegerPositive(split[0]);
+ final ItemStack item = getItemStack(split[1], stackamount, ess);
+ int amount = getInteger(split[2]);
+ amount -= amount % stackamount;
+ if (notEmpty && (amount < 1 || stackamount < 1 || item.getTypeId() == 0))
+ {
+ throw new SignException(Util.i18n("moreThanZero"));
+ }
+ item.setAmount(fullAmount ? amount : stackamount);
+ return new Trade(item, ess);
+ }
+ throw new SignException(Util.format("invalidSignLine", index+1));
+ }
+
+ protected final void substractAmount(final ISign sign, final int index, final Trade trade, final IEssentials ess) throws SignException
+ {
+ final Double money = trade.getMoney();
+ if (money != null)
+ {
+ changeAmount(sign, index, -money, ess);
+ }
+ final ItemStack item = trade.getItemStack();
+ if (item != null)
+ {
+ changeAmount(sign, index, -item.getAmount(), ess);
+ }
+ }
+
+ protected final void addAmount(final ISign sign, final int index, final Trade trade, final IEssentials ess) throws SignException
+ {
+ final Double money = trade.getMoney();
+ if (money != null)
+ {
+ changeAmount(sign, index, money, ess);
+ }
+ final ItemStack item = trade.getItemStack();
+ if (item != null)
+ {
+ changeAmount(sign, index, item.getAmount(), ess);
+ }
+ }
+
+ private void changeAmount(final ISign sign, final int index, final double value, final IEssentials ess) throws SignException
+ {
+ final String line = sign.getLine(index).trim();
+ if (line.isEmpty())
+ {
+ throw new SignException("Empty line");
+ }
+ final String[] split = line.split("[ :]+");
+
+ if (split.length == 2)
+ {
+ final Double money = getMoney(split[0]);
+ final Double amount = getDouble(split[1]);
+ if (money != null && amount != null)
+ {
+ sign.setLine(index, Util.formatCurrency(money, ess) + ":" + Util.formatCurrency(amount + value, ess).substring(1));
+ return;
+ }
+ }
+
+ if (split.length == 3)
+ {
+ final int stackamount = getIntegerPositive(split[0]);
+ final ItemStack item = getItemStack(split[1], stackamount, ess);
+ final int amount = getInteger(split[2]);
+ sign.setLine(index, stackamount + " " + split[1] + ":" + (amount + Math.round(value)));
+ return;
+ }
+ throw new SignException(Util.format("invalidSignLine", index+1));
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignWarp.java b/Essentials/src/com/earth2me/essentials/signs/SignWarp.java
new file mode 100644
index 000000000..244450d8a
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignWarp.java
@@ -0,0 +1,69 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.ChargeException;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+
+
+public class SignWarp extends EssentialsSign
+{
+ public SignWarp()
+ {
+ super("Warp");
+ }
+
+ @Override
+ protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ validateTrade(sign, 3, ess);
+ final String warpName = sign.getLine(1);
+
+ if (warpName.isEmpty())
+ {
+ sign.setLine(1, "§dWarp name!");
+ return false;
+ }
+ else
+ {
+ try
+ {
+ ess.getWarps().getWarp(warpName);
+ }
+ catch (Exception ex)
+ {
+ throw new SignException(ex.getMessage(), ex);
+ }
+ final String group = sign.getLine(2);
+ if ("Everyone".equalsIgnoreCase(group))
+ {
+ sign.setLine(2, "§2Everyone");
+ }
+ return true;
+ }
+ }
+
+ @Override
+ protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ final String warpName = sign.getLine(1);
+ final String group = sign.getLine(2);
+ if ((!group.isEmpty()
+ && ("§2Everyone".equals(group)
+ || player.inGroup(group)))
+ || (group.isEmpty() && (!ess.getSettings().getPerWarpPermission() || player.isAuthorized("essentials.warp." + warpName))))
+ {
+ final Trade charge = getTrade(sign, 3, ess);
+ try
+ {
+ player.getTeleport().warp(warpName, charge);
+ }
+ catch (Exception ex)
+ {
+ throw new SignException(ex.getMessage(), ex);
+ }
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignWeather.java b/Essentials/src/com/earth2me/essentials/signs/SignWeather.java
new file mode 100644
index 000000000..05496ac14
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/SignWeather.java
@@ -0,0 +1,56 @@
+package com.earth2me.essentials.signs;
+
+import com.earth2me.essentials.ChargeException;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.Trade;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+
+
+public class SignWeather extends EssentialsSign
+{
+ public SignWeather()
+ {
+ super("Weather");
+ }
+
+ @Override
+ protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
+ {
+ validateTrade(sign, 2, ess);
+ final String timeString = sign.getLine(1);
+ if ("Sun".equalsIgnoreCase(timeString))
+ {
+ sign.setLine(1, "§2Sun");
+ return true;
+ }
+ if ("Storm".equalsIgnoreCase(timeString))
+ {
+ sign.setLine(1, "§2Storm");
+ return true;
+ }
+ throw new SignException(Util.i18n("onlySunStorm"));
+ }
+
+ @Override
+ protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException, ChargeException
+ {
+ final Trade charge = getTrade(sign, 2, ess);
+ charge.isAffordableFor(player);
+ final String weatherString = sign.getLine(1);
+ if ("§2Sun".equalsIgnoreCase(weatherString))
+ {
+ player.getWorld().setStorm(false);
+ charge.charge(player);
+ return true;
+ }
+ if ("§2Storm".equalsIgnoreCase(weatherString))
+ {
+ player.getWorld().setStorm(true);
+ charge.charge(player);
+ return true;
+ }
+ throw new SignException(Util.i18n("onlySunStorm"));
+ }
+}
+
diff --git a/Essentials/src/com/earth2me/essentials/signs/Signs.java b/Essentials/src/com/earth2me/essentials/signs/Signs.java
new file mode 100644
index 000000000..18913ff10
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/signs/Signs.java
@@ -0,0 +1,29 @@
+package com.earth2me.essentials.signs;
+
+
+public enum Signs
+{
+ BALANCE(new SignBalance()),
+ BUY(new SignBuy()),
+ DISPOSAL(new SignDisposal()),
+ FREE(new SignFree()),
+ HEAL(new SignHeal()),
+ MAIL(new SignMail()),
+ PROTECTION(new SignProtection()),
+ SELL(new SignSell()),
+ TIME(new SignTime()),
+ TRADE(new SignTrade()),
+ WARP(new SignWarp()),
+ WEATHER(new SignWeather());
+ private final EssentialsSign sign;
+
+ private Signs(final EssentialsSign sign)
+ {
+ this.sign = sign;
+ }
+
+ public EssentialsSign getSign()
+ {
+ return sign;
+ }
+}
diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml
index 8fffa244b..d50144956 100644
--- a/Essentials/src/config.yml
+++ b/Essentials/src/config.yml
@@ -34,6 +34,9 @@ ops-name-color: 'c'
# The character(s) to prefix all nicknames, so that you know they are not true usernames.
nickname-prefix: '~'
+# Disable this if you have any other plugin, that modifies the displayname of a user.
+change-displayname: true
+
# The delay, in seconds, required between /home, /tp, etc.
teleport-cooldown: 0
@@ -51,6 +54,7 @@ default-stack-size: 64
item-spawn-blacklist:
# Set this to true if you want permission based item spawn rules
+# Note: The blacklist above will be ignored then.
# Permissions:
# - essentials.itemspawn.item-all
# - essentials.itemspawn.item-[itemname]
@@ -88,8 +92,6 @@ motd:
- '&cWelcome, {PLAYER}&c!'
- '&fType &c/help&f for a list of commands.'
- 'Currently online: {PLAYERLIST}'
- - 'Did you know that you can make [Disposal] signs with Essentials?'
- - 'You have {MAILS} mail messages'
# The server rules, available by typing /rules
rules:
@@ -112,50 +114,42 @@ overridden-commands:
disabled-commands:
# - nick
-# Restricted commands will only be available to ops.
+# Restricted commands have been removed.
+# Now we have a whitelist, all commands not on this list are only available to ops.
# These will have NO EFFECT if you have Permissions installed!
# These are here only if you want something simpler than Permissions.
-restricted-commands:
- - bigtree
- - item
- - give
- - heal
- - plugin
- - time
- - top
- - tp
- - tphere
- - tree
- - setspawn
- - antioch
- - kick
- - ban
- - unban
- - top
- - jump
- - tpo
- - tppos
- - tpohere
- - economy
- - setwarp
- - delwarp
- - essentials
- - gc
- - spawnmob
- - broadcast
- - burn
- - ext
- - kill
- - ping
- - banip
- - unban
- - mute
- - kick
- - kickall
- - unbanip
- - togglejail
- - setjail
- - eco.loan
+player-commands:
+ - afk
+ - back
+ - back.ondeath
+ - balance
+ - clearinventory
+ - compass
+ - help
+ - helpop
+ - home
+ - home.others
+ - ignore
+ - info
+ - list
+ - mail
+ - motd
+ - msg
+ - nick
+ - pay
+ - powertool
+ - r
+ - rules
+ - seen
+ - sell
+ - sethome
+ - suicide
+ - tpa
+ - tpaccept
+ - tpahere
+ - tpdeny
+ - world
+ - worth
# Note: All items MUST be followed by a quantity!
# Times are measured in seconds.
@@ -190,6 +184,8 @@ debug: false
# If you don't set this, the default locale of the server will be used.
#locale: de_DE
+#turn off god mode when people exit
+remove-god-on-disconnect: false
############################################################
# +------------------------------------------------------+ #
# | EssentialsHome | #
@@ -229,6 +225,13 @@ command-costs:
# Set this to a currency symbol you want to use.
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
+max-money: 10000000000000
+
+# Enable this to log all interactions with trade/buy/sell signs and sell command
+economy-log-enabled: false
+
############################################################
# +------------------------------------------------------+ #
# | EssentialsHelp | #
@@ -238,6 +241,9 @@ currency-symbol: '$'
#Show other plugins commands in help
non-ess-in-help: true
+#Hide plugins which dont give a permission
+hide-permissionless-help: true
+
############################################################
# +------------------------------------------------------+ #
# | EssentialsChat | #
@@ -318,6 +324,7 @@ protect:
lightning-fire-spread: true
portal-creation: false
tnt-explosion: false
+ fireball-explosion: false
creeper-explosion: false
creeper-playerdamage: false
creeper-blockdamage: false
@@ -362,6 +369,9 @@ protect:
# Prevent placing blocks above protected rails, this is to stop a potential griefing
prevent-block-on-rails: false
+
+ #Store blocks / signs in memory before writing
+ memstore: false
# Disable various default physics and behaviors
disable:
diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv
index 2a30bd806..d06da42fd 100644
--- a/Essentials/src/items.csv
+++ b/Essentials/src/items.csv
@@ -1,3 +1,4 @@
+#Last updated on 7/9/2011 21:37 (gmt +3) for minecraft version 1.7.3
#item,id,metadata
stone,1,0
sstone,1,0
@@ -447,32 +448,78 @@ detecttrack,28,0
detectrail,28,0
dtrack,28,0
drail,28,0
-pistonstickybase,29,0
+stickypistonbase,29,0
stickypiston,29,0
+stickpistonbase,29,0
+stickpiston,29,0
stickyp,29,0
-psticky,29,0
+spistonbase,29,0
spiston,29,0
+pistonstickybase,29,0
+pistonsticky,29,0
+pistonstickbase,29,0
+pistonstick,29,0
+pistonsbase,29,0
pistons,29,0
+psticky,29,0
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
grassl,31,0
grasst,31,0
+grassw,31,0
deadshrub,32,0
shrubdead,32,0
dshrub,32,0
shrubd,32,0
+normalpistonbase,33,0
+normalpiston,33,0
+normpistonbase,33,0
+normpiston,33,0
+npistonbase,33,0
+npiston,33,0
+pistonnormalbase,33,0
+pistonnormal,33,0
+pistonnormbase,33,0
+pistonnorm,33,0
+pistonnbase,33,0
+pistonn,33,0
pistonbase,33,0
piston,33,0
pistonblock,33,0
+pistonextensionnormal,34,0
+pistonextensionnorm,34,0
+pistonextensionn,34,0
pistonextension,34,0
+pistonextnormal,34,0
+pistonextnorm,34,0
+pistonextn,34,0
pistonext,34,0
+pistonenormal,34,0
+pistonenorm,34,0
+pistonen,34,0
+pistone,34,0
+extensionpistonnormal,34,0
+extensionpistonnorm,34,0
+extensionpistonn,34,0
+extensionpiston,34,0
+extpistonnormal,34,0
+extpistonnorm,34,0
+extpistonn,34,0
+extpiston,34,0
+epistonnormal,34,0
+epistonnorm,34,0
+epistonn,34,0
+episton,34,0
whitecloth,35,0
whitewool,35,0
whitecotton,35,0
@@ -807,6 +854,8 @@ blockdynamite,46,0
tnt,46,0
bomb,46,0
dynamite,46,0
+bookcase,47,0
+casebook,47,0
bookshelf,47,0
shelfbook,47,0
bookblock,47,0
diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties
index 261c2237e..cd7607c24 100644
--- a/Essentials/src/messages.properties
+++ b/Essentials/src/messages.properties
@@ -1,308 +1,322 @@
#version: TeamCity
# Single quotes have to be doubled: ''
# Translations start here
-loadinfo = Loaded {0} build {1} by {2}
-markedAsNotAway = \u00a77You are no longer marked as away.
-markedAsAway = \u00a77You are now marked as away.
-userIsNotAway = {0} is no longer AFK
-userIsAway = {0} is now AFK
-backupStarted = Backup started
+addedToAccount = \u00a7a{0} has been added to your account.
+addedToOthersAccount = \u00a7a{0} has been added to {1} account.
+alertBroke = broke:
+alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3}
+alertPlaced = placed:
+alertUsed = used:
+backAfterDeath = \u00a77Use the /back command to return to your death point.
+backUsageMsg = \u00a77Returning to previous location.
backupFinished = Backup finished
-invalidServer = Invalid server!
-usingTempFolderForTesting = Using temp folder for testing:
-versionMismatch = Version mismatch! Please update {0} to the same version.
-notRecommendedBukkit = Bukkit version is not the recommended build for Essentials.
-bukkitFormatChanged = Bukkit version format changed. Version not checked.
-itemsCsvNotLoaded = Could not load items.csv.
-corruptNodeInConfig = \u00a74Notice: Your configuration file has a corrupt {0} node.
-youHaveNewMail = \u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
-commandNotLoaded = \u00a7cCommand {0} is improperly loaded.
-deniedAccessCommand = {0} was denied access to command.
-noAccessCommand = \u00a7cYou do not have access to that command.
-errorCallingCommand = Error calling command /{0}
-commandFailed = Command {0} failed:
-bannedPlayersFileNotFound = banned-players.txt not found
-bannedPlayersFileError = Error reading banned-players.txt
-bannedIpsFileNotFound = banned-ips.txt not found
+backupStarted = Backup started
+balance = \u00a77Balance: {0}
+balanceTop = \u00a77Top {0} balances
+banExempt = \u00a7cYou can not ban that player.
+banIpAddress = \u00a77Banned IP address
bannedIpsFileError = Error reading banned-ips.txt
-noDestroyPermission = \u00a7cYou do not have permission to destroy that {0}.
-noAccessPermission = \u00a7cYou do not have permission to access that {0}.
-moreThanZero = Quantities must be greater than 0.
-errorWithMessage = \u00a7cError: {0}
+bannedIpsFileNotFound = banned-ips.txt not found
+bannedPlayersFileError = Error reading banned-players.txt
+bannedPlayersFileNotFound = banned-players.txt not found
+bigTreeFailure = \u00a7cBig tree generation failure. Try again on grass or dirt.
+bigTreeSuccess = \u00a77Big tree spawned.
+broadcast = [\u00a7cBroadcast\u00a7f]\u00a7a {0}
+buildAlert = \u00a7cYou are not permitted to build
+bukkitFormatChanged = Bukkit version format changed. Version not checked.
+burnMsg = \u00a77You set {0} on fire for {1} seconds.
+canTalkAgain = \u00a77You can talk again
+cantFindGeoIpDB = Can''t find GeoIP database!
+cantReadGeoIpDB = Failed to read GeoIP database!
+cantSpawnItem = \u00a7cYou are not allowed to spawn the item {0}
+commandFailed = Command {0} failed:
+commandNotLoaded = \u00a7cCommand {0} is improperly loaded.
+compassBearing = \u00a77Bearing: {0} ({1} degrees).
+configFileMoveError = Failed to move config.yml to backup location.
+configFileRenameError = Failed to rename temp file to config.yml
+connectedPlayers = Connected players:
+connectionFailed = Failed to open connection.
+cooldownWithMessage = \u00a7cCooldown: {0}
+corruptNodeInConfig = \u00a74Notice: Your configuration file has a corrupt {0} node.
+couldNotFindTemplate = Could not find template {0}
creatingConfigFromTemplate = Creating config from template: {0}
creatingEmptyConfig = Creating empty config: {0}
-failedToCreateConfig = Failed to create config {0}
-couldNotFindTemplate = Could not find template {0}
-failedToWriteConfig = Failed to write config {0}
-failedToCloseConfig = Failed to close config {0}
-notEnoughMoney = You do not have sufficient funds.
-missingItems = You do not have {0}x {1}.
-tradeSignEmpty = The trade sign does not have enough supply left.
-tradeCompleted = \u00a77Trade completed.
-backAfterDeath = \u00a77Use the /back command to return to your death point.
-mutedUserSpeaks = {0} tried to speak, but is muted.
-userCreatedPortal = {0} used a portal and generated an exit portal.
-generatingPortal = \u00a77Generating an exit portal.
-userUsedPortal = {0} used an existing exit portal.
-usingPortal = \u00a77Teleporting via portal to an existing portal.
-teleportingPortal = \u00a77Teleporting via portal.
-freedMemory = Freed {0} MB.
+creatingPortal = Creating portal at {0},{1},{2}.
+day = day
+days = days
defaultBanReason = The Ban Hammer has spoken!
-noNewMail = \u00a77You have no new mail.
-serverFull = Server is full
-returnPlayerToJailError = Error occured when trying to return player to jail.
-jailMessage = \u00a7cYou do the crime, you do the time.
-homeSetToBed = \u00a77Your home is now set to this bed.
-moneyTaken = {0} taken from your bank account.
-youAreHealed = \u00a77You have been healed.
-markMailAsRead = \u00a7cTo mark your mail as read, type /mail clear
-balance = \u00a77Balance: {0}
-backUsageMsg = \u00a77Returning to previous location.
-playerBanned = \u00a7cPlayer {0} banned
-banIpAddress = \u00a77Banned IP address
-bigTreeSuccess = \u00a77Big tree spawned.
-bigTreeFailure = \u00a7cBig tree generation failure. Try again on grass or dirt.
-broadcast = [\u00a7cBroadcast\u00a7f]\u00a7a {0}
-burnMsg = \u00a77You set {0} on fire for {1} seconds.
-playerNotFound = \u00a7cPlayer not found.
-inventoryCleared = \u00a77Inventory Cleared.
-inventoryClearedOthers = \u00a77Inventory of \u00a7c{0}\u00a77 cleared.
-compassBearing = \u00a77Bearing: {0} ({1} degrees).
+deleteFileError = Could not delete file: {0}
deleteJail = \u00a77Jail {0} has been removed.
deleteWarp = \u00a77Warp {0} has been removed.
+deniedAccessCommand = {0} was denied access to command.
+dependancyDownloaded = [Essentials] Dependancy {0} downloaded successfully.
+dependancyException = [Essentials] An error occured when trying to download a dependacy
+dependancyNotFound = [Essentials] A required dependancy was not found, downloading now.
depth = \u00a77You are at sea level.
depthAboveSea = \u00a77You are {0} block(s) above sea level.
depthBelowSea = \u00a77You are {0} block(s) below sea level.
+destinationNotSet = Destination not set
+disableUnlimited = \u00a77Disabled unlimited placing of {0} for {1}.
+disabled = disabled
+dontMoveMessage = \u00a77Teleportation will commence in {0}. Don''t move.
+downloadingGeoIp = Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB)
+duplicatedUserdata = Duplicated userdata: {0} and {1}
+emptyWorldName = Set Home: World name is null or empty.
+enableUnlimited = \u00a77Giving unlimited amount of {0} to {1}.
+enabled = enabled
+errorCallingCommand = Error calling command /{0}
+errorWithMessage = \u00a7cError: {0}
+essentialsReload = \u00a77Essentials Reloaded {0}
extinguish = \u00a77You extinguished yourself.
extinguishOthers = \u00a77You extinguished {0}.
-canTalkAgain = \u00a77You can talk again
-haveBeenReleased = \u00a77You have been released
-upgradingFilesError = Error while upgrading the files
-configFileMoveError = Failed to move config.yml to backup location.
-configFileRenameError = Failed to rename temp file to config.yml
+failedToCloseConfig = Failed to close config {0}
+failedToCreateConfig = Failed to create config {0}
+failedToWriteConfig = Failed to write config {0}
fileRenameError = Renaming file {0} failed
-userdataMoveError = Failed to move userdata/{0} to userdata/{1}.tmp
-duplicatedUserdata = Duplicated userdata: {0} and {1}
-userdataMoveBackError = Failed to move userdata/{0}.tmp to userdata/{1}
-parseError = Error parsing {0} on line {1}
-unknownItemName = Unknown item name: {0}
-unknownItemId = Unknown item id: {0}
-jailNotExist = That jail does not exist.
-unableToSpawnMob = Unable to spawn mob.
-creatingPortal = Creating portal at {0},{1},{2}.
-notSupportedYet = Not supported yet.
-unknownItemInList = Unknown item {0} in {1} list.
-teleportationCommencing = \u00a77Teleportation commencing...
-cooldownWithMessage = \u00a7cCooldown: {0}
-warpingTo = \u00a77Warping to {0}.
-timeBeforeTeleport = Time before next teleport: {0}
-pendingTeleportCancelled = \u00a7cPending teleportation request cancelled.
-dontMoveMessage = \u00a77Teleportation will commence in {0}. Don''t move.
-noHomeSet = You have not set a home.
-noHomeSetPlayer = Player has not set a home.
-timeBeforeHeal = Time before next heal: {0}
-addedToAccount = \u00a7a{0} has been added to your account.
-moneySentTo = \u00a7a{0} has been sent to {1}
-moneyRecievedFrom = \u00a7a{0} has been recieved from {1}
-takenFromAccount = \u00a7c{0} has been taken from your account.
-emptyWorldName = Set Home: World name is null or empty.
-now = now
-year = year
-years = years
-month = month
-months = months
-day = day
-days = days
-hour = hour
-hours = hours
-minute = minute
-minutes = minutes
-second = second
-seconds = seconds
-destinationNotSet = Destination not set
-holeInFloor = Hole in floor
-warpNotExist = That warp does not exist.
-similarWarpExist = A warp with a similar name already exists.
-warpDeleteError = Problem deleting the warp file.
-versionMismatchAll = Version mismatch! Please update all Essentials jars to the same version.
-missingPrefixSuffix = Missing a prefix or suffix for {0}
-permissionsError = Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled.
-shoutFormat = \u00a77[Shout]\u00a7f {0}
-notAllowedToShout = \u00a7cYou are not authorized to shout.
-questionFormat = \u00a77[Question]\u00a7f {0}
-notAllowedToQuestion = \u00a7cYou are not authorized to use question.
-localFormat = Local: <{0}> {1}
-geoipJoinFormat = Player {0} comes from {1}
-cantFindGeoIpDB = Can''t find GeoIP database!
-cantReadGeoIpDB = Failed to read GeoIP database!
-geoIpUrlEmpty = GeoIP download url is empty.
-downloadingGeoIp = Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB)
-geoIpUrlInvalid = GeoIP download url is invalid.
-connectionFailed = Failed to open connection.
-alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3}
-alertPlaced = placed:
-alertBroke = broke:
-alertUsed = used:
-buildAlert = \u00a7cYou are not permitted to build
-protectionOwner = \u00a76[EssentialsProtect] Protection owner: {0}
-spawnSet = \u00a77Spawn location set for group {0}.
-teleportNewPlayerError = Failed to teleport new player
-essentialsReload = \u00a77Essentials Reloaded {0}
-gcmax = Maximum memory: {0} MB
-gcmin = Minimum memory: {0} MB
+foreverAlone = \u00a7cYou have nobody to whom you can reply.
+freedMemory = Freed {0} MB.
gcchunks = chunks,
gcentities = entities
-godMode = \u00a77God mode {0}.
-enabled = enabled
-disabled = disabled
-godEnabledFor = enabled for {0}
+gcfree = Free memory: {0} MB
+gcmax = Maximum memory: {0} MB
+gctotal = Allocated memory: {0} MB
+generatingPortal = \u00a77Generating an exit portal.
+geoIpUrlEmpty = GeoIP download url is empty.
+geoIpUrlInvalid = GeoIP download url is invalid.
+geoipJoinFormat = Player {0} comes from {1}
godDisabledFor = disabled for {0}
+godEnabledFor = enabled for {0}
+godMode = \u00a77God mode {0}.
+haveBeenReleased = \u00a77You have been released
heal = \u00a77You have been healed.
healOther = \u00a77Healed {0}.
-helpPages = Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f:
helpConsole = To view help from the console, type ?.
helpOp = \u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1}
+helpPages = Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f:
+holeInFloor = Hole in floor
+homeSet = \u00a77Home set.
+homeSetToBed = \u00a77Your home is now set to this bed.
+hour = hour
+hours = hours
+ignorePlayer = You ignore player {0} from now on.
+illegalDate = Illegal date format.
+infoChapter = Select chapter:
+infoChapterPages = Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f:
infoFileDoesNotExist = File info.txt does not exist. Creating one for you.
infoPages = Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f:
-infoChapter = Select chapter:
infoUnknownChapter = Unknown chapter.
-infoChapterPages = Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f:
invBigger = The other users inventory is bigger than yours.
invRestored = Your inventory has been restored.
invSee = You see the inventory of {0}.
invSeeHelp = Use /invsee to restore your inventory.
-cantSpawnItem = \u00a7cYou are not allowed to spawn the item {0}
-itemSpawn = \u00a77Giving {0} of {1}
-jumpError = That would hurt your computer''s brain.
-kickDefault = Kicked from server
-kill = \u00a77Killed {0}.
-noKits = \u00a77There are no kits available yet
-kitError = \u00a7cThere are no valid kits.
-kitError2 = \u00a7cThat kit does not exist or is improperly defined.
-kitErrorHelp = \u00a7cPerhaps an item is missing a quantity in the configuration?
-noKitPermission = \u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit.
-kitTimed = \u00a7cYou can''t use that kit again for another {0}.
-kitInvFull = \u00a7cYour inventory was full, placing kit on the floor
-kitGive = \u00a77Giving kit {0}.
-lightningUse = \u00a77Smiting {0}
-lightningSmited = \u00a77You have just been smited
-connectedPlayers = Connected players:
-noMail = You do not have any mail
-mailClear = \u00a7cTo mark your mail as read, type /mail clear
-noMailSendPerm = \u00a7cYou do not have the \u00a7fessentials.mail.send\u00a7c permission.
-playerNeverOnServer = \u00a7cPlayer {0} was never on this server.
-mailSent = \u00a77Mail sent!
-mailCleared = \u00a77Mail Cleared!
-voiceSilenced = \u00a77Your voice has been silenced
-noMotd = \u00a7cThere is no message of the day."
-me = me
-mutedPlayerFor = Player {0} muted for {1}.
-mutedPlayer = Player {0} muted.
-unmutedPlayer = Player {0} unmuted.
-nickOthersPermission = \u00a7cYou do not have permission to change the nickname of others
-nickNoMore = \u00a7You no longer have a nickname.
-nickNamesAlpha = \u00a7cNicknames must be alphanumeric.
-nickInUse = \u00a7cThat name is already in use.
-nickSet = \u00a77Your nickname is now \u00a7c{0}
-nickChanged = Nickname changed.
-pong = Pong!
-powerToolAir = Command can''t be attached to air.
-powerToolAttach = Command assigned to {0}
-powerToolRemove = Command removed from {0}
-foreverAlone = \u00a7cYou have nobody to whom you can reply.
+invalidCharge = \u00a7cInvalid charge.
+invalidMob = Invalid mob type.
+invalidServer = Invalid server!
+invalidSignLine = Line {0} on sign is invalid.
+invalidWorld = \u00a7cInvalid world.
+inventoryCleared = \u00a77Inventory Cleared.
+inventoryClearedOthers = \u00a77Inventory of \u00a7c{0}\u00a77 cleared.
is = is
-reloadAllPlugins = \u00a77Reloaded all plugins.
-noRules = \u00a7cThere are no rules specified yet.
-seenOnline = Player {0} is online since {1}
-seenOffline = Player {0} is offline since {1}
itemCannotBeSold = That item cannot be sold to the server.
itemMustBeStacked = Item must be traded in stacks. A quantity of 2s would be two stacks, etc.
itemNotEnough1 = \u00a7cYou do not have enough of that item to sell.
itemNotEnough2 = \u00a77If you meant to sell all of your items of that type, use /sell itemname
itemNotEnough3 = \u00a77/sell itemname -1 will sell all but one item, etc.
+itemSellAir = You really tried to sell Air? Put an item in your hand.
itemSold = \u00a77Sold for \u00a7c {0} \u00a77 ({1} items at {2} each)
itemSoldConsole = {0} sold {1} for \u00a77 {2} \u00a77 ({3} items at {4} each)
-itemSellAir = You really tried to sell Air? Put an item in your hand.
-homeSet = \u00a77Home set.
+itemSpawn = \u00a77Giving {0} of {1}
+itemsCsvNotLoaded = Could not load items.csv.
+jailMessage = \u00a7cYou do the crime, you do the time.
+jailNotExist = That jail does not exist.
jailSet = \u00a77Jail {0} has been set
-warpSet = \u00a77Warp {0} set.
-worthSet = Worth value set
-mobSpawnTarget = Target block must be a mob spawner.
-mobSpawnError = Error while changing mob spawner.
-invalidMob = Invalid mob type.
-unableToSpawnMob = Unable to spawn mob.
-mobSpawnLimit = Mob quantity limited to server limit
-soloMob = That mob likes to be alone
-numberRequired = A number goes there, silly.
-spawned = spawned
-slimeMalformedSize = Malformed size.
-sheepMalformedColor = Malformed color.
-suicideMessage = \u00a77Goodbye Cruel World...
-suicideSuccess = \u00a77{0} took their own life
-tempBanned = Temporarily banned from server for {0}
-thunderDuration = You {0} thunder in your world for {1} seconds.
-thunder = You {0} thunder in your world
-deleteFileError = Could not delete file: {0}
-userDoesNotExist = The user {0} does not exist.
-negativeBalanceError = User is not allowed to have a negative balance.
-timeSet = Time set in all worlds.
-onlyDayNight = /time only supports day/night.
+jumpError = That would hurt your computer''s brain.
+kickDefault = Kicked from server
+kickExempt = \u00a7cYou can not kick that person.
+kill = \u00a77Killed {0}.
+kitError = \u00a7cThere are no valid kits.
+kitError2 = \u00a7cThat kit does not exist or is improperly defined.
+kitErrorHelp = \u00a7cPerhaps an item is missing a quantity in the configuration?
+kitGive = \u00a77Giving kit {0}.
+kitInvFull = \u00a7cYour inventory was full, placing kit on the floor
+kitTimed = \u00a7cYou can''t use that kit again for another {0}.
+kits = \u00a77Kits: {0}
+lightningSmited = \u00a77You have just been smited
+lightningUse = \u00a77Smiting {0}
+loadWarpError = Failed to load warp {0}
+loadinfo = Loaded {0} build {1} by {2}
+localFormat = Local: <{0}> {1}
+mailClear = \u00a7cTo mark your mail as read, type /mail clear
+mailCleared = \u00a77Mail Cleared!
+mailSent = \u00a77Mail sent!
+markMailAsRead = \u00a7cTo mark your mail as read, type /mail clear
+markedAsAway = \u00a77You are now marked as away.
+markedAsNotAway = \u00a77You are no longer marked as away.
mayNotJail = \u00a7cYou may not jail that person
-userJailed = \u00a77You have been jailed
+me = me
+minute = minute
+minutes = minutes
+missingItems = You do not have {0}x {1}.
+missingPrefixSuffix = Missing a prefix or suffix for {0}
+mobSpawnError = Error while changing mob spawner.
+mobSpawnLimit = Mob quantity limited to server limit
+mobSpawnTarget = Target block must be a mob spawner.
+moneyRecievedFrom = \u00a7a{0} has been recieved from {1}
+moneySentTo = \u00a7a{0} has been sent to {1}
+moneyTaken = {0} taken from your bank account.
+month = month
+months = months
+moreThanZero = Quantities must be greater than 0.
+msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
+mutedPlayer = Player {0} muted.
+mutedPlayerFor = Player {0} muted for {1}.
+mutedUserSpeaks = {0} tried to speak, but is muted.
+needTpohere = You need access to /tpohere to teleport other players.
+negativeBalanceError = User is not allowed to have a negative balance.
+nickChanged = Nickname changed.
+nickInUse = \u00a7cThat name is already in use.
+nickNamesAlpha = \u00a7cNicknames must be alphanumeric.
+nickNoMore = \u00a77You no longer have a nickname.
+nickOthersPermission = \u00a7cYou do not have permission to change the nickname of others
+nickSet = \u00a77Your nickname is now \u00a7c{0}
+noAccessCommand = \u00a7cYou do not have access to that command.
+noAccessPermission = \u00a7cYou do not have permission to access that {0}.
+noDestroyPermission = \u00a7cYou do not have permission to destroy that {0}.
+noHomeSet = You have not set a home.
+noHomeSetPlayer = Player has not set a home.
+noKitPermission = \u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit.
+noKits = \u00a77There are no kits available yet
+noMail = You do not have any mail
+noMailSendPerm = \u00a7cYou do not have the \u00a7fessentials.mail.send\u00a7c permission.
+noMotd = \u00a7cThere is no message of the day."
+noNewMail = \u00a77You have no new mail.
+noPendingRequest = You do not have a pending request.
+noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
+noRules = \u00a7cThere are no rules specified yet.
+noWarpsDefined = No warps defined
+none = none
+notAllowedToQuestion = \u00a7cYou are not authorized to use question.
+notAllowedToShout = \u00a7cYou are not authorized to shout.
+notEnoughMoney = You do not have sufficient funds.
+notRecommendedBukkit = Bukkit version is not the recommended build for Essentials.
+notSupportedYet = Not supported yet.
+now = now
+numberRequired = A number goes there, silly.
+onlyDayNight = /time only supports day/night.
+onlyPlayers = Only in-game players can use {0}.
+onlySunStorm = /weather only supports sun/storm.
+parseError = Error parsing {0} on line {1}
+pendingTeleportCancelled = \u00a7cPending teleportation request cancelled.
+permissionsError = Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled.
+playerBanned = \u00a7cPlayer {0} banned: {1}
+playerInJail = \u00a7cPlayer is already in jail {0}.
playerJailed = \u00a77Player {0} jailed.
playerJailedFor = \u00a77Player {0} jailed for {1}.
-playerInJail = \u00a7cPlayer is already in jail {0}.
-teleportTop = \u00a77Teleporting to top.
-teleporting = \u00a77Teleporting...
-teleportDisabled = {0} has teleportation disabled.
-needTpohere = You need access to /tpohere to teleport other players.
+playerKicked = \u00a7cPlayer {0} kicked: {1}
+playerNeverOnServer = \u00a7cPlayer {0} was never on this server.
+playerNotFound = \u00a7cPlayer not found.
+pong = Pong!
+possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}.
+powerToolAir = Command can''t be attached to air.
+powerToolAttach = Command assigned to {0}
+powerToolRemove = Command removed from {0}
+protectionOwner = \u00a76[EssentialsProtect] Protection owner: {0}
+questionFormat = \u00a77[Question]\u00a7f {0}
+reloadAllPlugins = \u00a77Reloaded all plugins.
+requestAccepted = \u00a77Teleport request accepted.
+requestDenied = \u00a77Teleport request denied.
+requestSent = \u00a77Request sent to {0}\u00a77.
+returnPlayerToJailError = Error occured when trying to return player to jail.
+second = second
+seconds = seconds
+seenOffline = Player {0} is offline since {1}
+seenOnline = Player {0} is online since {1}
+serverFull = Server is full
+sheepMalformedColor = Malformed color.
+shoutFormat = \u00a77[Shout]\u00a7f {0}
+similarWarpExist = A warp with a similar name already exists.
+slimeMalformedSize = Malformed size.
+soloMob = That mob likes to be alone
+spawnSet = \u00a77Spawn location set for group {0}.
+spawned = spawned
+suicideMessage = \u00a77Goodbye Cruel World...
+suicideSuccess = \u00a77{0} took their own life
+takenFromAccount = \u00a7c{0} has been taken from your account.
+takenFromOthersAccount = \u00a7c{0} has been taken from {1} account.
+teleportAll = \u00a77Teleporting all players...
teleportAtoB = \u00a77{0}\u00a77 teleported you to {1}\u00a77.
+teleportDisabled = {0} has teleportation disabled.
+teleportHereRequest = \u00a7c{0}\u00a7c has requested that you teleport to him/her.
+teleportNewPlayerError = Failed to teleport new player
teleportRequest = \u00a7c{0}\u00a7c has requested to teleport to you.
+teleportTop = \u00a77Teleporting to top.
+teleportationCommencing = \u00a77Teleportation commencing...
+teleportationDisabled = \u00a77Teleportation disabled.
+teleportationEnabled = \u00a77Teleportation enabled.
+teleporting = \u00a77Teleporting...
+teleportingPortal = \u00a77Teleporting via portal.
+tempBanned = Temporarily banned from server for {0}
+tempbanExempt = \u00a77You may not tempban that player
+thunder = You {0} thunder in your world
+thunderDuration = You {0} thunder in your world for {1} seconds.
+timeBeforeHeal = Time before next heal: {0}
+timeBeforeTeleport = Time before next teleport: {0}
+timePattern = (?:([0-9]+)\\s*y[a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
+timeSet = Time set in all worlds.
+tradeCompleted = \u00a77Trade completed.
+tradeSignEmpty = The trade sign does not have enough supply left.
+treeFailure = \u00a7cTree generation failure. Try again on grass or dirt.
+treeSpawned = \u00a77Tree spawned.
typeTpaccept = \u00a77To teleport, type \u00a7c/tpaccept\u00a77.
typeTpdeny = \u00a77To deny this request, type \u00a7c/tpdeny\u00a77.
-requestSent = \u00a77Request sent to {0}\u00a77.
-teleportHereRequest = \u00a7c{0}\u00a7c has requested that you teleport to him/her.
-teleportAll = \u00a77Teleporting all players...
-noPendingRequest = You do not have a pending request.
-requestDenied = \u00a77Teleport request denied.
-requestAccepted = \u00a77Teleport request accepted.
-teleportationEnabled = \u00a77Teleportation enabled.
-teleportationDisabled = \u00a77Teleportation disabled.
-treeSpawned = \u00a77Tree spawned.
-treeFailure = \u00a7cTree generation failure. Try again on grass or dirt.
-unbannedPlayer = Unbanned player.
+typeWorldName = \u00a77You can also type the name of a specific world.
+unableToSpawnMob = Unable to spawn mob.
+unableToSpawnMob = Unable to spawn mob.
unbannedIP = Unbanned IP address.
-unlimitedItems = Unlimited items:
-none = none
+unbannedPlayer = Unbanned player.
+unignorePlayer = You are not ignoring player {0} anymore.
+unknownItemId = Unknown item id: {0}
+unknownItemInList = Unknown item {0} in {1} list.
+unknownItemName = Unknown item name: {0}
unlimitedItemPermission = \u00a7cNo permission for unlimited item {0}.
-disableUnlimited = \u00a77Disabled unlimited placing of {0} for {1}.
-enableUnlimited = \u00a77Giving unlimited amount of {0} to {1}.
+unlimitedItems = Unlimited items:
+unmutedPlayer = Player {0} unmuted.
+upgradingFilesError = Error while upgrading the files
+userCreatedPortal = {0} used a portal and generated an exit portal.
+userDoesNotExist = The user {0} does not exist.
+userIsAway = {0} is now AFK
+userIsNotAway = {0} is no longer AFK
+userJailed = \u00a77You have been jailed
+userUsedPortal = {0} used an existing exit portal.
+userdataMoveBackError = Failed to move userdata/{0}.tmp to userdata/{1}
+userdataMoveError = Failed to move userdata/{0} to userdata/{1}.tmp
+usingPortal = \u00a77Teleporting via portal to an existing portal.
+usingTempFolderForTesting = Using temp folder for testing:
+versionMismatch = Version mismatch! Please update {0} to the same version.
+versionMismatchAll = Version mismatch! Please update all Essentials jars to the same version.
+voiceSilenced = \u00a77Your voice has been silenced
+warpDeleteError = Problem deleting the warp file.
warpListPermission = \u00a7cYou do not have Permission to list that warps.
-noWarpsDefined = No warps defined
+warpNotExist = That warp does not exist.
+warpSet = \u00a77Warp {0} set.
warpUsePermission = \u00a7cYou do not have Permission to use that warp.
-weatherSunFor = \u00a77You set the weather to sun in your world for {0} seconds
-weatherSun = \u00a77You set the weather to sun in your world
-weatherStormFor = \u00a77You set the weather to storm in your world for {0} seconds
+warpingTo = \u00a77Warping to {0}.
weatherStorm = \u00a77You set the weather to storm in your world
-whoisIs = {0} is {1}
+weatherStormFor = \u00a77You set the weather to storm in your world for {0} seconds
+weatherSun = \u00a77You set the weather to sun in your world
+weatherSunFor = \u00a77You set the weather to sun in your world for {0} seconds
+whoisGeoLocation = \u00a79 - Location: {0}
whoisHealth = \u00a79 - Health: {0}/20
+whoisIPAddress = \u00a79 - IP Address: {0}
+whoisIs = {0} is {1}
whoisLocation = \u00a79 - Location: ({0}, {1}, {2}, {3})
whoisMoney = \u00a79 - Money: {0}
-whoisStatusAway = \u00a79 - Status: \u00a7cAway\u00a7f
whoisStatusAvailable = \u00a79 - Status: Available
-whoisIPAddress = \u00a79 - IP Address: {0}
-whoisGeoLocation = \u00a79 - Location: {0}
-invalidWorld = \u00a7cInvalid world.
-possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}.
-typeWorldName = \u00a77You can also type the name of a specific world.
+whoisStatusAway = \u00a79 - Status: \u00a7cAway\u00a7f
worth = \u00a77Stack of {0} worth \u00a7c{1}\u00a77 ({2} item(s) at {3} each)
worthMeta = \u00a77Stack of {0} with metadata of {1} worth \u00a7c{2}\u00a77 ({3} item(s) at {4} each)
-onlyPlayers = Only in-game players can use {0}.
-unignorePlayer = You are not ignoring player {0} anymore.
-ignorePlayer = You ignore player {0} from now on.
-illegalDate = Illegal date format.
-timePattern = (?:([0-9]+)\\s*y[a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
-msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
-kits = \u00a77Kits: {0}
-loadWarpError = Failed to load warp {0}
-invalidSignLine = Line {0} on sign is invalid.
\ No newline at end of file
+worthSet = Worth value set
+year = year
+years = years
+youAreHealed = \u00a77You have been healed.
+youHaveNewMail = \u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties
index 1d78bed71..bd0352289 100644
--- a/Essentials/src/messages_da.properties
+++ b/Essentials/src/messages_da.properties
@@ -1,310 +1,324 @@
-#Danish Translation by papand13, papand13@gmail.com
-#Danish Translation Version: 1.0
#version: TeamCity
# Single quotes have to be doubled: ''
# Translations start here
-loadinfo = Indl\u00e6ste {0} byg {1} af {2}
-markedAsNotAway = \u00a77Du er ikke l\u00e6ngere markeret som v\u00e6k.
-markedAsAway = \u00a77Du er nu markeret som v\u00e6k.
-userIsNotAway = {0} er ikke l\u00e6ngere AFK
-userIsAway = {0} er nu AFK
-backupStarted = Backup startede
+#Danish Translation by papand13, papand13@gmail.com
+#Danish Translation Version: 1.0
+addedToAccount = \u00a7a{0} er tilf\u00f8jet til din konto.
+addedToOthersAccount = \u00a7a{0} er blevet tilf\u00f8jet til {1} konto.
+alertBroke = \u00f8delagde:
+alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} ved: {3}
+alertPlaced = placerede:
+alertUsed = brugte:
+backAfterDeath = \u00a77Brug /back kommandoen for at retunere til dit d\u00f8ds punkt.
+backUsageMsg = \u00a77Returnere til tidligere placering.
backupFinished = Backup sluttede
-invalidServer = Ugyldig server!
-usingTempFolderForTesting = Bruger temp mappe for testing:
-versionMismatch = Version matcher ikke! Venligst opdater {0} til den nyeste version.
-notRecommendedBukkit = Bukkit version er ikke den anbefalede byg for Essentials.
-bukkitFormatChanged = Bukkit version format \u00e6ndret. Version er ikke checket.
-itemsCsvNotLoaded = Kunne ikke indl\u00e6se items.csv.
-corruptNodeInConfig = \u00a74Notice: Din konfigurations fil har en korrupt {0} node.
-youHaveNewMail = \u00a7cDu har {0} beskeder!\u00a7f Type \u00a77/post l\u00e6s\u00a7f for at se din post.
-commandNotLoaded = \u00a7cCommand {0} er ikke indl\u00e6st korrekt.
-deniedAccessCommand = {0} var n\u00e6gtet adgang til kommando.
-noAccessCommand = \u00a7cDu har ikke adgang til den kommando.
-errorCallingCommand = Fejl ved opkald af kommando /{0}
-commandFailed = Kommando {0} fejlede:
-bannedPlayersFileNotFound = banned-players.txt ikke fundet
-bannedPlayersFileError = Fejl i l\u00e6sning af banned-players.txt
-bannedIpsFileNotFound = banned-ips.txt ikke fundet
+backupStarted = Backup startede
+balance = \u00a77Balance: {0}
+balanceTop = \u00a77 Top {0} saldi
+banIpAddress = \u00a77Bannede IP addresse
+banExempt = \u00a7cDu kan ikke forbyde den p\u00e5g\u00e6ldende spiller.
bannedIpsFileError = Fejl i l\u00e6sning af banned-ips.txt
-noDestroyPermission = \u00a7cDu har ikke tilladelse til at \u00f8del\u00e6gge det {0}.
-noAccessPermission = \u00a7cDu har ikke tilladelse til at f\u00e5 adgang til det {0}.
-moreThanZero = M\u00e6ngder skal v\u00e6re st\u00f8rre end 0.
-errorWithMessage = \u00a7cFejl: {0}
+bannedIpsFileNotFound = banned-ips.txt ikke fundet
+bannedPlayersFileError = Fejl i l\u00e6sning af banned-players.txt
+bannedPlayersFileNotFound = banned-players.txt ikke fundet
+bigTreeFailure = \u00a7cStort tr\u00e6 genererings fejl. Pr\u00f8v igen p\u00e5 gr\u00e6s eller jord.
+bigTreeSuccess = \u00a77Stort tr\u00e6 fremkaldt.
+broadcast = [\u00a7cMeddelelse\u00a7f]\u00a7a {0}
+buildAlert = \u00a7cDu er ikke tilladt at bygge!
+bukkitFormatChanged = Bukkit version format \u00e6ndret. Version er ikke checket.
+burnMsg = \u00a77Du satte ild til {0} for {1} sekunder.
+canTalkAgain = \u00a77Du kan snakke igen
+cantFindGeoIpDB = Kan ikke finde GeoIP database!
+cantReadGeoIpDB = Fejl ved l\u00e6sning af GeoIP database!
+cantSpawnItem = \u00a7cDu er ikke tilladt at spawne elementet {0}
+commandFailed = Kommando {0} fejlede:
+commandNotLoaded = \u00a7cCommand {0} er ikke indl\u00e6st korrekt.
+compassBearing = \u00a77B\u00e6rer: {0} ({1} grader).
+configFileMoveError = Kunne ikke flytte config.yml til backup placering.
+configFileRenameError = Kunne ikke omd\u00f8be temp fil til config.yml
+connectedPlayers = Tilsluttede spillere:
+connectionFailed = Failed ved \u00e5bning af forbindelse.
+cooldownWithMessage = \u00a7cNedk\u00f8lning: {0}
+corruptNodeInConfig = \u00a74Notice: Din konfigurations fil har en korrupt {0} node.
+couldNotFindTemplate = Kunne ikke finde skabelon {0}
creatingConfigFromTemplate = Opretter config fra skabelon: {0}
creatingEmptyConfig = Opretter tom config: {0}
-failedToCreateConfig = Fejl i oprettelse af config {0}
-couldNotFindTemplate = Kunne ikke finde skabelon {0}
-failedToWriteConfig = Fejlede i at skrive config {0}
-failedToCloseConfig = Fejlede i at lukke config {0}
-notEnoughMoney = Du har ikke tilstr\u00e6kkelig penge.
-missingItems = Du har ikke {0}x {1}.
-tradeSignEmpty = Forhandlings skiltet har ikke nok forsyning tilbage.
-tradeCompleted = \u00a77Forhandling fuldf\u00f8rt.
-backAfterDeath = \u00a77Brug /back kommandoen for at retunere til dit d\u00f8ds punkt.
-mutedUserSpeaks = {0} pr\u00f8vede at snakke, men er muted.
-userCreatedPortal = {0} bruge en portal og genererede en udgangs portal.
-generatingPortal = \u00a77Genererer en udgangs portal.
-userUsedPortal = {0} brugte en eksisterende udgangs portal.
-usingPortal = \u00a77Teleporterede via portal til en eksisterende portal.
-teleportingPortal = \u00a77Teleporterede via portal.
-freedMemory = Befriede {0} MB.
+creatingPortal = Opretter portal ved {0},{1},{2}.
+day = dag
+days = dage
defaultBanReason = Ban hammeren har talt!
-noNewMail = \u00a77Du har ingen ny post.
-serverFull = Server er fuld
-returnPlayerToJailError = En fejl opstod ved fors\u00f8g p\u00e5 at returnere spiller til f\u00e6ngsel.
-jailMessage = \u00a7cBryd reglerne, og tag din straf.
-homeSetToBed = \u00a77Dit hjem er nu sat til denne seng.
-moneyTaken = {0} taget fra din bank konto.
-youAreHealed = \u00a77Du er blevet helbredt.
-markMailAsRead = \u00a7cTo marker din post som l\u00e6st, skriv /post ryd
-balance = \u00a77Balance: {0}
-backUsageMsg = \u00a77Returnere til tidligere placering.
-playerBanned = \u00a7cSpiller {0} bannet
-banIpAddress = \u00a77Bannede IP addresse
-bigTreeSuccess = \u00a77Stort tr\u00e6 fremkaldt.
-bigTreeFailure = \u00a7cStort tr\u00e6 genererings fejl. Pr\u00f8v igen p\u00e5 gr\u00e6s eller jord.
-broadcast = [\u00a7cMeddelelse\u00a7f]\u00a7a {0}
-burnMsg = \u00a77Du satte ild til {0} for {1} sekunder.
-playerNotFound = \u00a7cSpiller ikke fundet.
-inventoryCleared = \u00a77Inventory ryddet.
-inventoryClearedOthers = \u00a77Inventory af \u00a7c{0}\u00a77 ryddet.
-compassBearing = \u00a77B\u00e6rer: {0} ({1} grader).
+deleteFileError = Kunne ikke slette fil: {0}
deleteJail = \u00a77F\u00e6ngsel {0} er fjernet.
deleteWarp = \u00a77Warp {0} er fjernet.
+deniedAccessCommand = {0} var n\u00e6gtet adgang til kommando.
+dependancyDownloaded = [Essentials] Dependancy {0} downloaded successfully.
+dependancyException = [Essentials] An error occured when trying to download a dependacy
+dependancyNotFound = [Essentials] A required dependancy was not found, downloading now.
depth = \u00a77Du er ved havoverfladen.
depthAboveSea = \u00a77Du er {0} blok(ke) over havoverfladen.
depthBelowSea = \u00a77Du er {0} blok(ke) under havoverfladen.
+destinationNotSet = Destination er ikke sat
+disableUnlimited = \u00a77Deaktiverede ubergr\u00e6nset placering af {0} for {1}.
+disabled = deaktiveret
+dontMoveMessage = \u00a77Teleportering vil begynde om {0}. Bev\u00e6g dig ikke.
+downloadingGeoIp = Downloader GeoIP database ... det her kan tage et stykke tid (land: 0.6 MB, by: 20MB)
+duplicatedUserdata = Duplikerede userdata: {0} og {1}
+emptyWorldName = S\u00e6t Hjem: World navn er null eller tom.
+enableUnlimited = \u00a77Giver ubegr\u00e6nset m\u00e6ngde af {0} til {1}.
+enabled = aktiveret
+errorCallingCommand = Fejl ved opkald af kommando /{0}
+errorWithMessage = \u00a7cFejl: {0}
+essentialsReload = \u00a77Essentials Genindl\u00e6st {0}
extinguish = \u00a77Du slukkede dig selv.
extinguishOthers = \u00a77Du slukkede {0}.
-canTalkAgain = \u00a77Du kan snakke igen
-haveBeenReleased = \u00a77Du er blevet l\u00f8sladt
-upgradingFilesError = Fejl under opgradering af filer
-configFileMoveError = Kunne ikke flytte config.yml til backup placering.
-configFileRenameError = Kunne ikke omd\u00f8be temp fil til config.yml
+failedToCloseConfig = Fejlede i at lukke config {0}
+failedToCreateConfig = Fejl i oprettelse af config {0}
+failedToWriteConfig = Fejlede i at skrive config {0}
fileRenameError = Resterende fil {0} fejlede
-userdataMoveError = Kunne ikke flytte userdata/{0} til userdata/{1}.tmp
-duplicatedUserdata = Duplikerede userdata: {0} og {1}
-userdataMoveBackError = Kunne ikke flytte userdata/{0}.tmp til userdata/{1}
-parseError = Fejl ved parsing {0} p\u00e5 linje {1}
-unknownItemName = Ukendt element navn: {0}
-unknownItemId = Ukendt element id: {0}
-jailNotExist = Det f\u00e6ngsel eksisterer ikke.
-unableToSpawnMob = Kunne ikke fremkalde mob.
-creatingPortal = Opretter portal ved {0},{1},{2}.
-notSupportedYet = Ikke underst\u00f8ttet endnu.
-unknownItemInList = Ukendt element {0} i {1} liste.
-teleportationCommencing = \u00a77Teleportering begynder...
-cooldownWithMessage = \u00a7cNedk\u00f8lning: {0}
-warpingTo = \u00a77Warper til {0}.
-timeBeforeTeleport = Tid f\u00f8r n\u00e6ste teleportering: {0}
-pendingTeleportCancelled = \u00a7cVentende teleportations anmodning aflyst.
-dontMoveMessage = \u00a77Teleportering vil begynde om {0}. Bev\u00e6g dig ikke.
-noHomeSet = Du har sat et nyt hjem.
-noHomeSetPlayer = Spiller har ikke sat et hjem.
-timeBeforeHeal = Tid inden n\u00e6ste helbredelse: {0}
-addedToAccount = \u00a7a{0} er tilf\u00f8jet til din konto.
-moneySentTo = \u00a7a{0} er sendt til {1}
-moneyRecievedFrom = \u00a7a{0} er modtaget fra {1}
-takenFromAccount = \u00a7c{0} er taget fra din konto.
-emptyWorldName = S\u00e6t Hjem: World navn er null eller tom.
-now = nu
-year = \u00e5r
-years = \u00e5r
-month = m\u00e5ned
-months = m\u00e5neder
-day = dag
-days = dage
-hour = time
-hours = timer
-minute = minut
-minutes = minutter
-second = sekunde
-seconds = sekunder
-destinationNotSet = Destination er ikke sat
-holeInFloor = Hul i gulv
-warpNotExist = Den warp eksisterer ikke.
-similarWarpExist = En warp med lignende tekst eksisterer allerede.
-warpDeleteError = Problem ved sletning af warp filen.
-versionMismatchAll = Version matcher ikke! Venligst opdater alle Essentials jar''er til samme version.
-missingPrefixSuffix = Mangler et pr\u00e6fiks eller suffiks for {0}
-permissionsError = Mangler Permissions/GroupManager; chat pr\u00e6fikser/suffikser vil v\u00e6re sl\u00e5et fra.
-shoutFormat = \u00a77[R\u00e5b]\u00a7f {0}
-notAllowedToShout = \u00a7cDu er ikke autoriseret til at r\u00e5be.
-questionFormat = \u00a77[Sp\u00f8rgsm\u00e5l]\u00a7f {0}
-notAllowedToQuestion = \u00a7cDu er ikke autoriseret til at bruge et sp\u00f8rgsm\u00e5l.
-localFormat = Lokal: <{0}> {1}
-geoipJoinFormat = Spiller {0} kommer fra {1}
-cantFindGeoIpDB = Kan ikke finde GeoIP database!
-cantReadGeoIpDB = Fejl ved l\u00e6sning af GeoIP database!
-geoIpUrlEmpty = GeoIP download url er tom.
-downloadingGeoIp = Downloader GeoIP database ... det her kan tage et stykke tid (land: 0.6 MB, by: 20MB)
-geoIpUrlInvalid = GeoIP download url er ugyldig.
-connectionFailed = Failed ved \u00e5bning af forbindelse.
-alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} ved: {3}
-alertPlaced = placerede:
-alertBroke = \u00f8delagde:
-alertUsed = brugte:
-buildAlert = \u00a7cDu er ikke tilladt at bygge!
-protectionOwner = \u00a76[EssentialsProtect] Beskyttelses ejer: {0}
-spawnSet = \u00a77Spawn placering sat for gruppe {0}.
-teleportNewPlayerError = Failed ved teleportering af ny spiller
-essentialsReload = \u00a77Essentials Genindl\u00e6st {0}
-gcmax = Maximum memory: {0} MB
-gcmin = Minimum memory: {0} MB
+foreverAlone = \u00a7cDu har ingen du kan svare.
+freedMemory = Befriede {0} MB.
gcchunks = stykker,
gcentities = enheder
-godMode = \u00a77Gud tilstand {0}.
-enabled = aktiveret
-disabled = deaktiveret
-godEnabledFor = aktiveret for {0}
+gcfree = Free memory: {0} MB
+gcmax = Maximum memory: {0} MB
+gctotal = Allocated memory: {0} MB
+generatingPortal = \u00a77Genererer en udgangs portal.
+geoIpUrlEmpty = GeoIP download url er tom.
+geoIpUrlInvalid = GeoIP download url er ugyldig.
+geoipJoinFormat = Spiller {0} kommer fra {1}
godDisabledFor = deaktiveret for {0}
+godEnabledFor = aktiveret for {0}
+godMode = \u00a77Gud tilstand {0}.
+haveBeenReleased = \u00a77Du er blevet l\u00f8sladt
heal = \u00a77Du er blevet helbredt.
healOther = \u00a77Helbredt {0}.
-helpPages = Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f:
helpConsole = For at se hj\u00e6lp fra konsolen, skriv ?.
helpOp = \u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1}
+helpPages = Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f:
+holeInFloor = Hul i gulv
+homeSet = \u00a77Hjem sat.
+homeSetToBed = \u00a77Dit hjem er nu sat til denne seng.
+hour = time
+hours = timer
+ignorePlayer = Du ignorere spiller {0} fra nu af.
+illegalDate = Ilegal dato format.
+infoChapter = V\u00e6lg kapitel:
+infoChapterPages = Kapitel {0}, side \u00a7c{1}\u00a7f af \u00a7c{2}\u00a7f:
infoFileDoesNotExist = Fil info.txt eksisterer ikke. Laver en for dig.
infoPages = Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f:
-infoChapter = V\u00e6lg kapitel:
infoUnknownChapter = Ukendt kapitel.
-infoChapterPages = Kapitel {0}, side \u00a7c{1}\u00a7f af \u00a7c{2}\u00a7f:
invBigger = Den anden brugers inventory er st\u00f8rre end din.
invRestored = Din inventory er blevet genoprettet.
invSee = Du ser inventoryen af {0}.
invSeeHelp = Brug /invsee for at genoprette din inventory.
-cantSpawnItem = \u00a7cDu er ikke tilladt at spawne elementet {0}
-itemSpawn = \u00a77Giver {0} af {1}
-jumpError = Det ville skade din computer''s hjerne.
-kickDefault = Kicket fra serveren
-kill = \u00a77Dr\u00e6bte {0}.
-noKits = \u00a77Der er ikke nogen pakker tilg\u00e6ngelig endnu
-kitError = \u00a7cDer er ikke nogen gyldige pakker.
-kitError2 = \u00a7cDen pakke eksisterer ikke eller er forkert defineret.
-kitErrorHelp = \u00a7cM\u00e5ske mangler et element en m\u00e6ngde i konfigurationen?
-noKitPermission = \u00a7cDu har brug for \u00a7c{0}\u00a7c tilladelsen for at bruge den pakke.
-kitTimed = \u00a7cDu kan ikke den pakke igen f\u00f8r om {0}.
-kitInvFull = \u00a7cDin inventory var fuld, placere pakken p\u00e5 gulvet
-kitGive = \u00a77Giver pakke {0}.
-lightningUse = \u00a77Sl\u00e5r {0}
-lightningSmited = \u00a77Du er blevet sl\u00e5et
-connectedPlayers = Tilsluttede spillere:
-noMail = Du har ikke noget post
-mailClear = \u00a7cFor at markere din post som l\u00e6st, skriv /mail clear
-noMailSendPerm = \u00a7cDu har ikke \u00a7fessentials.mail.send\u00a7c tilladelsen.
-playerNeverOnServer = \u00a7cSpiller {0} var aldrig p\u00e5 denne server.
-mailSent = \u00a77Post sendt!
-mailCleared = \u00a77Post ryddet!
-voiceSilenced = \u00a77Din stemme er blevet d\u00e6mpet
-noMotd = \u00a7cDer er ikke nogen besked for dagen."
-me = mig
-mutedPlayerFor = Spiller {0} d\u00e6mpet for {1}.
-mutedPlayer = Spiller {0} d\u00e6mpet.
-unmutedPlayer = Spiller {0} ikke-d\u00e6mpet.
-nickOthersPermission = \u00a7cDu har ikke tilladelse til at \u00e6ndre andres kaldenavn
-nickNoMore = \u00a7Du har ikke l\u00e6ngere et kaldenavn.
-nickNamesAlpha = \u00a7cKaldenavne skal v\u00e6re alfanumeriske.
-nickInUse = \u00a7cDet navn er allerede i brug.
-nickSet = \u00a77Dit kaldenavn er nu \u00a7c{0}
-nickChanged = Kaldenavn \u00e6ndret.
-pong = Pong!
-powerToolAir = Kommando kan ikke blive tildelt luft.
-powerToolAttach = Kommando tildelt til {0}
-powerToolRemove = Kommando fjernet fra {0}
-foreverAlone = \u00a7cDu har ingen du kan svare.
+invalidCharge = \u00a7cUgyldig opladning.
+invalidMob = Ugyldig mob type.
+invalidServer = Ugyldig server!
+invalidSignLine = Linje {0} p\u00e5 skilt er ugyldig.
+invalidWorld = \u00a7cUgyldig verden.
+inventoryCleared = \u00a77Inventory ryddet.
+inventoryClearedOthers = \u00a77Inventory af \u00a7c{0}\u00a77 ryddet.
is = er
-reloadAllPlugins = \u00a77Genindl\u00e6ste alle tilf\u00f8jelser.
-noRules = \u00a7cDer er ingen regler fastsat endnu.
-seenOnline = Spiller {0} er online siden {1}
-seenOffline = Spiller {0} er offline siden {1}
itemCannotBeSold = Det element kan ikke s\u00e6lges til serveren.
itemMustBeStacked = Element skal handles i stakke. En m\u00e6ngde af 2s ville v\u00e6re to stakke, osv.
itemNotEnough1 = \u00a7cDu har ikke nok af det element til at s\u00e6lge.
itemNotEnough2 = \u00a77Hvis du ville have solgt alle dine elementer af den type, brug /sell elementnavn
itemNotEnough3 = \u00a77/sell elementnavn -1 vil s\u00e6lge alle p\u00e5 n\u00e6r et element, osv.
+itemSellAir = Fors\u00f8gte du virkelig at s\u00e6lge luft? Kom et element i din h\u00e5nd.
itemSold = \u00a77Solgte for \u00a7c {0} \u00a77 ({1} elementer for {2} hver)
itemSoldConsole = {0} solgte {1} for \u00a77 {2} \u00a77 ({3} elementer for {4} hver)
-itemSellAir = Fors\u00f8gte du virkelig at s\u00e6lge luft? Kom et element i din h\u00e5nd.
-homeSet = \u00a77Hjem sat.
+itemSpawn = \u00a77Giver {0} af {1}
+itemsCsvNotLoaded = Kunne ikke indl\u00e6se items.csv.
+jailMessage = \u00a7cBryd reglerne, og tag din straf.
+jailNotExist = Det f\u00e6ngsel eksisterer ikke.
jailSet = \u00a77F\u00e6ngsel {0} er blevet sat
-warpSet = \u00a77Warp {0} sat.
-worthSet = V\u00e6rd v\u00e6rdi sat
-mobSpawnTarget = M\u00e5l blok skal v\u00e6re en mob fremkalder.
-mobSpawnError = Fejl ved \u00e6ndring af mob fremkalder.
-invalidMob = Ugyldig mob type.
-unableToSpawnMob = Kan ikke spawne mob.
-mobSpawnLimit = Mob m\u00e6ngde begr\u00e6nset til server gr\u00e6nse
-soloMob = Den mob kan godt lide at v\u00e6re alene
-numberRequired = Der skal v\u00e6re et nummer, fjolle.
-spawned = spawnet
-slimeMalformedSize = Misdannet st\u00f8rrelse.
-sheepMalformedColor = Misdannet farve.
-suicideMessage = \u00a77Farvel grusomme verden...
-suicideSuccess = \u00a77{0} tog sit eget liv
-tempBanned = Midlertidigt bannet fra serveren for {0}
-thunderDuration = Du {0} torden i din verden i {1} sekunder.
-thunder = Du {0} torden i din verden
-deleteFileError = Kunne ikke slette fil: {0}
-userDoesNotExist = Brugeren {0} eksisterer ikke.
-negativeBalanceError = Brugeren er ikke tilladt at have en negativ saldo.
-timeSet = Tid er sat i alle verdener.
-onlyDayNight = /time underst\u00f8tter kun day/night.
+jumpError = Det ville skade din computer''s hjerne.
+kickDefault = Kicket fra serveren
+kickExempt = \u00a77Du kan ikke sparke denne spiller.
+kill = \u00a77Dr\u00e6bte {0}.
+kitError = \u00a7cDer er ikke nogen gyldige pakker.
+kitError2 = \u00a7cDen pakke eksisterer ikke eller er forkert defineret.
+kitErrorHelp = \u00a7cM\u00e5ske mangler et element en m\u00e6ngde i konfigurationen?
+kitGive = \u00a77Giver pakke {0}.
+kitInvFull = \u00a7cDin inventory var fuld, placere pakken p\u00e5 gulvet
+kitTimed = \u00a7cDu kan ikke den pakke igen f\u00f8r om {0}.
+kits = \u00a77Pakker: {0}
+lightningSmited = \u00a77Du er blevet sl\u00e5et
+lightningUse = \u00a77Sl\u00e5r {0}
+loadWarpError = Kunne ikke indl\u00e6se warp {0}
+loadinfo = Indl\u00e6ste {0} byg {1} af {2}
+localFormat = Lokal: <{0}> {1}
+mailClear = \u00a7cFor at markere din post som l\u00e6st, skriv /mail clear
+mailCleared = \u00a77Post ryddet!
+mailSent = \u00a77Post sendt!
+markMailAsRead = \u00a7cTo marker din post som l\u00e6st, skriv /post ryd
+markedAsAway = \u00a77Du er nu markeret som v\u00e6k.
+markedAsNotAway = \u00a77Du er ikke l\u00e6ngere markeret som v\u00e6k.
mayNotJail = \u00a7cDu m\u00e5 ikke f\u00e6ngsle den person
-userJailed = \u00a77Du er blevet f\u00e6ngslet
+me = mig
+minute = minut
+minutes = minutter
+missingItems = Du har ikke {0}x {1}.
+missingPrefixSuffix = Mangler et pr\u00e6fiks eller suffiks for {0}
+mobSpawnError = Fejl ved \u00e6ndring af mob fremkalder.
+mobSpawnLimit = Mob m\u00e6ngde begr\u00e6nset til server gr\u00e6nse
+mobSpawnTarget = M\u00e5l blok skal v\u00e6re en mob fremkalder.
+moneyRecievedFrom = \u00a7a{0} er modtaget fra {1}
+moneySentTo = \u00a7a{0} er sendt til {1}
+moneyTaken = {0} taget fra din bank konto.
+month = m\u00e5ned
+months = m\u00e5neder
+moreThanZero = M\u00e6ngder skal v\u00e6re st\u00f8rre end 0.
+msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
+mutedPlayer = Spiller {0} d\u00e6mpet.
+mutedPlayerFor = Spiller {0} d\u00e6mpet for {1}.
+mutedUserSpeaks = {0} pr\u00f8vede at snakke, men er muted.
+needTpohere = Du skal have adgang til /tpohere for at teleporter andre spillere.
+negativeBalanceError = Brugeren er ikke tilladt at have en negativ saldo.
+nickChanged = Kaldenavn \u00e6ndret.
+nickInUse = \u00a7cDet navn er allerede i brug.
+nickNamesAlpha = \u00a7cKaldenavne skal v\u00e6re alfanumeriske.
+nickNoMore = \u00a7Du har ikke l\u00e6ngere et kaldenavn.
+nickOthersPermission = \u00a7cDu har ikke tilladelse til at \u00e6ndre andres kaldenavn
+nickSet = \u00a77Dit kaldenavn er nu \u00a7c{0}
+noAccessCommand = \u00a7cDu har ikke adgang til den kommando.
+noAccessPermission = \u00a7cDu har ikke tilladelse til at f\u00e5 adgang til det {0}.
+noDestroyPermission = \u00a7cDu har ikke tilladelse til at \u00f8del\u00e6gge det {0}.
+noHomeSet = Du har sat et nyt hjem.
+noHomeSetPlayer = Spiller har ikke sat et hjem.
+noKitPermission = \u00a7cDu har brug for \u00a7c{0}\u00a7c tilladelsen for at bruge den pakke.
+noKits = \u00a77Der er ikke nogen pakker tilg\u00e6ngelig endnu
+noMail = Du har ikke noget post
+noMailSendPerm = \u00a7cDu har ikke \u00a7fessentials.mail.send\u00a7c tilladelsen.
+noMotd = \u00a7cDer er ikke nogen besked for dagen."
+noNewMail = \u00a77Du har ingen ny post.
+noPendingRequest = Du har ikke en ventende anmodning.
+noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
+noRules = \u00a7cDer er ingen regler fastsat endnu.
+noWarpsDefined = Ingen warps defineret
+none = ingen
+notAllowedToQuestion = \u00a7cDu er ikke autoriseret til at bruge et sp\u00f8rgsm\u00e5l.
+notAllowedToShout = \u00a7cDu er ikke autoriseret til at r\u00e5be.
+notEnoughMoney = Du har ikke tilstr\u00e6kkelig penge.
+notRecommendedBukkit = Bukkit version er ikke den anbefalede byg for Essentials.
+notSupportedYet = Ikke underst\u00f8ttet endnu.
+now = nu
+numberRequired = Der skal v\u00e6re et nummer, fjolle.
+onlyDayNight = /time underst\u00f8tter kun day/night.
+onlyPlayers = Kun in-game spillere kan bruge {0}.
+onlySunStorm = /weather only supports sun/storm.
+parseError = Fejl ved parsing {0} p\u00e5 linje {1}
+pendingTeleportCancelled = \u00a7cVentende teleportations anmodning aflyst.
+permissionsError = Mangler Permissions/GroupManager; chat pr\u00e6fikser/suffikser vil v\u00e6re sl\u00e5et fra.
+playerBanned = \u00a7cSpiller {0} bannet: {1}
+playerInJail = \u00a7cSpiller er allerede i f\u00e6ngsel {0}.
playerJailed = \u00a77Spiller {0} f\u00e6ngslet.
playerJailedFor = \u00a77Spiller {0} f\u00e6ngslet for {1}.
-playerInJail = \u00a7cSpiller er allerede i f\u00e6ngsel {0}.
-teleportTop = \u00a77Teleportere til toppen.
-teleporting = \u00a77Teleportere...
-teleportDisabled = {0} har teleportation deaktiveret.
-needTpohere = Du skal have adgang til /tpohere for at teleporter andre spillere.
+playerKicked = \u00a7cPlayer {0} kicked: {1}
+playerNeverOnServer = \u00a7cSpiller {0} var aldrig p\u00e5 denne server.
+playerNotFound = \u00a7cSpiller ikke fundet.
+pong = Pong!
+possibleWorlds = \u00a77Mulige verdener er numrene 0 igennem {0}.
+powerToolAir = Kommando kan ikke blive tildelt luft.
+powerToolAttach = Kommando tildelt til {0}
+powerToolRemove = Kommando fjernet fra {0}
+protectionOwner = \u00a76[EssentialsProtect] Beskyttelses ejer: {0}
+questionFormat = \u00a77[Sp\u00f8rgsm\u00e5l]\u00a7f {0}
+reloadAllPlugins = \u00a77Genindl\u00e6ste alle tilf\u00f8jelser.
+requestAccepted = \u00a77Teleporterings anmodning n\u00e6gtet.
+requestDenied = \u00a77Teleporterings anmodning n\u00e6gtet.
+requestSent = \u00a77Anmodning sendt til {0}\u00a77.
+returnPlayerToJailError = En fejl opstod ved fors\u00f8g p\u00e5 at returnere spiller til f\u00e6ngsel.
+second = sekunde
+seconds = sekunder
+seenOffline = Spiller {0} er offline siden {1}
+seenOnline = Spiller {0} er online siden {1}
+serverFull = Server er fuld
+sheepMalformedColor = Misdannet farve.
+shoutFormat = \u00a77[R\u00e5b]\u00a7f {0}
+similarWarpExist = En warp med lignende tekst eksisterer allerede.
+slimeMalformedSize = Misdannet st\u00f8rrelse.
+soloMob = Den mob kan godt lide at v\u00e6re alene
+spawnSet = \u00a77Spawn placering sat for gruppe {0}.
+spawned = spawnet
+suicideMessage = \u00a77Farvel grusomme verden...
+suicideSuccess = \u00a77{0} tog sit eget liv
+takenFromAccount = \u00a7c{0} er taget fra din konto.
+takenFromOthersAccount = \u00a7c{0} er blevet taget fra {1} konto.
+teleportAll = \u00a77Teleportere alle spillere...
teleportAtoB = \u00a77{0}\u00a77 teleporterede dig til {1}\u00a77.
+teleportDisabled = {0} har teleportation deaktiveret.
+teleportHereRequest = \u00a7c{0}\u00a7c har anmodet at du teleportere dig til ham/hende.
+teleportNewPlayerError = Failed ved teleportering af ny spiller
teleportRequest = \u00a7c{0}\u00a7c har anmodet om at teleportere til dig.
+teleportTop = \u00a77Teleportere til toppen.
+teleportationCommencing = \u00a77Teleportering begynder...
+teleportationDisabled = \u00a77Teleportering deaktiveret.
+teleportationEnabled = \u00a77Teleportering aktiveret.
+teleporting = \u00a77Teleportere...
+teleportingPortal = \u00a77Teleporterede via portal.
+tempBanned = Midlertidigt bannet fra serveren for {0}
+tempbanExempt = \u00a77You may not tempban that player
+thunder = Du {0} torden i din verden
+thunderDuration = Du {0} torden i din verden i {1} sekunder.
+timeBeforeHeal = Tid inden n\u00e6ste helbredelse: {0}
+timeBeforeTeleport = Tid f\u00f8r n\u00e6ste teleportering: {0}
+timePattern = (?:([0-9]+)\\s*[a\u00e5y][a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[wu][a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[ht][a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
+timeSet = Tid er sat i alle verdener.
+tradeCompleted = \u00a77Forhandling fuldf\u00f8rt.
+tradeSignEmpty = Forhandlings skiltet har ikke nok forsyning tilbage.
+treeFailure = \u00a7cTr\u00e6 genererings fejl. Pr\u00f8v igen p\u00e5 gr\u00e6s eller jord.
+treeSpawned = \u00a77Tr\u00e6 fremkaldt.
typeTpaccept = \u00a77For at teleportere, skriv \u00a7c/tpaccept\u00a77.
typeTpdeny = \u00a77For at n\u00e6gte denne anmodning, skriv \u00a7c/tpdeny\u00a77.
-requestSent = \u00a77Anmodning sendt til {0}\u00a77.
-teleportHereRequest = \u00a7c{0}\u00a7c har anmodet at du teleportere dig til ham/hende.
-teleportAll = \u00a77Teleportere alle spillere...
-noPendingRequest = Du har ikke en ventende anmodning.
-requestDenied = \u00a77Teleporterings anmodning n\u00e6gtet.
-requestAccepted = \u00a77Teleporterings anmodning n\u00e6gtet.
-teleportationEnabled = \u00a77Teleportering aktiveret.
-teleportationDisabled = \u00a77Teleportering deaktiveret.
-treeSpawned = \u00a77Tr\u00e6 fremkaldt.
-treeFailure = \u00a7cTr\u00e6 genererings fejl. Pr\u00f8v igen p\u00e5 gr\u00e6s eller jord.
-unbannedPlayer = Tilgav spiller, ikke l\u00e6ngere bannet.
+typeWorldName = \u00a77Du kan ogs\u00e5 skrive nanvet p\u00e5 en specifik verden.
+unableToSpawnMob = Kan ikke spawne mob.
+unableToSpawnMob = Kunne ikke fremkalde mob.
unbannedIP = Tilgav IP addresse, ikke l\u00e6ngere bannet.
-unlimitedItems = Uendelige elementer:
-none = ingen
+unbannedPlayer = Tilgav spiller, ikke l\u00e6ngere bannet.
+unignorePlayer = Du ignorere ikke spiller {0} mere.
+unknownItemId = Ukendt element id: {0}
+unknownItemInList = Ukendt element {0} i {1} liste.
+unknownItemName = Ukendt element navn: {0}
unlimitedItemPermission = \u00a7cIngen tilladelse til ubegr\u00e6nset element {0}.
-disableUnlimited = \u00a77Deaktiverede ubergr\u00e6nset placering af {0} for {1}.
-enableUnlimited = \u00a77Giver ubegr\u00e6nset m\u00e6ngde af {0} til {1}.
+unlimitedItems = Uendelige elementer:
+unmutedPlayer = Spiller {0} ikke-d\u00e6mpet.
+upgradingFilesError = Fejl under opgradering af filer
+userCreatedPortal = {0} bruge en portal og genererede en udgangs portal.
+userDoesNotExist = Brugeren {0} eksisterer ikke.
+userIsAway = {0} er nu AFK
+userIsNotAway = {0} er ikke l\u00e6ngere AFK
+userJailed = \u00a77Du er blevet f\u00e6ngslet
+userUsedPortal = {0} brugte en eksisterende udgangs portal.
+userdataMoveBackError = Kunne ikke flytte userdata/{0}.tmp til userdata/{1}
+userdataMoveError = Kunne ikke flytte userdata/{0} til userdata/{1}.tmp
+usingPortal = \u00a77Teleporterede via portal til en eksisterende portal.
+usingTempFolderForTesting = Bruger temp mappe for testing:
+versionMismatch = Version matcher ikke! Venligst opdater {0} til den nyeste version.
+versionMismatchAll = Version matcher ikke! Venligst opdater alle Essentials jar''er til samme version.
+voiceSilenced = \u00a77Din stemme er blevet d\u00e6mpet
+warpDeleteError = Problem ved sletning af warp filen.
warpListPermission = \u00a7cDu har ikke tilladelse til at liste de warps.
-noWarpsDefined = Ingen warps defineret
+warpNotExist = Den warp eksisterer ikke.
+warpSet = \u00a77Warp {0} sat.
warpUsePermission = \u00a7cDu har ikke tilladelse til at benytte den warp.
-weatherSunFor = \u00a77Du har sat vejret til sol i din verden i {0} sekunder
-weatherSun = \u00a77Du har sat vejret til sol
-weatherStormFor = \u00a77Du har sat vejret til storm i din verden i {0} sekunder
+warpingTo = \u00a77Warper til {0}.
weatherStorm = \u00a77Du har sat vejret til storm i din verden
-whoisIs = {0} er {1}
+weatherStormFor = \u00a77Du har sat vejret til storm i din verden i {0} sekunder
+weatherSun = \u00a77Du har sat vejret til sol
+weatherSunFor = \u00a77Du har sat vejret til sol i din verden i {0} sekunder
+whoisGeoLocation = \u00a79 - Placering: {0}
whoisHealth = \u00a79 - Helbred: {0}/20
+whoisIPAddress = \u00a79 - IP Addresse: {0}
+whoisIs = {0} er {1}
whoisLocation = \u00a79 - Placering: ({0}, {1}, {2}, {3})
whoisMoney = \u00a79 - Penge: {0}
-whoisStatusAway = \u00a79 - Status: \u00a7cV\u00e6k\u00a7f
whoisStatusAvailable = \u00a79 - Status: Tilg\u00e6ngelig
-whoisIPAddress = \u00a79 - IP Addresse: {0}
-whoisGeoLocation = \u00a79 - Placering: {0}
-invalidWorld = \u00a7cUgyldig verden.
-possibleWorlds = \u00a77Mulige verdener er numrene 0 igennem {0}.
-typeWorldName = \u00a77Du kan ogs\u00e5 skrive nanvet p\u00e5 en specifik verden.
+whoisStatusAway = \u00a79 - Status: \u00a7cV\u00e6k\u00a7f
worth = \u00a77Stak af {0} v\u00e6rd \u00a7c{1}\u00a77 ({2} element(er) for {3} hver)
worthMeta = \u00a77Stak af {0} med metadata af {1} v\u00e6rd \u00a7c{2}\u00a77 ({3} element(er) for {4} hver)
-onlyPlayers = Kun in-game spillere kan bruge {0}.
-unignorePlayer = Du ignorere ikke spiller {0} mere.
-ignorePlayer = Du ignorere spiller {0} fra nu af.
-illegalDate = Ilegal dato format.
-timePattern = (?:([0-9]+)\\s*[a\u00e5y][a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[wu][a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[ht][a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
-msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
-kits = \u00a77Pakker: {0}
-loadWarpError = Kunne ikke indl\u00e6se warp {0}
-invalidSignLine = Linje {0} p\u00e5 skilt er ugyldig.
\ No newline at end of file
+worthSet = V\u00e6rd v\u00e6rdi sat
+year = \u00e5r
+years = \u00e5r
+youAreHealed = \u00a77Du er blevet helbredt.
+youHaveNewMail = \u00a7cDu har {0} beskeder!\u00a7f Type \u00a77/post l\u00e6s\u00a7f for at se din post.
diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties
index 65d666c67..5161fe335 100644
--- a/Essentials/src/messages_de.properties
+++ b/Essentials/src/messages_de.properties
@@ -1,308 +1,323 @@
#version: TeamCity
# Single quotes have to be doubled: ''
# Translations start here
-loadinfo = Plugin {0} Version {1} geladen, erstellt von {2}, \u00fcbersetzt von snowleo
-markedAsNotAway = \u00a77Du wirst nicht mehr als abwesend angezeigt.
-markedAsAway = \u00a77Du wirst als abwesend angezeigt.
-userIsNotAway = {0} ist wieder da.
-userIsAway = {0} ist abwesend.
-backupStarted = Backup gestartet
+addedToAccount = \u00a7a{0} wurden zu deiner Geldb\u00f6rse hinzugef\u00fcgt.
+addedToOthersAccount = \u00a7a{0} muss {1} Konto hinzugef\u00fcgt.
+alertBroke = zerst\u00f6rt:
+alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} bei: {3}
+alertPlaced = plaziert:
+alertUsed = benutzt:
+backAfterDeath = \u00a77Benutze den Befehl /back um zu deinem Todespunkt zur\u00fcck zu kehren.
+backUsageMsg = \u00a77Kehre zur letzten Position zur\u00fcck.
backupFinished = Backup beendet
-invalidServer = Ung\u00fcltiger Server!
-usingTempFolderForTesting = Benutze tempor\u00e4ren Ordner zum Testen:
-versionMismatch = Versionen nicht identisch! Bitte aktualisiere {0}.
-notRecommendedBukkit = Die verwendete Bukkit-Version ist nicht empfohlen f\u00fcr Essentials.
-bukkitFormatChanged = Bukkit-Versionsformat hat sich ge\u00e4ndert. Version nicht kontrolliert.
-itemsCsvNotLoaded = Konnte items.csv nicht laden.
-corruptNodeInConfig = \u00a74Hinweis: Deine Konfigurationsdatei hat einen ung\u00fcltigen Knoten {0}.
-youHaveNewMail = \u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen.
-commandNotLoaded = \u00a7cBefehl {0} ist nicht richtig geladen.
-deniedAccessCommand = {0} hat keinen Zugriff auf diesen Befehl.
-noAccessCommand = \u00a7cDu hast keinen Zugriff auf diesen Befehl.
-errorCallingCommand = Fehler beim Aufrufen des Befehls /{0}
-commandFailed = Befehl {0} scheiterte:
-bannedPlayersFileNotFound = banned-players.txt nicht gefunden
-bannedPlayersFileError = Fehler beim Lesen von banned-players.txt
-bannedIpsFileNotFound = banned-ips.txt nicht gefunden
+backupStarted = Backup gestartet
+balance = \u00a77Geldb\u00f6rse: {0}
+balanceTop = \u00a77 Top {0} Guthaben
+banIpAddress = \u00a77IP-Adresse gesperrt.
+banExempt = \u00a7cDu kannst diesen Spieler nicht sperren.
bannedIpsFileError = Fehler beim Lesen von banned-ips.txt
-noDestroyPermission = \u00a7cDu hast keine Rechte, den Block {0} zu zerst\u00f6ren.
-noAccessPermission = \u00a7cDu hast keine Rechte, den Block {0} zu \u00f6ffnen.
-moreThanZero = Anzahl muss gr\u00f6sser als 0 sein.
-errorWithMessage = \u00a7cFehler: {0}
+bannedIpsFileNotFound = banned-ips.txt nicht gefunden
+bannedPlayersFileError = Fehler beim Lesen von banned-players.txt
+bannedPlayersFileNotFound = banned-players.txt nicht gefunden
+bigTreeFailure = \u00a7cFehler beim Pflanzen von grossem Baum. Versuch es auf Gras oder Dreck.
+bigTreeSuccess = \u00a77Grosser Baum gepflanzt.
+broadcast = [\u00a7cRundruf\u00a7f]\u00a7a {0}
+buildAlert = \u00a7cDu hast keine Rechte zum Bauen.
+bukkitFormatChanged = Bukkit-Versionsformat hat sich ge\u00e4ndert. Version nicht kontrolliert.
+burnMsg = \u00a77Du hast {0} in Flammen gesetzt f\u00fcr {1} Sekunden.
+canTalkAgain = \u00a77Du kannst wieder sprechen.
+cantFindGeoIpDB = Kann GeoIP-Datenbank nicht finden!
+cantReadGeoIpDB = Fehler beim Einlesen der GeoIP-Datenbank!
+cantSpawnItem = \u00a7cDu darfst {0} nicht erzeugen.
+commandFailed = Befehl {0} scheiterte:
+commandNotLoaded = \u00a7cBefehl {0} ist nicht richtig geladen.
+compassBearing = \u00a77Peilung: {0} ({1} Grad).
+configFileMoveError = Verschieben von config.yml zu einer Sicherheitskopie gescheitert.
+configFileRenameError = Verschieben einer tempor\u00e4ren Datei nach config.yml gescheitert.
+connectedPlayers = Verbundene Spieler:
+connectionFailed = Fehler beim Verbindungsaufbau.
+cooldownWithMessage = \u00a7cBeschr\u00e4nkung: {0}
+corruptNodeInConfig = \u00a74Hinweis: Deine Konfigurationsdatei hat einen ung\u00fcltigen Knoten {0}.
+couldNotFindTemplate = Vorlage {0} konnte nicht gefunden werden.
creatingConfigFromTemplate = Erstelle Konfiguration aus Vorlage: {0}
creatingEmptyConfig = Erstelle leere Konfiguration: {0}
-failedToCreateConfig = Fehler beim Erstellen der Konfiguration {0}
-couldNotFindTemplate = Vorlage {0} konnte nicht gefunden werden.
-failedToWriteConfig = Fehler beim Schreiben der Konfiguration {0}
-failedToCloseConfig = Fehler beim Schliessen der Konfiguration {0}
-notEnoughMoney = Du hast nicht genug Geld.
-missingItems = Du ben\u00f6tigst {0}x {1}.
-tradeSignEmpty = Der Bestand des Trade-Schild ist aufgebraucht.
-tradeCompleted = \u00a77Handel abgeschlossen.
-backAfterDeath = \u00a77Benutze den Befehl /back um zu deinem Todespunkt zur\u00fcck zu kehren.
-mutedUserSpeaks = {0} versuchte zu sprechen, aber ist stumm geschalt.
-userCreatedPortal = {0} benutzt ein Portal und hat ein Ausgangsportal erstellt.
-generatingPortal = \u00a77Erstelle ein Ausgangsportal.
-userUsedPortal = {0} benutzt ein vorhandenes Ausgangsportal.
-usingPortal = \u00a77Teleportiere durch Portal zum Ausgangsportal.
-teleportingPortal = \u00a77Teleportiere durch Portal.
-freedMemory = {0} MB frei gemacht.
+creatingPortal = Erzeuge Portal bei {0},{1},{2}.
+day = Tag
+days = Tage
defaultBanReason = Der Bann-Hammer hat gesprochen!
-noNewMail = \u00a77Du hast keine Nachrichten.
-serverFull = Server ist voll
-returnPlayerToJailError = Fehler beim Versuch, den Spieler ins Gef\u00e4ngnis zu teleportieren.
-jailMessage = \u00a7cYou do the crime, you do the time.
-homeSetToBed = \u00a77Dein Zuhause ist nun an diesem Bett.
-moneyTaken = {0} wurde aus deiner Geldb\u00f6rse genommen.
-youAreHealed = \u00a77Du wurdest geheilt.
-markMailAsRead = \u00a7cUm deine Nachrichten zu l\u00f6schen, schreibe /mail clear
-balance = \u00a77Geldb\u00f6rse: {0}
-backUsageMsg = \u00a77Kehre zur letzten Position zur\u00fcck.
-playerBanned = \u00a7cSpieler {0} gesperrt.
-banIpAddress = \u00a77IP-Adresse gesperrt.
-bigTreeSuccess = \u00a77Grosser Baum gepflanzt.
-bigTreeFailure = \u00a7cFehler beim Pflanzen von grossem Baum. Versuch es auf Gras oder Dreck.
-broadcast = [\u00a7cRundruf\u00a7f]\u00a7a {0}
-burnMsg = \u00a77Du hast {0} in Flammen gesetzt f\u00fcr {1} Sekunden.
-playerNotFound = \u00a7cSpieler nicht gefunden.
-inventoryCleared = \u00a77Inventar geleert.
-inventoryClearedOthers = \u00a77Inventar von \u00a7c{0}\u00a77 geleert.
-compassBearing = \u00a77Peilung: {0} ({1} Grad).
+deleteFileError = Konnte Datei nicht l\u00f6schen: {0}
deleteJail = \u00a77Gef\u00e4ngnis {0} wurde gel\u00f6scht.
deleteWarp = \u00a77Warp-Punkt {0} wurde gel\u00f6scht.
+deniedAccessCommand = {0} hat keinen Zugriff auf diesen Befehl.
+dependancyDownloaded = [Essentials] Dependancy {0} downloaded successfully.
+dependancyException = [Essentials] An error occured when trying to download a dependacy
+dependancyNotFound = [Essentials] A required dependancy was not found, downloading now.
depth = \u00a77Du bist auf Meeresh\u00f6he.
depthAboveSea = \u00a77Du bist {0} Bl\u00f6cke \u00fcber Meeresh\u00f6he.
depthBelowSea = \u00a77Du bist {0} Bl\u00f6cke unter Meeresh\u00f6he.
+destinationNotSet = Ziel nicht gesetzt
+disableUnlimited = \u00a77Deaktiviere unendliches Platzieren von {0} f\u00fcr {1}.
+disabled = deaktiviert
+dontMoveMessage = \u00a77Teleportierung startet in {0}. Beweg dich nicht.
+downloadingGeoIp = Lade GeoIP-Datenbank ... dies kann etwas dauern (country: 0.6 MB, city: 20MB)
+duplicatedUserdata = Doppelte Datei in userdata: {0} and {1}
+emptyWorldName = /sethome: Weltname ist null oder leer.
+enableUnlimited = \u00a77Gebe {1} unendliche Mengen von {0}.
+enabled = aktiviert
+errorCallingCommand = Fehler beim Aufrufen des Befehls /{0}
+errorWithMessage = \u00a7cFehler: {0}
+essentialsReload = \u00a77Essentials neu geladen {0}
extinguish = \u00a77Du hast dich selbst gel\u00f6scht.
extinguishOthers = \u00a77Du hast {0} gel\u00f6scht.
-canTalkAgain = \u00a77Du kannst wieder sprechen.
-haveBeenReleased = \u00a77Du wurdest frei gelassen.
-upgradingFilesError = Fehler beim Aktualisieren der Dateien
-configFileMoveError = Verschieben von config.yml zu einer Sicherheitskopie gescheitert.
-configFileRenameError = Verschieben einer tempor\u00e4ren Datei nach config.yml gescheitert.
+failedToCloseConfig = Fehler beim Schliessen der Konfiguration {0}
+failedToCreateConfig = Fehler beim Erstellen der Konfiguration {0}
+failedToWriteConfig = Fehler beim Schreiben der Konfiguration {0}
fileRenameError = Umbenennen von {0} gescheitert.
-userdataMoveError = Verschieben von userdata/{0} nach userdata/{1}.tmp gescheitert.
-duplicatedUserdata = Doppelte Datei in userdata: {0} and {1}
-userdataMoveBackError = Verschieben von userdata/{0}.tmp nach userdata/{1} gescheitert.
-parseError = Fehler beim Parsen von {0} in Zeile {1}
-unknownItemName = Unbekannter Gegenstand: {0}
-unknownItemId = Unbekannte Item-Id: {0}
-jailNotExist = Dieses Gef\u00e4ngnis existiert nicht.
-unableToSpawnMob = Fehler beim Erzeugen von Monster.
-creatingPortal = Erzeuge Portal bei {0},{1},{2}.
-notSupportedYet = Noch nicht verf\u00fcgbar.
-unknownItemInList = Unbekannter Gegenstand {0} in Liste {1}.
-teleportationCommencing = \u00a77Teleportierung started...
-cooldownWithMessage = \u00a7cBeschr\u00e4nkung: {0}
-warpingTo = \u00a77Teleportiere zu Warp-Punkt {0}.
-timeBeforeTeleport = Zeit bis zum n\u00e4chsten Teleport: {0}
-pendingTeleportCancelled = \u00a7cLaufende Teleportierung abgebrochen.
-dontMoveMessage = \u00a77Teleportierung startet in {0}. Beweg dich nicht.
-noHomeSet = Du hast kein Zuhause gesetzt.
-noHomeSetPlayer = Spieler hat kein Zuhause gesetzt.
-timeBeforeHeal = Zeit bis zur n\u00e4chsten Heilung: {0}
-addedToAccount = \u00a7a{0} wurden zu deiner Geldb\u00f6rse hinzugef\u00fcgt.
-moneySentTo = \u00a7aDu hast {1} {0} gegeben.
-moneyRecievedFrom = \u00a7a{1} hat dir {0} gegeben.
-takenFromAccount = \u00a7c{0} wurden aus deiner Geldb\u00f6rse genommen.
-emptyWorldName = /sethome: Weltname ist null oder leer.
-now = jetzt
-year = Jahr
-years = Jahre
-month = Monat
-months = Monate
-day = Tag
-days = Tage
-hour = Stunde
-hours = Stunden
-minute = Minute
-minutes = Minuten
-second = Sekunde
-seconds = Sekunden
-destinationNotSet = Ziel nicht gesetzt
-holeInFloor = Loch im Boden
-warpNotExist = Warp-Punkt existiert nicht.
-similarWarpExist = Ein Warp-Punkt mit einem \u00e4hnlichen Namen existiert bereits.
-warpDeleteError = Fehler beim L\u00f6schen der Warp-Datei.
-versionMismatchAll = Versionen ungleich! Bitte aktualisiere alle Essentials jars auf die gleiche Version.
-missingPrefixSuffix = Prefix/Suffix fehlt f\u00fcr {0}
-permissionsError = Permissions/GroupManager fehlt; Chat-Prefixe/-Suffixe sind ausgeschaltet.
-shoutFormat = \u00a77[Schrei]\u00a7f {0}
-notAllowedToShout = \u00a7cDu bist nicht berechtigt zu schreien.
-questionFormat = \u00a77[Frage]\u00a7f {0}
-notAllowedToQuestion = \u00a7cDu bist nicht berechtigt zu fragen.
-localFormat = Lokal: <{0}> {1}
-geoipJoinFormat = Spieler {0} kommst aus {1}
-cantFindGeoIpDB = Kann GeoIP-Datenbank nicht finden!
-cantReadGeoIpDB = Fehler beim Einlesen der GeoIP-Datenbank!
-geoIpUrlEmpty = GeoIP Download-URL ist leer.
-downloadingGeoIp = Lade GeoIP-Datenbank ... dies kann etwas dauern (country: 0.6 MB, city: 20MB)
-geoIpUrlInvalid = GeoIP Download-URL ist ung\u00fcltig.
-connectionFailed = Fehler beim Verbindungsaufbau.
-alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} bei: {3}
-alertPlaced = plaziert:
-alertBroke = zerst\u00f6rt:
-alertUsed = benutzt:
-buildAlert = \u00a7cDu hast keine Rechte zum Bauen.
-protectionOwner = \u00a76[EssentialsProtect] Besitzer dieses Blocks: {0}
-spawnSet = \u00a77Spawn-Punkt gesetzt f\u00fcr Gruppe {0}.
-teleportNewPlayerError = Fehler beim Teleportieren eines neuen Spielers
-essentialsReload = \u00a77Essentials neu geladen {0}
-gcmax = Maximaler Speicher: {0} MB
-gcmin = Minimaler Speicher: {0} MB
+foreverAlone = \u00a7cDu hast niemanden, dem du antworten kannst.
+freedMemory = {0} MB frei gemacht.
gcchunks = Chunks,
gcentities = Einheiten
-godMode = \u00a77Unsterblichkeit {0}.
-enabled = aktiviert
-disabled = deaktiviert
-godEnabledFor = aktiviert f\u00fcr {0}
+gcfree = Freier Speicher: {0} MB
+gcmax = Maximaler Speicher: {0} MB
+gctotal = Reservierter Speicher: {0} MB
+generatingPortal = \u00a77Erstelle ein Ausgangsportal.
+geoIpUrlEmpty = GeoIP Download-URL ist leer.
+geoIpUrlInvalid = GeoIP Download-URL ist ung\u00fcltig.
+geoipJoinFormat = Spieler {0} kommt aus {1}
godDisabledFor = aktiviert f\u00fcr {0}
+godEnabledFor = aktiviert f\u00fcr {0}
+godMode = \u00a77Unsterblichkeit {0}.
+haveBeenReleased = \u00a77Du wurdest frei gelassen.
heal = \u00a77Du wurdest geheilt.
healOther = \u00a77{0} geheilt.
-helpPages = Seite \u00a7c{0}\u00a7f von \u00a7c{1}\u00a7f:
helpConsole = Um die Hilfe der Konsole zu sehen, schreibe ?.
helpOp = \u00a7c[Hilfe]\u00a7f \u00a77{0}:\u00a7f {1}
+helpPages = Seite \u00a7c{0}\u00a7f von \u00a7c{1}\u00a7f:
+holeInFloor = Loch im Boden
+homeSet = \u00a77Zuhause gesetzt.
+homeSetToBed = \u00a77Dein Zuhause ist nun an diesem Bett.
+hour = Stunde
+hours = Stunden
+ignorePlayer = Du ignorierst ab jetzt Spieler {0}.
+illegalDate = Ung\u00fcltiges Datumsformat.
+infoChapter = W\u00e4hle Kapitel:
+infoChapterPages = Kapitel {0}, Seite \u00a7c{1}\u00a7f von \u00a7c{2}\u00a7f:
infoFileDoesNotExist = Datei info.txt existiert nicht. Erzeuge eine neue Datei.
infoPages = Seite \u00a7c{0}\u00a7f von \u00a7c{1}\u00a7f:
-infoChapter = W\u00e4hle Kapitel:
infoUnknownChapter = Unbekanntes Kapitel:
-infoChapterPages = Kapitel {0}, Seite \u00a7c{1}\u00a7f von \u00a7c{2}\u00a7f:
invBigger = Das andere Inventar ist gr\u00f6sser als deins.
invRestored = Dein Inventar wurde wieder hergestellt.
invSee = Du siehst das Inventar von {0}.
invSeeHelp = Benutze /invsee um dein Inventar wiederherzustellen.
-cantSpawnItem = \u00a7cDu darfst {0} nicht erzeugen.
-itemSpawn = \u00a77Gebe {0}x {1}
-jumpError = Das w\u00fcrde deinen Computer \u00fcberlasten.
-kickDefault = Vom Server geworfen
-kill = \u00a77{0} get\u00f6tet.
-noKits = \u00a77Es sind keine Ausr\u00fcstungen verf\u00fcgbar.
-kitError = \u00a7cEs gibt keine g\u00fcltigen Ausr\u00fcstungen.
-kitError2 = \u00a7cDiese Ausr\u00fcstung existiert nicht oder ist ung\u00fcltig.
-kitErrorHelp = \u00a7cEventuell fehlt bei einem Gegenstand die Menge?
-noKitPermission = \u00a7cDu brauchst die Berechtigung \u00a7c{0}\u00a7c um diese Ausr\u00fcstung anzufordern.
-kitTimed = \u00a7cDu kannst diese Ausr\u00fcstung nicht innerhalb von {0} anfordern.
-kitInvFull = \u00a7cDein Inventar ist voll, lege Ausr\u00fcstung auf den Boden
-kitGive = \u00a77Gebe Ausr\u00fcstung {0}.
-lightningUse = \u00a77Peinige {0}
-lightningSmited = \u00a77Du wurdest gepeinigt.
-connectedPlayers = Verbundene Spieler:
-noMail = Du hast keine Nachrichten
-mailClear = \u00a7cUm deine Nachrichten zu l\u00f6schen, schreibe /mail clear
-noMailSendPerm = \u00a7cDu hast die Rechte \u00a7fessentials.mail.send\u00a7c nicht.
-playerNeverOnServer = \u00a7cSpieler {0} war niemals auf diesem Server.
-mailSent = \u00a77Nachricht gesendet!
-mailCleared = \u00a77Nachrichten gel\u00f6scht!
-voiceSilenced = \u00a77Du bist stumm
-noMotd = \u00a7cEs existiert keine Willkommensnachricht."
-me = mir
-mutedPlayerFor = Player {0} ist nun stumm f\u00fcr {1}.
-mutedPlayer = Player {0} ist nun stumm.
-unmutedPlayer = Player {0} ist nicht mehr stumm.
-nickOthersPermission = \u00a7cDu hast keine Rechte um den Nicknamen von anderen zu \u00e4ndern.
-nickNoMore = \u00a7Du hast keinen Nicknamen mehr.
-nickNamesAlpha = \u00a7cNicknamen d\u00fcrfen nur alphanumerische Zeichen enthalten.
-nickInUse = \u00a7cDieser Name wird bereits verwendet.
-nickSet = \u00a77Dein Nickname ist nun \u00a7c{0}
-nickChanged = Nickname ge\u00e4ndert.
-pong = Pong!
-powerToolAir = Befehl kann nicht mit Luft verbunden werden.
-powerToolAttach = Befehl verbunden mit {0}
-powerToolRemove = Befehl entfernt von {0}
-foreverAlone = \u00a7cDu hast niemanden, dem du antworten kannst.
+invalidCharge = \u00a7cUng\u00fcltige Verf\u00fcgung.
+invalidMob = Ung\u00fcltiger Monstername.
+invalidServer = Ung\u00fcltiger Server!
+invalidSignLine = Die Zeile {0} auf dem Schild ist falsch.
+invalidWorld = \u00a7cUng\u00fcltige Welt.
+inventoryCleared = \u00a77Inventar geleert.
+inventoryClearedOthers = \u00a77Inventar von \u00a7c{0}\u00a77 geleert.
is = ist
-reloadAllPlugins = \u00a77Alle plugins neu geladen.
-noRules = \u00a7cEs wurden keine Regeln definiert.
-seenOnline = Spieler {0} ist online seit {1}
-seenOffline = Spieler {0} ist offline seit {1}
itemCannotBeSold = Dieser Gegenstand kann nicht verkauft werden.
itemMustBeStacked = Gegenstand muss als Stapel verkauft werden. Eine Anzahl von 2s verkauft 2 Stapel usw.
itemNotEnough1 = \u00a7cDu hast nicht genug Gegenst\u00e4nde zum Verkaufen.
itemNotEnough2 = \u00a77Wenn du alles verkaufen willst, nutze /sell itemname
itemNotEnough3 = \u00a77/sell itemname -1 verkauft alles bis auf eins usw.
+itemSellAir = Du versuchst Luft zu verkaufen? Nimm einen Gegenstand in die Hand.
itemSold = \u00a77Verkauft f\u00fcr \u00a7c{0}\u00a77 ({1} Einheiten je {2})
itemSoldConsole = {0} verkauft {1} f\u00fcr \u00a77{2}\u00a77 ({3} Einheiten je {4})
-itemSellAir = Du versuchst Luft zu verkaufen? Nimm einen Gegenstand in die Hand.
-homeSet = \u00a77Zuhause gesetzt.
+itemSpawn = \u00a77Gebe {0}x {1}
+itemsCsvNotLoaded = Konnte items.csv nicht laden.
+jailMessage = \u00a7cYou do the crime, you do the time.
+jailNotExist = Dieses Gef\u00e4ngnis existiert nicht.
jailSet = \u00a77Gef\u00e4ngnis {0} wurde erstellt.
-warpSet = \u00a77Warp-Punkt {0} wurde erstellt.
-worthSet = Wert des Gegenstands gesetzt.
-mobSpawnTarget = Zielblock, muss ein Monster-Spawner sein.
-mobSpawnError = Fehler beim \u00e4ndern des Monster-Spawner.
-invalidMob = Ung\u00fcltiger Monstername.
-unableToSpawnMob = Erzeugen von Monster gescheitert
-mobSpawnLimit = Anzahl an Monster auf Serverlimit beschr\u00e4nkt
-soloMob = Das Monster m\u00f6chte allein sein.
-numberRequired = Ein Zahl wird ben\u00f6tigt.
-spawned = erzeugt
-slimeMalformedSize = Ung\u00fcltige Gr\u00f6sse.
-sheepMalformedColor = Ung\u00fcltige Farbe.
-suicideMessage = \u00a77Lebewohl grausame Welt...
-suicideSuccess = \u00a77{0} hat sich das Leben genommen.
-tempBanned = Zeitlich gesperrt vom Server f\u00fcr {0}
-thunderDuration = Du hast Donner in deiner Welt {0} f\u00fcr {1} Sekunden.
-thunder = Du hast Donner in deiner Welt {0}.
-deleteFileError = Konnte Datei nicht l\u00f6schen: {0}
-userDoesNotExist = Spieler {0} existiert nicht.
-negativeBalanceError = Spieler darf keine Schulden machen.
-timeSet = Zeit gesetzt in allen Welten.
-onlyDayNight = /time unterst\u00fctzt nur day/night.
+jumpError = Das w\u00fcrde deinen Computer \u00fcberlasten.
+kickDefault = Vom Server geworfen
+kickExempt = \u00a7cDu kannst diesen Spieler nicht rauswerfen.
+kill = \u00a77{0} get\u00f6tet.
+kitError = \u00a7cEs gibt keine g\u00fcltigen Ausr\u00fcstungen.
+kitError2 = \u00a7cDiese Ausr\u00fcstung existiert nicht oder ist ung\u00fcltig.
+kitErrorHelp = \u00a7cEventuell fehlt bei einem Gegenstand die Menge?
+kitGive = \u00a77Gebe Ausr\u00fcstung {0}.
+kitInvFull = \u00a7cDein Inventar ist voll, lege Ausr\u00fcstung auf den Boden
+kitTimed = \u00a7cDu kannst diese Ausr\u00fcstung nicht innerhalb von {0} anfordern.
+kits = \u00a77Ausr\u00fcstungen: {0}
+lightningSmited = \u00a77Du wurdest gepeinigt.
+lightningUse = \u00a77Peinige {0}
+loadWarpError = Fehler beim Laden von Warp-Punkt {0}
+loadinfo = Plugin {0} Version {1} geladen, erstellt von {2}, \u00fcbersetzt von snowleo
+localFormat = Lokal: <{0}> {1}
+mailClear = \u00a7cUm deine Nachrichten zu l\u00f6schen, schreibe /mail clear
+mailCleared = \u00a77Nachrichten gel\u00f6scht!
+mailSent = \u00a77Nachricht gesendet!
+markMailAsRead = \u00a7cUm deine Nachrichten zu l\u00f6schen, schreibe /mail clear
+markedAsAway = \u00a77Du wirst als abwesend angezeigt.
+markedAsNotAway = \u00a77Du wirst nicht mehr als abwesend angezeigt.
mayNotJail = \u00a7cDu kannst diese Person nicht einsperren.
-userJailed = \u00a77Du wurdest eingesperrt.
+me = mir
+minute = Minute
+minutes = Minuten
+missingItems = Du ben\u00f6tigst {0}x {1}.
+missingPrefixSuffix = Prefix/Suffix fehlt f\u00fcr {0}
+mobSpawnError = Fehler beim \u00e4ndern des Monster-Spawner.
+mobSpawnLimit = Anzahl an Monster auf Serverlimit beschr\u00e4nkt
+mobSpawnTarget = Zielblock, muss ein Monster-Spawner sein.
+moneyRecievedFrom = \u00a7a{1} hat dir {0} gegeben.
+moneySentTo = \u00a7aDu hast {1} {0} gegeben.
+moneyTaken = {0} wurde aus deiner Geldb\u00f6rse genommen.
+month = Monat
+months = Monate
+moreThanZero = Anzahl muss gr\u00f6sser als 0 sein.
+msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
+mutedPlayer = Player {0} ist nun stumm.
+mutedPlayerFor = Player {0} ist nun stumm f\u00fcr {1}.
+mutedUserSpeaks = {0} versuchte zu sprechen, aber ist stumm geschalt.
+needTpohere = Du brauchst Zugriff auf /tpohere um andere Spieler teleportieren zu k\u00f6nnen.
+negativeBalanceError = Spieler darf keine Schulden machen.
+nickChanged = Nickname ge\u00e4ndert.
+nickInUse = \u00a7cDieser Name wird bereits verwendet.
+nickNamesAlpha = \u00a7cNicknamen d\u00fcrfen nur alphanumerische Zeichen enthalten.
+nickNoMore = \u00a7Du hast keinen Nicknamen mehr.
+nickOthersPermission = \u00a7cDu hast keine Rechte um den Nicknamen von anderen zu \u00e4ndern.
+nickSet = \u00a77Dein Nickname ist nun \u00a7c{0}
+noAccessCommand = \u00a7cDu hast keinen Zugriff auf diesen Befehl.
+noAccessPermission = \u00a7cDu hast keine Rechte, den Block {0} zu \u00f6ffnen.
+noDestroyPermission = \u00a7cDu hast keine Rechte, den Block {0} zu zerst\u00f6ren.
+noHomeSet = Du hast kein Zuhause gesetzt.
+noHomeSetPlayer = Spieler hat kein Zuhause gesetzt.
+noKitPermission = \u00a7cDu brauchst die Berechtigung \u00a7c{0}\u00a7c um diese Ausr\u00fcstung anzufordern.
+noKits = \u00a77Es sind keine Ausr\u00fcstungen verf\u00fcgbar.
+noMail = Du hast keine Nachrichten
+noMailSendPerm = \u00a7cDu hast die Rechte \u00a7fessentials.mail.send\u00a7c nicht.
+noMotd = \u00a7cEs existiert keine Willkommensnachricht."
+noNewMail = \u00a77Du hast keine Nachrichten.
+noPendingRequest = Du hast keine Teleportierungsanfragen.
+noPlacePermission = \u00a7cDu hast keine Rechte, einen Block in der N\u00e4he des Schildes zu platzieren.
+noRules = \u00a7cEs wurden keine Regeln definiert.
+noWarpsDefined = Keine Warp-Punkte erstellt.
+none = keine
+notAllowedToQuestion = \u00a7cDu bist nicht berechtigt zu fragen.
+notAllowedToShout = \u00a7cDu bist nicht berechtigt zu schreien.
+notEnoughMoney = Du hast nicht genug Geld.
+notRecommendedBukkit = Die verwendete Bukkit-Version ist nicht empfohlen f\u00fcr Essentials.
+notSupportedYet = Noch nicht verf\u00fcgbar.
+now = jetzt
+numberRequired = Ein Zahl wird ben\u00f6tigt.
+onlyDayNight = /time unterst\u00fctzt nur day/night.
+onlyPlayers = Nur Spieler k\u00f6nnen {0} benutzen.
+onlySunStorm = /weather unterst\u00fctzt nur sun/storm.
+parseError = Fehler beim Parsen von {0} in Zeile {1}
+pendingTeleportCancelled = \u00a7cLaufende Teleportierung abgebrochen.
+permissionsError = Permissions/GroupManager fehlt; Chat-Prefixe/-Suffixe sind ausgeschaltet.
+playerBanned = \u00a7cSpieler {0} gesperrt: {1}
+playerInJail = \u00a7cSpieler ist bereits in Gef\u00e4ngnis {0}.
playerJailed = \u00a77Spieler {0} eingesperrt.
playerJailedFor = \u00a77Spieler {0} eingesperrt f\u00fcr {1}.
-playerInJail = \u00a7cSpieler ist bereits in Gef\u00e4ngnis {0}.
-teleportTop = \u00a77Teleportiere nach oben.
-teleporting = \u00a77Teleportiere...
-teleportDisabled = {0} verweigert die Teleportierung.
-needTpohere = Du brauchst Zugriff auf /tpohere um andere Spieler teleportieren zu k\u00f6nnen.
+playerKicked = \u00a7cSpieler {0} rausgeworfen: {1}
+playerNeverOnServer = \u00a7cSpieler {0} war niemals auf diesem Server.
+playerNotFound = \u00a7cSpieler nicht gefunden.
+pong = Pong!
+possibleWorlds = \u00a77M\u00f6gliche Welten sind nummeriet von 0 bis {0}.
+powerToolAir = Befehl kann nicht mit Luft verbunden werden.
+powerToolAttach = Befehl verbunden mit {0}
+powerToolRemove = Befehl entfernt von {0}
+protectionOwner = \u00a76[EssentialsProtect] Besitzer dieses Blocks: {0}
+questionFormat = \u00a77[Frage]\u00a7f {0}
+reloadAllPlugins = \u00a77Alle plugins neu geladen.
+requestAccepted = \u00a77Teleportierungsanfrage akzeptiert.
+requestDenied = \u00a77Teleportierungsanfrage verweigert.
+requestSent = \u00a77Anfrage gesendet an {0}\u00a77.
+returnPlayerToJailError = Fehler beim Versuch, den Spieler ins Gef\u00e4ngnis zu teleportieren.
+second = Sekunde
+seconds = Sekunden
+seenOffline = Spieler {0} ist offline seit {1}
+seenOnline = Spieler {0} ist online seit {1}
+serverFull = Server ist voll
+sheepMalformedColor = Ung\u00fcltige Farbe.
+shoutFormat = \u00a77[Schrei]\u00a7f {0}
+similarWarpExist = Ein Warp-Punkt mit einem \u00e4hnlichen Namen existiert bereits.
+slimeMalformedSize = Ung\u00fcltige Gr\u00f6sse.
+soloMob = Das Monster m\u00f6chte allein sein.
+spawnSet = \u00a77Spawn-Punkt gesetzt f\u00fcr Gruppe {0}.
+spawned = erzeugt
+suicideMessage = \u00a77Lebewohl grausame Welt...
+suicideSuccess = \u00a77{0} hat sich das Leben genommen.
+takenFromAccount = \u00a7c{0} wurden aus deiner Geldb\u00f6rse genommen.
+takenFromOthersAccount = \u00a7c{0} wurde von {1} wurde Rechnung getragen.
+teleportAll = \u00a77Teleportiere alle Spieler...
teleportAtoB = \u00a77{0}\u00a77 teleportiert dich zu {1}\u00a77.
+teleportDisabled = {0} verweigert die Teleportierung.
+teleportHereRequest = \u00a7c{0}\u00a7c fragt, ob du dich zu ihm teleportierst.
+teleportNewPlayerError = Fehler beim Teleportieren eines neuen Spielers
teleportRequest = \u00a7c{0}\u00a7c fragt, ob er sich zu dir teleportieren darf.
+teleportTop = \u00a77Teleportiere nach oben.
+teleportationCommencing = \u00a77Teleportierung started...
+teleportationDisabled = \u00a77Teleportierung deaktiviert.
+teleportationEnabled = \u00a77Teleportierung aktiviert.
+teleporting = \u00a77Teleportiere...
+teleportingPortal = \u00a77Teleportiere durch Portal.
+tempBanned = Zeitlich gesperrt vom Server f\u00fcr {0}
+tempbanExempt = \u00a77Du kannst diesen Spieler nicht zeitlich sperren.
+thunder = Du hast Donner in deiner Welt {0}.
+thunderDuration = Du hast Donner in deiner Welt {0} f\u00fcr {1} Sekunden.
+timeBeforeHeal = Zeit bis zur n\u00e4chsten Heilung: {0}
+timeBeforeTeleport = Zeit bis zum n\u00e4chsten Teleport: {0}
+timePattern = (?:([0-9]+)\\s*[yj][a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[dt][a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:h|st)[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
+timeSet = Zeit gesetzt in allen Welten.
+tradeCompleted = \u00a77Handel abgeschlossen.
+tradeSignEmpty = Der Bestand des Trade-Schild ist aufgebraucht.
+treeFailure = \u00a7cBaumpflanzung gescheitert. Versuche es auf Gras oder Dreck.
+treeSpawned = \u00a77Baum gepflanzt.
typeTpaccept = \u00a77Um zu teleportieren, schreibe \u00a7c/tpaccept\u00a77.
typeTpdeny = \u00a77Um diese Anfrage abzulehnen, schreibe \u00a7c/tpdeny\u00a77.
-requestSent = \u00a77Anfrage gesendet an {0}\u00a77.
-teleportHereRequest = \u00a7c{0}\u00a7c fragt, ob du dich zu ihm teleportierst.
-teleportAll = \u00a77Teleportiere alle Spieler...
-noPendingRequest = Du hast keine Teleportierungsanfragen.
-requestDenied = \u00a77Teleportierungsanfrage verweigert.
-requestAccepted = \u00a77Teleportierungsanfrage akzeptiert.
-teleportationEnabled = \u00a77Teleportierung aktiviert.
-teleportationDisabled = \u00a77Teleportierung deaktiviert.
-treeSpawned = \u00a77Baum gepflanzt.
-treeFailure = \u00a7cBaumpflanzung gescheitert. Versuche es auf Gras oder Dreck.
-unbannedPlayer = Verbannung von Spieler r\u00fcckg\u00e4ngig gemacht.
+typeWorldName = \u00a77Du kannst auch den Namen der Welt eingeben.
+unableToSpawnMob = Erzeugen von Monster gescheitert
+unableToSpawnMob = Fehler beim Erzeugen von Monster.
unbannedIP = Verbannung von IP-Adresse r\u00fcckg\u00e4ngig gemacht.
-unlimitedItems = Unendliche Objekte:
-none = keine
+unbannedPlayer = Verbannung von Spieler r\u00fcckg\u00e4ngig gemacht.
+unignorePlayer = Du ignorierst Spieler {0} nicht mehr.
+unknownItemId = Unbekannte Item-Id: {0}
+unknownItemInList = Unbekannter Gegenstand {0} in Liste {1}.
+unknownItemName = Unbekannter Gegenstand: {0}
unlimitedItemPermission = \u00a7cDu hast keine Rechte f\u00fcr {0}.
-disableUnlimited = \u00a77Deaktiviere unendliches Platzieren von {0} f\u00fcr {1}.
-enableUnlimited = \u00a77Gebe {1} unendliche Mengen von {0}.
+unlimitedItems = Unendliche Objekte:
+unmutedPlayer = Player {0} ist nicht mehr stumm.
+upgradingFilesError = Fehler beim Aktualisieren der Dateien
+userCreatedPortal = {0} benutzt ein Portal und hat ein Ausgangsportal erstellt.
+userDoesNotExist = Spieler {0} existiert nicht.
+userIsAway = {0} ist abwesend.
+userIsNotAway = {0} ist wieder da.
+userJailed = \u00a77Du wurdest eingesperrt.
+userUsedPortal = {0} benutzt ein vorhandenes Ausgangsportal.
+userdataMoveBackError = Verschieben von userdata/{0}.tmp nach userdata/{1} gescheitert.
+userdataMoveError = Verschieben von userdata/{0} nach userdata/{1}.tmp gescheitert.
+usingPortal = \u00a77Teleportiere durch Portal zum Ausgangsportal.
+usingTempFolderForTesting = Benutze tempor\u00e4ren Ordner zum Testen:
+versionMismatch = Versionen nicht identisch! Bitte aktualisiere {0}.
+versionMismatchAll = Versionen ungleich! Bitte aktualisiere alle Essentials jars auf die gleiche Version.
+voiceSilenced = \u00a77Du bist stumm
+warpDeleteError = Fehler beim L\u00f6schen der Warp-Datei.
warpListPermission = \u00a7cDu hast keine Berechtigung, die Warp-Punkte anzuzeigen.
-noWarpsDefined = Keine Warp-Punkte erstellt.
+warpNotExist = Warp-Punkt existiert nicht.
+warpSet = \u00a77Warp-Punkt {0} wurde erstellt.
warpUsePermission = \u00a7cDu hast keinen Zugriff auf diesen Warp-Punkt.
-weatherSunFor = \u00a77Du hast das Wetter zu Sonne f\u00fcr {0} Sekunden in deiner Welt ge\u00e4ndert.
-weatherSun = \u00a77Du hast das Wetter zu Sonne in deiner Welt ge\u00e4ndert.
-weatherStormFor = \u00a77Du hast das Wetter zu Sturm f\u00fcr {0} Sekunden in deiner Welt ge\u00e4ndert.
+warpingTo = \u00a77Teleportiere zu Warp-Punkt {0}.
weatherStorm = \u00a77Du hast das Wetter zu Sturm in deiner Welt ge\u00e4ndert.
-whoisIs = {0} ist {1}
+weatherStormFor = \u00a77Du hast das Wetter zu Sturm f\u00fcr {0} Sekunden in deiner Welt ge\u00e4ndert.
+weatherSun = \u00a77Du hast das Wetter zu Sonne in deiner Welt ge\u00e4ndert.
+weatherSunFor = \u00a77Du hast das Wetter zu Sonne f\u00fcr {0} Sekunden in deiner Welt ge\u00e4ndert.
+whoisGeoLocation = \u00a79 - Herkunft: {0}
whoisHealth = \u00a79 - Gesundheit: {0}/20
+whoisIPAddress = \u00a79 - IP-Adresse: {0}
+whoisIs = {0} ist {1}
whoisLocation = \u00a79 - Position: ({0}, {1}, {2}, {3})
whoisMoney = \u00a79 - Geldb\u00f6rse: {0}
-whoisStatusAway = \u00a79 - Status: \u00a7cAbwesend\u00a7f
whoisStatusAvailable = \u00a79 - Status: Anwesend
-whoisIPAddress = \u00a79 - IP-Adresse: {0}
-whoisGeoLocation = \u00a79 - Herkunft: {0}
-invalidWorld = \u00a7cUng\u00fcltige Welt.
-possibleWorlds = \u00a77M\u00f6gliche Welten sind nummeriet von 0 bis {0}.
-typeWorldName = \u00a77Du kannst auch den Namen der Welt eingeben.
+whoisStatusAway = \u00a79 - Status: \u00a7cAbwesend\u00a7f
worth = \u00a77Ein Stapel von {0} ist \u00a7c{1}\u00a77 wert ({2} Einheiten je {3})
worthMeta = \u00a77Ein Stapel von {0} mit Metadaten {1} ist \u00a7c{2}\u00a77 wert. ({3} Einheiten je {4})
-onlyPlayers = Nur Spieler k\u00f6nnen {0} benutzen.
-unignorePlayer = Du ignorierst Spieler {0} nicht mehr.
-ignorePlayer = Du ignorierst ab jetzt Spieler {0}.
-illegalDate = Ung\u00fcltiges Datumsformat.
-timePattern = (?:([0-9]+)\\s*[yj][a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[dt][a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:h|st)[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
-msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
-kits = \u00a77Ausr\u00fcstungen: {0}
-loadWarpError = Fehler beim Laden von Warp-Punkt {0}
-invalidSignLine = Die Zeile {0} auf dem Schild ist falsch.
\ No newline at end of file
+worthSet = Wert des Gegenstands gesetzt.
+year = Jahr
+years = Jahre
+youAreHealed = \u00a77Du wurdest geheilt.
+youHaveNewMail = \u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen.
+invalidCharge = \u00a7cUng\u00fcltige Verf\u00fcgung.
\ No newline at end of file
diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties
index 261c2237e..d65e6fd7f 100644
--- a/Essentials/src/messages_en.properties
+++ b/Essentials/src/messages_en.properties
@@ -1,308 +1,323 @@
#version: TeamCity
# Single quotes have to be doubled: ''
# Translations start here
-loadinfo = Loaded {0} build {1} by {2}
-markedAsNotAway = \u00a77You are no longer marked as away.
-markedAsAway = \u00a77You are now marked as away.
-userIsNotAway = {0} is no longer AFK
-userIsAway = {0} is now AFK
-backupStarted = Backup started
+addedToAccount = \u00a7a{0} has been added to your account.
+addedToOthersAccount = \u00a7a{0} has been added to {1} account.
+alertBroke = broke:
+alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3}
+alertPlaced = placed:
+alertUsed = used:
+backAfterDeath = \u00a77Use the /back command to return to your death point.
+backUsageMsg = \u00a77Returning to previous location.
backupFinished = Backup finished
-invalidServer = Invalid server!
-usingTempFolderForTesting = Using temp folder for testing:
-versionMismatch = Version mismatch! Please update {0} to the same version.
-notRecommendedBukkit = Bukkit version is not the recommended build for Essentials.
-bukkitFormatChanged = Bukkit version format changed. Version not checked.
-itemsCsvNotLoaded = Could not load items.csv.
-corruptNodeInConfig = \u00a74Notice: Your configuration file has a corrupt {0} node.
-youHaveNewMail = \u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
-commandNotLoaded = \u00a7cCommand {0} is improperly loaded.
-deniedAccessCommand = {0} was denied access to command.
-noAccessCommand = \u00a7cYou do not have access to that command.
-errorCallingCommand = Error calling command /{0}
-commandFailed = Command {0} failed:
-bannedPlayersFileNotFound = banned-players.txt not found
-bannedPlayersFileError = Error reading banned-players.txt
-bannedIpsFileNotFound = banned-ips.txt not found
+backupStarted = Backup started
+balance = \u00a77Balance: {0}
+balanceTop = \u00a77 Top {0} balances
+banIpAddress = \u00a77Banned IP address
+banExempt = \u00a7cYou can not ban that player.
bannedIpsFileError = Error reading banned-ips.txt
-noDestroyPermission = \u00a7cYou do not have permission to destroy that {0}.
-noAccessPermission = \u00a7cYou do not have permission to access that {0}.
-moreThanZero = Quantities must be greater than 0.
-errorWithMessage = \u00a7cError: {0}
+bannedIpsFileNotFound = banned-ips.txt not found
+bannedPlayersFileError = Error reading banned-players.txt
+bannedPlayersFileNotFound = banned-players.txt not found
+bigTreeFailure = \u00a7cBig tree generation failure. Try again on grass or dirt.
+bigTreeSuccess = \u00a77Big tree spawned.
+broadcast = [\u00a7cBroadcast\u00a7f]\u00a7a {0}
+buildAlert = \u00a7cYou are not permitted to build
+bukkitFormatChanged = Bukkit version format changed. Version not checked.
+burnMsg = \u00a77You set {0} on fire for {1} seconds.
+canTalkAgain = \u00a77You can talk again
+cantFindGeoIpDB = Can''t find GeoIP database!
+cantReadGeoIpDB = Failed to read GeoIP database!
+cantSpawnItem = \u00a7cYou are not allowed to spawn the item {0}
+commandFailed = Command {0} failed:
+commandNotLoaded = \u00a7cCommand {0} is improperly loaded.
+compassBearing = \u00a77Bearing: {0} ({1} degrees).
+configFileMoveError = Failed to move config.yml to backup location.
+configFileRenameError = Failed to rename temp file to config.yml
+connectedPlayers = Connected players:
+connectionFailed = Failed to open connection.
+cooldownWithMessage = \u00a7cCooldown: {0}
+corruptNodeInConfig = \u00a74Notice: Your configuration file has a corrupt {0} node.
+couldNotFindTemplate = Could not find template {0}
creatingConfigFromTemplate = Creating config from template: {0}
creatingEmptyConfig = Creating empty config: {0}
-failedToCreateConfig = Failed to create config {0}
-couldNotFindTemplate = Could not find template {0}
-failedToWriteConfig = Failed to write config {0}
-failedToCloseConfig = Failed to close config {0}
-notEnoughMoney = You do not have sufficient funds.
-missingItems = You do not have {0}x {1}.
-tradeSignEmpty = The trade sign does not have enough supply left.
-tradeCompleted = \u00a77Trade completed.
-backAfterDeath = \u00a77Use the /back command to return to your death point.
-mutedUserSpeaks = {0} tried to speak, but is muted.
-userCreatedPortal = {0} used a portal and generated an exit portal.
-generatingPortal = \u00a77Generating an exit portal.
-userUsedPortal = {0} used an existing exit portal.
-usingPortal = \u00a77Teleporting via portal to an existing portal.
-teleportingPortal = \u00a77Teleporting via portal.
-freedMemory = Freed {0} MB.
+creatingPortal = Creating portal at {0},{1},{2}.
+day = day
+days = days
defaultBanReason = The Ban Hammer has spoken!
-noNewMail = \u00a77You have no new mail.
-serverFull = Server is full
-returnPlayerToJailError = Error occured when trying to return player to jail.
-jailMessage = \u00a7cYou do the crime, you do the time.
-homeSetToBed = \u00a77Your home is now set to this bed.
-moneyTaken = {0} taken from your bank account.
-youAreHealed = \u00a77You have been healed.
-markMailAsRead = \u00a7cTo mark your mail as read, type /mail clear
-balance = \u00a77Balance: {0}
-backUsageMsg = \u00a77Returning to previous location.
-playerBanned = \u00a7cPlayer {0} banned
-banIpAddress = \u00a77Banned IP address
-bigTreeSuccess = \u00a77Big tree spawned.
-bigTreeFailure = \u00a7cBig tree generation failure. Try again on grass or dirt.
-broadcast = [\u00a7cBroadcast\u00a7f]\u00a7a {0}
-burnMsg = \u00a77You set {0} on fire for {1} seconds.
-playerNotFound = \u00a7cPlayer not found.
-inventoryCleared = \u00a77Inventory Cleared.
-inventoryClearedOthers = \u00a77Inventory of \u00a7c{0}\u00a77 cleared.
-compassBearing = \u00a77Bearing: {0} ({1} degrees).
+deleteFileError = Could not delete file: {0}
deleteJail = \u00a77Jail {0} has been removed.
deleteWarp = \u00a77Warp {0} has been removed.
+deniedAccessCommand = {0} was denied access to command.
+dependancyDownloaded = [Essentials] Dependancy {0} downloaded successfully.
+dependancyException = [Essentials] An error occured when trying to download a dependacy
+dependancyNotFound = [Essentials] A required dependancy was not found, downloading now.
depth = \u00a77You are at sea level.
depthAboveSea = \u00a77You are {0} block(s) above sea level.
depthBelowSea = \u00a77You are {0} block(s) below sea level.
+destinationNotSet = Destination not set
+disableUnlimited = \u00a77Disabled unlimited placing of {0} for {1}.
+disabled = disabled
+dontMoveMessage = \u00a77Teleportation will commence in {0}. Don''t move.
+downloadingGeoIp = Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB)
+duplicatedUserdata = Duplicated userdata: {0} and {1}
+emptyWorldName = Set Home: World name is null or empty.
+enableUnlimited = \u00a77Giving unlimited amount of {0} to {1}.
+enabled = enabled
+errorCallingCommand = Error calling command /{0}
+errorWithMessage = \u00a7cError: {0}
+essentialsReload = \u00a77Essentials Reloaded {0}
extinguish = \u00a77You extinguished yourself.
extinguishOthers = \u00a77You extinguished {0}.
-canTalkAgain = \u00a77You can talk again
-haveBeenReleased = \u00a77You have been released
-upgradingFilesError = Error while upgrading the files
-configFileMoveError = Failed to move config.yml to backup location.
-configFileRenameError = Failed to rename temp file to config.yml
+failedToCloseConfig = Failed to close config {0}
+failedToCreateConfig = Failed to create config {0}
+failedToWriteConfig = Failed to write config {0}
fileRenameError = Renaming file {0} failed
-userdataMoveError = Failed to move userdata/{0} to userdata/{1}.tmp
-duplicatedUserdata = Duplicated userdata: {0} and {1}
-userdataMoveBackError = Failed to move userdata/{0}.tmp to userdata/{1}
-parseError = Error parsing {0} on line {1}
-unknownItemName = Unknown item name: {0}
-unknownItemId = Unknown item id: {0}
-jailNotExist = That jail does not exist.
-unableToSpawnMob = Unable to spawn mob.
-creatingPortal = Creating portal at {0},{1},{2}.
-notSupportedYet = Not supported yet.
-unknownItemInList = Unknown item {0} in {1} list.
-teleportationCommencing = \u00a77Teleportation commencing...
-cooldownWithMessage = \u00a7cCooldown: {0}
-warpingTo = \u00a77Warping to {0}.
-timeBeforeTeleport = Time before next teleport: {0}
-pendingTeleportCancelled = \u00a7cPending teleportation request cancelled.
-dontMoveMessage = \u00a77Teleportation will commence in {0}. Don''t move.
-noHomeSet = You have not set a home.
-noHomeSetPlayer = Player has not set a home.
-timeBeforeHeal = Time before next heal: {0}
-addedToAccount = \u00a7a{0} has been added to your account.
-moneySentTo = \u00a7a{0} has been sent to {1}
-moneyRecievedFrom = \u00a7a{0} has been recieved from {1}
-takenFromAccount = \u00a7c{0} has been taken from your account.
-emptyWorldName = Set Home: World name is null or empty.
-now = now
-year = year
-years = years
-month = month
-months = months
-day = day
-days = days
-hour = hour
-hours = hours
-minute = minute
-minutes = minutes
-second = second
-seconds = seconds
-destinationNotSet = Destination not set
-holeInFloor = Hole in floor
-warpNotExist = That warp does not exist.
-similarWarpExist = A warp with a similar name already exists.
-warpDeleteError = Problem deleting the warp file.
-versionMismatchAll = Version mismatch! Please update all Essentials jars to the same version.
-missingPrefixSuffix = Missing a prefix or suffix for {0}
-permissionsError = Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled.
-shoutFormat = \u00a77[Shout]\u00a7f {0}
-notAllowedToShout = \u00a7cYou are not authorized to shout.
-questionFormat = \u00a77[Question]\u00a7f {0}
-notAllowedToQuestion = \u00a7cYou are not authorized to use question.
-localFormat = Local: <{0}> {1}
-geoipJoinFormat = Player {0} comes from {1}
-cantFindGeoIpDB = Can''t find GeoIP database!
-cantReadGeoIpDB = Failed to read GeoIP database!
-geoIpUrlEmpty = GeoIP download url is empty.
-downloadingGeoIp = Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB)
-geoIpUrlInvalid = GeoIP download url is invalid.
-connectionFailed = Failed to open connection.
-alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3}
-alertPlaced = placed:
-alertBroke = broke:
-alertUsed = used:
-buildAlert = \u00a7cYou are not permitted to build
-protectionOwner = \u00a76[EssentialsProtect] Protection owner: {0}
-spawnSet = \u00a77Spawn location set for group {0}.
-teleportNewPlayerError = Failed to teleport new player
-essentialsReload = \u00a77Essentials Reloaded {0}
-gcmax = Maximum memory: {0} MB
-gcmin = Minimum memory: {0} MB
+foreverAlone = \u00a7cYou have nobody to whom you can reply.
+freedMemory = Freed {0} MB.
gcchunks = chunks,
gcentities = entities
-godMode = \u00a77God mode {0}.
-enabled = enabled
-disabled = disabled
-godEnabledFor = enabled for {0}
+gcfree = Free memory: {0} MB
+gcmax = Maximum memory: {0} MB
+gctotal = Allocated memory: {0} MB
+generatingPortal = \u00a77Generating an exit portal.
+geoIpUrlEmpty = GeoIP download url is empty.
+geoIpUrlInvalid = GeoIP download url is invalid.
+geoipJoinFormat = Player {0} comes from {1}
godDisabledFor = disabled for {0}
+godEnabledFor = enabled for {0}
+godMode = \u00a77God mode {0}.
+haveBeenReleased = \u00a77You have been released
heal = \u00a77You have been healed.
healOther = \u00a77Healed {0}.
-helpPages = Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f:
helpConsole = To view help from the console, type ?.
helpOp = \u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1}
+helpPages = Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f:
+holeInFloor = Hole in floor
+homeSet = \u00a77Home set.
+homeSetToBed = \u00a77Your home is now set to this bed.
+hour = hour
+hours = hours
+ignorePlayer = You ignore player {0} from now on.
+illegalDate = Illegal date format.
+infoChapter = Select chapter:
+infoChapterPages = Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f:
infoFileDoesNotExist = File info.txt does not exist. Creating one for you.
infoPages = Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f:
-infoChapter = Select chapter:
infoUnknownChapter = Unknown chapter.
-infoChapterPages = Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f:
invBigger = The other users inventory is bigger than yours.
invRestored = Your inventory has been restored.
invSee = You see the inventory of {0}.
invSeeHelp = Use /invsee to restore your inventory.
-cantSpawnItem = \u00a7cYou are not allowed to spawn the item {0}
-itemSpawn = \u00a77Giving {0} of {1}
-jumpError = That would hurt your computer''s brain.
-kickDefault = Kicked from server
-kill = \u00a77Killed {0}.
-noKits = \u00a77There are no kits available yet
-kitError = \u00a7cThere are no valid kits.
-kitError2 = \u00a7cThat kit does not exist or is improperly defined.
-kitErrorHelp = \u00a7cPerhaps an item is missing a quantity in the configuration?
-noKitPermission = \u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit.
-kitTimed = \u00a7cYou can''t use that kit again for another {0}.
-kitInvFull = \u00a7cYour inventory was full, placing kit on the floor
-kitGive = \u00a77Giving kit {0}.
-lightningUse = \u00a77Smiting {0}
-lightningSmited = \u00a77You have just been smited
-connectedPlayers = Connected players:
-noMail = You do not have any mail
-mailClear = \u00a7cTo mark your mail as read, type /mail clear
-noMailSendPerm = \u00a7cYou do not have the \u00a7fessentials.mail.send\u00a7c permission.
-playerNeverOnServer = \u00a7cPlayer {0} was never on this server.
-mailSent = \u00a77Mail sent!
-mailCleared = \u00a77Mail Cleared!
-voiceSilenced = \u00a77Your voice has been silenced
-noMotd = \u00a7cThere is no message of the day."
-me = me
-mutedPlayerFor = Player {0} muted for {1}.
-mutedPlayer = Player {0} muted.
-unmutedPlayer = Player {0} unmuted.
-nickOthersPermission = \u00a7cYou do not have permission to change the nickname of others
-nickNoMore = \u00a7You no longer have a nickname.
-nickNamesAlpha = \u00a7cNicknames must be alphanumeric.
-nickInUse = \u00a7cThat name is already in use.
-nickSet = \u00a77Your nickname is now \u00a7c{0}
-nickChanged = Nickname changed.
-pong = Pong!
-powerToolAir = Command can''t be attached to air.
-powerToolAttach = Command assigned to {0}
-powerToolRemove = Command removed from {0}
-foreverAlone = \u00a7cYou have nobody to whom you can reply.
+invalidCharge = \u00a7cInvalid charge.
+invalidMob = Invalid mob type.
+invalidServer = Invalid server!
+invalidSignLine = Line {0} on sign is invalid.
+invalidWorld = \u00a7cInvalid world.
+inventoryCleared = \u00a77Inventory Cleared.
+inventoryClearedOthers = \u00a77Inventory of \u00a7c{0}\u00a77 cleared.
is = is
-reloadAllPlugins = \u00a77Reloaded all plugins.
-noRules = \u00a7cThere are no rules specified yet.
-seenOnline = Player {0} is online since {1}
-seenOffline = Player {0} is offline since {1}
itemCannotBeSold = That item cannot be sold to the server.
itemMustBeStacked = Item must be traded in stacks. A quantity of 2s would be two stacks, etc.
itemNotEnough1 = \u00a7cYou do not have enough of that item to sell.
itemNotEnough2 = \u00a77If you meant to sell all of your items of that type, use /sell itemname
itemNotEnough3 = \u00a77/sell itemname -1 will sell all but one item, etc.
+itemSellAir = You really tried to sell Air? Put an item in your hand.
itemSold = \u00a77Sold for \u00a7c {0} \u00a77 ({1} items at {2} each)
itemSoldConsole = {0} sold {1} for \u00a77 {2} \u00a77 ({3} items at {4} each)
-itemSellAir = You really tried to sell Air? Put an item in your hand.
-homeSet = \u00a77Home set.
+itemSpawn = \u00a77Giving {0} of {1}
+itemsCsvNotLoaded = Could not load items.csv.
+jailMessage = \u00a7cYou do the crime, you do the time.
+jailNotExist = That jail does not exist.
jailSet = \u00a77Jail {0} has been set
-warpSet = \u00a77Warp {0} set.
-worthSet = Worth value set
-mobSpawnTarget = Target block must be a mob spawner.
-mobSpawnError = Error while changing mob spawner.
-invalidMob = Invalid mob type.
-unableToSpawnMob = Unable to spawn mob.
-mobSpawnLimit = Mob quantity limited to server limit
-soloMob = That mob likes to be alone
-numberRequired = A number goes there, silly.
-spawned = spawned
-slimeMalformedSize = Malformed size.
-sheepMalformedColor = Malformed color.
-suicideMessage = \u00a77Goodbye Cruel World...
-suicideSuccess = \u00a77{0} took their own life
-tempBanned = Temporarily banned from server for {0}
-thunderDuration = You {0} thunder in your world for {1} seconds.
-thunder = You {0} thunder in your world
-deleteFileError = Could not delete file: {0}
-userDoesNotExist = The user {0} does not exist.
-negativeBalanceError = User is not allowed to have a negative balance.
-timeSet = Time set in all worlds.
-onlyDayNight = /time only supports day/night.
+jumpError = That would hurt your computer''s brain.
+kickDefault = Kicked from server
+kickExempt = \u00a7cYou can not kick that person.
+kill = \u00a77Killed {0}.
+kitError = \u00a7cThere are no valid kits.
+kitError2 = \u00a7cThat kit does not exist or is improperly defined.
+kitErrorHelp = \u00a7cPerhaps an item is missing a quantity in the configuration?
+kitGive = \u00a77Giving kit {0}.
+kitInvFull = \u00a7cYour inventory was full, placing kit on the floor
+kitTimed = \u00a7cYou can''t use that kit again for another {0}.
+kits = \u00a77Kits: {0}
+lightningSmited = \u00a77You have just been smited
+lightningUse = \u00a77Smiting {0}
+loadWarpError = Failed to load warp {0}
+loadinfo = Loaded {0} build {1} by {2}
+localFormat = Local: <{0}> {1}
+mailClear = \u00a7cTo mark your mail as read, type /mail clear
+mailCleared = \u00a77Mail Cleared!
+mailSent = \u00a77Mail sent!
+markMailAsRead = \u00a7cTo mark your mail as read, type /mail clear
+markedAsAway = \u00a77You are now marked as away.
+markedAsNotAway = \u00a77You are no longer marked as away.
mayNotJail = \u00a7cYou may not jail that person
-userJailed = \u00a77You have been jailed
+me = me
+minute = minute
+minutes = minutes
+missingItems = You do not have {0}x {1}.
+missingPrefixSuffix = Missing a prefix or suffix for {0}
+mobSpawnError = Error while changing mob spawner.
+mobSpawnLimit = Mob quantity limited to server limit
+mobSpawnTarget = Target block must be a mob spawner.
+moneyRecievedFrom = \u00a7a{0} has been recieved from {1}
+moneySentTo = \u00a7a{0} has been sent to {1}
+moneyTaken = {0} taken from your bank account.
+month = month
+months = months
+moreThanZero = Quantities must be greater than 0.
+msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
+mutedPlayer = Player {0} muted.
+mutedPlayerFor = Player {0} muted for {1}.
+mutedUserSpeaks = {0} tried to speak, but is muted.
+needTpohere = You need access to /tpohere to teleport other players.
+negativeBalanceError = User is not allowed to have a negative balance.
+nickChanged = Nickname changed.
+nickInUse = \u00a7cThat name is already in use.
+nickNamesAlpha = \u00a7cNicknames must be alphanumeric.
+nickNoMore = \u00a77You no longer have a nickname.
+nickOthersPermission = \u00a7cYou do not have permission to change the nickname of others
+nickSet = \u00a77Your nickname is now \u00a7c{0}
+noAccessCommand = \u00a7cYou do not have access to that command.
+noAccessPermission = \u00a7cYou do not have permission to access that {0}.
+noDestroyPermission = \u00a7cYou do not have permission to destroy that {0}.
+noHelpFound = \u00a7cNo matching commands.
+noHomeSet = You have not set a home.
+noHomeSetPlayer = Player has not set a home.
+noKitPermission = \u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit.
+noKits = \u00a77There are no kits available yet
+noMail = You do not have any mail
+noMailSendPerm = \u00a7cYou do not have the \u00a7fessentials.mail.send\u00a7c permission.
+noMotd = \u00a7cThere is no message of the day."
+noNewMail = \u00a77You have no new mail.
+noPendingRequest = You do not have a pending request.
+noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
+noRules = \u00a7cThere are no rules specified yet.
+noWarpsDefined = No warps defined
+none = none
+notAllowedToQuestion = \u00a7cYou are not authorized to use question.
+notAllowedToShout = \u00a7cYou are not authorized to shout.
+notEnoughMoney = You do not have sufficient funds.
+notRecommendedBukkit = Bukkit version is not the recommended build for Essentials.
+notSupportedYet = Not supported yet.
+now = now
+numberRequired = A number goes there, silly.
+onlyDayNight = /time only supports day/night.
+onlyPlayers = Only in-game players can use {0}.
+onlySunStorm = /weather only supports sun/storm.
+parseError = Error parsing {0} on line {1}
+pendingTeleportCancelled = \u00a7cPending teleportation request cancelled.
+permissionsError = Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled.
+playerBanned = \u00a7cPlayer {0} banned: {1}
+playerInJail = \u00a7cPlayer is already in jail {0}.
playerJailed = \u00a77Player {0} jailed.
playerJailedFor = \u00a77Player {0} jailed for {1}.
-playerInJail = \u00a7cPlayer is already in jail {0}.
-teleportTop = \u00a77Teleporting to top.
-teleporting = \u00a77Teleporting...
-teleportDisabled = {0} has teleportation disabled.
-needTpohere = You need access to /tpohere to teleport other players.
+playerKicked = \u00a7cPlayer {0} kicked: {1}
+playerNeverOnServer = \u00a7cPlayer {0} was never on this server.
+playerNotFound = \u00a7cPlayer not found.
+pong = Pong!
+possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}.
+powerToolAir = Command can''t be attached to air.
+powerToolAttach = Command assigned to {0}
+powerToolRemove = Command removed from {0}
+protectionOwner = \u00a76[EssentialsProtect] Protection owner: {0}
+questionFormat = \u00a77[Question]\u00a7f {0}
+reloadAllPlugins = \u00a77Reloaded all plugins.
+requestAccepted = \u00a77Teleport request accepted.
+requestDenied = \u00a77Teleport request denied.
+requestSent = \u00a77Request sent to {0}\u00a77.
+returnPlayerToJailError = Error occured when trying to return player to jail.
+second = second
+seconds = seconds
+seenOffline = Player {0} is offline since {1}
+seenOnline = Player {0} is online since {1}
+serverFull = Server is full
+sheepMalformedColor = Malformed color.
+shoutFormat = \u00a77[Shout]\u00a7f {0}
+similarWarpExist = A warp with a similar name already exists.
+slimeMalformedSize = Malformed size.
+soloMob = That mob likes to be alone
+spawnSet = \u00a77Spawn location set for group {0}.
+spawned = spawned
+suicideMessage = \u00a77Goodbye Cruel World...
+suicideSuccess = \u00a77{0} took their own life
+takenFromAccount = \u00a7c{0} has been taken from your account.
+takenFromOthersAccount = \u00a7c{0} has been taken from {1} account.
+teleportAll = \u00a77Teleporting all players...
teleportAtoB = \u00a77{0}\u00a77 teleported you to {1}\u00a77.
+teleportDisabled = {0} has teleportation disabled.
+teleportHereRequest = \u00a7c{0}\u00a7c has requested that you teleport to him/her.
+teleportNewPlayerError = Failed to teleport new player
teleportRequest = \u00a7c{0}\u00a7c has requested to teleport to you.
+teleportTop = \u00a77Teleporting to top.
+teleportationCommencing = \u00a77Teleportation commencing...
+teleportationDisabled = \u00a77Teleportation disabled.
+teleportationEnabled = \u00a77Teleportation enabled.
+teleporting = \u00a77Teleporting...
+teleportingPortal = \u00a77Teleporting via portal.
+tempBanned = Temporarily banned from server for {0}
+tempbanExempt = \u00a77You may not tempban that player
+thunder = You {0} thunder in your world
+thunderDuration = You {0} thunder in your world for {1} seconds.
+timeBeforeHeal = Time before next heal: {0}
+timeBeforeTeleport = Time before next teleport: {0}
+timePattern = (?:([0-9]+)\\s*y[a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
+timeSet = Time set in all worlds.
+tradeCompleted = \u00a77Trade completed.
+tradeSignEmpty = The trade sign does not have enough supply left.
+treeFailure = \u00a7cTree generation failure. Try again on grass or dirt.
+treeSpawned = \u00a77Tree spawned.
typeTpaccept = \u00a77To teleport, type \u00a7c/tpaccept\u00a77.
typeTpdeny = \u00a77To deny this request, type \u00a7c/tpdeny\u00a77.
-requestSent = \u00a77Request sent to {0}\u00a77.
-teleportHereRequest = \u00a7c{0}\u00a7c has requested that you teleport to him/her.
-teleportAll = \u00a77Teleporting all players...
-noPendingRequest = You do not have a pending request.
-requestDenied = \u00a77Teleport request denied.
-requestAccepted = \u00a77Teleport request accepted.
-teleportationEnabled = \u00a77Teleportation enabled.
-teleportationDisabled = \u00a77Teleportation disabled.
-treeSpawned = \u00a77Tree spawned.
-treeFailure = \u00a7cTree generation failure. Try again on grass or dirt.
-unbannedPlayer = Unbanned player.
+typeWorldName = \u00a77You can also type the name of a specific world.
+unableToSpawnMob = Unable to spawn mob.
+unableToSpawnMob = Unable to spawn mob.
unbannedIP = Unbanned IP address.
-unlimitedItems = Unlimited items:
-none = none
+unbannedPlayer = Unbanned player.
+unignorePlayer = You are not ignoring player {0} anymore.
+unknownItemId = Unknown item id: {0}
+unknownItemInList = Unknown item {0} in {1} list.
+unknownItemName = Unknown item name: {0}
unlimitedItemPermission = \u00a7cNo permission for unlimited item {0}.
-disableUnlimited = \u00a77Disabled unlimited placing of {0} for {1}.
-enableUnlimited = \u00a77Giving unlimited amount of {0} to {1}.
+unlimitedItems = Unlimited items:
+unmutedPlayer = Player {0} unmuted.
+upgradingFilesError = Error while upgrading the files
+userCreatedPortal = {0} used a portal and generated an exit portal.
+userDoesNotExist = The user {0} does not exist.
+userIsAway = {0} is now AFK
+userIsNotAway = {0} is no longer AFK
+userJailed = \u00a77You have been jailed
+userUsedPortal = {0} used an existing exit portal.
+userdataMoveBackError = Failed to move userdata/{0}.tmp to userdata/{1}
+userdataMoveError = Failed to move userdata/{0} to userdata/{1}.tmp
+usingPortal = \u00a77Teleporting via portal to an existing portal.
+usingTempFolderForTesting = Using temp folder for testing:
+versionMismatch = Version mismatch! Please update {0} to the same version.
+versionMismatchAll = Version mismatch! Please update all Essentials jars to the same version.
+voiceSilenced = \u00a77Your voice has been silenced
+warpDeleteError = Problem deleting the warp file.
warpListPermission = \u00a7cYou do not have Permission to list that warps.
-noWarpsDefined = No warps defined
+warpNotExist = That warp does not exist.
+warpSet = \u00a77Warp {0} set.
warpUsePermission = \u00a7cYou do not have Permission to use that warp.
-weatherSunFor = \u00a77You set the weather to sun in your world for {0} seconds
-weatherSun = \u00a77You set the weather to sun in your world
-weatherStormFor = \u00a77You set the weather to storm in your world for {0} seconds
+warpingTo = \u00a77Warping to {0}.
weatherStorm = \u00a77You set the weather to storm in your world
-whoisIs = {0} is {1}
+weatherStormFor = \u00a77You set the weather to storm in your world for {0} seconds
+weatherSun = \u00a77You set the weather to sun in your world
+weatherSunFor = \u00a77You set the weather to sun in your world for {0} seconds
+whoisGeoLocation = \u00a79 - Location: {0}
whoisHealth = \u00a79 - Health: {0}/20
+whoisIPAddress = \u00a79 - IP Address: {0}
+whoisIs = {0} is {1}
whoisLocation = \u00a79 - Location: ({0}, {1}, {2}, {3})
whoisMoney = \u00a79 - Money: {0}
-whoisStatusAway = \u00a79 - Status: \u00a7cAway\u00a7f
whoisStatusAvailable = \u00a79 - Status: Available
-whoisIPAddress = \u00a79 - IP Address: {0}
-whoisGeoLocation = \u00a79 - Location: {0}
-invalidWorld = \u00a7cInvalid world.
-possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}.
-typeWorldName = \u00a77You can also type the name of a specific world.
+whoisStatusAway = \u00a79 - Status: \u00a7cAway\u00a7f
worth = \u00a77Stack of {0} worth \u00a7c{1}\u00a77 ({2} item(s) at {3} each)
worthMeta = \u00a77Stack of {0} with metadata of {1} worth \u00a7c{2}\u00a77 ({3} item(s) at {4} each)
-onlyPlayers = Only in-game players can use {0}.
-unignorePlayer = You are not ignoring player {0} anymore.
-ignorePlayer = You ignore player {0} from now on.
-illegalDate = Illegal date format.
-timePattern = (?:([0-9]+)\\s*y[a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
-msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
-kits = \u00a77Kits: {0}
-loadWarpError = Failed to load warp {0}
-invalidSignLine = Line {0} on sign is invalid.
\ No newline at end of file
+worthSet = Worth value set
+year = year
+years = years
+youAreHealed = \u00a77You have been healed.
+youHaveNewMail = \u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail.
diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties
index 704e951f2..e5591cb96 100644
--- a/Essentials/src/messages_fr.properties
+++ b/Essentials/src/messages_fr.properties
@@ -1,305 +1,321 @@
-loadinfo = Charg\u00e9 {0} version {1} par {2}
-markedAsNotAway = \u00a77Vous n''\u00eates plus marqu\u00e9 comme inactif.
-markedAsAway = \u00a77Vous \u00eates d\u00e9sormais inactif.
-userIsNotAway = {0} n''est plus inactif
-userIsAway = {0} est d\u00e9sormais inactif
-backupStarted = D\u00e9but du backup
-backupFinished = Backup termin\u00e9
-invalidServer = Serveur non valide.
-usingTempFolderForTesting = Utilise un fichier temporaire pour un test.
-versionMismatch = Versions diff\u00e9rentes! S''il vous plait mettez {0} \u00e0 la m\u00eame version.
-notRecommendedBukkit = La version de Bukkit n''est pas celle qui est recommand\u00e9 pour cette version de Essentials.
-bukkitFormatChanged = Format de version Bukkit chang\u00e9. La version n''a pas \u00e9t\u00e9 v\u00e9rifi\u00e9e.
-itemsCsvNotLoaded = N''a pas pu charger items.csv.
-corruptNodeInConfig = \u00a74Annonce:Votre fichier configuration a un {0} noeud corrompu.
-youHaveNewMail = \u00a7cVous avez {0} messages!\u00a7f Tapez \u00a77/mail read\u00a7f pour voir votre courrier.
-commandNotLoaded = \u00a7cCommande {0} mal charg\u00e9.
-deniedAccessCommand = {0} a \u00e9t\u00e9 refuse d''acc\u00e8s a la commande.
-noAccessCommand = \u00a7cVous n''avez pas acc\u00e8s \u00e0 cette commande.
-errorCallingCommand = Erreur en appelant la commande /{0}
-commandFailed = Commande {0} \u00e9chec.
-bannedPlayersFileNotFound = banned-players.txt introuvable.
-bannedPlayersFileError = Erreur en lisant banned-players.txt
-bannedIpsFileNotFound = banned-ips.txt introuvable
-bannedIpsFileError = Erreur lisant banned-ips.txt
-noDestroyPermission = \u00a7cVous n''avez pas la permission de d\u00e9truire \u00e7a {0}.
-noAccessPermission = \u00a7cVous n''avez pas la permission d''acc\u00e9der \u00e0 \u00e7a {0}.
-moreThanZero = Les Quantit\u00e9s doivent \u00eatre sup\u00e9rieures \u00e0 z\u00e9ro.
-errorWithMessage = \u00a7cErreur:{0}
-creatingConfigFromTemplate = Cr\u00e9ation de configuration \u00e0 partir du mod\u00e8le:{0}
-creatingEmptyConfig = Cr\u00e9ation d''une configuration vierge:{0}
-failedToCreateConfig = Echec de la cr\u00e9ation de la configuration {0}
-couldNotFindTemplate = Mod\u00e8le introuvable {0}
-failedToWriteConfig = Echec de l''\u00e9criture de la configuration {0}
-failedToCloseConfig = Echec de la fermeture de la configuration {0}
-notEnoughMoney = Vous n''avez pas les fonds n\u00e9cessaires.
-missingItems = Vous n''avez pas {0}x {1}.
-tradeSignEmpty = Le panneau de vente n''as pas encore assez de stock.
-tradeCompleted = \u00a77Echange termin\u00e9.
-backAfterDeath = \u00a77Utilisez la commande /back pour retourner \u00e0 l''endroit ou vous \u00eates mort.
-mutedUserSpeaks = {0} a essay\u00e9 de parler mais est muet.
-userCreatedPortal = {0} a utilis\u00e9 un portail et a g\u00e9n\u00e9r\u00e9 un portail de sortie.
-generatingPortal = \u00a77G\u00e9n\u00e9ration d''un portail de sortie.
-userUsedPortal = {0} a utilis\u00e9 un portail existant.
-usingPortal = \u00a77T\u00e9l\u00e9portation via portail vers un portail existant.
-teleportingPortal = \u00a77T\u00e9l\u00e9portation via portail.
-freedMemory = A lib\u00e9r\u00e9 {0} MB.
-defaultBanReason = Le Marteau du ban a frapp\u00e9!
-noNewMail = \u00a77Vous n''avez pas de courrier.
-serverFull = Le serveur est plein.
-returnPlayerToJailError = Erreur en tentant de retourner un joueur en prison.
-jailMessage = \u00a7cVous avez commis un crime, vous en payez le prix.
-homeSetToBed = \u00a77Votre home est d\u00e9sormais ce lit.
-moneyTaken = {0} pr\u00e9lev\u00e9 de votre compte bancaire.
-youAreHealed = \u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
-markMailAsRead = \u00a7cPour marquer tout votre courrier comme lu, tapez /mail clear.
-balance = \u00a77Solde:{0}
-backUsageMsg = \u00a77Retour a votre emplacement pr\u00e9c\u00e8dent.
-playerBanned = \u00a7cJoueur {0} banni.
-banIpAddress = \u00a77Banni l''adresse IP.
-bigTreeSuccess = \u00a77Gros arbre cr\u00e9e.
-bigTreeFailure = \u00a7cEchec de la g\u00e9n\u00e9ration du gros arbre. Essayez encore sur de la terre ou de l''herbe.
-broadcast = [\u00a7cMessage\u00a7f]\u00a7a {0}
-burnMsg = \u00a77Vous avez enflamm\u00e9 {0} pour {1} secondes.
-playerNotFound = \u00a7c Joueur introuvable.
-inventoryCleared = \u00a77Inventaire nettoy\u00e9.
-inventoryClearedOthers = \u00a77Ivnetaire de \u00a7c{0}\u00a77 nettoy\u00e9.
-compassBearing = \u00a77Orientation:{0} ({1} degr\u00e9s).
-deleteJail = \u00a77Prison {0} supprim\u00e9e.
-deleteWarp = \u00a77Warp {0} supprim\u00e9.
-depth = \u00a77Vous \u00eates au niveau de la mer.
-depthAboveSea = \u00a77Vous \u00eates {0} bloc(s) au-dessus du niveau de la mer.
-depthBelowSea = \u00a77Vous \u00eates {0} bloc(s) en-dessous du niveau de la mer.
-extinguish = \u00a77Vous vous \u00eates \u00e9teint vous-m\u00eame.
-extinguishOthers = \u00a77Vous avez \u00e9teint {0}.
-canTalkAgain = \u00a77Vous pouvez de nouveau parler.
-haveBeenReleased = \u00a77Vous \u00eates libre de vos mouvements.
-upgradingFilesError = Erreur en mettant \u00e0 jour le fichier.
-configFileMoveError = Echec du d\u00e9placement config.yml dans son fichier backup.
-configFileRenameError = Echec du changement de nom du fichier temp \u00e0 config.yml
-fileRenameError = Echec du changement de nom de {0}.
-userdataMoveError = Echec du d\u00e9placement de userdata/{0} \u00e0 userdata/{1}.tmp
-duplicatedUserdata = Dupliqu\u00e9 userdata:{0} et {1}
-userdataMoveBackError = Echec du d\u00e9placement de userdata/{0}.tmp \u00e0 userdata/{1}
-parseError = Erreur de conversion {0} \u00e0 la ligne {1}
-unknownItemName = Nom d''objet inconnu:{0}
-unknownItemId = Num\u00e9ro d''objet inconnu:{0}
-jailNotExist = Cette prison n''existe pas.
-unableToSpawnMob = Incapable de cr\u00e9er le monstre.
-creatingPortal = Cr\u00e9ation d''un portail \u00e0 {0},{1},{2}.
-notSupportedYet = Pas encore pris en charge.
-unknownItemInList = Objet inconnu {0} dans {1} liste.
-teleportationCommencing = \u00a77D\u00e9but de la T\u00e9l\u00e9portation....
-cooldownWithMessage = \u00a7cRefroidissement:{0}
-warpingTo = \u00a77Warpant \u00e0 {0}.
-timeBeforeTeleport = Temps avant prochaine t\u00e9l\u00e9portation {0}
-pendingTeleportCancelled = \u00a7cRequete de t\u00e9l\u00e9portation annul\u00e9e.
-dontMoveMessage = \u00a77La t\u00e9l\u00e9portation commence dans {0}. Ne bougez pas.
-noHomeSet = Vous n''avez pas mis de home.
-noHomeSetPlayer = Player n''a pas fait de home.
-timeBeforeHeal = Temps avant prochains soins:{0}
+#version: TeamCity
+# Single quotes have to be doubled: ''
+# Translations start here
addedToAccount = \u00a7a{0} a \u00e9t\u00e9 rajout\u00e9 a votre compte.
-moneySentTo = \u00a7a{0} a \u00e9t\u00e9 r\u00e9initialis\u00e9 \u00e0 {1}
-moneyRecievedFrom = \u00a7a{0} a \u00e9t\u00e9 re\u00e7u de {1}
-takenFromAccount = \u00a7c{0} a \u00e9t\u00e9 pris de votre compte.
-emptyWorldName = Set Home:Nom du monde est nul ou vide.
-now = maintenant
-year = ann\u00e9e
-years = ann\u00e9es
-month = mois
-months = mois
-day = jour
-days = jours
-hour = heure
-hours = heures
-minute = minute
-minutes = minutes
-second = seconde
-seconds = secondes
-destinationNotSet = Destination pas choisie.
-holeInFloor = Trou dans le Sol.
-warpNotExist = Ce warp n''existe pas.
-similarWarpExist = Un warp avec un nom similaire existe d\u00e9j\u00e0.
-warpDeleteError = Probl\u00e8me d\u00e9tectant le fichier de warp.
-versionMismatchAll = Mauvaise version! S''il vous plait mettez des jars Essentiels de version identique.
-missingPrefixSuffix = Pr\u00e9fixe ou Suffixe manquant pour {0}
-permissionsError = Permissions/GroupManager manquant, les pr\u00e9fixes et suffixes ne seront pas affich\u00e9s.
-shoutFormat = \u00a77[Crie]\u00a7f {0}
-notAllowedToShout = \u00a7cVous n''avez pas le droit de crier.
-questionFormat = \u00a77[Question]\u00a7f {0}
-notAllowedToQuestion = \u00a7cVous n''avez pas le droit de poser des questions.
-localFormat = Local:<{0}> {1}
-geoipJoinFormat = Joueur {0} vient de {1}
+addedToOthersAccount = \u00a7a{0} a \u00e9t\u00e9 ajout\u00e9 \u00e0 {1} compte.
+alertBroke = a cass\u00e9:
+alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} \u00e0:{3}
+alertPlaced = a plac\u00e9:
+alertUsed = a utilis\u00e9:
+backAfterDeath = \u00a77Utilisez la commande /back pour retourner \u00e0 l''endroit ou vous \u00eates mort.
+backUsageMsg = \u00a77Retour a votre emplacement pr\u00e9c\u00e8dent.
+backupFinished = Backup termin\u00e9
+backupStarted = D\u00e9but du backup
+balance = \u00a77Solde: {0}
+balanceTop = \u00a77 Top {0} soldes
+banIpAddress = \u00a77Adresse IP banni
+banExempt = \u00a77Vous ne pouvez pas interdire ce joueur.
+bannedIpsFileError = Erreur de lecture de banned-ips.txt
+bannedIpsFileNotFound = Fichier banned-ips.txt introuvable
+bannedPlayersFileError = Erreur lors de la lecture de banned-players.txt
+bannedPlayersFileNotFound = banned-players.txt introuvable.
+bigTreeFailure = \u00a7c\u00c9chec de la g\u00e9n\u00e9ration du gros arbre. Essayez de nouveau sur de la terre ou de l''herbe.
+bigTreeSuccess = \u00a77Gros arbre cr\u00e9e.
+broadcast = [\u00a7cMessage\u00a7f]\u00a7a {0}
+buildAlert = \u00a7cVous n''avez pas la permission de construire.
+bukkitFormatChanged = Le format de la version de Bukkit a \u00e9t\u00e9 chang\u00e9. La version n''a pas \u00e9t\u00e9 v\u00e9rifi\u00e9e.
+burnMsg = \u00a77Vous avez enflamm\u00e9 {0} pour {1} seconde(s).
+canTalkAgain = \u00a77Vous pouvez de nouveau parler.
cantFindGeoIpDB = N''arrive pas \u00e0 trouver la base de donn\u00e9es GeoIP!
cantReadGeoIpDB = Echec de la lecture de la base de donn\u00e9s GeoIP!
-geoIpUrlEmpty = L''url de t\u00e9l\u00e9chargement de GeoIP est vide.
-downloadingGeoIp = T\u00e9l\u00e9chargement de la base de donn\u00e9es GeoIP ... cela va peut-\u00eatre prendre un moment (campagne:0.6 MB, ville:20MB)
-geoIpUrlInvalid = L''url de t\u00e9l\u00e9chargement de GeoIP est invalide.
-connectionFailed = Echec de l''ouverture de la connexion.
-alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} \u00e0:{3}
-alertPlaced = a plac\u00e9
-alertBroke = a cass\u00e9
-alertUsed = a utilis\u00e9
-buildAlert = \u00a7cVous n''avez pas la permission de construire.
-protectionOwner = \u00a76[EssentialsProtect] Propri\u00e9taire Protect:{0}
-spawnSet = \u00a77Spawn cr\u00e9\u00e9 pour le groupe {0}.
-teleportNewPlayerError = Echec de la t\u00e9l\u00e9portation du nouveau joueur.
-essentialsReload = \u00a77Essentials Recharg\u00e9 {0}
-gcmax = M\u00e9moire maximale:{0} MB
-gcmin = M\u00e9moire minimale:{0} MB
-gcchunks = chunks,
-gcentities = entit\u00e9s
-godMode = \u00a77mode dieu {0}.
-enabled = activ\u00e9
+cantSpawnItem = \u00a7cVous n''avez pas le droit de faire apparaitre {0}
+commandFailed = \u00c9chec de la commande {0}:
+commandNotLoaded = \u00a7cLa commande {0} a \u00e9t\u00e9 mal charg\u00e9e.
+compassBearing = \u00a77Orientation: {0} ({1} degr\u00e9s).
+configFileMoveError = \u00c9chec du d\u00e9placement de config.yml vers l''emplacement de backup.
+configFileRenameError = \u00c9chec du changement de nom du fichier temp de config.yml
+connectedPlayers = Joueurs connect\u00e9s:
+connectionFailed = \u00c9chec de l''ouverture de la connexion.
+cooldownWithMessage = \u00a7cRefroidissement: {0}
+corruptNodeInConfig = \u00a74Annonce: Votre fichier de configuration a un {0} n\u0153ud corrompu.
+couldNotFindTemplate = Le mod\u00e8le {0} est introuvable
+creatingConfigFromTemplate = Cr\u00e9ation de la configuration \u00e0 partir du mod\u00e8le : {0}
+creatingEmptyConfig = Cr\u00e9ation d''une configuration vierge : {0}
+creatingPortal = Cr\u00e9ation d''un portail \u00e0 {0},{1},{2}.
+day = jour
+days = jours
+defaultBanReason = Le marteau du ban a frapp\u00e9!
+deleteFileError = Le fichier n''a pas pu \u00eatre supprim\u00e9: {0}
+deleteJail = \u00a77La prison {0} a \u00e9t\u00e9 supprim\u00e9e.
+deleteWarp = \u00a77Warp {0} supprim\u00e9.
+deniedAccessCommand = L''acc\u00e8s \u00e0 la commande a \u00e9t\u00e9 refus\u00e9 pour {0}.
+dependancyDownloaded = [Essentials] Fichier {0} correctement t\u00e9l\u00e9charg\u00e9.
+dependancyException = [Essentials] Une erreur est survenue lors de la tentative de t\u00e9l\u00e9chargement
+dependancyNotFound = [Essentials] Une d\u00e9pendance requise n''a pas \u00e9t\u00e9 trouv\u00e9e, t\u00e9l\u00e9chargement en cours.
+depth = \u00a77Vous \u00eates au niveau de la mer.
+depthAboveSea = \u00a77Vous \u00eates \u00e0 {0} bloc(s) au-dessus du niveau de la mer.
+depthBelowSea = \u00a77Vous \u00eates \u00e0 {0} bloc(s) en-dessous du niveau de la mer.
+destinationNotSet = Destination non d\u00e9finie
+disableUnlimited = \u00a77D\u00e9sactivation du placement illimit\u00e9 de {0} pour {1}.
disabled = d\u00e9sactiv\u00e9
-godEnabledFor = activ\u00e9 pour {0}
+dontMoveMessage = \u00a77La t\u00e9l\u00e9portation commence dans {0}. Ne bougez pas.
+downloadingGeoIp = T\u00e9l\u00e9chargement de la base de donn\u00e9es GeoIP ... cela peut prendre un moment (campagne : 0.6 Mo, ville : 20Mo)
+duplicatedUserdata = Donn\u00e9e utilisateur dupliqu\u00e9e: {0} et {1}
+emptyWorldName = Set Home: Le nom du monte est nul ou vide.
+enableUnlimited = \u00a77Donner un nombre illimit\u00e9 de {0} \u00e0 {1}.
+enabled = activ\u00e9
+errorCallingCommand = Erreur en appelant la commande /{0}
+errorWithMessage = \u00a7cErreur: {0}
+essentialsReload = \u00a77Essentials Recharg\u00e9 {0}
+extinguish = \u00a77Vous vous \u00eates \u00e9teint.
+extinguishOthers = \u00a77Vous avez \u00e9teint {0}.
+failedToCloseConfig = Echec de la fermeture de la configuration {0}
+failedToCreateConfig = Echec de la cr\u00e9ation de la configuration {0}
+failedToWriteConfig = \u00c9chec de l''\u00e9criture de la configuration {0}
+fileRenameError = Echec du changement de nom de {0}.
+foreverAlone = \u00a7cVous n''avez personne \u00e0 qui r\u00e9pondre.
+freedMemory = A lib\u00e9r\u00e9 {0} Mo.
+gcchunks = chunks,
+gcentities = entit\u00e9s
+gcfree = Free memory: {0} Mo
+gcmax = M\u00e9moire maximale: {0} Mo
+gctotal = Allocated memory: {0} Mo
+generatingPortal = \u00a77G\u00e9n\u00e9ration d''un portail de sortie.
+geoIpUrlEmpty = L''url de t\u00e9l\u00e9chargement de GeoIP est vide.
+geoIpUrlInvalid = L''url de t\u00e9l\u00e9chargement de GeoIP est invalide.
+geoipJoinFormat = Joueur {0} vient de {1}
godDisabledFor = d\u00e9sactive pour {0}
+godEnabledFor = activ\u00e9 pour {0}
+godMode = \u00a77Mode Dieu {0}.
+haveBeenReleased = \u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9
heal = \u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
-healOther = \u00a77Soign\u00e9 {0}.
-helpPages = Page \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f.
+healOther = \u00a77{0} a \u00e9t\u00e9 soign\u00e9.
helpConsole = Pour voir l''aide tapez ?
helpOp = \u00a7c[Aide Admin]\u00a7f \u00a77{0}:\u00a7f {1}
-infoFileDoesNotExist = Le fichier info.txt n''existe pas. Cr\u00e9ation d''un autre.
+helpPages = Page \u00a7c{0}\u00a7f sur \u00a7c{1}\u00a7f.
+holeInFloor = Trou dans le Sol.
+homeSet = \u00a77Home d\u00e9fini.
+homeSetToBed = \u00a77Votre home est d\u00e9sormais d\u00e9fini sur ce lit.
+hour = heure
+hours = heures
+ignorePlayer = Vous ignorez d\u00e9sormais {0}.
+illegalDate = Format de date ill\u00e9gal.
+infoChapter = S\u00e9lectionner le chapitre :
+infoChapterPages = Chapitre {0}, page \u00a7c{1}\u00a7f sur \u00a7c{2}\u00a7f:
+infoFileDoesNotExist = Le fichier info.txt n''existe pas. Le fichier est en cours de cr\u00e9ation pour vous.
infoPages = Page \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f.
-infoChapter = S\u00e9lectionner le chapitre.
infoUnknownChapter = Chapitre inconnu.
-infoChapterPages = Chapitre {0}, page \u00a7c{1}\u00a7f de \u00a7c{2}\u00a7f:
-invBigger = L''inventaire de l''autre joueur est plus gros que le v\u00f4tre.
+invBigger = Les inventaires des autres joueurs sont plus gros que le v\u00f4tre.
invRestored = Votre inventaire vous a \u00e9t\u00e9 rendu.
invSee = Vous voyez l''inventaire de {0}.
invSeeHelp = Utilisez /invsee pour voir l''inventaire de quelqu''un.
-cantSpawnItem = \u00a7cVous n''avez pas le droit de faire apparaitre {0}
+invalidCharge = \u00a7cInvalide charge.
+invalidMob = Mauvias type de monstre.
+invalidServer = Serveur non valide.
+invalidSignLine = La ligne {0} du panneau est invalide.
+invalidWorld = \u00a7cMonde invalide.
+inventoryCleared = \u00a77Inventaire nettoy\u00e9.
+inventoryClearedOthers = \u00a77L''inventaire de \u00a7c{0}\u00a77 a \u00e9t\u00e9 nettoy\u00e9.
+is = est
+itemCannotBeSold = Cet objet ne peut \u00eatre vendu au serveur.
+itemMustBeStacked = Cet objet doit \u00eatre vendu par 64. Une quantit\u00e9 de 2 serait deux fois 64.
+itemNotEnough1 = \u00a7cVous n''avez pas assez de cet objet pour le vendre.
+itemNotEnough2 = \u00a77Si vous voulez vendre l''int\u00e9gralit\u00e9 de vos objets de ce type l\u00e0, utilisez /sell nomObjet
+itemNotEnough3 = \u00a77/sell nomObjet -1 vendra tout sauf un objet, etc.
+itemSellAir = Vous vouliez vraiment vendre de l''air? Mettez un objet dans votre main.
+itemSold = \u00a77Vendu pour \u00a7c {0} \u00a77 ({1} objet(s) \u00e0 {2} chacun)
+itemSoldConsole = {0} vendu {1} pour \u00a77 {2} \u00a77 ({3} objet(s) \u00e0 {4} chacun)
itemSpawn = \u00a77Donne {0} de {1}
-jumpError = \u00c7a aurait pu faire mal au cerveau de votre Ordinateur.
+itemsCsvNotLoaded = N''a pas pu charger items.csv.
+jailMessage = \u00a7cVous avez commis un crime, vous en payez le prix.
+jailNotExist = Cette prison n''existe pas.
+jailSet = \u00a77La prison {0} a \u00e9t\u00e9 cr\u00e9\u00e9.
+jumpError = \u00c7a aurait pu faire mal au cerveau de votre ordinateur.
kickDefault = Kick\u00e9 du serveur
+kickExempt = \u00a77Vous ne pouvez pas lancer ce joueur.
kill = \u00a77Tu\u00e9 {0}.
-noKits = \u00a77Il n''y a pas encore de kit disponible.
kitError = \u00a7cIl n''y a pas de kits valides.
-kitError2 = \u00a7cCe kit n''existe pas ou est mal tap\u00e9.
-kitErrorHelp = \u00a7cPeut-etre qu''un objet manque une quantit\u00e9 dans la configuration?
-noKitPermission = \u00a7cVous avez besoin de la permission \u00a7c{0}\u00a7c pour utiliser ce kit.
-kitTimed = \u00a7cVous ne pouvez pas utiliser ce kit pendant encore {0}.
+kitError2 = \u00a7cCe kit n''existe pas ou a \u00e9t\u00e9 mal d\u00e9fini.
+kitErrorHelp = \u00a7cPeut-\u00eatre qu''un objet manque d''une quantit\u00e9 dans la configuration?
+kitGive = \u00a77Donner le kit {0}.
kitInvFull = \u00a7cVotre inventaire \u00e9tait plein, le kit est Parre-terre.
-kitGive = \u00a77Donnant le kit {0}.
-lightningUse = \u00a77Foudroie {0}
+kitTimed = \u00a7cVous ne pouvez pas utiliser ce kit pendant encore {0}.
+kits = \u00a77Kits:{0}
lightningSmited = \u00a77Vous venez d''\u00eatre foudroy\u00e9
-connectedPlayers = Joueurs connect\u00e9s:
-noMail = Vous n''avez pas de courrier
-mailClear = \u00a7cPOur marquer votre courrier comme lu, tapez /mail clear
-noMailSendPerm = \u00a7cVous n''avez pas la permission \u00a7fessentials.mail.send\u00a7c.
-playerNeverOnServer = \u00a7cLe joueur {0} n''as jamais \u00e9t\u00e9 sur le serveur.
-mailSent = \u00a77Mail Envoy\u00e9!
-mailCleared = \u00a77Mail Nettoy\u00e9!
-voiceSilenced = \u00a77Votre voix a \u00e9t\u00e9 r\u00e9duite au silence
-noMotd = \u00a7cIl n''y a pas de message su jour.
+lightningUse = \u00a77{0} a \u00e9t\u00e9 foudroy\u00e9
+loadWarpError = \u00c9chec du chargement du warp {0}
+loadinfo = {0} version {1} par {2} a \u00e9t\u00e9 charg\u00e9
+localFormat = Local:<{0}> {1}
+mailClear = \u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear
+mailCleared = \u00a77Mail supprim\u00e9 !
+mailSent = \u00a77Courrier envoy\u00e9 !
+markMailAsRead = \u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear
+markedAsAway = \u00a77Vous \u00eates d\u00e9sormais AFK.
+markedAsNotAway = \u00a77Vous n''\u00eates d\u00e9sormais plus AFK.
+mayNotJail = \u00a7cVous ne pouvez pas emprisonner cette personne.
me = moi
-mutedPlayerFor = Joueur {0} muet pour {1}.
-mutedPlayer = Joueur {0} est d\u00e9sormais muet.
-unmutedPlayer = Joueur {0} n''est plus muet.
-nickOthersPermission = \u00a7cVous n''avez pas la permission de changer les surnoms des autres.
-nickNoMore = \u00a7Vous n''avez plus de surnom.
-nickNamesAlpha = \u00a7cLes surnoms doivent \u00eatre alphanum\u00e9riques.
+minute = minute
+minutes = minutes
+missingItems = Vous n''avez pas {0} x {1}.
+missingPrefixSuffix = Pr\u00e9fixe ou Suffixe manquant pour {0}
+mobSpawnError = Erreur lors du changement du spawner de monstres.
+mobSpawnLimit = Quantit\u00e9 de monstres limit\u00e9 \u00e0 la limite du serveur.
+mobSpawnTarget = Le bloc cible doit \u00eatre un spawner de monstres.
+moneyRecievedFrom = \u00a7a{0} a \u00e9t\u00e9 re\u00e7u de {1}
+moneySentTo = \u00a7a{0} a \u00e9t\u00e9 envoy\u00e9 \u00e0 {1}
+moneyTaken = {0} pr\u00e9lev\u00e9(s) de votre compte bancaire.
+month = mois
+months = mois
+moreThanZero = Les Quantit\u00e9s doivent \u00eatre sup\u00e9rieures \u00e0 z\u00e9ro.
+msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
+mutedPlayer = Le joueur {0} est d\u00e9sormais muet.
+mutedPlayerFor = {0} a \u00e9t\u00e9 mute pour {1}.
+mutedUserSpeaks = {0} a essay\u00e9 de parler mais est muet.
+needTpohere = Vous avez besoin de l''acc\u00e8s \u00e0 /tpohere pour t\u00e9l\u00e9porter d''autres joueurs.
+negativeBalanceError = L''utilisateur n''est pas autoris\u00e9 \u00e0 avoir un solde n\u00e9gatif.
+nickChanged = Pseudo modifi\u00e9.
nickInUse = \u00a7cCe nom est d\u00e9j\u00e0 utilis\u00e9.
-nickSet = \u00a77Votre surnom est maintenant \u00a7c{0}
-nickChanged = Surnom chang\u00e9.
+nickNamesAlpha = \u00a7cLes pseudos doivent \u00eatre alphanum\u00e9riques.
+nickNoMore = \u00a7Vous n''avez plus de surnom.
+nickOthersPermission = \u00a7cVous n''avez pas la permission de changer le pseudo des autres.
+nickSet = \u00a77Votre pseudo est maintenant \u00a7c{0}
+noAccessCommand = \u00a7cVous n''avez pas acc\u00e8s \u00e0 cette commande.
+noAccessPermission = \u00a7cVous n''avez pas la permissions d''acc\u00e9der \u00e0 cette {0}
+noDestroyPermission = \u00a7cVous n''avez pas la permission de d\u00e9truire ce {0}.
+noHomeSet = Vous n''avez pas d\u00e9fini de home.
+noHomeSetPlayer = Le joueur n''a pas d\u00e9fini son home.
+noKitPermission = \u00a7cVous avez besoin de la permission \u00a7c{0}\u00a7c pour utiliser ce kit.
+noKits = \u00a77Il n''y a pas encore de kits disponibles.
+noMail = Vous n''avez pas de courrier
+noMailSendPerm = \u00a7cVous n''avez pas la permission \u00a7fessentials.mail.send\u00a7c.
+noMotd = \u00a7cIl n''y a pas de message su jour.
+noNewMail = \u00a77Vous n''avez pas de courrier.
+noPendingRequest = Vous n''avez pas de requ\u00eate non lue.
+noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
+noRules = \u00a7cIl n''y a pas encore de r\u00e8gles d\u00e9finies.
+noWarpsDefined = Aucun warps d\u00e9finis.
+none = aucun
+notAllowedToQuestion = \u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 poser des questions.
+notAllowedToShout = \u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 crier.
+notEnoughMoney = Vous n''avez pas les fonds n\u00e9cessaires.
+notRecommendedBukkit = La version de Bukkit n''est pas celle qui est recommand\u00e9 pour cette version de Essentials.
+notSupportedYet = Pas encore pris en charge.
+now = maintenant
+numberRequired = On a besoin d''un nombre ici, idiot.
+onlyDayNight = /time ne supporte que (jour) day/night (nuit).
+onlyPlayers = Seulement les joueurs en jeu peuvent utiliser {0}.
+onlySunStorm = /weather only supports sun/storm.
+parseError = Erreur de conversion {0} \u00e0 la ligne {1}
+pendingTeleportCancelled = \u00a7cRequete de t\u00e9l\u00e9portation annul\u00e9e.
+permissionsError = Permissions/GroupManager manquant, les pr\u00e9fixes et suffixes ne seront pas affich\u00e9s.
+playerBanned = \u00a7cLe joueur {0} a \u00e9t\u00e9 banni: {1}
+playerInJail = \u00a7cLe joueur est d\u00e9j\u00e0 dans la prison {0}.
+playerJailed = \u00a77Le joueur {0} a \u00e9t\u00e9 emprisonn\u00e9.
+playerJailedFor = \u00a77{0} a \u00e9t\u00e9 emprisonn\u00e9 pour {1}.
+playerKicked = \u00a7cPlayer {0} kicked: {1}
+playerNeverOnServer = \u00a7cLe joueur {0} n''a jamais \u00e9t\u00e9 sur le serveur.
+playerNotFound = \u00a7cLe joueur est introuvable.
pong = Pong!
+possibleWorlds = \u00a77Les mondes possibles sont les nombres 0 par {0}.
powerToolAir = La commande ne peut pas \u00eatre attach\u00e9e \u00e0 l''air.
powerToolAttach = Commande assign\u00e9e \u00e0 {0}
powerToolRemove = Commande enlev\u00e9e \u00e0 {0}
-foreverAlone = \u00a7cVous n''avez personne \u00e0 qui r\u00e9pondre.
-is = est
-reloadAllPlugins = \u00a77Recharge tous les plugins.
-noRules = \u00a7cIl n''y a pas encore de r\u00e8gles d\u00e9finies.
-seenOnline = Joueur {0} est en ligne depuis {1}
-seenOffline = Joueur {0} est hors ligne depuis {1}
-itemCannotBeSold = Cet objet ne peut \u00eatre vendu.
-itemMustBeStacked = Cet objet doit \u00eatre vendu par 64. Une quantit\u00e9 de 2 serait deux fois 64.
-itemNotEnough1 = \u00a7cVous n''avez pas assez de ca pour le vendre.
-itemNotEnough2 = \u00a77Si vous vouliez vendre tous vos objets de ce type-l\u00e0, utilisez /sell nomd''objet
-itemNotEnough3 = \u00a77/sell itemname -1 vendra tout sauf un item, etc.
-itemSold = \u00a77Sold for \u00a7c {0} \u00a77 ({1} items at {2} each) Vendu pour \u00a7c {0} \u00a77 ({1} objets \u00e0 {2} chacun)
-itemSoldConsole = {0} vendu {1} pour \u00a77 {2} \u00a77 ({3} objets \u00e0 {4} chacun)
-itemSellAir = Vous vouliez vraiment vendre de l''Air? Mettez un objet dans votre main.
-homeSet = \u00a77Home cr\u00e9e.
-jailSet = \u00a77Prison {0} a \u00e9t\u00e9 cr\u00e9e.
-warpSet = \u00a77Warp {0} cr\u00e9e.
-worthSet = Valeur cr\u00e9e
-mobSpawnTarget = Le bloc cible doit \u00eatre un spawner de monstres.
-mobSpawnError = Erreur en changeant le spawner de monstres.
-invalidMob = Mauvias type de monstre.
-unableToSpawnMob = Incapable de spawner un monstre.
-mobSpawnLimit = Quantit\u00e9 de monstres limit\u00e9 \u00e0 la limite du serveur.
-soloMob = Ce monstre aime \u00eatre seul.
-numberRequired = On a besoin d''un nombre ici, sot.
-spawned = spawn\u00e9
-slimeMalformedSize = Taille mal form\u00e9e.
-sheepMalformedColor = Couleur mal form\u00e9e.
-suicideMessage = \u00a77 Au revoir monde cruel...
-suicideSuccess = \u00a77{0} a pris sa propre vie.
-tempBanned = Banni temporairement du serveur pour {0}
-thunderDuration = Vous avez {0} la foudre dans le serveur {1} secondes.
-thunder = Vous avez {0} la foudre dans votre serveur.
-deleteFileError = N''a pas pu supprimer le fichier:{0}
-userDoesNotExist = L''utilisateur {0} n''existe pas.
-negativeBalanceError = L''utilisateur ne peut avoir un solde n\u00e9gatif.
-timeSet = Heure modifi\u00e9e dans tous les mondes.
-onlyDayNight = /time ne supporte que (jour) day/night (nuit).
-mayNotJail = \u00a7cVous ne pouvez pas emprisonner cette personne.
-userJailed = \u00a77Vous avez \u00e9t\u00e9 emprisonn\u00e9
-playerJailed = \u00a77Joueur {0} emprisonn\u00e9.
-playerJailedFor = \u00a77Joueur {0} emprisonn\u00e9 pendant {1}.
-playerInJail = \u00a7cLe joueur est d\u00e9j\u00e0 dans la prison {0}.
-teleportTop = \u00a77T\u00e9l\u00e9portation vers le haut.
-teleporting = \u00a77T\u00e9l\u00e9poration en cours...
-teleportDisabled = {0} a la t\u00e9l\u00e9portation d\u00e9sactiv\u00e9.
-needTpohere = Vous avez besoin de l''acc\u00e8s \u00e0 /tpohere pour t\u00e9l\u00e9porter d''autres joueurs.
-teleportAtoB = \u00a77{0}\u00a77 vous a t\u00e9l\u00e9port\u00e9 \u00e0 {1}\u00a77.
-teleportRequest = \u00a7c{0}\u00a7c vous demande si il peut se t\u00e9l\u00e9porter sur vous.
-typeTpaccept = \u00a77Pour le t\u00e9l\u00e9porter, tapez \u00a7c/tpaccept\u00a77.
-typeTpdeny = \u00a77Pour refuser cette demande, tapez \u00a7c/tpdeny\u00a77.
-requestSent = \u00a77Requete envoy\u00e9e \u00e0 {0}\u00a77.
-teleportHereRequest = \u00a7c{0}\u00a7c Vous a demand\u00e9 de vous t\u00e9l\u00e9porter \u00e0 lui/elle.
-teleportAll = \u00a77T\u00e9l\u00e9poration de tous les joueurs.
-noPendingRequest = Vous n''avez pas de requ\u00eate non lue.
-requestDenied = \u00a77Demande de t\u00e9l\u00e9portation refus\u00e9e.
+protectionOwner = \u00a76[EssentialsProtect] Propri\u00e9taire de la protection : {0}
+questionFormat = \u00a77[Question]\u00a7f {0}
+reloadAllPlugins = \u00a77Tous les plugins ont \u00e9t\u00e9 recharg\u00e9s.
requestAccepted = \u00a77Demande de t\u00e9l\u00e9portation accept\u00e9e.
-teleportationEnabled = \u00a77T\u00e9l\u00e9poration activ\u00e9e.
+requestDenied = \u00a77Demande de t\u00e9l\u00e9portation refus\u00e9e.
+requestSent = \u00a77Requ\u00eate envoy\u00e9e \u00e0 {0}\u00a77.
+returnPlayerToJailError = Erreur survenue lors de la tentative d''emprisonner de nouveau un joueur.
+second = seconde
+seconds = secondes
+seenOffline = Le joueur {0} est hors ligne depuis {1}
+seenOnline = Le joueur {0} est en ligne depuis {1}
+serverFull = Le serveur est plein.
+sheepMalformedColor = Couleur mal form\u00e9e.
+shoutFormat = \u00a77[Crie]\u00a7f {0}
+similarWarpExist = Un warp avec un nom similaire existe d\u00e9j\u00e0.
+slimeMalformedSize = Taille mal form\u00e9e.
+soloMob = Ce monstre aime \u00eatre seul.
+spawnSet = \u00a77Le point de spawn a \u00e9t\u00e9 d\u00e9fini pour le groupe {0}.
+spawned = spawn\u00e9
+suicideMessage = \u00a77Au revoir monde cruel...
+suicideSuccess = \u00a77{0} a pris sa propre vie.
+takenFromAccount = \u00a7c{0} ont \u00e9t\u00e9 pris de votre compte.
+takenFromOthersAccount = \u00a7c{0} a \u00e9t\u00e9 prise de {1} compte.
+teleportAll = \u00a77T\u00e9l\u00e9poration de tous les joueurs.
+teleportAtoB = \u00a77{0}\u00a77 vous a t\u00e9l\u00e9port\u00e9 \u00e0 {1}\u00a77.
+teleportDisabled = {0} a la t\u00e9l\u00e9portation d\u00e9sactiv\u00e9.
+teleportHereRequest = \u00a7c{0}\u00a7c Vous a demand\u00e9 de vous t\u00e9l\u00e9porter \u00e0 lui/elle.
+teleportNewPlayerError = \u00c9chec de la t\u00e9l\u00e9portation du nouveau joueur.
+teleportRequest = \u00a7c{0}\u00a7c vous demande s''il peut se t\u00e9l\u00e9porter sur vous.
+teleportTop = \u00a77T\u00e9l\u00e9portation vers le haut.
+teleportationCommencing = \u00a77D\u00e9but de la t\u00e9l\u00e9portation....
teleportationDisabled = \u00a77T\u00e9l\u00e9poration d\u00e9sactiv\u00e9.
-treeSpawned = \u00a77Arbre cr\u00e9e.
+teleportationEnabled = \u00a77T\u00e9l\u00e9portation activ\u00e9e.
+teleporting = \u00a77T\u00e9l\u00e9poration en cours...
+teleportingPortal = \u00a77T\u00e9l\u00e9portation via portail.
+tempBanned = Banni temporairement du serveur pour {0}
+tempbanExempt = \u00a77You may not tempban that player
+thunder = Vous avez {0} la foudre dans votre monde.
+thunderDuration = Vous avez {0} la foudre dans le serveur {1} secondes.
+timeBeforeHeal = Temps avant le prochain soin : {0}
+timeBeforeTeleport = Temps avant prochaine t\u00e9l\u00e9portation {0}
+timePattern = (?:([0-9]+)\\\\s*[ya][a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*mo[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*(?:sem|w)[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*[dj][a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*h[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*m[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*(?:s[a-z]*)?)?
+timeSet = Heure modifi\u00e9e dans tous les mondes.
+tradeCompleted = \u00a77\u00c9change termin\u00e9.
+tradeSignEmpty = Le panneau de vente n''as pas encore assez de stock.
treeFailure = \u00a7cEchec de la g\u00e9n\u00e9ration de l''arbre. Essayez de nouveau sur de l''herbe ou de la terre.
-unbannedPlayer = Joueur d\u00e9banni.
-unbannedIP = Adresse IP d\u00e9banni.
-unlimitedItems = Objets illimit\u00e9s:
-none = aucun
-unlimitedItemPermission = \u00a7cas de permission pour l''objet illimit\u00e9 {0}.
-disableUnlimited = \u00a77D\u00e9sactivation du placement illimit\u00e9 de {0} pour {1}.
-enableUnlimited = \u00a77Activation du placement illimit\u00e9 de {0} pour {1}.
-warpListPermission = \u00a7cVous n''avez pas la permission de lister les warps.
-noWarpsDefined = Aucun warp d\u00e9fini.
-warpUsePermission = \u00a7cVous n''avez pas la permission d''utiliser ce warp.
-weatherSunFor = \u00a77Vous avez mis le beau temps dans ce monde pour {0} secondes.
-weatherSun = \u00a77Vous avez mis le beau temps dans ce monde.
-weatherStormFor = \u00a77Vous avez mis l''orage dans votre monde pour {0} secondes.
-weatherStorm = \u00a77Vous avez mis l''orage dans votre monde
-whoisIs = {0} est {1}
-whoisHealth = \u00a79 - Vie:{0}/20
-whoisLocation = \u00a79 - Emplacement:({0}, {1}, {2}, {3})
-whoisMoney = \u00a79 - Argent:{0}
-whoisStatusAway = \u00a79 - Statut:\u00a7cAilleurs\u00a7f
-whoisStatusAvailable = \u00a79 - Statut:Disponible
-whoisIPAddress = \u00a79 - Adresse IP:{0}
-whoisGeoLocation = \u00a79 - Emplacement:{0}
-invalidWorld = \u00a7cMonde invalide.
-possibleWorlds = \u00a77Les mondes possibles sont les nombres 0 par {0}.
+treeSpawned = \u00a77Arbre cr\u00e9\u00e9.
+typeTpaccept = \u00a77Pour le t\u00e9l\u00e9porter, tapez \u00a7c/tpaccept\u00a77.
+typeTpdeny = \u00a77Pour d\u00e9cliner cette demande, entrez \u00a7c/tpdeny\u00a77.
typeWorldName = \u00a77Vous pouvez aussi taper le nom d''un monde sp\u00e9cifique.
-worth = \u00a77Une pile de {0} vaut \u00a7c{1}\u00a77 ({2} objet(s) \u00e0 {3} chacun)
-worthMeta = \u00a77Une pile de {0} avec le metadata de {1} vaut \u00a7c{2}\u00a77 ({3} objet(s) \u00e0 {4} chacun)
-onlyPlayers = Seulement les joueurs en jeu peuvent utiliser {0}.
+unableToSpawnMob = Incapable de spawner un monstre.
+unbannedIP = Adresse IP d\u00e9banni.
+unbannedPlayer = Joueur d\u00e9banni.
unignorePlayer = Vous n''ignorez plus {0}.
-ignorePlayer = Vous ignorez d\u00e9sormais {0}.
-illegalDate = Format de date ill\u00e9gal.
-timePattern = (?:([0-9]+)\\s*[ya][a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:sem|w)[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[dj][a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
-msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
-kits = \u00a77Kits:{0}
-loadWarpError = Echec du chargement du warp {0}
-invalidSignLine = Ligne {0} du panneau est invalide.
\ No newline at end of file
+unknownItemId = Num\u00e9ro d''objet inconnu : {0}
+unknownItemInList = L''objet {0} est inconnu dans la liste {1}.
+unknownItemName = Nom d''objet inconnu : {0}
+unlimitedItemPermission = \u00a7cPas de permission pour l''objet illimit\u00e9 {0}.
+unlimitedItems = Objets illimit\u00e9s:
+unmutedPlayer = Le joueur {0} n''est plus muet.
+upgradingFilesError = Erreur durant la mise \u00e0 jour des fichiers.
+userCreatedPortal = {0} a utilis\u00e9 un portail et a g\u00e9n\u00e9r\u00e9 un portail de sortie.
+userDoesNotExist = L''utilisateur {0} n''existe pas.
+userIsAway = {0} s''est mis en AFK
+userIsNotAway = {0} n''est plus inactif
+userJailed = \u00a77Vous avez \u00e9t\u00e9 emprisonn\u00e9
+userUsedPortal = {0} a utilis\u00e9 un portail existant.
+userdataMoveBackError = Echec du d\u00e9placement de userdata/{0}.tmp \u00e0 userdata/{1}
+userdataMoveError = Echec du d\u00e9placement de userdata/{0} \u00e0 userdata/{1}.tmp
+usingPortal = \u00a77T\u00e9l\u00e9portation via portail vers un portail existant.
+usingTempFolderForTesting = Utilise un fichier temporaire pour un test.
+versionMismatch = Versions diff\u00e9rentes! Mettez s''il vous pla\u00eet {0} \u00e0 la m\u00eame version.
+versionMismatchAll = Mauvaise version! S''il vous plait mettez des jars Essentiels de version identique.
+voiceSilenced = \u00a77Votre voix a \u00e9t\u00e9 r\u00e9duite au silence
+warpDeleteError = Probl\u00e8me concernant la suppression du fichier warp.
+warpListPermission = \u00a7cVous n''avez pas la permission d''afficher la liste des warps.
+warpNotExist = Ce warp n''existe pas.
+warpSet = \u00a77Le warp {0} a \u00e9t\u00e9 cr\u00e9\u00e9.
+warpUsePermission = \u00a7cVous n''avez pas la permission d''utiliser ce warp.
+warpingTo = \u00a77T\u00e9l\u00e9portation au warp {0}.
+weatherStorm = \u00a77Vous avez d\u00e9fini l''orage dans votre monde
+weatherStormFor = \u00a77Vous avez d\u00e9fini l''orage dans votre monde pour {0} secondes.
+weatherSun = \u00a77Vous avez mis le beau temps dans votre monde
+weatherSunFor = \u00a77Vous avez mis le beau temps dans votre monde pour {0} secondes.
+whoisGeoLocation = \u00a79 - Emplacement: {0}
+whoisHealth = \u00a79 - Vie: {0} / 20
+whoisIPAddress = \u00a79 - Adresse IP: {0}
+whoisIs = {0} est {1}
+whoisLocation = \u00a79 - Emplacement: ({0}, {1}, {2}, {3})
+whoisMoney = \u00a79 - Argent: {0}
+whoisStatusAvailable = \u00a79 - Statut: Disponible
+whoisStatusAway = \u00a79 - Statut: \u00a7cAilleurs\u00a7f
+worth = \u00a77Un stack de {0} vaut \u00a7c{1}\u00a77 ({2} objet(s) \u00e0 {3} chacun)
+worthMeta = \u00a77Un stack de {0} avec la m\u00e9tadonn\u00e9e de {1} vaut \u00a7c{2}\u00a77 ({3} objet(s) \u00e0 {4} chacun)
+worthSet = Valeur cr\u00e9e
+year = ann\u00e9e
+years = ann\u00e9es
+youAreHealed = \u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
+youHaveNewMail = \u00a7cVous avez {0} messages! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier.
diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties
new file mode 100644
index 000000000..5091b6d42
--- /dev/null
+++ b/Essentials/src/messages_nl.properties
@@ -0,0 +1,323 @@
+#version: TeamCity
+# Single quotes have to be doubled: ''
+# Translations start here
+# by Geertje123
+addedToAccount = \u00a7a{0} is aan je bankrekening toegevoegd.
+addedToOthersAccount = \u00a7a{0} is toegevoegd aan {1} rekening
+alertBroke = gebroken:
+alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} bij: {3}
+alertPlaced = geplaatst:
+alertUsed = gebruikt:
+backAfterDeath = \u00a77Gebruik de /back command om terug te keren naar het punt waar je dood ging.
+backUsageMsg = \u00a77Bezig met terugkeren naar vorige locatie.
+backupFinished = Backup voltooid
+backupStarted = Backup wordt nu gemaakt
+balance = \u00a77Saldo: {0}
+balanceTop = \u00a77 Top {0} saldi
+banIpAddress = \u00a77Verboden IP-adres
+banExempt = \u00a77Je kunt niet verbieden die speler.
+bannedIpsFileError = Fout bij het lezen van banned-ips.txt
+bannedIpsFileNotFound = banned-ips.txt werd niet gevonden
+bannedPlayersFileError = Fout bij het lezen van banned-players.txt
+bannedPlayersFileNotFound = banned-players.txt werd niet gevonden
+bigTreeFailure = \u00a7cCre\u00ebren van grote boom fout gegaan. Probeer het opnieuw op gras of dirt.
+bigTreeSuccess = \u00a77Grote boom gespawnd.
+broadcast = [\u00a7cBroadcast\u00a7f]\u00a7a {0}
+buildAlert = \u00a7cJe bent niet bevoegd om te bouwen
+bukkitFormatChanged = Bukkit versie formaat veranderd. Versie niet nagekeken.
+burnMsg = \u00a77Je hebt voor {1} seconden {0} in de fik gezet.
+canTalkAgain = \u00a77Je kan weer praten.
+cantFindGeoIpDB = De GeoIP database kon niet gevonden worden!
+cantReadGeoIpDB = Fout bij het lezen van de GeoIP database!
+cantSpawnItem = \u00a7cJe bent niet bevoegd om {0} te spawnen.
+commandFailed = Opdracht {0} mislukt:
+commandNotLoaded = \u00a7cOpdracht {0} is fout geladen.
+compassBearing = \u00a77Ligging: {0} ({1} graden).
+configFileMoveError = Het verplaatsen van config.yml naar de backup locatie is mislukt.
+configFileRenameError = Fout bij het hernoemen van de tijdelijke map naar config.yml
+connectedPlayers = Verbonden spelers:
+connectionFailed = Fout bij het verbinden.
+cooldownWithMessage = \u00a7cAfkoeltijd: {0}
+corruptNodeInConfig = \u00a74Waarschuwing: Het configuratie bestand bevat een fout {0}.
+couldNotFindTemplate = Het sjabloon kon niet gevonden worden {0}
+creatingConfigFromTemplate = Bezig met aanmaken van config vanaf sjabloon: {0}
+creatingEmptyConfig = Bezig met lege config aanmaken: {0}
+creatingPortal = Bezig met cre\u00ebren van portal bij {0},{1},{2}.
+day = dag
+days = dagen
+defaultBanReason = De Ban Hamer heeft gesproken!
+deleteFileError = Het bestand kon niet verwijderd worden: {0}
+deleteJail = \u00a77Gevangenis {0} is verwijderd.
+deleteWarp = \u00a77Warp {0} is verwijderd.
+deniedAccessCommand = {0} werd de toegang geweigerd tot de opdracht.
+dependancyDownloaded = [Essentials] Dependancy {0} downloaded successfully.
+dependancyException = [Essentials] An error occured when trying to download a dependacy
+dependancyNotFound = [Essentials] A required dependancy was not found, downloading now.
+depth = \u00a77Je zit op zeeniveau.
+depthAboveSea = \u00a77Je zit {0} blok(ken) boven zeeniveau.
+depthBelowSea = \u00a77Je zit {0} blok(ken) onder zeeniveau.
+destinationNotSet = Bestemming niet ingesteld
+disableUnlimited = \u00a77Oneindig plaatsen van {0} uitgeschakeld voor {1}.
+disabled = uitgeschakeld
+dontMoveMessage = \u00a77Beginnen met teleporteren in {0}. Niet bewegen.
+downloadingGeoIp = Bezig met downloaden van GeoIP database ... Dit kan een tijdje duren (country: 0.6 MB, city: 20MB)
+duplicatedUserdata = Verdubbelde userdata: {0} en {1}.
+emptyWorldName = Set Home: Naam van wereld is leeg.
+enableUnlimited = \u00a77Oneindig van {0} gegeven aan {1}.
+enabled = ingeschakeld
+errorCallingCommand = Fout bij het aanroepen van de opdracht /{0}
+errorWithMessage = \u00a7cFout: {0}
+essentialsReload = \u00a77Essentials herlaadde {0}
+extinguish = \u00a77Je hebt jezelf uitgeblust.
+extinguishOthers = \u00a77Je hebt {0} uitgeblust.
+failedToCloseConfig = Fout bij het sluiten van config {0}
+failedToCreateConfig = Fout tijdens het aanmaken van config {0}
+failedToWriteConfig = Fout bij het cre\u00ebren van config {0}
+fileRenameError = Hernoemen van {0} mislukt
+foreverAlone = \u00a7cJe hebt niemand waarnaar je kan reageren.
+freedMemory = {0} MB gelost.
+gcchunks = chunks,
+gcentities = entities
+gcfree = Free memory: {0} MB
+gcmax = Maximaal geheugen: {0} MB
+gctotal = Allocated memory: {0} MB
+generatingPortal = \u00a77Uitgangs portal aan het cre\u00ebren.
+geoIpUrlEmpty = GeoIP download url is leeg.
+geoIpUrlInvalid = GeoIP download url is ongeldig.
+geoipJoinFormat = Speler {0} komt uit {1}
+godDisabledFor = uitgeschakeld voor {0}
+godEnabledFor = ingeschakeld voor {0}
+godMode = \u00a77God mode {0}.
+haveBeenReleased = \u00a77Je bent bevrijdt
+heal = \u00a77Je bent gehealed.
+healOther = \u00a77Je healde {0}.
+helpConsole = type ?, Om help vanaf de console te bekijken.
+helpOp = \u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1}
+helpPages = Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f:
+holeInFloor = Gat in de vloer
+homeSet = \u00a77Home ingesteld.
+homeSetToBed = \u00a77Je home is is nu verplaatst naar dit bed.
+hour = uur
+hours = uren
+ignorePlayer = Je negeert {0} vanaf nu.
+illegalDate = Illegaal data formaat.
+infoChapter = Selecteer hoofdstuk:
+infoChapterPages = Hoofdstuk {0}, Pagina \u00a7c{1}\u00a7f van de \u00a7c{2}\u00a7f:
+infoFileDoesNotExist = Bestand info.txt bestaat niet. Bezig met aanmaken.
+infoPages = Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f:
+infoUnknownChapter = Onbekend hoofdstuk.
+invBigger = De inventory van de andere speler is groter dan die van jou.
+invRestored = Je inventory is hersteld.
+invSee = Je kijkt naar de inventory van {0}.
+invSeeHelp = Type /invsee om je inventory te herstellen.
+invalidCharge = \u00a7cOngeldig te laden.
+invalidMob = Ongeldig mob type.
+invalidServer = Ongeldige server!
+invalidSignLine = Regel {0} op het bordje is ongeldig.
+invalidWorld = \u00a7cOngeldige wereld.
+inventoryCleared = \u00a77inventory leeggemaakt.
+inventoryClearedOthers = \u00a77inventory van \u00a7c{0}\u00a77 leeggemaakt.
+is = is
+itemCannotBeSold = Dat voorwerp kan niet aan de server worden verkocht.
+itemMustBeStacked = Voorwerp moet geruild worden als stapel. Een hoeveelheid van 2 moet dus geruild worden als twee stapels, etc.
+itemNotEnough1 = \u00a7cJe hebt niet genoeg van dat voorwerp om te verkopen.
+itemNotEnough2 = \u00a77Type /sell itemname Als je alles daarvan wilt verkopen
+itemNotEnough3 = \u00a77/sell itemname -1 zorgt ervoor dat ze allemaal behalve 1 worden verkocht, etc.
+itemSellAir = Je wilde serieus lucht verkopen? Plaats een voorwerp in je hand.
+itemSold = \u00a77Verkocht voor \u00a7c {0} \u00a77 ({1} voorwerpen voor {2} per stuk)
+itemSoldConsole = {0} verkocht {1} voor \u00a77 {2} \u00a77 ({3} voorwerpen voor {4} per stuk)
+itemSpawn = \u00a77Geven van {0} van de {1}
+itemsCsvNotLoaded = De item kunnen niet geladen worden.csv.
+jailMessage = \u00a7cYou do the crime, you do the time.
+jailNotExist = Die gevangenis bestaat niet.
+jailSet = \u00a77Gevangenis {0} is ingesteld
+jumpError = Dat zou je computers hersenen beschadigen.
+kickDefault = Gekicked van de server
+kickExempt = \u00a77Je kunt niet schoppen die speler.
+kill = \u00a77Jij doodde {0}.
+kitError = \u00a7cEr zijn geen geldige kits.
+kitError2 = \u00a7cDie kit bestaat niet of is verkeerde beschreven.
+kitErrorHelp = \u00a7cMisschien mist er een hoeveelheid van het item in de configuratie?
+kitGive = \u00a77Kit {0} wordt gegeven.
+kitInvFull = \u00a7cJe inventory was vol, de kit wordt op de grond geplaatst
+kitTimed = \u00a7cJe kan die kit pas weer gebruiken over {0}.
+kits = \u00a77Kits: {0}
+lightningSmited = \u00a77Je bent zojuist verbrand
+lightningUse = \u00a77Brand {0}
+loadWarpError = Fout bij het laden van warp {0}
+loadinfo = Build {1} geladen {0} van {2}
+localFormat = Local: <{0}> {1}
+mailClear = \u00a7cType /mail clear, om ej berichten als gelezen te markeren.
+mailCleared = \u00a77Bericht geklaard!
+mailSent = \u00a77Bericht verzonden!
+markMailAsRead = \u00a7cType /mail clear, om je berichten als gelezen te markeren
+markedAsAway = \u00a77Je staat nu als afwezig gemeld.
+markedAsNotAway = \u00a77Je staat niet meer als afwezig gemeld.
+mayNotJail = \u00a7cJe mag die speler niet in de gevangenis zetten.
+me = me
+minute = minuut
+minutes = minuten
+missingItems = Je hebt geen {0}x {1}.
+missingPrefixSuffix = Er mist een prefix of suffix voor {0}
+mobSpawnError = Fout bij het veranderen van de mob spawner.
+mobSpawnLimit = Grootte van de mob hang af van het server limiet
+mobSpawnTarget = Target blok moet een mob spawner zijn.
+moneyRecievedFrom = \u00a7a{0} is ontvangen van {1}
+moneySentTo = \u00a7a{0} is verzonden naar {1}
+moneyTaken = {0} van je bankrekening afgehaald.
+month = maand
+months = maanden
+moreThanZero = Aantal moet groter zijn dan 0.
+msgFormat = \u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
+mutedPlayer = Speler {0} gemute.
+mutedPlayerFor = Speler {0} is gemute voor {1}.
+mutedUserSpeaks = {0} probeerde te praten, maar is gemute.
+needTpohere = Je moet toegang krijgen tot /tpohere om naar andere spelers te teleporteren.
+negativeBalanceError = Speler is niet toegestaan om een negatief saldo te hebben.
+nickChanged = Nickname veranderd.
+nickInUse = \u00a7cDie naam is al in gebruik.
+nickNamesAlpha = \u00a7cNicknames moeten alfanumeriek zijn.
+nickNoMore = \u00a7Je hebt geen nickname meer.
+nickOthersPermission = \u00a7cJe hebt geen toestemming om de nickname van anderen te veranderen
+nickSet = \u00a77Je nickname is nu \u00a7c{0}
+noAccessCommand = \u00a7cJe hebt geen toegang tot die opdracht.
+noAccessPermission = \u00a7cJe hebt hier geen toegang voor {0}.
+noDestroyPermission = \u00a7cJe hebt geen toegang om dat te vernietigen {0}.
+noHomeSet = Je hebt geen home gemaakt.
+noHomeSetPlayer = Speler heeft geen home.
+noKitPermission = \u00a7cJe hebt de \u00a7c{0}\u00a7c toestemming nodig om die kit te gebruiken.
+noKits = \u00a77Er zijn nog geen kits beschikbaar
+noMail = Je hebt geen berichten
+noMailSendPerm = \u00a7cJe hebt de \u00a7fessentials.mail.send\u00a7c toestemming niet.
+noMotd = \u00a7cEr is geen bericht van de dag."
+noNewMail = \u00a77Je hebt geen nieuwe berichten.
+noPendingRequest = Je hebt geen aanvragen.
+noPlacePermission = \u00a7cYou do not have permission to place a block near that sign.
+noRules = \u00a7cEr zijn nog geen regels gegeven.
+noWarpsDefined = Geen warps gedefinieerd
+none = geen
+notAllowedToQuestion = \u00a7cJe bent niet bevoegd om de vraag functie te gebruiken.
+notAllowedToShout = \u00a7cJe bent niet bevoegd om de roep functie te gebruiken.
+notEnoughMoney = Je hebt niet voldoende middelen.
+notRecommendedBukkit = De Bukkit versie is niet de aangeraden build voor Essentials.
+notSupportedYet = Nog niet ondersteund.
+now = nu
+numberRequired = Er moet daar een nummer, grapjas.
+onlyDayNight = /time oondersteund alleen day/night.
+onlyPlayers = Alleen in-game spelers kunnen {0} gebruiken.
+onlySunStorm = /weather only supports sun/storm.
+parseError = Fout bij ontleding {0} op regel {1}
+pendingTeleportCancelled = \u00a7cAangevraagde teleportatie afgelast.
+permissionsError = Vermisde Permissions/GroupManager; chat prefixes/suffixes worden uitgeschakeld.
+playerBanned = \u00a7cSpeler {0} is geband: {1}
+playerInJail = \u00a7cSpeler zit al in de gevangenis {0}.
+playerJailed = \u00a77Speler {0} is in de gevangenis gezet.
+playerJailedFor = \u00a77Speler {0} is in de gevangenis gezet voor {1}.
+playerKicked = \u00a7cPlayer {0} kicked: {1}
+playerNeverOnServer = \u00a7cSpeler {0} is nooit op deze server geweest.
+playerNotFound = \u00a7cSpeler niet gevonden.
+pong = Pong!
+possibleWorlds = \u00a77Mogelijk zijn de werelden de nummer 0 tot en met {0}.
+powerToolAir = Command kan niet worden bevestigd aan de lucht.
+powerToolAttach = Command toegewezen aan {0}
+powerToolRemove = Command verwijderd van {0}
+protectionOwner = \u00a76[EssentialsProtect] Bescherming eigenaar: {0}
+questionFormat = \u00a77[Question]\u00a7f {0}
+reloadAllPlugins = \u00a77Alle plugins zijn herladen.
+requestAccepted = \u00a77Teleporteer aanvraag geaccepteerd.
+requestDenied = \u00a77Teleporteer aanvraag geweigerd.
+requestSent = \u00a77Aanvraag verstuurd naar {0}\u00a77.
+returnPlayerToJailError = Fout opgetreden bij terugzetten van speler in gevangenis.
+second = seconde
+seconds = seconde
+seenOffline = Speler {0} is offline vanaf {1}
+seenOnline = Speler {0} is online vanaf {1}
+serverFull = Server is vol
+sheepMalformedColor = Misvoormde kleur.
+shoutFormat = \u00a77[Shout]\u00a7f {0}
+similarWarpExist = Er bestaat al een warp met dezelfde naam.
+slimeMalformedSize = Misvoormde grootte.
+soloMob = Die mob is liever in zijn eentje
+spawnSet = \u00a77Spawn locatie voor de groep {0} ingesteld.
+spawned = gespawned
+suicideMessage = \u00a77Vaarwel vreedzame wereld...
+suicideSuccess = \u00a77{0} pleegde zelfmoord
+takenFromAccount = \u00a7c{0} is van je bank rekening afgehaald.
+takenFromOthersAccount = \u00a7c{0} is overgenomen uit {1} account.
+teleportAll = \u00a77Bezig met teleporteren van alle spelers...
+teleportAtoB = \u00a77{0}\u00a77 is naar {1}\u00a77 geteleporteerd.
+teleportDisabled = {0} heeft teleporteren uit gezet.
+teleportHereRequest = \u00a7c{0}\u00a7c Heeft gevraagd of hij/zij naar jou mag teleporteren.
+teleportNewPlayerError = Fout bij het teleporteren van nieuwe speler.
+teleportRequest = \u00a7c{0}\u00a7c vraagt of hij jou kan teleporteren.
+teleportTop = \u00a77Bezig met teleporteren naar de top.
+teleportationCommencing = \u00a77Aan het beginnen met teleporteren...
+teleportationDisabled = \u00a77Teleportatie uitgeschakeld.
+teleportationEnabled = \u00a77Teleportatie ingeschakeld.
+teleporting = \u00a77Bezig met teleporteren...
+teleportingPortal = \u00a77Bezig met teleporteren via de portal.
+tempBanned = Tijdelijk geband voor {0}
+tempbanExempt = \u00a77You may not tempban that player
+thunder = Je {0} onweert de wereld
+thunderDuration = Je {0} onweert de wereld voor {1} seconde.
+timeBeforeHeal = Afkoeltijd tot de volgende heal: {0}
+timeBeforeTeleport = Afkoeltijd tot de volgende teleport: {0}
+timePattern = (?:([0-9]+)\\s*[yj][a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[oa][a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*[hu][a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)?
+timeSet = Tijd ingesteld in alle werelden.
+tradeCompleted = \u00a77Ruil verricht.
+tradeSignEmpty = Het handelsbordje heeft een te kleine voorraad.
+treeFailure = \u00a7cFout bij het genereren van boom. Pobeer het opnieuw op gras of dirt.
+treeSpawned = \u00a77Boom gespawned.
+typeTpaccept = \u00a77Om te teleporten, type \u00a7c/tpaccept\u00a77.
+typeTpdeny = \u00a77Om te weigeren, type \u00a7c/tpdeny\u00a77.
+typeWorldName = \u00a77Je kan ook de exacte naam van de wereld typen.
+unableToSpawnMob = De mob kan niet gespawned worden.
+unableToSpawnMob = Mob kon niet gespawnd worden.
+unbannedIP = IP adres unbanned.
+unbannedPlayer = Speler unbanned.
+unignorePlayer = Je negeert {0} niet meer.
+unknownItemId = Onbekend voorwerp id: {0}
+unknownItemInList = Onbekend voorwerp {0} in {1} lijst.
+unknownItemName = Onbekende voorwerp naam: {0}
+unlimitedItemPermission = \u00a7cOnbevoegd om oneindig {0} te hebben.
+unlimitedItems = Oneindige voorwerpen:
+unmutedPlayer = Speler {0} ge-unmute.
+upgradingFilesError = Fout tijdens het upgraden van de bestanden
+userCreatedPortal = {0} gebruikte een portal en maakte een uitgangs portal.
+userDoesNotExist = Speler {0} bestaat niet.
+userIsAway = {0} is nu AFK
+userIsNotAway = {0} is niet meer AFK
+userJailed = \u00a77Je bent in de gevangenis gezet.
+userUsedPortal = {0} gebruikte een bestaande uitgangs portal.
+userdataMoveBackError = Fout bij het verplaasten van userdata/{0}.tmp naar userdata/{1}
+userdataMoveError = Fout bij het verplaasten van userdata/{0} naar userdata/{1}.tmp
+usingPortal = \u00a77Bezig met via de portal naar de uitgangs portal.
+usingTempFolderForTesting = Tijdelijke map om te testen:
+versionMismatch = Verkeerde versie! Update {0} naar dezelfde versie.
+versionMismatchAll = Verkeerde versie! Update alle Essentials jars naar dezelfde versie.
+voiceSilenced = \u00a77Je kan niet meer praten
+warpDeleteError = Fout bij het verwijderen van het warp bestand.
+warpListPermission = \u00a7cJe hebt geen toegang om die warp te maken.
+warpNotExist = Die warp bestaat niet.
+warpSet = \u00a77Warp {0} ingesteld.
+warpUsePermission = \u00a7cOnbevoegd om die warp te gebruiken.
+warpingTo = \u00a77Aan het warpen naar {0}.
+weatherStorm = \u00a77Je hebt het weer naar storm gezet in de wereld
+weatherStormFor = \u00a77Je hebt het weer in de wereld naar storm gezet voor {0} seconde
+weatherSun = \u00a77Je hebt het weer naar zon gezet in de wereld
+weatherSunFor = \u00a77Je hebt het weer in de wereld naar zon gezet voor {0} seconde
+whoisGeoLocation = \u00a79 - Locatie: {0}
+whoisHealth = \u00a79 - Levens: {0}/20
+whoisIPAddress = \u00a79 - IP Adres: {0}
+whoisIs = {0} is {1}
+whoisLocation = \u00a79 - Locatie: ({0}, {1}, {2}, {3})
+whoisMoney = \u00a79 - Geld: {0}
+whoisStatusAvailable = \u00a79 - Status: Beschikbaar
+whoisStatusAway = \u00a79 - Status: \u00a7cWeg\u00a7f
+worth = \u00a77Stapel {0} met waarde \u00a7c{1}\u00a77 ({2} voorwerp(en) voor {3} per stuk)
+worthMeta = \u00a77Stapel {0} met een metadata van {1} met waarde \u00a7c{2}\u00a77 ({3} voorwerp(en) voor {4} per stuk)
+worthSet = Waarde ingesteld
+year = jaar
+years = jaren
+youAreHealed = \u00a77Je bent gehealed.
+youHaveNewMail = \u00a7cJe hebt {0} berichten!\u00a7f Type \u00a77/mail read\u00a7f om je berichten te bekijken.
diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml
index b255f4c82..26bcf5806 100644
--- a/Essentials/src/plugin.yml
+++ b/Essentials/src/plugin.yml
@@ -12,11 +12,11 @@ commands:
usage: /
aliases: [eafk]
antioch:
- description: 'A little surprise for operators. Warning: Point away from face.'
+ description: 'A little surprise for operators.'
usage: /
aliases: [eantioch]
back:
- description: Teleports you to your location prior to teleporting/spawning/warping.
+ description: Teleports you to your location prior to tp/spawn/warp.
usage: /
aliases: [eback]
backup:
@@ -24,9 +24,13 @@ commands:
usage: /
aliases: [ebackup]
balance:
- description: States the current balance of a player. Defaults to self.
+ description: States the current balance of a player.
usage: /
aliases: [bal,emoney,ebalance,ebal]
+ balancetop:
+ description: Gets the top x balance values. (max 10)
+ usage: /
+ aliases: [baltop,ebaltop,ebalancetop]
ban:
description: Bans a player.
usage: / [player]
@@ -54,9 +58,11 @@ commands:
compass:
description: Describes your current bearing.
usage: /
+ aliases: [ecompass]
deljail:
description: Removes a jail
usage: / [jailname]
+ aliases: [edeljail]
delwarp:
description: Deletes the specified warp.
usage: / [warp]
@@ -75,13 +81,17 @@ commands:
ext:
description: Extinguish players.
usage: /
- aliases: [extinguish]
+ aliases: [extinguish,eext,eextinguish]
+ fireball:
+ description: Throw a fireball.
+ usage: /
+ aliases: [efireball]
getpos:
description: Get your current coordinates.
usage: /
aliases: [coords,egetpos]
gc:
- description: Reports garbage collection info; useful to plugin/CraftBukkit developers
+ description: Reports garbage collection info; useful to developers.
usage: /
aliases: [mem,memory,egc]
give:
@@ -98,7 +108,7 @@ commands:
aliases: [eheal]
help:
description: Views a list of available commands.
- usage: /
+ usage: / [search term] [page]
aliases: [ehelp]
helpop:
description: Request help from online operators.
@@ -114,7 +124,7 @@ commands:
info:
description: Shows information set by the server owner
usage: / [chapter] [page]
- aliases: [ifo,einfo,eabout]
+ aliases: [ifo,einfo,eabout,news]
invsee:
description: See the inventory of other players.
usage: /
@@ -138,19 +148,22 @@ commands:
kickall:
description: Kicks all players off the server except the issuer.
usage: /
+ aliases: [ekickall]
kit:
description: Obtains the specified kit or views all available kits.
usage: /
kill:
description: Kills specified player.
usage: /
+ aliases: [ekill]
list:
description: List all online players.
usage: /
aliases: [playerlist,who,online,elist]
lightning:
- description: Command the power of Thor. Look and strike or pass a player args.
- usage: /
+ description: The power of Thor. Strike at cursor or player.
+ usage: / [player]
+ aliases: [strike,elightning,estrike]
mail:
description: Manages inter-player, intra-server mail.
usage: / [read|clear|send [to] [message]]
@@ -175,6 +188,10 @@ commands:
description: Change your nickname or that of another player.
usage: / [nickname|off]
aliases: [enick]
+ nuke:
+ description: May death rain upon them.
+ usage: /
+ aliases: [enuke]
pay:
description: Pays another player from your balance
usage: / [player] [amount]
@@ -190,9 +207,9 @@ commands:
r:
description: Quickly reply to the last player to message you.
usage: / [message]
- aliases: [er]
+ aliases: [er,reply,ereply]
realname:
- description: Displays the username of a user based on his/her nickname.
+ description: Displays the username of a user based on nickname.
usage: / [nickname]
aliases: [erealname]
reloadall:
@@ -206,6 +223,7 @@ commands:
seen:
description: Shows the last logout time of a player
usage: / [playername]
+ aliases: [eseen]
sell:
description: Sells the item currently in your hand.
usage: / [itemname|id|hand|inventory|blocks] [-][amount]
@@ -223,15 +241,17 @@ commands:
usage: / [warp]
aliases: [createwarp,esetwarp]
setworth:
- description: Set the value of an item for sale, will add item if doesn't exist
+ description: Set the sell value of an item.
usage: / [itemname|id] [price]
aliases: [esetworth]
socialspy:
- description: Toggles if you can see /msg and /mail commands in chat.
+ description: Toggles if you can see msg/mail commands in chat.
usage: /
+ aliases: [esocialspy]
spawner:
description: Change the mob type of a spawner
usage: / [mob]
+ aliases: [espawner]
spawnmob:
description: Spawns a mob.
usage: / [mob]<:data><,mount<:data>>
@@ -243,19 +263,21 @@ commands:
tempban:
description: Temporary ban a user.
usage: / [playername] [datediff]
+ aliases: [etempban]
thunder:
description: Enable/disable thunder.
usage: / [duration]
+ aliases: [ethunder]
time:
- description: Change the server time to day or night.
- usage: / [day|night]
+ description: Change the time to day or night of the player (default) or world (essentials.time.world permission).
+ usage: / [day|night|reset]
aliases: [etime]
togglejail:
description: Prevents a player from interacting with the world and teleports him/her to the the jail specified
usage: / [player] [jailname]
aliases: [tjail,etogglejail]
top:
- description: Teleport to the highest block at your current coordinates.
+ description: Teleport to the highest block at your current position.
usage: /
aliases: [etop]
tp:
@@ -272,7 +294,7 @@ commands:
description: Request that the specified player teleport to you.
usage: /
tpall:
- desctiption: Teleport all online players to another player.
+ description: Teleport all online players to another player.
usage: /
tpdeny:
description: Reject a teleport request.
@@ -280,7 +302,7 @@ commands:
tphere:
description: Teleport a player to you.
usage: / [player]
- aliases: s
+ aliases: [s]
tpo:
description: Teleport override for tptoggle.
usage: /
@@ -300,8 +322,7 @@ commands:
unban:
description: Unbans the specified player.
usage: / [player]
- aliases: pardon
- aliases: [eunban]
+ aliases: [pardon,eunban]
unbanip:
description: Unbans the specified IP address.
usage: / [address]
@@ -317,7 +338,7 @@ commands:
weather:
description: Setting the weather.
usage: / [duration]
- aliases: [sky]
+ aliases: [sky,sun,storm,eweather]
whois:
description: Determine the username behind a nickname.
usage: / [nickname]
diff --git a/Essentials/test/com/earth2me/essentials/EconomyTest.java b/Essentials/test/com/earth2me/essentials/EconomyTest.java
index 74f5f11d2..219d68b40 100644
--- a/Essentials/test/com/earth2me/essentials/EconomyTest.java
+++ b/Essentials/test/com/earth2me/essentials/EconomyTest.java
@@ -4,22 +4,24 @@ import com.earth2me.essentials.api.Economy;
import com.earth2me.essentials.api.NoLoanPermittedException;
import com.earth2me.essentials.api.UserDoesNotExistException;
import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import junit.framework.TestCase;
+import org.bukkit.World.Environment;
import org.bukkit.plugin.InvalidDescriptionException;
+import org.junit.Test;
public class EconomyTest extends TestCase
{
- private final OfflinePlayer base1;
- private final Essentials ess;
+ private final transient Essentials ess;
+ private final static String NPCNAME = "npc1";
+ private final static String PLAYERNAME = "TestPlayer1";
- public EconomyTest(String testName)
+ public EconomyTest(final String testName)
{
super(testName);
ess = new Essentials();
- FakeServer server = new FakeServer();
+ final FakeServer server = new FakeServer();
+ server.createWorld("testWorld", Environment.NORMAL);
try
{
ess.setupForTesting(server);
@@ -32,46 +34,45 @@ public class EconomyTest extends TestCase
{
fail("IOException");
}
- base1 = new OfflinePlayer("TestPlayer1");
- server.addPlayer(base1);
+ server.addPlayer(new OfflinePlayer(PLAYERNAME, ess));
}
-
+
// only one big test, since we use static instances
+ @Test
public void testEconomy()
{
// test NPC
- String npcName = "npc1";
- assertFalse(Economy.playerExists(npcName));
- assertTrue(Economy.createNPC(npcName));
- assertTrue(Economy.playerExists(npcName));
- assertNotNull(ess.getOfflineUser(npcName));
+ assertFalse("NPC does not exists", Economy.playerExists(NPCNAME));
+ assertTrue("Create NPC", Economy.createNPC(NPCNAME));
+ assertTrue("NPC exists", Economy.playerExists(NPCNAME));
+ assertNotNull("NPC can be accessed", ess.getOfflineUser(NPCNAME));
try
{
- Economy.removeNPC(npcName);
+ Economy.removeNPC(NPCNAME);
}
catch (UserDoesNotExistException ex)
{
fail(ex.getMessage());
}
- assertFalse(Economy.playerExists(npcName));
-
+ assertFalse("NPC can be removed", Economy.playerExists(NPCNAME));
+
//test Math
try
{
- String playerName = "TestPlayer1";
- assertTrue(Economy.playerExists(playerName));
- Economy.resetBalance(playerName);
- assertEquals(0.0, Economy.getMoney(playerName));
- Economy.add(playerName, 10.0);
- assertEquals(10.0, Economy.getMoney(playerName));
- Economy.subtract(playerName, 5.0);
- assertEquals(5.0, Economy.getMoney(playerName));
- Economy.multiply(playerName, 2.0);
- assertEquals(10.0, Economy.getMoney(playerName));
- Economy.divide(playerName, 2.0);
- assertEquals(5.0, Economy.getMoney(playerName));
- Economy.setMoney(playerName, 10.0);
- assertEquals(10.0, Economy.getMoney(playerName));
+
+ assertTrue("Player exists", Economy.playerExists(PLAYERNAME));
+ Economy.resetBalance(PLAYERNAME);
+ assertEquals("Player has no money", 0.0, Economy.getMoney(PLAYERNAME));
+ Economy.add(PLAYERNAME, 10.0);
+ assertEquals("Add money", 10.0, Economy.getMoney(PLAYERNAME));
+ Economy.subtract(PLAYERNAME, 5.0);
+ assertEquals("Subtract money", 5.0, Economy.getMoney(PLAYERNAME));
+ Economy.multiply(PLAYERNAME, 2.0);
+ assertEquals("Multiply money", 10.0, Economy.getMoney(PLAYERNAME));
+ Economy.divide(PLAYERNAME, 2.0);
+ assertEquals("Divide money", 5.0, Economy.getMoney(PLAYERNAME));
+ Economy.setMoney(PLAYERNAME, 10.0);
+ assertEquals("Set money", 10.0, Economy.getMoney(PLAYERNAME));
}
catch (NoLoanPermittedException ex)
{
@@ -81,24 +82,23 @@ public class EconomyTest extends TestCase
{
fail(ex.getMessage());
}
-
+
//test Format
- assertEquals("$1000", Economy.format(1000.0));
- assertEquals("$10", Economy.format(10.0));
- assertEquals("$10.10", Economy.format(10.10));
- assertEquals("$10.10", Economy.format(10.102));
- assertEquals("$10.11", Economy.format(10.109));
-
-
+ assertEquals("Format $1000", "$1000", Economy.format(1000.0));
+ assertEquals("Format $10", "$10", Economy.format(10.0));
+ assertEquals("Format $10.10", "$10.10", Economy.format(10.10));
+ assertEquals("Format $10.10", "$10.10", Economy.format(10.102));
+ assertEquals("Format $10.11", "$10.11", Economy.format(10.109));
+
+
//test Exceptions
try
{
- String playerName = "TestPlayer1";
- assertTrue(Economy.playerExists(playerName));
- Economy.resetBalance(playerName);
- assertEquals(0.0, Economy.getMoney(playerName));
- Economy.subtract(playerName, 5.0);
- fail();
+ assertTrue("Player exists", Economy.playerExists(PLAYERNAME));
+ Economy.resetBalance(PLAYERNAME);
+ assertEquals("Reset balance", 0.0, Economy.getMoney(PLAYERNAME));
+ Economy.subtract(PLAYERNAME, 5.0);
+ fail("Did not throw exception");
}
catch (NoLoanPermittedException ex)
{
@@ -107,12 +107,11 @@ public class EconomyTest extends TestCase
{
fail(ex.getMessage());
}
-
+
try
{
- String playerName = "UnknownPlayer";
- Economy.resetBalance(playerName);
- fail();
+ Economy.resetBalance("UnknownPlayer");
+ fail("Did not throw exception");
}
catch (NoLoanPermittedException ex)
{
diff --git a/Essentials/test/com/earth2me/essentials/FakeServer.java b/Essentials/test/com/earth2me/essentials/FakeServer.java
index 4cabbb9f8..1d2ddd9c1 100644
--- a/Essentials/test/com/earth2me/essentials/FakeServer.java
+++ b/Essentials/test/com/earth2me/essentials/FakeServer.java
@@ -193,9 +193,9 @@ public class FakeServer implements Server
players.add(base1);
}
- public OfflinePlayer createPlayer(String name)
+ public OfflinePlayer createPlayer(String name, IEssentials ess)
{
- OfflinePlayer player = new OfflinePlayer(name);
+ OfflinePlayer player = new OfflinePlayer(name, ess);
player.setLocation(new Location(worlds.get(0), 0, 0, 0, 0, 0));
return player;
}
@@ -239,4 +239,9 @@ public class FakeServer implements Server
{
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ public World getWorld(long l)
+ {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
}
diff --git a/Essentials/test/com/earth2me/essentials/UserTest.java b/Essentials/test/com/earth2me/essentials/UserTest.java
index 3bfe0fad0..2b138d687 100644
--- a/Essentials/test/com/earth2me/essentials/UserTest.java
+++ b/Essentials/test/com/earth2me/essentials/UserTest.java
@@ -3,7 +3,6 @@ package com.earth2me.essentials;
import java.io.IOException;
import junit.framework.TestCase;
import org.bukkit.Location;
-import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.plugin.InvalidDescriptionException;
@@ -32,7 +31,7 @@ public class UserTest extends TestCase
{
fail("IOException");
}
- base1 = server.createPlayer("testPlayer1");
+ base1 = server.createPlayer("testPlayer1", ess);
server.addPlayer(base1);
}
@@ -43,7 +42,7 @@ public class UserTest extends TestCase
public void testUpdate()
{
- OfflinePlayer base1alt = server.createPlayer(base1.getName());
+ OfflinePlayer base1alt = server.createPlayer(base1.getName(), ess);
assertEquals(base1alt, ess.getUser(base1alt).getBase());
}
@@ -52,7 +51,7 @@ public class UserTest extends TestCase
User user = ess.getUser(base1);
Location loc = base1.getLocation();
user.setHome();
- OfflinePlayer base2 = server.createPlayer(base1.getName());
+ OfflinePlayer base2 = server.createPlayer(base1.getName(), ess);
User user2 = ess.getUser(base2);
Location home = user2.getHome(loc);
assertEquals(loc.getWorld().getName(), home.getWorld().getName());
diff --git a/Essentials/test/com/earth2me/essentials/UtilTest.java b/Essentials/test/com/earth2me/essentials/UtilTest.java
index 4e7949448..4772b4923 100644
--- a/Essentials/test/com/earth2me/essentials/UtilTest.java
+++ b/Essentials/test/com/earth2me/essentials/UtilTest.java
@@ -1,37 +1,45 @@
package com.earth2me.essentials;
-import java.io.File;
import java.io.IOException;
import java.util.Calendar;
import java.util.GregorianCalendar;
import junit.framework.TestCase;
+import org.bukkit.World.Environment;
+import org.bukkit.plugin.InvalidDescriptionException;
public class UtilTest extends TestCase
{
- public void testFDDnow() {
+ private final Essentials ess;
+ private final FakeServer server;
+
+ public UtilTest()
+ {
+ ess = new Essentials();
+ server = new FakeServer();
+ server.createWorld("testWorld", Environment.NORMAL);
try
{
- Util.updateLocale("en_US", File.createTempFile("test1", "").getParentFile());
+ ess.setupForTesting(server);
+ }
+ catch (InvalidDescriptionException ex)
+ {
+ fail("InvalidDescriptionException");
}
catch (IOException ex)
{
- fail(ex.getMessage());
+ fail("IOException");
}
+ Util.updateLocale("en_US", ess);
+ }
+
+ public void testFDDnow() {
Calendar c = new GregorianCalendar();
String resp = Util.formatDateDiff(c, c);
assertEquals(resp, "now");
}
public void testFDDfuture() {
- try
- {
- Util.updateLocale("en_US", File.createTempFile("test2", "").getParentFile());
- }
- catch (IOException ex)
- {
- fail(ex.getMessage());
- }
Calendar a, b;
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
b = new GregorianCalendar(2010, 1, 1, 10, 0, 1);
@@ -99,14 +107,6 @@ public class UtilTest extends TestCase
}
public void testFDDpast() {
- try
- {
- Util.updateLocale("en_US", File.createTempFile("test3", "").getParentFile());
- }
- catch (IOException ex)
- {
- fail(ex.getMessage());
- }
Calendar a, b;
a = new GregorianCalendar(2010, 1, 1, 10, 0, 0);
b = new GregorianCalendar(2010, 1, 1, 9, 59, 59);
diff --git a/EssentialsChat/nbproject/project.properties b/EssentialsChat/nbproject/project.properties
index 89b368bee..2e51b176b 100644
--- a/EssentialsChat/nbproject/project.properties
+++ b/EssentialsChat/nbproject/project.properties
@@ -26,14 +26,14 @@ dist.jar=${dist.dir}/EssentialsChat.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
-file.reference.craftbukkit-0.0.1-SNAPSHOT.jar=../lib/craftbukkit-0.0.1-SNAPSHOT.jar
-file.reference.Permissions.jar=..\\lib\\Permissions.jar
+file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar
+file.reference.Factions.jar=../lib/Factions.jar
includes=**
jar.compress=false
javac.classpath=\
- ${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}:\
- ${file.reference.Permissions.jar}:\
- ${reference.Essentials.jar}
+ ${reference.Essentials.jar}:\
+ ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}:\
+ ${file.reference.Factions.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java
index 0271fff6f..fcc734de2 100644
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java
@@ -1,35 +1,33 @@
package com.earth2me.essentials.chat;
-import com.earth2me.essentials.Essentials;
+import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.Util;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.event.Event.Priority;
import org.bukkit.event.Event.Type;
-import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
public class EssentialsChat extends JavaPlugin
{
- private static final Logger logger = Logger.getLogger("Minecraft");
-
- public EssentialsChat()
- {
- super();
- }
+ private static final Logger LOGGER = Logger.getLogger("Minecraft");
public void onEnable()
{
- PluginManager pm = getServer().getPluginManager();
- EssentialsChatPlayerListener playerListener = new EssentialsChatPlayerListener(getServer());
- pm.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this);
- pm.registerEvent(Type.PLAYER_CHAT, playerListener, Priority.Highest, this);
- if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion())) {
- logger.log(Level.WARNING, Util.i18n("versionMismatchAll"));
+ final PluginManager pluginManager = getServer().getPluginManager();
+ final IEssentials ess = (IEssentials)pluginManager.getPlugin("Essentials");
+
+ EssentialsChatPlayerListener.checkFactions(pluginManager);
+
+ final EssentialsChatPlayerListener playerListener = new EssentialsChatPlayerListener(getServer(), ess);
+ pluginManager.registerEvent(Type.PLAYER_CHAT, playerListener, Priority.Highest, this);
+ if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
+ {
+ LOGGER.log(Level.WARNING, Util.i18n("versionMismatchAll"));
}
- logger.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), Essentials.AUTHORS));
+ LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
}
public void onDisable()
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java
index d3dff8538..60af127ad 100644
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java
+++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListener.java
@@ -1,61 +1,148 @@
package com.earth2me.essentials.chat;
-import com.earth2me.essentials.Essentials;
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import java.util.logging.Logger;
+import org.bukkit.Location;
import org.bukkit.Server;
+import org.bukkit.World;
+import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerListener;
-import org.bukkit.event.player.PlayerRespawnEvent;
+import org.bukkit.plugin.Plugin;
+import org.bukkit.plugin.PluginManager;
+
+import org.mcteam.factions.Factions;
public class EssentialsChatPlayerListener extends PlayerListener
{
- private final Server server;
+ private static final Logger LOGGER = Logger.getLogger("Minecraft");
+ private final transient IEssentials ess;
+ private final transient Server server;
+ private static Factions factions = null;
- public EssentialsChatPlayerListener(Server server)
+ public EssentialsChatPlayerListener(final Server server, final IEssentials ess)
{
this.server = server;
+ this.ess = ess;
}
@Override
- @SuppressWarnings("CallToThreadDumpStack")
- public void onPlayerJoin(PlayerJoinEvent event)
+ public void onPlayerChat(final PlayerChatEvent event)
{
- try
+ if (event.isCancelled())
{
- EssentialsChatWorker.onPlayerJoin(server, event);
+ return;
}
- catch (Throwable ex)
+
+ if (factions != null && (factions.shouldLetFactionsHandleThisChat(event)))
+ return;
+
+ final User user = ess.getUser(event.getPlayer());
+
+ if (user.isAuthorized("essentials.chat.color"))
{
- ex.printStackTrace();
+ event.setMessage(event.getMessage().replaceAll("&([0-9a-f])", "§$1"));
+ }
+
+ event.setFormat(ess.getSettings().getChatFormat(user.getGroup()).replace('&', '§').replace("§§", "&").replace("{DISPLAYNAME}", "%1$s").replace("{GROUP}", user.getGroup()).replace("{MESSAGE}", "%2$s").replace("{WORLDNAME}", user.getWorld().getName()).replace("{SHORTWORLDNAME}", user.getWorld().getName().substring(0, 1).toUpperCase()));
+
+ final int radius = ess.getSettings().getChatRadius();
+ if (radius < 1)
+ {
+ return;
+ }
+
+ if (event.getMessage().startsWith("!") && event.getMessage().length() > 1)
+ {
+ if (user.isAuthorized("essentials.chat.shout"))
+ {
+ event.setMessage(event.getMessage().substring(1));
+ event.setFormat(Util.format("shoutFormat", event.getFormat()));
+ return;
+ }
+ user.sendMessage(Util.i18n("notAllowedToShout"));
+ event.setCancelled(true);
+ return;
+ }
+
+ if (event.getMessage().startsWith("?") && event.getMessage().length() > 1)
+ {
+ if (user.isAuthorized("essentials.chat.question"))
+ {
+ event.setMessage(event.getMessage().substring(1));
+ event.setFormat(Util.format("questionFormat", event.getFormat()));
+ return;
+ }
+ user.sendMessage(Util.i18n("notAllowedToQuestion"));
+ event.setCancelled(true);
+ return;
+ }
+
+ event.setCancelled(true);
+ LOGGER.info(Util.format("localFormat", user.getName(), event.getMessage()));
+
+ final Location loc = user.getLocation();
+ final World world = loc.getWorld();
+ final int x = loc.getBlockX();
+ final int y = loc.getBlockY();
+ final int z = loc.getBlockZ();
+
+ for (Player p : server.getOnlinePlayers())
+ {
+ final User u = ess.getUser(p);
+ if (u.isIgnoredPlayer(user.getName()) && !user.isOp())
+ {
+ continue;
+ }
+ if (u.equals(user) && !u.isAuthorized("essentials.chat.spy"))
+ {
+ final Location l = u.getLocation();
+ final int dx = Math.abs(x - l.getBlockX());
+ final int dy = Math.abs(y - l.getBlockY());
+ final int dz = Math.abs(z - l.getBlockZ());
+ final int delta = dx + dy + dz;
+ if (delta > radius || world != l.getWorld())
+ {
+ continue;
+ }
+ }
+ String message = String.format(event.getFormat(), user.getDisplayName(), event.getMessage());
+
+ if (factions != null)
+ message = message.replace("{FACTION}", factions.getPlayerFactionTagRelation(event.getPlayer(), p)).replace("{FACTION_TITLE}", factions.getPlayerTitle(event.getPlayer()));
+
+ u.sendMessage(message);
}
}
- @Override
- @SuppressWarnings("CallToThreadDumpStack")
- public void onPlayerRespawn(PlayerRespawnEvent event)
+ protected static void checkFactions(PluginManager pm)
{
- try
- {
- EssentialsChatWorker.onPlayerRespawn(server, event);
- }
- catch (Throwable ex)
- {
- ex.printStackTrace();
- }
- }
+ if (factions != null)
+ return;
- @Override
- @SuppressWarnings("CallToThreadDumpStack")
- public void onPlayerChat(PlayerChatEvent event)
- {
+ Plugin factionsPlugin = pm.getPlugin("Factions");
+ if (factionsPlugin == null)
+ return;
+
+ factions = (Factions)factionsPlugin;
try
- {
- EssentialsChatWorker.onPlayerChat(server, event);
+ { // make sure Factions is sufficiently up-to-date
+ if (factions.hookSupportVersion() < 1)
+ factions = null;
}
- catch (Throwable ex)
- {
- ex.printStackTrace();
+ catch (NoSuchMethodError ex)
+ { // if not, we can't work with it, so don't bother
+ factions = null;
}
+
+ if (factions == null)
+ return;
+
+ // normally a good thing, but we'll skip it to let Factions handle faction tags for global messages
+ //factions.handleFactionTagExternally(true);
}
}
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatWorker.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatWorker.java
deleted file mode 100644
index 10787e75b..000000000
--- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatWorker.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package com.earth2me.essentials.chat;
-
-import com.earth2me.essentials.Essentials;
-import com.earth2me.essentials.User;
-import com.earth2me.essentials.Util;
-import com.nijikokun.bukkit.Permissions.Permissions;
-import java.util.logging.Logger;
-import org.bukkit.Location;
-import org.bukkit.Server;
-import org.bukkit.World;
-import org.bukkit.entity.Player;
-import org.bukkit.event.player.PlayerChatEvent;
-import org.bukkit.event.player.PlayerEvent;
-import org.bukkit.event.player.PlayerRespawnEvent;
-
-
-public class EssentialsChatWorker
-{
- private static final Logger logger = Logger.getLogger("Minecraft");
-
- public static void onPlayerRespawn(Server server, PlayerRespawnEvent event)
- {
- User user = Essentials.getStatic().getUser(event.getPlayer());
- updateDisplayName(user);
- }
-
- public static void onPlayerJoin(Server server, PlayerEvent event)
- {
- User user = Essentials.getStatic().getUser(event.getPlayer());
- updateDisplayName(user);
- }
-
- private static void updateDisplayName(User user)
- {
- try
- {
- String group = user.getGroup();
- try
- {
- String prefix = Permissions.Security.getGroupPrefix(user.getWorld().getName(), group).replace('&', '§').replace("{WORLDNAME}", user.getWorld().getName());
- String suffix = Permissions.Security.getGroupSuffix(user.getWorld().getName(), group).replace('&', '§').replace("{WORLDNAME}", user.getWorld().getName());
-
- user.setDisplayName(prefix + user.getNick() + suffix + (suffix.length() > 1 && suffix.substring(suffix.length() -2).equals("§") ? "" : "§f"));
- }
- catch (Throwable ex)
- {
- logger.warning(Util.format("missingPrefixSuffix", group));
- }
- }
- catch (Throwable ex)
- {
- logger.warning(Util.i18n("permissionsError"));
- }
- }
-
- public static void onPlayerChat(Server server, PlayerChatEvent event)
- {
- if (event.isCancelled()) return;
- User user = Essentials.getStatic().getUser(event.getPlayer());
- updateDisplayName(user);
-
- if (user.isAuthorized("essentials.chat.color"))
- event.setMessage(event.getMessage().replaceAll("&([0-9a-f])", "§$1"));
-
- event.setFormat(Essentials.getStatic().getSettings().getChatFormat(user.getGroup()).replace('&', '§').replace("§§", "&").replace("{DISPLAYNAME}", "%1$s").replace("{GROUP}", user.getGroup()).replace("{MESSAGE}", "%2$s").replace("{WORLDNAME}", user.getWorld().getName()));
-
- int radius = Essentials.getStatic().getSettings().getChatRadius();
- if (radius < 1) return;
-
- if (event.getMessage().startsWith("!") && event.getMessage().length() > 1)
- {
- if (user.isAuthorized("essentials.chat.shout"))
- {
- event.setMessage(event.getMessage().substring(1));
- event.setFormat(Util.format("shoutFormat", event.getFormat()));
- return;
- }
- user.sendMessage(Util.i18n("notAllowedToShout"));
- event.setCancelled(true);
- return;
- }
-
- if (event.getMessage().startsWith("?") && event.getMessage().length() > 1)
- {
- if (user.isAuthorized("essentials.chat.question"))
- {
- event.setMessage(event.getMessage().substring(1));
- event.setFormat(Util.format("questionFormat", event.getFormat()));
- return;
- }
- user.sendMessage(Util.i18n("notAllowedToQuestion"));
- event.setCancelled(true);
- return;
- }
-
- event.setCancelled(true);
- logger.info(Util.format("localFormat", user.getName(), event.getMessage()));
-
- Location loc = user.getLocation();
- World w = loc.getWorld();
- int x = loc.getBlockX();
- int y = loc.getBlockY();
- int z = loc.getBlockZ();
-
- for (Player p : server.getOnlinePlayers())
- {
- User u = Essentials.getStatic().getUser(p);
- if (u.isIgnoredPlayer(user.getName()) && !user.isOp()) {
- continue;
- }
- if (u != user && !u.isAuthorized("essentials.chat.spy"))
- {
- Location l = u.getLocation();
- int dx = Math.abs(x - l.getBlockX());
- int dy = Math.abs(y - l.getBlockY());
- int dz = Math.abs(z - l.getBlockZ());
- int delta = dx + dy + dz;
- if (delta > radius || w != l.getWorld()) continue;
- }
-
- u.sendMessage(String.format(event.getFormat(), user.getDisplayName(), event.getMessage()));
- }
- }
-}
diff --git a/EssentialsChat/src/plugin.yml b/EssentialsChat/src/plugin.yml
index 0be4e1c75..4ad77d230 100644
--- a/EssentialsChat/src/plugin.yml
+++ b/EssentialsChat/src/plugin.yml
@@ -1,9 +1,10 @@
-# This determines the command prefix when there are conflicts (/name:home, /name:help, etc.)
-name: EssentialsChat
-main: com.earth2me.essentials.chat.EssentialsChat
-# Note to developers: This next line cannot change, or the automatic versioning system will break.
-version: TeamCity
-website: http://www.earth2me.net:8001/
-description: Provides chat control features for Essentials. Requires Permissions.
-authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
-depend: [Essentials]
\ No newline at end of file
+# This determines the command prefix when there are conflicts (/name:home, /name:help, etc.)
+name: EssentialsChat
+main: com.earth2me.essentials.chat.EssentialsChat
+# Note to developers: This next line cannot change, or the automatic versioning system will break.
+version: TeamCity
+website: http://www.earth2me.net:8001/
+description: Provides chat control features for Essentials. Requires Permissions.
+authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
+depend: [Essentials]
+softdepend: [Factions]
\ No newline at end of file
diff --git a/EssentialsGeoIP/nbproject/project.properties b/EssentialsGeoIP/nbproject/project.properties
index ed96af206..8eb099985 100644
--- a/EssentialsGeoIP/nbproject/project.properties
+++ b/EssentialsGeoIP/nbproject/project.properties
@@ -1,9 +1,9 @@
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
-annotation.processing.processor.options=
-annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=EssentialsGeoIP
+application.vendor=snowleo
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
@@ -24,13 +24,14 @@ debug.test.classpath=\
dist.dir=dist
dist.jar=${dist.dir}/EssentialsGeoIP.jar
dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
excludes=
-file.reference.craftbukkit-0.0.1-SNAPSHOT.jar=../lib/craftbukkit-0.0.1-SNAPSHOT.jar
+file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar
includes=**
jar.compress=false
javac.classpath=\
${reference.Essentials.jar}:\
- ${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}
+ ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java
index ef9d9af27..aa919f44b 100644
--- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java
+++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java
@@ -1,6 +1,7 @@
package com.earth2me.essentials.geoip;
import com.earth2me.essentials.Essentials;
+import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.Util;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -26,14 +27,15 @@ public class EssentialsGeoIP extends JavaPlugin
@Override
public void onEnable()
{
- PluginManager pm = getServer().getPluginManager();
- EssentialsGeoIPPlayerListener playerListener = new EssentialsGeoIPPlayerListener(getDataFolder());
+ final PluginManager pm = getServer().getPluginManager();
+ final IEssentials ess = (IEssentials)pm.getPlugin("Essentials");
+ final EssentialsGeoIPPlayerListener playerListener = new EssentialsGeoIPPlayerListener(getDataFolder(), ess);
pm.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this);
- if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion())) {
+ if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) {
logger.log(Level.WARNING, Util.i18n("versionMismatchAll"));
}
- logger.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), Essentials.AUTHORS));
+ logger.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
logger.log(Level.INFO, "This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/.");
}
diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
index a9dd9ad3d..5a6553f0e 100644
--- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
+++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
@@ -1,6 +1,5 @@
package com.earth2me.essentials.geoip;
-import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.EssentialsConf;
import com.earth2me.essentials.IConf;
import com.earth2me.essentials.IEssentials;
@@ -33,9 +32,11 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
File databaseFile;
File dataFolder;
EssentialsConf config;
+ private final transient IEssentials ess;
- public EssentialsGeoIPPlayerListener(File dataFolder)
+ public EssentialsGeoIPPlayerListener(File dataFolder, IEssentials ess)
{
+ this.ess = ess;
this.dataFolder = dataFolder;
this.config = new EssentialsConf(new File(dataFolder, "config.yml"));
config.setTemplateName("/config.yml", EssentialsGeoIP.class);
@@ -45,7 +46,6 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
@Override
public void onPlayerJoin(PlayerJoinEvent event)
{
- IEssentials ess = Essentials.getStatic();
User u = ess.getUser(event.getPlayer());
if (u.isAuthorized("essentials.geoip.hide"))
{
diff --git a/EssentialsGroupManager/src/groups.yml b/EssentialsGroupManager/src/groups.yml
index 20434f45b..87033cdc9 100644
--- a/EssentialsGroupManager/src/groups.yml
+++ b/EssentialsGroupManager/src/groups.yml
@@ -18,13 +18,18 @@ groups:
permissions:
- -groupmanager.mantogglesave
- essentials
+ - essentials.antioch
+ - essentials.burn
- essentials.clearinventory
- essentials.cooldown.bypass
- essentials.deljail
+ - essentials.fireball
+ - essentials.gc
- essentials.give
- essentials.god
- essentials.heal
- essentials.heal.others
+ - essentials.lightning
- essentials.invsee
- essentials.item
- essentials.jails
@@ -33,13 +38,12 @@ groups:
- essentials.mute
- essentials.sell
- essentials.setjail
- - essentials.signs.protection.override
+ - essentials.signs.*
- essentials.spawnmob
- essentials.teleport.cooldown.bypass
- essentials.teleport.timer.bypass
- essentials.togglejail
- groupmanager.*
- - essentials.burn
inheritance:
- moderator
info:
@@ -50,11 +54,13 @@ groups:
default: false
permissions:
- essentials.afk
+ - essentials.back
- essentials.back.ondeath
- essentials.balance
- essentials.chat.shout
- essentials.compass
- essentials.home
+ - essentials.depth
- essentials.kit
- essentials.kit.tools
- essentials.mail
@@ -64,20 +70,18 @@ groups:
- essentials.nick
- essentials.pay
- essentials.portal
+ - essentials.powertool
- essentials.protect
- essentials.sethome
- - essentials.signs.buy.use
- - essentials.signs.disposal.create
- - essentials.signs.disposal.use
- - essentials.signs.free.use
- - essentials.signs.heal.use
- - essentials.signs.mail.create
- - essentials.signs.mail.use
- - essentials.signs.protection.create
- - essentials.signs.protection.use
- - essentials.signs.sell.use
- - essentials.signs.trade.create
- - essentials.signs.trade.use
+ - essentials.signs.use.*
+ - essentials.signs.create.disposal
+ - essentials.signs.create.mail
+ - essentials.signs.create.protection
+ - essentials.signs.create.trade
+ - essentials.signs.break.disposal
+ - essentials.signs.break.mail
+ - essentials.signs.break.protection
+ - essentials.signs.break.trade
- essentials.suicide
- essentials.tpa
- essentials.tpaccept
@@ -95,19 +99,23 @@ groups:
Moderator:
default: false
permissions:
- - essentials.back
- essentials.ban
- essentials.banip
- essentials.broadcast
- essentials.delwarp
- - essentials.depth
- essentials.eco
+ - essentials.ext
- essentials.getpos
- essentials.jump
- essentials.kick
- essentials.kill
- essentials.setwarp
+ - essentials.signs.create.*
+ - essentials.signs.break.*
+ - essentials.spawner
+ - essentials.thunder
- essentials.time
+ - essentials.time.world
- essentials.togglejail
- essentials.top
- essentials.tp
@@ -118,6 +126,7 @@ groups:
- essentials.tptoggle
- essentials.unban
- essentials.unbanip
+ - essentials.weather
- essentials.whois
- essentials.world
- groupmanager.listgroups
@@ -128,7 +137,6 @@ groups:
- groupmanager.manselect
- groupmanager.manuadd
- groupmanager.manudel
- - essentials.ext
inheritance:
- builder
info:
@@ -139,7 +147,6 @@ groups:
default: false
permissions:
- '*'
- - -essentials.protect.damage.*
inheritance:
- semiadmin
info:
diff --git a/EssentialsPermissionsCommands/build.xml b/EssentialsPermissionsCommands/build.xml
new file mode 100644
index 000000000..507230993
--- /dev/null
+++ b/EssentialsPermissionsCommands/build.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+ Builds, tests, and runs the project EssentialsPermissionsCommands.
+
+
+
diff --git a/EssentialsPermissionsCommands/manifest.mf b/EssentialsPermissionsCommands/manifest.mf
new file mode 100644
index 000000000..328e8e5bc
--- /dev/null
+++ b/EssentialsPermissionsCommands/manifest.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
diff --git a/EssentialsPermissionsCommands/nbproject/build-impl.xml b/EssentialsPermissionsCommands/nbproject/build-impl.xml
new file mode 100644
index 000000000..5147dc1c2
--- /dev/null
+++ b/EssentialsPermissionsCommands/nbproject/build-impl.xml
@@ -0,0 +1,1080 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set src.dir
+ Must set test.src.dir
+ Must set build.dir
+ Must set dist.dir
+ Must set build.classes.dir
+ Must set dist.javadoc.dir
+ Must set build.test.classes.dir
+ Must set build.test.results.dir
+ Must set build.classes.excludes
+ Must set dist.jar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must set JVM to use for profiling in profiler.info.jvm
+ Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+
+
+
+
+
+ java -cp "${run.classpath.with.dist.jar}" ${main.class}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ To run this application from the command line without Ant, try:
+
+ java -jar "${dist.jar.resolved}"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+ Must select one file in the IDE or set run.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must select one file in the IDE or set debug.class
+
+
+
+
+ Must set fix.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set profile.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set javac.includes
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+
+
+
+
+ Must select some files in the IDE or set test.includes
+
+
+
+ Some tests failed; see details above.
+
+
+
+
+ Must select one file in the IDE or set test.class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+ Must select one file in the IDE or set applet.url
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EssentialsPermissionsCommands/nbproject/genfiles.properties b/EssentialsPermissionsCommands/nbproject/genfiles.properties
new file mode 100644
index 000000000..bb1e587db
--- /dev/null
+++ b/EssentialsPermissionsCommands/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=9c3a069f
+build.xml.script.CRC32=0a912bb3
+build.xml.stylesheet.CRC32=28e38971@1.43.1.45
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=9c3a069f
+nbproject/build-impl.xml.script.CRC32=dd030a92
+nbproject/build-impl.xml.stylesheet.CRC32=0c01fd8e@1.43.1.45
diff --git a/EssentialsPermissionsCommands/nbproject/project.properties b/EssentialsPermissionsCommands/nbproject/project.properties
new file mode 100644
index 000000000..d92776f5b
--- /dev/null
+++ b/EssentialsPermissionsCommands/nbproject/project.properties
@@ -0,0 +1,79 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=EssentialsPermissionsCommands
+application.vendor=snowleo
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/EssentialsPermissionsCommands.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar
+file.reference.Permissions3.jar=../lib/Permissions3.jar
+includes=**
+jar.compress=false
+javac.classpath=\
+ ${reference.Essentials.jar}:\
+ ${file.reference.Permissions3.jar}:\
+ ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.6
+javac.target=1.6
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+project.Essentials=../Essentials
+reference.Essentials.jar=${project.Essentials}/dist/Essentials.jar
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
diff --git a/EssentialsPermissionsCommands/nbproject/project.xml b/EssentialsPermissionsCommands/nbproject/project.xml
new file mode 100644
index 000000000..89e773c31
--- /dev/null
+++ b/EssentialsPermissionsCommands/nbproject/project.xml
@@ -0,0 +1,28 @@
+
+
+ org.netbeans.modules.java.j2seproject
+
+
+ EssentialsPermissionsCommands
+
+
+
+
+
+
+
+
+ ../lib/nblibraries.properties
+
+
+
+ Essentials
+ jar
+
+ jar
+ clean
+ jar
+
+
+
+
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangadd.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangadd.java
new file mode 100644
index 000000000..8c22dabdc
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangadd.java
@@ -0,0 +1,30 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmangadd extends EssentialsCommand
+{
+ public Commandmangadd()
+ {
+ super("mangadd");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 1)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String group = args[0];
+ String command = "permissions g:" + group + " create";
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddi.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddi.java
new file mode 100644
index 000000000..760b5c81f
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddi.java
@@ -0,0 +1,31 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmangaddi extends EssentialsCommand
+{
+ public Commandmangaddi()
+ {
+ super("mangaddi");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String target = args[0];
+ final String group = args[1];
+ String command = "permissions g:"+target+" parents add "+group;
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddp.java
new file mode 100644
index 000000000..e83de4e50
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddp.java
@@ -0,0 +1,31 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmangaddp extends EssentialsCommand
+{
+ public Commandmangaddp()
+ {
+ super("mangaddp");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String target = args[0];
+ final String perm = args[1];
+ String command = "permissions g:"+target+" perms add "+perm;
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangcheckp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangcheckp.java
new file mode 100644
index 000000000..1152d1a0b
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangcheckp.java
@@ -0,0 +1,31 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmangcheckp extends EssentialsCommand
+{
+ public Commandmangcheckp()
+ {
+ super("mangcheckp");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String target = args[0];
+ final String perm = args[1];
+ String command = "permissions g:"+target+" has "+perm;
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdel.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdel.java
new file mode 100644
index 000000000..24ffe2307
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdel.java
@@ -0,0 +1,30 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmangdel extends EssentialsCommand
+{
+ public Commandmangdel()
+ {
+ super("mangdel");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 1)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String group = args[0];
+ String command = "permissions g:"+group+" delete";
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdeli.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdeli.java
new file mode 100644
index 000000000..aea296735
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdeli.java
@@ -0,0 +1,31 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmangdeli extends EssentialsCommand
+{
+ public Commandmangdeli()
+ {
+ super("mangdeli");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String target = args[0];
+ final String group = args[1];
+ String command = "permissions g:"+target+" parents remove "+group;
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdelp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdelp.java
new file mode 100644
index 000000000..ef1dd4207
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdelp.java
@@ -0,0 +1,31 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmangdelp extends EssentialsCommand
+{
+ public Commandmangdelp()
+ {
+ super("mangdelp");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String target = args[0];
+ final String perm = args[1];
+ String command = "permissions g:"+target+" perms remove "+perm;
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanglistp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanglistp.java
new file mode 100644
index 000000000..715f42774
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanglistp.java
@@ -0,0 +1,30 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmanglistp extends EssentialsCommand
+{
+ public Commandmanglistp()
+ {
+ super("manglistp");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 1)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String target = args[0];
+ String command = "permissions g:"+target+" perms list";
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanload.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanload.java
new file mode 100644
index 000000000..390cb78eb
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanload.java
@@ -0,0 +1,30 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmanload extends EssentialsCommand
+{
+ public Commandmanload()
+ {
+ super("manload");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ String world = "all";
+ if (args.length > 1)
+ {
+ world = args[0];
+ }
+ String command = "permissions -reload "+world;
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java
new file mode 100644
index 000000000..a63a1a36b
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java
@@ -0,0 +1,32 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmanuadd extends EssentialsCommand
+{
+ public Commandmanuadd()
+ {
+ super("manuadd");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String player = args[0];
+ final String group = args[1];
+ //TODO: Make this command add a player if it doesnt exist /permissions +player+ create
+ String command = "permissions "+player+" parents add "+group;
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddp.java
new file mode 100644
index 000000000..3d3d67c72
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddp.java
@@ -0,0 +1,31 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmanuaddp extends EssentialsCommand
+{
+ public Commandmanuaddp()
+ {
+ super("manuaddp");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String player = args[0];
+ final String perm = args[1];
+ String command = "permissions "+player+" perms add "+perm;
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddsub.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddsub.java
new file mode 100644
index 000000000..60d1980af
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddsub.java
@@ -0,0 +1,31 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmanuaddsub extends EssentialsCommand
+{
+ public Commandmanuaddsub()
+ {
+ super("manuaddsub");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String player = args[0];
+ final String group = args[1];
+ String command = "permissions "+player+" parents add "+group;
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanucheckp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanucheckp.java
new file mode 100644
index 000000000..634b447c7
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanucheckp.java
@@ -0,0 +1,31 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmanucheckp extends EssentialsCommand
+{
+ public Commandmanucheckp()
+ {
+ super("manucheckp");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String player = args[0];
+ final String perm = args[1];
+ String command = "permissions "+player+" has "+perm;
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudel.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudel.java
new file mode 100644
index 000000000..72c8fc2af
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudel.java
@@ -0,0 +1,30 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmanudel extends EssentialsCommand
+{
+ public Commandmanudel()
+ {
+ super("manudel");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 1)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String player = args[0];
+ String command = "permissions "+player+" delete";
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelp.java
new file mode 100644
index 000000000..01adf97b2
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelp.java
@@ -0,0 +1,31 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmanudelp extends EssentialsCommand
+{
+ public Commandmanudelp()
+ {
+ super("manudelp");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String player = args[0];
+ final String perm = args[1];
+ String command = "permissions "+player+" perms remove "+perm;
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelsub.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelsub.java
new file mode 100644
index 000000000..1a1ae2a6d
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelsub.java
@@ -0,0 +1,31 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmanudelsub extends EssentialsCommand
+{
+ public Commandmanudelsub()
+ {
+ super("manudelsub");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 2)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String player = args[0];
+ final String group = args[1];
+ String command = "permissions "+player+" parents remove "+group;
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanulistp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanulistp.java
new file mode 100644
index 000000000..f809f3c61
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanulistp.java
@@ -0,0 +1,30 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
+import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
+
+
+public class Commandmanulistp extends EssentialsCommand
+{
+ public Commandmanulistp()
+ {
+ super("manulistp");
+ }
+
+ @Override
+ protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 1)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String player = args[0];
+ String command = "permissions "+player+" perms list";
+ sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead.");
+ ess.getServer().dispatchCommand(sender, command);
+ }
+
+
+}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java
new file mode 100644
index 000000000..14e9a117c
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java
@@ -0,0 +1,57 @@
+package com.earth2me.essentials.permissions;
+
+import com.earth2me.essentials.IEssentials;
+import com.earth2me.essentials.Util;
+import com.nijiko.permissions.PermissionHandler;
+import com.nijikokun.bukkit.Permissions.Permissions;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
+import org.bukkit.plugin.Plugin;
+import org.bukkit.plugin.PluginManager;
+import org.bukkit.plugin.java.JavaPlugin;
+
+
+public class EssentialsPermissionsCommands extends JavaPlugin
+{
+ private static PermissionHandler permissionHandler = null;
+ private static final Logger LOGGER = Logger.getLogger("Minecraft");
+ private IEssentials ess;
+
+ public static PermissionHandler getPermissionHandler()
+ {
+ return permissionHandler;
+ }
+
+ @Override
+ public void onEnable()
+ {
+ final PluginManager pluginManager = getServer().getPluginManager();
+ final Plugin permissionsPlugin = pluginManager.getPlugin("Permissions");
+
+ if (permissionsPlugin != null
+ && permissionsPlugin.getDescription().getVersion().charAt(0) == '3')
+ {
+ permissionHandler = ((Permissions)permissionsPlugin).getHandler();
+ }
+ ess = (IEssentials)pluginManager.getPlugin("Essentials");
+
+ if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) {
+ LOGGER.log(Level.WARNING, Util.i18n("versionMismatchAll"));
+ }
+ LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
+
+ }
+
+ @Override
+ public boolean onCommand(final CommandSender sender, final Command command, final String label, final String[] args)
+ {
+ return ess.onCommandEssentials(sender, command, label, args, EssentialsPermissionsCommands.class.getClassLoader(), "com.earth2me.essentials.permissions.Command", "groupmanager.");
+ }
+
+ @Override
+ public void onDisable()
+ {
+ }
+}
diff --git a/EssentialsPermissionsCommands/src/plugin.yml b/EssentialsPermissionsCommands/src/plugin.yml
new file mode 100644
index 000000000..a13023a5c
--- /dev/null
+++ b/EssentialsPermissionsCommands/src/plugin.yml
@@ -0,0 +1,166 @@
+# This determines the command prefix when there are conflicts (/name:home, /name:help, etc.)
+name: EssentialsPermissionsCommands
+main: com.earth2me.essentials.permissions.EssentialsPermissionsCommands
+# Note to developers: This next line cannot change, or the automatic versioning system will break.
+version: TeamCity
+website: http://www.earth2me.net:8001/
+description: Adds commands aliases to Permissions 3
+authors: [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology]
+depend: [Permissions, Essentials]
+commands:
+ manuadd:
+ description: Move a player to desired group.(Adds to the file if not exists)
+ usage: /
+ permission: groupmanager.manuadd
+ manudel:
+ description: Remove any user specific configuration. Make him default group.
+ usage: /
+ permission: groupmanager.manudel
+ manuaddsub:
+ description: Add a group to a player's subgroup list.
+ usage: /
+ permission: groupmanager.manuaddsub
+ manudelsub:
+ description: Remove a group to a player's subgroup list.
+ usage: /
+ permission: groupmanager.manudelsub
+ mangadd:
+ description: Add group to the system.
+ usage: /
+ permission: groupmanager.mangadd
+ mangdel:
+ description: Removes group from the system(all it's users become default)
+ usage: /
+ permission: groupmanager.mangdel
+ manuaddp:
+ description: Add permission diretly to the player.
+ usage: /