diff options
74 files changed, 848 insertions, 521 deletions
diff --git a/.gitignore b/.gitignore index 9f90b60e1..90401bb3c 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ manifest.mf *.ipr *.iws .idea/ + +EssentialsRelease/
\ No newline at end of file diff --git a/Essentials/src/com/earth2me/essentials/Economy.java b/Essentials/src/com/earth2me/essentials/Economy.java index 950b40e32..4edf9b17a 100644 --- a/Essentials/src/com/earth2me/essentials/Economy.java +++ b/Essentials/src/com/earth2me/essentials/Economy.java @@ -123,7 +123,7 @@ public class Economy implements IEconomy @Override public String format(double amount) { - return Util.formatCurrency(amount, ess); + return Util.displayCurrency(amount, ess); } @Override diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index a3aef503d..911a41cd7 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -53,7 +53,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 1952; + public static final int BUKKIT_VERSION = 2015; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TntExplodeListener tntListener = new TntExplodeListener(this); @@ -122,11 +122,11 @@ public class Essentials extends JavaPlugin implements IEssentials LOGGER.log(Level.WARNING, _("versionMismatch", plugin.getDescription().getName())); } } - final Matcher versionMatch = Pattern.compile("git-Bukkit-([0-9]+).([0-9]+).([0-9]+)-R[0-9]+-(?:[0-9]+-g[0-9a-f]+-)?b([0-9]+)jnks.*").matcher(getServer().getVersion()); + final Matcher versionMatch = Pattern.compile("git-Bukkit-(?:(?:[0-9]+)\\.)+[0-9]+-R[\\.0-9]+-(?:[0-9]+-g[0-9a-f]+-)?b([0-9]+)jnks.*").matcher(getServer().getVersion()); if (versionMatch.matches()) { - final int versionNumber = Integer.parseInt(versionMatch.group(4)); - if (versionNumber < BUKKIT_VERSION) + final int versionNumber = Integer.parseInt(versionMatch.group(1)); + if (versionNumber < BUKKIT_VERSION && versionNumber > 100) { LOGGER.log(Level.SEVERE, _("notRecommendedBukkit")); LOGGER.log(Level.SEVERE, _("requiredBukkit", Integer.toString(BUKKIT_VERSION))); diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java index 2fb2c4bc5..171611a6a 100644 --- a/Essentials/src/com/earth2me/essentials/Jails.java +++ b/Essentials/src/com/earth2me/essentials/Jails.java @@ -118,7 +118,7 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett acquireReadLock(); try { - if (!(user.isOnline())) + if (user.isOnline()) { Location loc = getJail(jail); user.getTeleport().now(loc, false, TeleportCause.COMMAND); @@ -160,7 +160,7 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett private class JailBlockListener implements Listener { - @EventHandler(priority = EventPriority.LOW) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onBlockBreak(final BlockBreakEvent event) { @Cleanup @@ -172,7 +172,7 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett } } - @EventHandler(priority = EventPriority.LOW) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onBlockPlace(final BlockPlaceEvent event) { @Cleanup @@ -184,7 +184,7 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett } } - @EventHandler(priority = EventPriority.LOW) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onBlockDamage(final BlockDamageEvent event) { @Cleanup @@ -200,7 +200,7 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett private class JailPlayerListener implements Listener { - @EventHandler(priority = EventPriority.LOW) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onPlayerInteract(final PlayerInteractEvent event) { @Cleanup @@ -212,7 +212,7 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett } } - @EventHandler(priority = EventPriority.HIGH) + @EventHandler(priority = EventPriority.HIGHEST) public void onPlayerRespawn(final PlayerRespawnEvent event) { @Cleanup @@ -269,7 +269,7 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett user.sendMessage(_("jailMessage")); } - @EventHandler(priority = EventPriority.HIGH) + @EventHandler(priority = EventPriority.HIGHEST) public void onPlayerJoin(final PlayerJoinEvent event) { @Cleanup diff --git a/Essentials/src/com/earth2me/essentials/Mob.java b/Essentials/src/com/earth2me/essentials/Mob.java index 049f7b8a3..38c11a81a 100644 --- a/Essentials/src/com/earth2me/essentials/Mob.java +++ b/Essentials/src/com/earth2me/essentials/Mob.java @@ -1,6 +1,7 @@ package com.earth2me.essentials; import static com.earth2me.essentials.I18n._; +import java.util.Collections; import java.util.HashMap; import java.util.Locale; import java.util.Map; @@ -9,40 +10,42 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Location; import org.bukkit.Server; -import org.bukkit.entity.CreatureType; +import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; public enum Mob { - CHICKEN("Chicken", Enemies.FRIENDLY, CreatureType.CHICKEN), - COW("Cow", Enemies.FRIENDLY, CreatureType.COW), - CREEPER("Creeper", Enemies.ENEMY, CreatureType.CREEPER), - GHAST("Ghast", Enemies.ENEMY, CreatureType.GHAST), - GIANT("Giant", Enemies.ENEMY, CreatureType.GIANT), - PIG("Pig", Enemies.FRIENDLY, CreatureType.PIG), - PIGZOMB("PigZombie", Enemies.NEUTRAL, CreatureType.PIG_ZOMBIE), - SHEEP("Sheep", Enemies.FRIENDLY, "", CreatureType.SHEEP), - SKELETON("Skeleton", Enemies.ENEMY, CreatureType.SKELETON), - SLIME("Slime", Enemies.ENEMY, CreatureType.SLIME), - SPIDER("Spider", Enemies.ENEMY, CreatureType.SPIDER), - SQUID("Squid", Enemies.FRIENDLY, CreatureType.SQUID), - ZOMBIE("Zombie", Enemies.ENEMY, CreatureType.ZOMBIE), - WOLF("Wolf", Enemies.NEUTRAL, CreatureType.WOLF), - CAVESPIDER("CaveSpider", Enemies.ENEMY, CreatureType.CAVE_SPIDER), - ENDERMAN("Enderman", Enemies.ENEMY, "", CreatureType.ENDERMAN), - SILVERFISH("Silverfish", Enemies.ENEMY, "", CreatureType.SILVERFISH), - ENDERDRAGON("EnderDragon", Enemies.ENEMY, CreatureType.ENDER_DRAGON), - VILLAGER("Villager", Enemies.FRIENDLY, CreatureType.VILLAGER), - BLAZE("Blaze", Enemies.ENEMY, CreatureType.BLAZE), - MUSHROOMCOW("MushroomCow", Enemies.FRIENDLY, CreatureType.MUSHROOM_COW), - MAGMACUBE("MagmaCube", Enemies.ENEMY, CreatureType.MAGMA_CUBE), - SNOWMAN("Snowman", Enemies.FRIENDLY, "", CreatureType.SNOWMAN); + CHICKEN("Chicken", Enemies.FRIENDLY, EntityType.CHICKEN), + COW("Cow", Enemies.FRIENDLY, EntityType.COW), + CREEPER("Creeper", Enemies.ENEMY, EntityType.CREEPER), + GHAST("Ghast", Enemies.ENEMY, EntityType.GHAST), + GIANT("Giant", Enemies.ENEMY, EntityType.GIANT), + PIG("Pig", Enemies.FRIENDLY, EntityType.PIG), + PIGZOMB("PigZombie", Enemies.NEUTRAL, EntityType.PIG_ZOMBIE), + SHEEP("Sheep", Enemies.FRIENDLY, "", EntityType.SHEEP), + SKELETON("Skeleton", Enemies.ENEMY, EntityType.SKELETON), + SLIME("Slime", Enemies.ENEMY, EntityType.SLIME), + SPIDER("Spider", Enemies.ENEMY, EntityType.SPIDER), + SQUID("Squid", Enemies.FRIENDLY, EntityType.SQUID), + ZOMBIE("Zombie", Enemies.ENEMY, EntityType.ZOMBIE), + WOLF("Wolf", Enemies.NEUTRAL, EntityType.WOLF), + CAVESPIDER("CaveSpider", Enemies.ENEMY, EntityType.CAVE_SPIDER), + ENDERMAN("Enderman", Enemies.ENEMY, "", EntityType.ENDERMAN), + SILVERFISH("Silverfish", Enemies.ENEMY, "", EntityType.SILVERFISH), + ENDERDRAGON("EnderDragon", Enemies.ENEMY, EntityType.ENDER_DRAGON), + VILLAGER("Villager", Enemies.FRIENDLY, EntityType.VILLAGER), + BLAZE("Blaze", Enemies.ENEMY, EntityType.BLAZE), + MUSHROOMCOW("MushroomCow", Enemies.FRIENDLY, EntityType.MUSHROOM_COW), + MAGMACUBE("MagmaCube", Enemies.ENEMY, EntityType.MAGMA_CUBE), + SNOWMAN("Snowman", Enemies.FRIENDLY, "", EntityType.SNOWMAN), + OCELOT("Ocelot", Enemies.NEUTRAL, EntityType.OCELOT), + IRONGOLEM("IronGolem", Enemies.NEUTRAL, EntityType.IRON_GOLEM); public static final Logger logger = Logger.getLogger("Minecraft"); - private Mob(String n, Enemies en, String s, CreatureType type) + private Mob(String n, Enemies en, String s, EntityType type) { this.suffix = s; this.name = n; @@ -50,7 +53,7 @@ public enum Mob this.bukkitType = type; } - private Mob(String n, Enemies en, CreatureType type) + private Mob(String n, Enemies en, EntityType type) { this.name = n; this.type = en; @@ -59,7 +62,7 @@ public enum Mob public String suffix = "s"; final public String name; final public Enemies type; - final private CreatureType bukkitType; + final private EntityType bukkitType; private static final Map<String, Mob> hashMap = new HashMap<String, Mob>(); static @@ -71,7 +74,7 @@ public enum Mob } public static Set<String> getMobList() { - return hashMap.keySet(); + return Collections.unmodifiableSet(hashMap.keySet()); } public LivingEntity spawn(final Player player, final Server server, final Location loc) throws MobException @@ -99,7 +102,7 @@ public enum Mob final protected String type; } - public CreatureType getType() + public EntityType getType() { return bukkitType; } diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java index e9dc9f78a..c01e62037 100644 --- a/Essentials/src/com/earth2me/essentials/Trade.java +++ b/Essentials/src/com/earth2me/essentials/Trade.java @@ -153,8 +153,7 @@ public class Trade { if (getMoney() != null) { - final double mon = user.getMoney(); - if (mon < getMoney() && getMoney() > 0 && !Permissions.ECO_LOAN.isAuthorized(user)) + if (!user.canAfford(getMoney()) && getMoney() > 0) { throw new ChargeException(_("notEnoughMoney")); } @@ -175,9 +174,8 @@ public class Trade @Cleanup final ISettings settings = ess.getSettings(); settings.acquireReadLock(); - final double mon = user.getMoney(); final double cost = settings.getData().getEconomy().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command); - if (mon < cost && cost > 0 && !Permissions.ECO_LOAN.isAuthorized(user)) + if (!user.canAfford(cost) && cost > 0) { throw new ChargeException(_("notEnoughMoney")); } diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index dcd431e39..9c1db7788 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -350,7 +350,7 @@ public final class Util while (isBlockUnsafe(world, x, y, z)) { y += 1; - if (y >= 127) + if (y >= world.getHighestBlockYAt(x, z)) { x += 1; break; @@ -361,8 +361,8 @@ public final class Util y -= 1; if (y <= 1) { - y = 127; x += 1; + y = world.getHighestBlockYAt(x, z); if (x - 32 > loc.getBlockX()) { throw new Exception(_("holeInFloor")); @@ -479,14 +479,12 @@ public final class Util } return is; } - private static DecimalFormat df = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.US)); + private static DecimalFormat dFormat = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.US)); - public static String formatCurrency(final double value, final IEssentials ess) + public static String formatAsCurrency(final double value) { - @Cleanup - final ISettings settings = ess.getSettings(); - settings.acquireReadLock(); - String str = settings.getData().getEconomy().getCurrencySymbol() + df.format(value); + + String str = dFormat.format(value); if (str.endsWith(".00")) { str = str.substring(0, str.length() - 3); @@ -494,6 +492,22 @@ public final class Util return str; } + public static String displayCurrency(final double value, final IEssentials ess) + { + @Cleanup + final ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + return _("currency", settings.getData().getEconomy().getCurrencySymbol(), formatAsCurrency(value)); + } + + public static String shortCurrency(final double value, final IEssentials ess) + { + @Cleanup + final ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + return settings.getData().getEconomy().getCurrencySymbol() + formatAsCurrency(value); + } + public static double roundDouble(final double d) { return Math.round(d * 100.0) / 100.0; diff --git a/Essentials/src/com/earth2me/essentials/api/IUser.java b/Essentials/src/com/earth2me/essentials/api/IUser.java index d4cb81f21..091b141df 100644 --- a/Essentials/src/com/earth2me/essentials/api/IUser.java +++ b/Essentials/src/com/earth2me/essentials/api/IUser.java @@ -101,4 +101,10 @@ public interface IUser extends Player, IStorageObjectHolder<UserData>, IReload, boolean gotMailInfo(); List<String> getMails(); + + public boolean canAfford(double money); + + public void updateMoneyCache(double userMoney); + + public boolean canAfford(double amount, boolean b); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java b/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java index 989275d56..5b5103240 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java @@ -11,8 +11,11 @@ public class Commandantioch extends EssentialsCommand @Override public void run(final IUser user, final String commandLabel, final String[] args) throws Exception { - ess.broadcastMessage(user, "...lobbest thou thy Holy Hand Grenade of Antioch towards thy foe,"); - ess.broadcastMessage(user, "who being naughty in My sight, shall snuff it."); + if (args.length > 0) + { + ess.broadcastMessage(user, "...lobbest thou thy Holy Hand Grenade of Antioch towards thy foe,"); + ess.broadcastMessage(user, "who being naughty in My sight, shall snuff it."); + } final Location loc = Util.getTarget(user); loc.getWorld().spawn(loc, TNTPrimed.class); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java index 483ed8596..f276b82d5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java @@ -16,7 +16,7 @@ public class Commandbalance extends EssentialsCommand { throw new NotEnoughArgumentsException(); } - sender.sendMessage(_("balance", Util.formatCurrency(getPlayer(args, 0, true).getMoney(), ess))); + sender.sendMessage(_("balance", Util.displayCurrency(getPlayer(args, 0, true).getMoney(), ess))); } @Override @@ -26,6 +26,6 @@ public class Commandbalance extends EssentialsCommand || !Permissions.BALANCE_OTHERS.isAuthorized(user) ? user : getPlayer(args, 0, true)).getMoney(); - user.sendMessage(_("balance", Util.formatCurrency(bal, ess))); + user.sendMessage(_("balance", Util.displayCurrency(bal, ess))); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java index 6c7237eb9..8b2e0b2a7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java @@ -100,14 +100,18 @@ public class Commandbalancetop extends EssentialsCommand { if (force || cacheage <= System.currentTimeMillis() - CACHETIME) { - cache.getLines().clear(); + cache.getLines().clear(); final Map<String, Double> balances = new HashMap<String, Double>(); + double totalMoney = 0d; for (String u : ess.getUserMap().getAllUniqueUsers()) { final IUser user = ess.getUserMap().getUser(u); if (user != null) { - balances.put(user.getDisplayName(), user.getMoney()); + final double userMoney = user.getMoney(); + user.updateMoneyCache(userMoney); + totalMoney += userMoney; + balances.put(user.getDisplayName(), userMoney); } } @@ -120,10 +124,12 @@ public class Commandbalancetop extends EssentialsCommand return -entry1.getValue().compareTo(entry2.getValue()); } }); + + cache.getLines().add(_("serverTotal", Util.displayCurrency(totalMoney, ess))); int pos = 1; for (Map.Entry<String, Double> entry : sortedEntries) { - cache.getLines().add(pos + ". " + entry.getKey() + ", " + Util.formatCurrency(entry.getValue(), ess)); + cache.getLines().add(pos + ". " + entry.getKey() + ", " + Util.displayCurrency(entry.getValue(), ess)); pos++; } cacheage = System.currentTimeMillis(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java index 5119a53ef..3969a023c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java @@ -21,7 +21,7 @@ public class Commandban extends EssentialsCommand } @Cleanup final IUser user = getPlayer(args, 0, true); - if (user.isOnline()) + if (!user.isOnline()) { if (Permissions.BAN_EXEMPT.isAuthorized(user)) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java index 3d07107ea..2b7d550d6 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.perm.Permissions; +import static com.earth2me.essentials.I18n._; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.event.block.BlockBreakEvent; @@ -24,7 +25,7 @@ public class Commandbreak extends EssentialsCommand } if (block.getType() == Material.BEDROCK && !Permissions.BREAK_BEDROCK.isAuthorized(user)) { - throw new Exception("You are not allowed to destroy bedrock."); //TODO: Translation + throw new Exception(_("noBreakBedrock")); } final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase()); server.getPluginManager().callEvent(event); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java index bf9ebaef6..3269d2114 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; +import static com.earth2me.essentials.I18n._; import java.util.Locale; import lombok.Cleanup; import org.bukkit.command.CommandSender; @@ -29,7 +30,34 @@ public class Commandeco extends EssentialsCommand throw new NotEnoughArgumentsException(ex); } - if (args[1].contentEquals("*")) + if (args[1].contentEquals("**")) + { + for (String sUser : ess.getUserMap().getAllUniqueUsers()) + { + final IUser player = ess.getUser(sUser); + switch (cmd) + { + case GIVE: + player.giveMoney(amount); + break; + + case TAKE: + if (player.canAfford(amount, false)) + { + player.takeMoney(amount); + } + break; + + case RESET: + @Cleanup + ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + player.setMoney(amount == 0 ? settings.getData().getEconomy().getStartingBalance() : amount); + break; + } + } + } + else if (args[1].contentEquals("*")) { for (Player onlinePlayer : server.getOnlinePlayers()) { @@ -41,6 +69,10 @@ public class Commandeco extends EssentialsCommand break; case TAKE: + if (!player.canAfford(amount, false)) + { + throw new Exception(_("notEnoughMoney")); + } player.takeMoney(amount); break; @@ -63,6 +95,10 @@ public class Commandeco extends EssentialsCommand break; case TAKE: + if (!player.canAfford(amount, false)) + { + throw new Exception(_("notEnoughMoney")); + } player.takeMoney(amount, sender); break; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index ddc6d775e..095690374 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -7,6 +7,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.command.CommandSender; +import org.bukkit.command.ConsoleCommandSender; import org.bukkit.entity.Player; @@ -30,6 +31,10 @@ public class Commandessentials extends EssentialsCommand { run_nya(sender, args); } + else if (args[0].equalsIgnoreCase("moo")) + { + run_moo(sender, args); + } else { run_reload(sender, args); @@ -109,7 +114,7 @@ public class Commandessentials extends EssentialsCommand if (loc.getBlock().getTypeId() == 0) { noteBlocks.put(player, loc.getBlock()); - loc.getBlock().setType(Material.NOTE_BLOCK); + player.sendBlockChange(loc, Material.NOTE_BLOCK, (byte)0); } } taskid = ess.scheduleSyncRepeatingTask(new Runnable() @@ -141,7 +146,6 @@ public class Commandessentials extends EssentialsCommand } } }, 20, 2); - return; } private void stopTune() @@ -156,4 +160,12 @@ public class Commandessentials extends EssentialsCommand } noteBlocks.clear(); } + + private void run_moo(final CommandSender sender, final String args[]) + { + if(sender instanceof ConsoleCommandSender) + sender.sendMessage(new String[]{" (__)", " (oo)", " /------\\/", " / | ||", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..." } ); + else + sender.sendMessage(new String[]{" (__)", " (oo)", " /------\\/", " / | | |", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..." } ); + } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java index 2c0a66d60..057e8fca9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.perm.GivePermissions; +import static com.earth2me.essentials.I18n._; import java.util.Locale; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -29,8 +30,8 @@ public class Commandgive extends EssentialsCommand final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""); if (!GivePermissions.getPermission(stack.getType()).isAuthorized(sender)) { - throw new Exception(ChatColor.RED + "You are not allowed to spawn the item " + itemname); - } + throw new Exception(_("cantSpawnItem", itemname)); + } if (args.length > 2 && Integer.parseInt(args[2]) > 0) { @@ -62,7 +63,7 @@ public class Commandgive extends EssentialsCommand if (stack.getType() == Material.AIR) { - throw new Exception(ChatColor.RED + "You can't give air."); + throw new Exception(_("cantSpawnItem", "Air")); } giveTo.giveItems(stack, false); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java index 1fb3d8011..269536f45 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java @@ -51,6 +51,8 @@ public class Commandkit extends EssentialsCommand charge.isAffordableFor(user); ess.getKits().sendKit(user, kit); + + //TODO: Merge kit changes from 2.9 charge.charge(user); user.sendMessage(_("kitGive", kitName)); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java b/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java new file mode 100644 index 000000000..08c5912ae --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java @@ -0,0 +1,38 @@ +package com.earth2me.essentials.commands; + +import com.earth2me.essentials.Mob; +import com.earth2me.essentials.api.IUser; +import java.util.Random; +import org.bukkit.Location; +import org.bukkit.entity.Ocelot; + + +public class Commandkittycannon extends EssentialsCommand +{ + private static Random random = new Random(); + + @Override + protected void run(final IUser user, final String commandLabel, final String[] args) throws Exception + { + final Mob cat = Mob.OCELOT; + final Ocelot ocelot = (Ocelot)cat.spawn(user, server, user.getEyeLocation()); + if (ocelot == null) + { + return; + } + final int i = random.nextInt(Ocelot.Type.values().length); + ocelot.setCatType(Ocelot.Type.values()[i]); + ocelot.setTamed(true); + ocelot.setVelocity(user.getEyeLocation().getDirection().multiply(2)); + ess.scheduleSyncDelayedTask(new Runnable() + { + @Override + public void run() + { + final Location loc = ocelot.getLocation(); + ocelot.remove(); + loc.getWorld().createExplosion(loc, 0F); + } + }, 20); + } +} diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java index 0973b2137..f7323a20f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; +import com.earth2me.essentials.perm.Permissions; import lombok.Cleanup; import org.bukkit.command.CommandSender; import org.bukkit.entity.LightningStrike; @@ -20,7 +21,7 @@ public class Commandlightning extends EssentialsCommand { user = ess.getUser(((Player)sender)); } - if (args.length < 1 & user != null) + if ((args.length < 1 || !Permissions.LIGHTNING_OTHERS.isAuthorized(user)) && user != null) { user.getWorld().strikeLightning(user.getTargetBlock(null, 600).getLocation()); return; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java index c069d93f1..12c4f4f19 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java @@ -1,6 +1,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.Util; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.perm.Permissions; @@ -75,7 +76,7 @@ public class Commandlist extends EssentialsCommand for (String group : groups) { final StringBuilder groupString = new StringBuilder(); - groupString.append(group).append(": "); + groupString.append(_("listGroupTag",Util.replaceColor(group))); final List<IUser> users = sort.get(group); Collections.sort(users); boolean first = true; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java index d1b560191..4f6e3933a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java @@ -45,7 +45,7 @@ public class Commandnuke extends EssentialsCommand { for (int z = -10; z <= 10; z += 5) { - final Location tntloc = new Location(world, loc.getBlockX() + x, 127, loc.getBlockZ() + z); + final Location tntloc = new Location(world, loc.getBlockX() + x, world.getMaxHeight(), loc.getBlockZ() + z); final TNTPrimed tnt = world.spawn(tntloc, TNTPrimed.class); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index 6b987c628..83c5b1f31 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -3,7 +3,9 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.Util; import com.earth2me.essentials.api.IUser; +import com.earth2me.essentials.perm.Permissions; import com.earth2me.essentials.user.UserData.TimestampType; +import lombok.Cleanup; import org.bukkit.command.CommandSender; @@ -12,6 +14,17 @@ public class Commandseen extends EssentialsCommand @Override protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { + seen(sender,args,true); + } + + @Override + protected void run(final IUser user, final String commandLabel, final String[] args) throws Exception + { + seen(user,args,Permissions.SEEN_BANREASON.isAuthorized(user)); + } + + protected void seen (final CommandSender sender, final String[] args, final boolean show) throws Exception + { if (args.length < 1) { throw new NotEnoughArgumentsException(); @@ -23,7 +36,9 @@ public class Commandseen extends EssentialsCommand } catch (NoSuchFieldException e) { + @Cleanup IUser u = ess.getUser(args[0]); + u.acquireReadLock(); if (u == null) { throw new Exception(_("playerNotFound")); @@ -31,7 +46,7 @@ public class Commandseen extends EssentialsCommand sender.sendMessage(_("seenOffline", u.getDisplayName(), Util.formatDateDiff(u.getTimestamp(TimestampType.LOGOUT)))); if (u.isBanned()) { - sender.sendMessage(_("whoisBanned", _("true"))); + sender.sendMessage(_("whoisBanned", show ? u.getData().getBan().getReason() : _("true"))); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java index 20923dcdd..cede8841b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java @@ -145,8 +145,8 @@ public class Commandsell extends EssentialsCommand user.updateInventory(); Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(worth * amount, ess), user.getLocation(), ess); user.giveMoney(worth * amount); - user.sendMessage(_("itemSold", Util.formatCurrency(worth * amount, ess), amount, is.getType().toString().toLowerCase(Locale.ENGLISH), Util.formatCurrency(worth, ess))); - logger.log(Level.INFO, _("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(Locale.ENGLISH), Util.formatCurrency(worth * amount, ess), amount, Util.formatCurrency(worth, ess))); + user.sendMessage(_("itemSold", Util.displayCurrency(worth * amount, ess), amount, is.getType().toString().toLowerCase(Locale.ENGLISH), Util.displayCurrency(worth, ess))); + logger.log(Level.INFO, _("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(Locale.ENGLISH), Util.displayCurrency(worth * amount, ess), amount, Util.displayCurrency(worth, ess))); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java index 3e0b3f52c..e6acb1fbe 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; +import org.bukkit.command.CommandSender; import org.bukkit.inventory.ItemStack; @@ -15,8 +16,34 @@ public class Commandsetworth extends EssentialsCommand throw new NotEnoughArgumentsException(); } + ItemStack stack; + String price; + + if (args.length == 1) + { + stack = user.getInventory().getItemInHand(); + price = args[0]; + } + else + { + stack = ess.getItemDb().get(args[0]); + price = args[1]; + } + + ess.getWorth().setPrice(stack, Double.parseDouble(price)); + user.sendMessage(_("worthSet")); + } + + @Override + public void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception + { + if (args.length < 2) + { + throw new NotEnoughArgumentsException(); + } + ItemStack stack = ess.getItemDb().get(args[0]); ess.getWorth().setPrice(stack, Double.parseDouble(args[1])); - user.sendMessage(_("worthSet")); + sender.sendMessage(_("worthSet")); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java index 9aed4b10f..2c8cb2b3e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java @@ -10,6 +10,7 @@ import java.util.Locale; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.CreatureSpawner; +import org.bukkit.entity.EntityType; public class Commandspawner extends EssentialsCommand @@ -45,7 +46,7 @@ public class Commandspawner extends EssentialsCommand } final Trade charge = new Trade("spawner-" + mob.name.toLowerCase(Locale.ENGLISH), ess); charge.isAffordableFor(user); - ((CreatureSpawner)target.getBlock().getState()).setCreatureType(mob.getType()); + ((CreatureSpawner)target.getBlock().getState()).setSpawnedType(mob.getType()); charge.charge(user); user.sendMessage(_("setSpawner", mob.name)); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 8b5206543..d075ac7c3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -7,9 +7,7 @@ import com.earth2me.essentials.Util; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.perm.SpawnmobPermissions; -import java.util.Locale; -import java.util.Random; -import java.util.Set; +import java.util.*; import org.bukkit.DyeColor; import org.bukkit.Location; import org.bukkit.block.Block; @@ -23,12 +21,13 @@ public class Commandspawnmob extends EssentialsCommand { if (args.length < 1) { - Set<String> availableList = Mob.getMobList(); - for (String mob : availableList) + final Set<String> mobList = Mob.getMobList(); + final Set<String> availableList = new HashSet<String>(); + for (String mob : mobList) { - if (!SpawnmobPermissions.getPermission(mob).isAuthorized(user)) + if (SpawnmobPermissions.getPermission(mob).isAuthorized(user)) { - availableList.remove(mob); + availableList.add(mob); } } if (availableList.isEmpty()) @@ -174,7 +173,7 @@ public class Commandspawnmob extends EssentialsCommand changeMobData(mobMount.getType(), spawnedMount, mountData, user); } } - user.sendMessage(args[1] + " " + mob.name.toLowerCase(Locale.ENGLISH) + mob.suffix + " " + _("spawned")); + user.sendMessage(mobCount + " " + mob.name.toLowerCase(Locale.ENGLISH) + mob.suffix + " " + _("spawned")); } catch (MobException e1) { @@ -195,9 +194,10 @@ public class Commandspawnmob extends EssentialsCommand } } - private void changeMobData(final CreatureType type, final Entity spawned, final String data, final IUser user) throws Exception + private void changeMobData(final EntityType type, final Entity spawned, String data, final IUser user) throws Exception { - if (type == CreatureType.SLIME || type == CreatureType.MAGMA_CUBE) + data = data.toLowerCase(Locale.ENGLISH); + if (type == EntityType.SLIME || type == EntityType.MAGMA_CUBE) { try { @@ -208,28 +208,25 @@ public class Commandspawnmob extends EssentialsCommand throw new Exception(_("slimeMalformedSize"), e); } } - if ((type == CreatureType.SHEEP - || type == CreatureType.COW - || type == CreatureType.MUSHROOM_COW - || type == CreatureType.CHICKEN - || type == CreatureType.PIG - || type == CreatureType.WOLF) - && data.equalsIgnoreCase("baby")) + if ((type == EntityType.SHEEP + || type == EntityType.COW + || type == EntityType.MUSHROOM_COW + || type == EntityType.CHICKEN + || type == EntityType.PIG + || type == EntityType.VILLAGER + || type == EntityType.OCELOT + || type == EntityType.WOLF) + && data.contains("baby")) { - ((Animals)spawned).setAge(-24000); + ((Animals)spawned).setBaby(); return; } - if (type == CreatureType.SHEEP) + if (type == EntityType.SHEEP) { - if (data.toLowerCase(Locale.ENGLISH).contains("baby")) - { - ((Sheep)spawned).setAge(-24000); - } final String color = data.toUpperCase(Locale.ENGLISH).replace("BABY", ""); try { - - if (color.equalsIgnoreCase("random")) + if (color.equals("RANDOM")) { Random rand = new Random(); ((Sheep)spawned).setColor(DyeColor.values()[rand.nextInt(DyeColor.values().length)]); @@ -244,30 +241,37 @@ public class Commandspawnmob extends EssentialsCommand throw new Exception(_("sheepMalformedColor"), e); } } - if (type == CreatureType.WOLF - && data.toLowerCase(Locale.ENGLISH).startsWith("tamed")) + if ((type == EntityType.WOLF + || type == EntityType.OCELOT) + && data.contains("tamed")) { - final Wolf wolf = ((Wolf)spawned); - wolf.setTamed(true); - wolf.setOwner(user.getBase()); - wolf.setSitting(true); - if (data.equalsIgnoreCase("tamedbaby")) - { - ((Animals)spawned).setAge(-24000); - } + final Tameable tameable = ((Tameable)spawned); + tameable.setTamed(true); + tameable.setOwner(user.getBase()); } - if (type == CreatureType.WOLF - && data.toLowerCase(Locale.ENGLISH).startsWith("angry")) + if (type == EntityType.WOLF + && data.contains("angry")) { ((Wolf)spawned).setAngry(true); - if (data.equalsIgnoreCase("angrybaby")) - { - ((Animals)spawned).setAge(-24000); - } } - if (type == CreatureType.CREEPER && data.equalsIgnoreCase("powered")) + if (type == EntityType.CREEPER && data.contains("powered")) { ((Creeper)spawned).setPowered(true); } + if (type == EntityType.OCELOT) + { + if (data.contains("siamese")) + { + ((Ocelot)spawned).setCatType(Ocelot.Type.SIAMESE_CAT); + } + if (data.contains("red")) + { + ((Ocelot)spawned).setCatType(Ocelot.Type.RED_CAT); + } + if (data.contains("black")) + { + ((Ocelot)spawned).setCatType(Ocelot.Type.BLACK_CAT); + } + } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java index 0ada17f16..59b7ececf 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java @@ -2,6 +2,8 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.perm.Permissions; +import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.Util; import org.bukkit.command.CommandSender; import org.bukkit.command.PluginCommand; @@ -24,14 +26,12 @@ public class Commandsudo extends EssentialsCommand System.arraycopy(args, 2, arguments, 0, args.length - 2); } - //TODO: Translate this. if (Permissions.SUDO_EXEMPT.isAuthorized(user)) { - throw new Exception("You cannot sudo this user"); + throw new Exception(_("sudoExempt")); } - //TODO: Translate this. - sender.sendMessage("Forcing " + user.getDisplayName() + " to run: /" + command + " " + arguments); + sender.sendMessage(_("sudoRun", user.getDisplayName(), command, getFinalArg(arguments, 0))); final PluginCommand execCommand = ess.getServer().getPluginCommand(command); if (execCommand != null) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java index ab6cbef89..748d2b830 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java @@ -21,7 +21,7 @@ public class Commandtempban extends EssentialsCommand throw new NotEnoughArgumentsException(); } final IUser user = getPlayer(args, 0, true); - if (user.getBase() instanceof OfflinePlayer) + if (!user.isOnline()) { if (Permissions.TEMPBAN_OFFLINE.isAuthorized(sender)) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java index f9bcd95c9..3c76c3a60 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java @@ -26,7 +26,7 @@ public class Commandtogglejail extends EssentialsCommand if (args.length >= 2 && !player.getData().isJailed()) { - if (player.getBase() instanceof OfflinePlayer) + if (!player.isOnline()) { if (Permissions.TOGGLEJAIL_OFFLINE.isAuthorized(sender)) { @@ -42,7 +42,7 @@ public class Commandtogglejail extends EssentialsCommand return; } } - if (!(player.getBase() instanceof OfflinePlayer)) + if (player.isOnline()) { ess.getJails().sendToJail(player, args[1]); } @@ -95,7 +95,7 @@ public class Commandtogglejail extends EssentialsCommand player.setTimestamp(TimestampType.JAIL, 0); player.sendMessage(_("jailReleasedPlayerNotify")); player.getData().setJail(null); - if (!(player.getBase() instanceof OfflinePlayer)) + if (player.isOnline()) { player.getTeleport().back(); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java index 2652a3a43..92b2c6c8b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java @@ -37,8 +37,7 @@ public class Commandtp extends EssentialsCommand default: if (!Permissions.TPOHERE.isAuthorized(user)) { - //TODO: Translate this - throw new Exception("You need access to /tpohere to teleport other players."); + throw new Exception(_("needTpohere")); } user.sendMessage(_("teleporting")); final IUser target = getPlayer(args, 0); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java index 174d21d9d..291d3d73c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java @@ -21,7 +21,7 @@ public class Commandtpaccept extends EssentialsCommand final IUser target = user.getTeleportRequester(); if (target == null - || target.getBase() instanceof OfflinePlayer + || !target.isOnline() || (user.isTeleportRequestHere() && !Permissions.TPAHERE.isAuthorized(target)) || (!user.isTeleportRequestHere() && !Permissions.TPA.isAuthorized(target) && !Permissions.TPAALL.isAuthorized(target))) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java index 69c8c47a3..8fefb0abd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java @@ -3,7 +3,6 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.perm.Permissions; -import org.bukkit.OfflinePlayer; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -20,7 +19,7 @@ public class Commandtpo extends EssentialsCommand //Just basically the old tp command final IUser player = getPlayer(args, 0, true); // Check if user is offline - if (player.getBase() instanceof OfflinePlayer) + if (!player.isOnline()) { throw new NoSuchFieldException(_("playerNotFound")); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java index 33351eeb7..c6421e90a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java @@ -3,7 +3,6 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.perm.Permissions; -import org.bukkit.OfflinePlayer; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -21,7 +20,7 @@ public class Commandtpohere extends EssentialsCommand final IUser player = getPlayer(args, 0, true); // Check if user is offline - if (player.getBase() instanceof OfflinePlayer) + if (!player.isOnline()) { throw new NoSuchFieldException(_("playerNotFound")); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java index 4ec9b9c04..402ac2018 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java @@ -5,6 +5,7 @@ import com.earth2me.essentials.Util; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.perm.Permissions; +import com.earth2me.essentials.user.UserData; import java.util.Locale; import lombok.Cleanup; import org.bukkit.command.CommandSender; @@ -61,7 +62,12 @@ public class Commandwhois extends EssentialsCommand sender.sendMessage(_("whoisGod", (user.isGodModeEnabled() ? _("true") : _("false")))); sender.sendMessage(_("whoisGamemode", _(user.getGameMode().toString().toLowerCase(Locale.ENGLISH)))); sender.sendMessage(_("whoisLocation", user.getLocation().getWorld().getName(), user.getLocation().getBlockX(), user.getLocation().getBlockY(), user.getLocation().getBlockZ())); - sender.sendMessage(_("whoisMoney", Util.formatCurrency(user.getMoney(), ess))); + sender.sendMessage(_("whoisMoney", Util.displayCurrency(user.getMoney(), ess))); + sender.sendMessage(_("whoisJail", (user.getData().isJailed() + ? user.getTimestamp(UserData.TimestampType.JAIL) > 0 + ? Util.formatDateDiff(user.getTimestamp(UserData.TimestampType.JAIL)) + : _("true") + : _("false")))); sender.sendMessage(user.getData().isAfk() ? _("whoisStatusAway") : _("whoisStatusAvailable")); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java index 57955b6ba..7996e5b24 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java @@ -45,14 +45,14 @@ public class Commandworth extends EssentialsCommand ? _("worthMeta", iStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""), iStack.getDurability(), - Util.formatCurrency(worth * amount, ess), + Util.displayCurrency(worth * amount, ess), amount, - Util.formatCurrency(worth, ess)) + Util.displayCurrency(worth, ess)) : _("worth", iStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""), - Util.formatCurrency(worth * amount, ess), + Util.displayCurrency(worth * amount, ess), amount, - Util.formatCurrency(worth, ess))); + Util.displayCurrency(worth, ess))); } @Override @@ -89,14 +89,14 @@ public class Commandworth extends EssentialsCommand ? _("worthMeta", iStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""), iStack.getDurability(), - Util.formatCurrency(worth * amount, ess), + Util.displayCurrency(worth * amount, ess), amount, - Util.formatCurrency(worth, ess)) + Util.displayCurrency(worth, ess)) : _("worth", iStack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""), - Util.formatCurrency(worth * amount, ess), + Util.displayCurrency(worth * amount, ess), amount, - Util.formatCurrency(worth, ess))); + Util.displayCurrency(worth, ess))); } } diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java index 5d1b3b1c3..01e7bd5b2 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java @@ -193,23 +193,33 @@ public class FakeInventory implements Inventory } } - public List<HumanEntity> getViewers() { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public List<HumanEntity> getViewers() + { + throw new UnsupportedOperationException("Not supported yet."); + } - public String getTitle() { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public String getTitle() + { + throw new UnsupportedOperationException("Not supported yet."); + } - public InventoryType getType() { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public InventoryType getType() + { + throw new UnsupportedOperationException("Not supported yet."); + } - public InventoryHolder getHolder() { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public InventoryHolder getHolder() + { + throw new UnsupportedOperationException("Not supported yet."); + } - public ListIterator<ItemStack> iterator() { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public ListIterator<ItemStack> iterator() + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/ShowInventory.java b/Essentials/src/com/earth2me/essentials/craftbukkit/ShowInventory.java deleted file mode 100644 index 7a176f843..000000000 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/ShowInventory.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.earth2me.essentials.craftbukkit; - -import java.util.logging.Level; -import java.util.logging.Logger; -import net.minecraft.server.EntityPlayer; -import net.minecraft.server.IInventory; -import net.minecraft.server.PlayerInventory; -import org.bukkit.craftbukkit.entity.CraftPlayer; -import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; - - -public class ShowInventory -{ - public static void showEmptyInventory(final Player player) - { - try - { - final EntityPlayer entityPlayer = ((CraftPlayer)player).getHandle(); - final CraftInventoryPlayer inv = new CraftInventoryPlayer(new PlayerInventory(((CraftPlayer)player).getHandle())); - inv.clear(); - entityPlayer.openContainer((IInventory)inv.getInventory()); - } - catch (Throwable ex) - { - Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex); - } - } - - public static void showFilledInventory(final Player player, final ItemStack stack) - { - try - { - final EntityPlayer entityPlayer = ((CraftPlayer)player).getHandle(); - final CraftInventoryPlayer inv = new CraftInventoryPlayer(new PlayerInventory(((CraftPlayer)player).getHandle())); - inv.clear(); - InventoryWorkaround.addItem(inv, true, stack); - entityPlayer.openContainer((IInventory)inv.getInventory()); - } - catch (Throwable ex) - { - Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex); - } - } -} diff --git a/Essentials/src/com/earth2me/essentials/listener/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/listener/EssentialsBlockListener.java index 0b461eb91..8710c6701 100644 --- a/Essentials/src/com/earth2me/essentials/listener/EssentialsBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/listener/EssentialsBlockListener.java @@ -21,13 +21,9 @@ public class EssentialsBlockListener implements Listener this.ess = ess; } - @EventHandler(priority = EventPriority.LOWEST) + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onBlockPlace(final BlockPlaceEvent event) { - if (event.isCancelled()) - { - return; - } // Do not rely on getItemInHand(); // http://leaky.bukkit.org/issues/663 final ItemStack itemstack = Util.convertBlockToItem(event.getBlockPlaced()); diff --git a/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java index 41e989708..c5a967378 100644 --- a/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java @@ -29,50 +29,49 @@ public class EssentialsEntityListener implements Listener } @EventHandler(priority = EventPriority.LOWEST) - public void onEntityDamage(final EntityDamageEvent event) + public void onEntityDamage(final EntityDamageByEntityEvent event) { - if (event instanceof EntityDamageByEntityEvent) + final Entity eAttack = event.getDamager(); + final Entity eDefend = event.getEntity(); + if (eDefend instanceof Player && eAttack instanceof Player) { - final EntityDamageByEntityEvent edEvent = (EntityDamageByEntityEvent)event; - final Entity eAttack = edEvent.getDamager(); - final Entity eDefend = edEvent.getEntity(); - if (eDefend instanceof Player && eAttack instanceof Player) + @Cleanup + final IUser attacker = ess.getUser((Player)eAttack); + attacker.acquireReadLock(); + attacker.updateActivity(true); + final ItemStack itemstack = attacker.getItemInHand(); + final List<String> commandList = attacker.getData().getPowertool(itemstack.getType()); + if (commandList != null && !commandList.isEmpty()) { - @Cleanup - final IUser attacker = ess.getUser((Player)eAttack); - attacker.acquireReadLock(); - attacker.updateActivity(true); - final ItemStack itemstack = attacker.getItemInHand(); - final List<String> commandList = attacker.getData().getPowertool(itemstack.getType()); - if (commandList != null && !commandList.isEmpty()) + for (String command : commandList) { - for (String command : commandList) + if (command != null && !command.isEmpty()) { - - if (command != null && !command.isEmpty()) - { - final IUser defender = ess.getUser((Player)eDefend); - attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", defender.getName())); - event.setCancelled(true); - return; - } + attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", ((Player)eDefend).getName())); + event.setCancelled(true); + return; } } } - if (eDefend instanceof Animals && eAttack instanceof Player) + } + else if (eDefend instanceof Animals && eAttack instanceof Player) + { + final Player player = (Player)eAttack; + final ItemStack hand = player.getItemInHand(); + if (hand != null && hand.getType() == Material.MILK_BUCKET) { - final IUser player = ess.getUser((Player)eAttack); - final ItemStack hand = player.getItemInHand(); - if (hand != null && hand.getType() == Material.MILK_BUCKET) - { - ((Animals)eDefend).setAge(-24000); - hand.setType(Material.BUCKET); - player.setItemInHand(hand); - player.updateInventory(); - event.setCancelled(true); - } + ((Animals)eDefend).setBaby(); + hand.setType(Material.BUCKET); + player.setItemInHand(hand); + player.updateInventory(); + event.setCancelled(true); } } + } + + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + public void onEntityDamage(final EntityDamageEvent event) + { if (event.getEntity() instanceof Player && ess.getUser((Player)event.getEntity()).isGodModeEnabled()) { final Player player = (Player)event.getEntity(); @@ -82,7 +81,7 @@ public class EssentialsEntityListener implements Listener } } - @EventHandler(priority = EventPriority.LOWEST) + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onEntityCombust(final EntityCombustEvent event) { if (event.getEntity() instanceof Player && ess.getUser((Player)event.getEntity()).isGodModeEnabled()) @@ -92,28 +91,24 @@ public class EssentialsEntityListener implements Listener } @EventHandler(priority = EventPriority.LOWEST) - public void onEntityDeath(final EntityDeathEvent event) + public void onPlayerDeathEvent(final PlayerDeathEvent event) { - if (event instanceof PlayerDeathEvent) + final IUser user = ess.getUser((Player)event.getEntity()); + @Cleanup + final ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + if (Permissions.BACK_ONDEATH.isAuthorized(user) && !settings.getData().getCommands().isDisabled("back")) { - final PlayerDeathEvent pdevent = (PlayerDeathEvent)event; - final IUser user = ess.getUser((Player)pdevent.getEntity()); - @Cleanup - final ISettings settings = ess.getSettings(); - settings.acquireReadLock(); - if (Permissions.BACK_ONDEATH.isAuthorized(user) && !settings.getData().getCommands().isDisabled("back")) - { - user.setLastLocation(); - user.sendMessage(_("backAfterDeath")); - } - if (!settings.getData().getGeneral().isDeathMessages()) - { - pdevent.setDeathMessage(""); - } + user.setLastLocation(); + user.sendMessage(_("backAfterDeath")); + } + if (!settings.getData().getGeneral().isDeathMessages()) + { + event.setDeathMessage(""); } } - @EventHandler(priority = EventPriority.LOWEST) + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onFoodLevelChange(final FoodLevelChangeEvent event) { if (event.getEntity() instanceof Player && ess.getUser((Player)event.getEntity()).isGodModeEnabled()) @@ -122,7 +117,7 @@ public class EssentialsEntityListener implements Listener } } - @EventHandler(priority = EventPriority.LOWEST) + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onEntityRegainHealth(final EntityRegainHealthEvent event) { diff --git a/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java index 49abd6298..f008cb435 100644 --- a/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java @@ -26,7 +26,6 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerLoginEvent.Result; import org.bukkit.event.player.*; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -79,13 +78,9 @@ public class EssentialsPlayerListener implements Listener user.updateDisplayName(); } - @EventHandler(priority = EventPriority.HIGH) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerMove(final PlayerMoveEvent event) { - if (event.isCancelled()) - { - return; - } @Cleanup final IUser user = ess.getUser(event.getPlayer()); user.acquireReadLock(); @@ -199,8 +194,13 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.HIGH) public void onPlayerLogin(final PlayerLoginEvent event) { - if (event.getResult() != Result.ALLOWED && event.getResult() != Result.KICK_FULL && event.getResult() != Result.KICK_BANNED) + switch (event.getResult()) { + case ALLOWED: + case KICK_FULL: + case KICK_BANNED: + break; + default: return; } @Cleanup @@ -231,29 +231,22 @@ public class EssentialsPlayerListener implements Listener user.updateCompass(); } - @EventHandler(priority = EventPriority.HIGH) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerTeleport(final PlayerTeleportEvent event) { - if (event.isCancelled()) - { - return; - } - @Cleanup final ISettings settings = ess.getSettings(); settings.acquireReadLock(); - final IUser user = ess.getUser(event.getPlayer()); //There is TeleportCause.COMMMAND but plugins have to actively pass the cause in on their teleports. if ((event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND) && settings.getData().getCommands().getBack().isRegisterBackInListener()) { + final IUser user = ess.getUser(event.getPlayer()); user.setLastLocation(); } - user.updateDisplayName(); - user.updateCompass(); } - @EventHandler(priority = EventPriority.HIGH) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerEggThrow(final PlayerEggThrowEvent event) { @Cleanup @@ -267,7 +260,7 @@ public class EssentialsPlayerListener implements Listener } } - @EventHandler(priority = EventPriority.HIGH) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerBucketEmpty(final PlayerBucketEmptyEvent event) { @Cleanup @@ -287,71 +280,9 @@ public class EssentialsPlayerListener implements Listener } } - @EventHandler(priority = EventPriority.NORMAL) - public void onPlayerAnimation(final PlayerAnimationEvent event) - { - final IUser user = ess.getUser(event.getPlayer()); - user.updateActivity(true); - if (event.getAnimationType() == PlayerAnimationType.ARM_SWING) - { - usePowertools(user); - } - } - - private void usePowertools(final IUser user) - { - user.acquireReadLock(); - try - { - if (!user.getData().hasPowerTools() || !user.getData().isPowerToolsEnabled()) - { - return; - } - - final ItemStack hand = user.getItemInHand(); - Material type; - if (hand == null || (type = hand.getType()) == Material.AIR) - { - return; - } - final List<String> commandList = user.getData().getPowertool(type); - - if (commandList == null || commandList.isEmpty()) - { - return; - } - - // We need to loop through each command and execute - for (String command : commandList) - { - if (command.matches(".*\\{player\\}.*")) - { - //user.sendMessage("Click a player to use this command"); - continue; - } - else if (command.startsWith("c:")) - { - user.chat(command.substring(2)); - } - else - { - user.getServer().dispatchCommand(user.getBase(), command); - } - } - } - finally - { - user.unlock(); - } - } - - @EventHandler(priority = EventPriority.MONITOR) + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event) { - if (event.isCancelled()) - { - return; - } final IUser user = ess.getUser(event.getPlayer()); final String cmd = event.getMessage().toLowerCase(Locale.ENGLISH).split(" ")[0].replace("/", "").toLowerCase(Locale.ENGLISH); final List<String> commands = Arrays.asList("msg", "r", "mail", "m", "t", "emsg", "tell", "er", "reply", "ereply", "email"); @@ -383,6 +314,10 @@ public class EssentialsPlayerListener implements Listener @Cleanup final IUser user = ess.getUser(event.getPlayer()); user.acquireReadLock(); + if (settings.getData().getChat().getChangeDisplayname()) + { + user.updateDisplayName(); + } if (!settings.getData().getWorldOptions(event.getPlayer().getLocation().getWorld().getName()).isGodmode() && !Permissions.NOGOD_OVERRIDE.isAuthorized(user)) { if (user.getData().isGodmode()) @@ -400,34 +335,91 @@ public class EssentialsPlayerListener implements Listener } } - @EventHandler(priority = EventPriority.MONITOR) + @EventHandler(priority = EventPriority.NORMAL) public void onPlayerInteract(final PlayerInteractEvent event) { - if (event.isCancelled()) + @Cleanup + final IUser user = ess.getUser(event.getPlayer()); + user.acquireReadLock(); + user.updateActivity(true); + switch (event.getAction()) { - return; + case RIGHT_CLICK_BLOCK: + if (event.isCancelled()) + { + return; + } + @Cleanup + final ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + if (settings.getData().getCommands().getHome().isUpdateBedAtDaytime() && event.getClickedBlock().getType() == Material.BED_BLOCK) + { + event.getPlayer().setBedSpawnLocation(event.getClickedBlock().getLocation()); + } + break; + case LEFT_CLICK_AIR: + case LEFT_CLICK_BLOCK: + if (user.getData().hasPowerTools() && user.getData().isPowerToolsEnabled()) + { + if (usePowertools(user)) + { + event.setCancelled(true); + } + } + break; + default: + break; } - if (event.getAction() != Action.RIGHT_CLICK_BLOCK) + } + + private boolean usePowertools(final IUser user) + { + final ItemStack is = user.getItemInHand(); + int id; + if (is == null || (id = is.getTypeId()) == 0) { - return; + return false; } - - @Cleanup - final ISettings settings = ess.getSettings(); - settings.acquireReadLock(); - if (settings.getData().getCommands().getHome().isUpdateBedAtDaytime() && event.getClickedBlock().getType() == Material.BED_BLOCK) + + final List<String> commandList = user.getData().getPowertool(is.getType()); + if (commandList == null || commandList.isEmpty()) { - event.getPlayer().setBedSpawnLocation(event.getClickedBlock().getLocation()); + return false; } + boolean used = false; + // We need to loop through each command and execute + for (final String command : commandList) + { + if (command.matches(".*\\{player\\}.*")) + { + //user.sendMessage("Click a player to use this command"); + continue; + } + else if (command.startsWith("c:")) + { + used = true; + user.chat(command.substring(2)); + } + else + { + used = true; + ess.scheduleSyncDelayedTask( + new Runnable() + { + @Override + public void run() + { + user.getServer().dispatchCommand(user.getBase(), command); + } + }); + } + } + return used; } - @EventHandler(priority = EventPriority.LOW) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onPlayerPickupItem(final PlayerPickupItemEvent event) { - if (event.isCancelled()) - { - return; - } @Cleanup final ISettings settings = ess.getSettings(); settings.acquireReadLock(); diff --git a/Essentials/src/com/earth2me/essentials/perm/Permissions.java b/Essentials/src/com/earth2me/essentials/perm/Permissions.java index 2c66dd573..de0da1879 100644 --- a/Essentials/src/com/earth2me/essentials/perm/Permissions.java +++ b/Essentials/src/com/earth2me/essentials/perm/Permissions.java @@ -39,6 +39,7 @@ public enum Permissions implements IPermission KICK_EXEMPT, KICK_NOTIFY, LIST_HIDDEN, + LIGHTNING_OTHERS, MAIL, MAIL_SEND, MAIL_SENDALL, @@ -54,6 +55,7 @@ public enum Permissions implements IPermission PTIME_OTHERS, REPAIR_ARMOR, REPAIR_ENCHANTED, + SEEN_BANREASON, SETHOME_MULTIPLE, SETHOME_OTHERS, SLEEPINGIGNORED, diff --git a/Essentials/src/com/earth2me/essentials/settings/Economy.java b/Essentials/src/com/earth2me/essentials/settings/Economy.java index 21b6f3b05..a92a5e6c7 100644 --- a/Essentials/src/com/earth2me/essentials/settings/Economy.java +++ b/Essentials/src/com/earth2me/essentials/settings/Economy.java @@ -37,6 +37,18 @@ public class Economy implements StorageObject { return Math.abs(maxMoney) > MAXMONEY ? MAXMONEY : Math.abs(maxMoney); } + + @Comment( + { + "Set the minimum amount of money a player can have (must be above the negative of max-money).", + "Setting this to 0, will disable overdrafts/loans completely. Users need 'essentials.eco.loan' perm to go below 0." + }) + private double minMoney = -MAXMONEY; + public double getMinMoney() + { + return Math.abs(minMoney) > MAXMONEY ? -MAXMONEY : minMoney; + } + @Comment("Enable this to log all interactions with trade/buy/sell signs and sell command") private boolean logEnabled = false; private Worth worth = new Worth(); diff --git a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java index e9dd0b9a7..d33b54a2c 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java @@ -56,7 +56,7 @@ public class HelpInput implements IText final String node = "essentials." + k.getKey(); if (!settings.getData().getCommands().isDisabled(k.getKey()) && user.hasPermission(node)) { - lines.add("§c" + k.getKey() + "§7: " + k.getValue().get(DESCRIPTION)); + lines.add(_("helpLine", k.getKey(), k.getValue().get(DESCRIPTION))); } } else @@ -75,7 +75,7 @@ public class HelpInput implements IText } if (HelpPermissions.getPermission(pluginName).isAuthorized(user)) { - lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION)); + lines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } else if (permissions instanceof List && !((List<Object>)permissions).isEmpty()) { @@ -90,21 +90,21 @@ public class HelpInput implements IText } if (enabled) { - lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION)); + lines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } } else if (permissions instanceof String && !"".equals(permissions)) { if (user.hasPermission(permissions.toString())) { - lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION)); + lines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } } else { if (!settings.getData().getCommands().getHelp().isHidePermissionlessCommands()) { - lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION)); + lines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } } } diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index fe63b27d3..5d06b706d 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -115,10 +115,10 @@ public class User extends UserBase implements IUser try { setMoney(getMoney() + value); - sendMessage(_("addedToAccount", Util.formatCurrency(value, ess))); + sendMessage(_("addedToAccount", Util.displayCurrency(value, ess))); if (initiator != null) { - initiator.sendMessage(_("addedToOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName())); + initiator.sendMessage(_("addedToOthersAccount", Util.displayCurrency(value, ess), this.getDisplayName())); } } finally @@ -138,8 +138,8 @@ public class User extends UserBase implements IUser { setMoney(getMoney() - value); reciever.setMoney(reciever.getMoney() + value); - sendMessage(_("moneySentTo", Util.formatCurrency(value, ess), reciever.getDisplayName())); - reciever.sendMessage(_("moneyRecievedFrom", Util.formatCurrency(value, ess), getDisplayName())); + sendMessage(_("moneySentTo", Util.displayCurrency(value, ess), reciever.getDisplayName())); + reciever.sendMessage(_("moneyRecievedFrom", Util.displayCurrency(value, ess), getDisplayName())); } else { @@ -161,19 +161,13 @@ public class User extends UserBase implements IUser return; } setMoney(getMoney() - value); - sendMessage(_("takenFromAccount", Util.formatCurrency(value, ess))); + sendMessage(_("takenFromAccount", Util.displayCurrency(value, ess))); if (initiator != null) { - initiator.sendMessage(_("takenFromOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName())); + initiator.sendMessage(_("takenFromOthersAccount", Util.displayCurrency(value, ess), this.getDisplayName())); } } - public boolean canAfford(final double cost) - { - final double mon = getMoney(); - return mon >= cost || Permissions.ECO_LOAN.isAuthorized(this); - } - public void setHome() { setHome("home", getLocation()); @@ -237,8 +231,8 @@ public class User extends UserBase implements IUser displayname = displayname.replace("{SUFFIX}", groups.getSuffix(this)); } displayname = displayname.replace("{WORLDNAME}", this.getWorld().getName()); - displayname = displayname.replace('&', '§'); - displayname = displayname.concat("§f"); + displayname = displayname.replace('&', '�'); + displayname = displayname.concat("�f"); return displayname; } @@ -258,7 +252,7 @@ public class User extends UserBase implements IUser } if (name.length() > 16) { - name = name.substring(0, name.charAt(15) == '§' ? 15 : 16); + name = name.substring(0, name.charAt(15) == '�' ? 15 : 16); } try { @@ -667,4 +661,28 @@ public class User extends UserBase implements IUser } return spew; } + + @Override + public boolean canAfford(final double cost) + { + final double mon = getMoney(); + if (Permissions.ECO_LOAN.isAuthorized(this)) + { + @Cleanup + final ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + return (mon - cost) >= settings.getData().getEconomy().getMinMoney(); + } + return cost <= mon; + } + + public void updateMoneyCache(double userMoney) { + if (super.getMoney() != userMoney) { + super.setMoney(userMoney); + } + } + + public boolean canAfford(double amount, boolean b) { + return true; + } } diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 80124ba7d..c1ed63046 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -18,8 +18,6 @@ # - CraftBukkit and Permissions have been updated: CraftBukkit and Essentials almost always line up, but sometimes other plugins fall behind CraftBukkit's multiple daily updates # - You have saved the document as UTF-8, NOT the default, ANSI - - ############################################################ # +------------------------------------------------------+ # # | Essentials (Global) | # @@ -85,7 +83,7 @@ warn-on-smite: true overridden-commands: - god -# Disabled commands will be completelly unavailable on the server. +# Disabled commands will be completely unavailable on the server. disabled-commands: # - nick @@ -160,12 +158,19 @@ player-commands: # All kit names should be lower case, and will be treated as lower in permissions/costs. # Times are measured in seconds. kits: - tools: + dtools: delay: 10 items: - 277 1 - 278 1 - 279 1 + tools: + delay: 10 + items: + - 272 1 + - 273 1 + - 274 1 + - 275 1 # Essentials Sign Control # See http://ess.khhq.net/wiki/Sign_Tutorial for instructions on how to use these. @@ -288,10 +293,10 @@ spawn-if-no-home: true update-bed-at-daytime: true # Allow players to have multiple homes. +# Players need essentials.sethome.multiple before they can have more than 1 home, default to 'default' below. # Define different amounts of multiple homes for different permissions, e.g. essentials.sethome.multiple.vip # People with essentials.sethome.multiple.unlimited are not limited by these numbers. sethome-multiple: - # essentials.sethome.multiple default: 3 # essentials.sethome.multiple.vip vip: 5 @@ -328,6 +333,10 @@ currency-symbol: '$' # The amount is always limited to 10 trillions because of the limitations of a java double max-money: 10000000000000 +# Set the minimum amount of money a player can have (must be above the negitive of max-money). +# Setting this to 0, will disable overdrafts/loans completely. Users need 'essentials.eco.loan' perm to go below 0. +min-money: -10000 + # Enable this to log all interactions with trade/buy/sell signs and sell command economy-log-enabled: false @@ -375,8 +384,6 @@ chat: # If your using group formats make sure to remove the '#' to allow the setting to be read. - - ############################################################ # +------------------------------------------------------+ # # | EssentialsProtect | # @@ -532,7 +539,6 @@ protect: # Should we tell people they are not allowed to build warn-on-build-disallow: true - # Disable weather options weather: storm: false @@ -555,6 +561,11 @@ newbies: # When we spawn for the first time, which spawnpoint do we use? # Set to "none" if you want to use the spawn point of the world. spawnpoint: newbies + + # Do we want to give users anything on first join? Set to '' to disable + # This kit will be given reguardless of cost, and permissions. + #kit: '' + kit: tools # Set this to lowest, if you want Multiverse to handle the respawning # Set this to high, if you want EssentialsSpawn to handle the respawning diff --git a/Essentials/src/info.txt b/Essentials/src/info.txt index efc629923..0b4fb3c42 100644 --- a/Essentials/src/info.txt +++ b/Essentials/src/info.txt @@ -11,6 +11,9 @@ Extra pages: Type /info Colours Type /info Tags +If you have problem viewing this file ingame, try using /einfo. +If this works, it means another command is blocking /info. + It can contain chapters like the Chapter1 below: #Chapter1 diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index 98c25c327..acec277cc 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -1461,6 +1461,9 @@ dragonegg,122,0 degg,122,0 bossegg,122,0 begg,122,0 +redstonelamp,123,0 +redlamp,123,0 +rslamp,123,0 ironshovel,256,0 ironspade,256,0 ishovel,256,0 @@ -2452,7 +2455,14 @@ squidegg,383,94 wolfegg,383,95 mooshroomegg,383,96 mushroomcowegg,383,96 +snowgolemegg,383,97 +ocelotegg,383,98 +irongolemegg,383,99 villageregg,383,120 +bottleofenchanting,384,0 +enchantingbottle,384,0 +expbottle,384,0 +xpbottle,384,0 goldmusicrecord,2256,0 goldmusicdisk,2256,0 goldmusiccd,2256,0 diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index b5722f946..968e10f76 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -4,7 +4,7 @@ # by: action=* {0} {1} addedToAccount=\u00a7a{0} has been added to your account. -addedToOthersAccount=\u00a7a{0} has been added to {1} account. +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=placed: @@ -49,6 +49,7 @@ couldNotFindTemplate=Could not find template {0} creatingConfigFromTemplate=Creating config from template: {0} creatingEmptyConfig=Creating empty config: {0} creative=creative +currency={0}{1} day=day days=days defaultBanReason=The Ban Hammer has spoken! @@ -109,6 +110,7 @@ haveBeenReleased=\u00a77You have been released heal=\u00a77You have been healed. healOther=\u00a77Healed {0}. helpConsole=To view help from the console, type ?. +helpLine=\u00a76/{0}\u00a7f: {1} helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: holeInFloor=Hole in floor @@ -129,6 +131,7 @@ invRestored=Your inventory has been restored. invSee=You see the inventory of {0}. invSeeHelp=Use /invsee to restore your inventory. invalidCharge=\u00a7cInvalid charge. +invalidHome=Home {0} doesn't exist invalidMob=Invalid mob type. invalidServer=Invalid server! invalidSignLine=Line {0} on sign is invalid. @@ -169,6 +172,7 @@ lightningUse=\u00a77Smiting {0} listAfkTag = \u00a77[AFK]\u00a7f listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79 players online. listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online. +listGroupTag={0}\u00a7f: listHiddenTag = \u00a77[HIDDEN]\u00a7f loadWarpError=Failed to load warp {0} localFormat=Local: <{0}> {1} @@ -212,6 +216,7 @@ nickOthersPermission=\u00a7cYou do not have permission to change the nickname of 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}. +noBreakBedrock=You are not allowed to destroy bedrock. noDestroyPermission=\u00a7cYou do not have permission to destroy that {0}. noGodWorldWarning=\u00a7cWarning! God mode in this world disabled. noHelpFound=\u00a7cNo matching commands. @@ -294,7 +299,7 @@ requestDenied=\u00a77Teleport request denied. requestDeniedFrom=\u00a77{0} denied your teleport request. requestSent=\u00a77Request sent to {0}\u00a77. requestTimedOut=\u00a7cTeleport request has timed out -requiredBukkit= * ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org. +requiredBukkit= * ! * You need atleast build {0} of CraftBukkit, download it from http://dl.bukkit.org/downloads/craftbukkit/ returnPlayerToJailError=Error occurred when trying to return player {0} to jail: {1} second=second seconds=seconds @@ -302,6 +307,7 @@ seenBanReason=Reason: {0} seenOffline=Player {0} is offline since {1} seenOnline=Player {0} is online since {1} serverFull=Server is full +serverTotal=Server Total: {0} setSpawner=Changed spawner type to {0} sheepMalformedColor=Malformed color. shoutFormat=\u00a77[Shout]\u00a7f {0} @@ -314,11 +320,13 @@ slimeMalformedSize=Malformed size. soloMob=That mob likes to be alone spawnSet=\u00a77Spawn location set for group {0}. spawned=spawned +sudoExempt=You cannot sudo this user +sudoRun=Forcing {0} to run: /{1} {2} suicideMessage=\u00a77Goodbye Cruel World... suicideSuccess= \u00a77{0} took their own life survival=survival takenFromAccount=\u00a7c{0} has been taken from your account. -takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... teleportAtoB=\u00a77{0}\u00a77 teleported you to {1}\u00a77. @@ -397,6 +405,7 @@ whoisGod=\u00a79 - God mode: {0} whoisHealth=\u00a79 - Health: {0}/20 whoisIPAddress=\u00a79 - IP Address: {0} whoisIs={0} is {1} +whoisJail=\u00a79 - Jail: {0} whoisLocation=\u00a79 - Location: ({0}, {1}, {2}, {3}) whoisMoney=\u00a79 - Money: {0} whoisOP=\u00a79 - OP: {0} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index cbbc644f9..07f2e03db 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -4,7 +4,7 @@ # by: Dysp, dysperen@gmail.com action=* {0} {1} addedToAccount=\u00a7a{0} er blevet tilf\u00f8jet til din konto. -addedToOthersAccount=\u00a7a{0} er blevet tilf\u00f8jet til {1} konto. +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=\u00f8delagde: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} ved: {3} alertPlaced=placerede: @@ -15,7 +15,7 @@ backUsageMsg=\u00a77Teleporterer til tidligere placering. backupFinished=Backup sluttet backupStarted=Backup startet balance=\u00a77Saldo: {0} -balanceTop=\u00a77 Top saldoer ({0}) +balanceTop=\u00a77Top saldoer ({0}) banExempt=\u00a7cDu kan ikke banne den p\u00e5g\u00e6ldende spiller. banIpAddress=\u00a77Bannede IP addresse bannedIpsFileError=Fejl i afl\u00e6sning af banned-ips.txt @@ -49,6 +49,7 @@ couldNotFindTemplate=Kunne ikke finde skabelon {0} creatingConfigFromTemplate=Opretter config fra skabelon: {0} creatingEmptyConfig=Opretter tom config: {0} creative=creative +currency={0}{1} day=dag days=dage defaultBanReason=Banhammeren har talt! @@ -109,6 +110,7 @@ haveBeenReleased=\u00a77Du er blevet l\u00f8sladt heal=\u00a77Du er blevet healed. healOther=\u00a77Healed {0}. helpConsole=For at se hj\u00e6lp fra konsolen, skriv ?. +helpLine=\u00a76/{0}\u00a7f: {1} helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f: holeInFloor=Hul i gulv @@ -129,6 +131,7 @@ invRestored=Din inventory er blevet genoprettet. invSee=Du ser {0}''s inventory. invSeeHelp=Brug /invsee for at genoprette din inventory. invalidCharge=\u00a7cUgyldig opladning (korrekt oversat?). +invalidHome=Home {0} doesn't exist invalidMob=Ugyldig mob type. invalidServer=Ugyldig server! invalidSignLine=Linje {0} p\u00e5 skilt er ugyldig. @@ -169,6 +172,7 @@ lightningUse=\u00a77Kaster lyn efter {0} listAfkTag = \u00a77[AFK]\u00a7f listAmount = \u00a79Der er \u00a7c{0}\u00a79 ud af maksimum\u00a7c{1}\u00a79 spillere online. listAmountHidden = \u00a79Der er \u00a7c{0}\u00a77/{1}\u00a79 ud af maksimum \u00a7c{2}\u00a79 spillere online. +listGroupTag={0}\u00a7f: listHiddenTag = \u00a77[HIDDEN]\u00a7f loadWarpError=Kunne ikke l\u00c3\u00a6se warp {0} localFormat=Local: <{0}> {1} @@ -212,6 +216,7 @@ nickOthersPermission=\u00a7cDu har ikke tilladelse til at \u00e6ndre en andens n nickSet=\u00a77Dit nickname er nu \u00a7c{0} noAccessCommand=\u00a7cDu har ikke adgang til denne kommando. noAccessPermission=\u00a7cDu har ikke tilladelse til at f\u00e5 adgang til {0}. +noBreakBedrock=You are not allowed to destroy bedrock. noDestroyPermission=\u00a7cDu har ikke tilladelse til at \u00f8del\u00e6gge {0}. noGodWorldWarning=\u00a7cAdvarsel! God mode er sl\u00c3\u00a5et fra i denne verden. noHelpFound=\u00a7cIngen matchende kommandoer. @@ -302,6 +307,7 @@ seenBanReason=Reason: {0} seenOffline=Spilleren {0} har v\u00c3\u00a6ret offline i {1} seenOnline=Spilleren {0} har v\u00c3\u00a6ret online i {1} serverFull=Serveren er sgu fuld. Den b\u00c3\u00b8r melde sig til AA. +serverTotal=Server Total: {0} setSpawner=\u00c3\u0086ndrede spawner type til {0} sheepMalformedColor=Forkert farve. (Korrekt oversat?) shoutFormat=\u00a77[Shout]\u00a7f {0} @@ -314,11 +320,13 @@ slimeMalformedSize=Forkert st\u00f8rrelse. (Korrekt oversat?) soloMob=Denne mob kan godt lide at v\u00e6re alene. Den hygger sig. spawnSet=\u00a77Spawnplacering fastsat for gruppe: {0}. spawned=spawnet +sudoExempt=You cannot sudo this user +sudoRun=Forcing {0} to run: /{1} {2} suicideMessage=\u00a77Farvel grusomme verden... suicideSuccess= \u00a77{0} tog sit eget liv survival=survival takenFromAccount=\u00a7c{0} er blevet taget fra din konto. -takenFromOthersAccount=\u00a7c{0} er blevet taget fra {1}''s konto. +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Anmodning om teleport er sendt til alle spillere. teleportAll=\u00a77Teleporterer alle spillere... teleportAtoB=\u00a77{0}\u00a77 teleporterede dig til {1}\u00a77. @@ -397,6 +405,7 @@ whoisGod=\u00a79 - God mode: {0} whoisHealth=\u00a79 - Health: {0}/20 whoisIPAddress=\u00a79 - IP-Adresse: {0} whoisIs={0} er {1} +whoisJail=\u00a79 - Jail: {0} whoisLocation=\u00a79 - Placering: ({0}, {1}, {2}, {3}) whoisMoney=\u00a79 - Saldo: {0} whoisOP=\u00a79 - OP: {0} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 479b99e17..a272aa6e6 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -4,7 +4,7 @@ # by: action=* {0} {1} addedToAccount=\u00a7a{0} wurden zu deiner Geldb\u00f6rse hinzugef\u00fcgt. -addedToOthersAccount=\u00a7a{0} wurden zu {1}s Konto hinzugef\u00fcgt. +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=zerst\u00f6rt: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bei: {3} alertPlaced=platziert: @@ -15,7 +15,7 @@ backUsageMsg=\u00a77Kehre zur letzten Position zur\u00fcck. backupFinished=Backup beendet backupStarted=Backup gestartet balance=\u00a77Geldb\u00f6rse: {0} -balanceTop=\u00a77 Top Guthaben ({0}) +balanceTop=\u00a77Top Guthaben ({0}) banExempt=\u00a7cDu kannst diesen Spieler nicht sperren. banIpAddress=\u00a77IP-Adresse gesperrt. bannedIpsFileError=Fehler beim Lesen von banned-ips.txt @@ -49,6 +49,7 @@ couldNotFindTemplate=Vorlage {0} konnte nicht gefunden werden. creatingConfigFromTemplate=Erstelle Konfiguration aus Vorlage: {0} creatingEmptyConfig=Erstelle leere Konfiguration: {0} creative=creative +currency={0}{1} day=Tag days=Tage defaultBanReason=Der Bann-Hammer hat gesprochen! @@ -109,6 +110,7 @@ haveBeenReleased=\u00a77Du wurdest frei gelassen. heal=\u00a77Du wurdest geheilt. healOther=\u00a77{0} geheilt. helpConsole=Um die Hilfe der Konsole zu sehen, schreibe ?. +helpLine=\u00a76/{0}\u00a7f: {1} helpOp=\u00a7c[Hilfe]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Seite \u00a7c{0}\u00a7f von \u00a7c{1}\u00a7f: holeInFloor=Loch im Boden @@ -130,6 +132,7 @@ invRestored=Dein Inventar wurde wieder hergestellt. invSee=Du siehst das Inventar von {0}. invSeeHelp=Benutze /invsee um dein Inventar wiederherzustellen. invalidCharge=\u00a7cUng\u00fcltige Verf\u00fcgung. +invalidHome=Home {0} doesn't exist invalidMob=Ung\u00fcltiger Monstername. invalidServer=Ung\u00fcltiger Server! invalidSignLine=Die Zeile {0} auf dem Schild ist falsch. @@ -169,6 +172,7 @@ lightningUse=\u00a77Peinige {0} listAfkTag = \u00a77[Inaktiv]\u00a7f listAmount = \u00a79Es sind \u00a7c{0}\u00a79 von maximal \u00a7c{1}\u00a79 Spielern online. listAmountHidden = \u00a79Es sind \u00a7c{0}\u00a77/{1}\u00a79 von maximal \u00a7c{2}\u00a79 Spielern online. +listGroupTag={0}\u00a7f: listHiddenTag = \u00a77[Versteckt]\u00a7f loadWarpError=Fehler beim Laden von Warp-Punkt {0} localFormat=Lokal: <{0}> {1} @@ -212,6 +216,7 @@ nickOthersPermission=\u00a7cDu hast keine Rechte um den Nicknamen von anderen zu 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. +noBreakBedrock=You are not allowed to destroy bedrock. noDestroyPermission=\u00a7cDu hast keine Rechte, den Block {0} zu zerst\u00f6ren. noGodWorldWarning=\u00a7cWarning! God mode in this world disabled. noHelpFound=\u00a7cKeine \u00fcbereinstimmenden Kommandos. @@ -302,6 +307,7 @@ seenBanReason=Reason: {0} seenOffline=Spieler {0} ist offline seit {1} seenOnline=Spieler {0} ist online seit {1} serverFull=Server ist voll +serverTotal=Server Total: {0} setSpawner=\u00c4ndere Mob-Spawner zu {0} sheepMalformedColor=Ung\u00fcltige Farbe. shoutFormat=\u00a77[Schrei]\u00a7f {0} @@ -314,11 +320,13 @@ slimeMalformedSize=Ung\u00fcltige Gr\u00f6sse. soloMob=Das Monster m\u00f6chte allein sein. spawnSet=\u00a77Spawn-Punkt gesetzt f\u00fcr Gruppe {0}. spawned=erzeugt +sudoExempt=You cannot sudo this user +sudoRun=Forcing {0} to run: /{1} {2} suicideMessage=\u00a77Lebewohl grausame Welt... suicideSuccess= \u00a77{0} hat sich das Leben genommen. survival=survival takenFromAccount=\u00a7c{0} wurden aus deiner Geldb\u00f6rse genommen. -takenFromOthersAccount=\u00a7c{0} wurde von {1} wurde Rechnung getragen. +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleportierungsanfrage zu allen Spielern gesendet... teleportAll=\u00a77Teleportiere alle Spieler... teleportAtoB=\u00a77{0}\u00a77 teleportiert dich zu {1}\u00a77. @@ -397,6 +405,7 @@ whoisGod=\u00a79 - God mode: {0} whoisHealth=\u00a79 - Gesundheit: {0}/20 whoisIPAddress=\u00a79 - IP-Adresse: {0} whoisIs={0} ist {1} +whoisJail=\u00a79 - Jail: {0} whoisLocation=\u00a79 - Position: ({0}, {1}, {2}, {3}) whoisMoney=\u00a79 - Geldb\u00f6rse: {0} whoisOP=\u00a79 - OP: {0} diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index c7cee3f58..47dc9e9f4 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -4,7 +4,7 @@ # by: action=* {0} {1} addedToAccount=\u00a7a{0} has been added to your account. -addedToOthersAccount=\u00a7a{0} has been added to {1} account. +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=placed: @@ -49,6 +49,7 @@ couldNotFindTemplate=Could not find template {0} creatingConfigFromTemplate=Creating config from template: {0} creatingEmptyConfig=Creating empty config: {0} creative=creative +currency={0}{1} day=day days=days defaultBanReason=The Ban Hammer has spoken! @@ -109,6 +110,7 @@ haveBeenReleased=\u00a77You have been released heal=\u00a77You have been healed. healOther=\u00a77Healed {0}. helpConsole=To view help from the console, type ?. +helpLine=\u00a76/{0}\u00a7f: {1} helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: holeInFloor=Hole in floor @@ -129,6 +131,7 @@ invRestored=Your inventory has been restored. invSee=You see the inventory of {0}. invSeeHelp=Use /invsee to restore your inventory. invalidCharge=\u00a7cInvalid charge. +invalidHome=Home {0} doesn't exist invalidMob=Invalid mob type. invalidServer=Invalid server! invalidSignLine=Line {0} on sign is invalid. @@ -169,6 +172,7 @@ lightningUse=\u00a77Smiting {0} listAfkTag = \u00a77[AFK]\u00a7f listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79 players online. listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online. +listGroupTag={0}\u00a7f: listHiddenTag = \u00a77[HIDDEN]\u00a7f loadWarpError=Failed to load warp {0} localFormat=Local: <{0}> {1} @@ -212,6 +216,7 @@ nickOthersPermission=\u00a7cYou do not have permission to change the nickname of 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}. +noBreakBedrock=You are not allowed to destroy bedrock. noDestroyPermission=\u00a7cYou do not have permission to destroy that {0}. noGodWorldWarning=\u00a7cWarning! God mode in this world disabled. noHelpFound=\u00a7cNo matching commands. @@ -302,6 +307,7 @@ seenBanReason=Reason: {0} seenOffline=Player {0} is offline since {1} seenOnline=Player {0} is online since {1} serverFull=Server is full +serverTotal=Server Total: {0} setSpawner=Changed spawner type to {0} sheepMalformedColor=Malformed color. shoutFormat=\u00a77[Shout]\u00a7f {0} @@ -314,11 +320,13 @@ slimeMalformedSize=Malformed size. soloMob=That mob likes to be alone spawnSet=\u00a77Spawn location set for group {0}. spawned=spawned +sudoExempt=You cannot sudo this user +sudoRun=Forcing {0} to run: /{1} {2} suicideMessage=\u00a77Goodbye Cruel World... suicideSuccess= \u00a77{0} took their own life survival=survival takenFromAccount=\u00a7c{0} has been taken from your account. -takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... teleportAtoB=\u00a77{0}\u00a77 teleported you to {1}\u00a77. @@ -397,6 +405,7 @@ whoisGod=\u00a79 - God mode: {0} whoisHealth=\u00a79 - Health: {0}/20 whoisIPAddress=\u00a79 - IP Address: {0} whoisIs={0} is {1} +whoisJail=\u00a79 - Jail: {0} whoisLocation=\u00a79 - Location: ({0}, {1}, {2}, {3}) whoisMoney=\u00a79 - Money: {0} whoisOP=\u00a79 - OP: {0} diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index f3b4c4966..c784fb8c6 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -4,7 +4,7 @@ # by: action=* {0} {1} addedToAccount=\u00a7a{0} ha sido agregado a tu cuenta. -addedToOthersAccount=\u00a7a{0} ha sido agregado a la cuenta de {1}. +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=roto: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} en: {3} alertPlaced=situado: @@ -49,6 +49,7 @@ couldNotFindTemplate=No se puede encontrar el template {0} creatingConfigFromTemplate=Creando configuracion desde el template: {0} creatingEmptyConfig=Creando configuracion vacia: {0} creative=creative +currency={0}{1} day=dia days=dias defaultBanReason=Baneado por incumplir las normas! @@ -109,6 +110,7 @@ haveBeenReleased=\u00a77Has sido liberado heal=\u00a77Has sido curado. healOther=\u00a77Has curado a {0}. helpConsole=Para obtener ayuda de la consola, escribe ?. +helpLine=\u00a76/{0}\u00a7f: {1} helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Pagina \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f: holeInFloor=Agujero en el suelo @@ -129,6 +131,7 @@ invRestored=Tu inventario ha sido recuperado. invSee=Estas viendo el inventario de {0}. invSeeHelp=Usa /invsee para recuperar tu inventario. invalidCharge=\u00a7cCargo invalido. +invalidHome=Home {0} doesn't exist invalidMob=Mob invalido. invalidServer=Servidor invalido! invalidSignLine=Linea {0} en el signo es invalida. @@ -169,6 +172,7 @@ lightningUse=\u00a77Golpeando a {0} listAfkTag = \u00a77[AFK]\u00a7f listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79 players online. listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online. +listGroupTag={0}\u00a7f: listHiddenTag = \u00a77[HIDDEN]\u00a7f loadWarpError=Error al cargar el tenetransporte {0} localFormat=Local: <{0}> {1} @@ -212,6 +216,7 @@ nickOthersPermission=\u00a7cNo tienes permiso para cambiar el nombre de usuario nickSet=\u00a77Tu nombre es ahora \u00a7c{0} noAccessCommand=\u00a7cNo tienes acceso a ese comando. noAccessPermission=\u00a7cNo tienes permisos para hacer eso {0}. +noBreakBedrock=You are not allowed to destroy bedrock. noDestroyPermission=\u00a7cNo tienes permisos para destrozar eso {0}. noGodWorldWarning=\u00a7cWarning! God mode in this world disabled. noHelpFound=\u00a7cNo hay comandos relacionados. @@ -302,6 +307,7 @@ seenBanReason=Reason: {0} seenOffline=El jugador {0} esta desconectado desde {1} seenOnline=El jugador {0} lleva conectado desde {1} serverFull=Servidor lleno +serverTotal=Server Total: {0} setSpawner=Cambiado tipo de lugar de nacimiento a {0} sheepMalformedColor=Color malformado. shoutFormat=\u00a77[Shout]\u00a7f {0} @@ -314,11 +320,13 @@ slimeMalformedSize=Medidas malformadas. soloMob=A este mob le gusta estar solo spawnSet=\u00a77El lugar de nacimiento ha sido puesto para el grupo {0}. spawned=nacido +sudoExempt=You cannot sudo this user +sudoRun=Forcing {0} to run: /{1} {2} suicideMessage=\u00a77Adios mundo cruel... suicideSuccess= \u00a77{0} se quito su propia vida survival=survival takenFromAccount=\u00a7c{0} ha sido sacado de tu cuenta. -takenFromOthersAccount=\u00a7c{0} ha sido sacado de la cuenta de {1}. +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Peticion de teletransporte enviada a todos los jugadores... teleportAll=\u00a77Teletransportando a todos los jugadores... teleportAtoB=\u00a77{0}\u00a77 te teletransporto a {1}\u00a77. @@ -397,6 +405,7 @@ whoisGod=\u00a79 - God mode: {0} whoisHealth=\u00a79 - Salud: {0}/20 whoisIPAddress=\u00a79 - Direccion IP: {0} whoisIs={0} es {1} +whoisJail=\u00a79 - Jail: {0} whoisLocation=\u00a79 - Localizacion: ({0}, {1}, {2}, {3}) whoisMoney=\u00a79 - Dinero: {0} whoisOP=\u00a79 - OP: {0} diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index b42b7d55b..caf6c6b7b 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -4,7 +4,7 @@ # by: L\u00e9a Gris action=* {0} {1} addedToAccount=\u00a7a{0} a \u00e9t\u00e9 rajout\u00e9 \u00e0 votre compte. -addedToOthersAccount=\u00a7a{0} a \u00e9t\u00e9 ajout\u00e9 \u00e0 {1} compte. +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=a cass\u00e9 : alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} \u00e0:{3} alertPlaced=a plac\u00e9 : @@ -15,7 +15,7 @@ backUsageMsg=\u00a77Retour \u00e0 votre emplacement pr\u00e9c\u00c3\u00a8dent. backupFinished=Sauvegarde termin\u00e9 backupStarted=D\u00e9but de la sauvegarde... balance=\u00a77Solde : {0} -balanceTop=\u00a77 Meilleurs soldes au ({0}) +balanceTop=\u00a77Meilleurs soldes au ({0}) banExempt=\u00a77Vous ne pouvez pas bannir ce joueur. banIpAddress=\u00a77Adresse IP bannie. bannedIpsFileError=Erreur de lecture de banned-ips.txt @@ -49,6 +49,7 @@ couldNotFindTemplate=Le mod\u00c3\u00a8le {0} est introuvable creatingConfigFromTemplate=Cr\u00e9ation de la configuration \u00e0 partir du mod\u00c3\u00a8le : {0} creatingEmptyConfig=Cr\u00e9ation d''une configuration vierge : {0} creative=cr\u00e9atif +currency={0}{1} day=jour days=jours defaultBanReason=Le marteau du bannissement a frapp\u00e9 ! @@ -109,6 +110,7 @@ haveBeenReleased=\u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9. heal=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9. healOther=\u00a77{0} a \u00e9t\u00e9 soign\u00e9. helpConsole=Pour voir l''aide tapez ? +helpLine=\u00a76/{0}\u00a7f: {1} helpOp=\u00a7c[Aide Admin]\u00a7f \u00a77{0} : \u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f sur \u00a7c{1}\u00a7f. holeInFloor=Trou dans le Sol. @@ -129,6 +131,7 @@ invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu. invSee=Vous voyez l''inventaire de {0}. invSeeHelp=Utilisez /invsee pour revenir \u00e0 votre inventaire. invalidCharge=\u00a7cCharge invalide. +invalidHome=Home {0} doesn't exist invalidMob=Mauvias type de cr\u00e9ature. invalidServer=Serveur non valide. invalidSignLine=La ligne {0} du panneau est invalide. @@ -169,6 +172,7 @@ lightningUse=\u00a77{0} a \u00e9t\u00e9 foudroy\u00e9. listAfkTag = \u00a77[AFK]\u00a7f listAmount = \u00a79Il y a \u00a7c{0}\u00a79 joueurs en ligne sur \u00a7c{1}\u00a79 au total. listAmountHidden = \u00a79Il y a \u00a7c{0}\u00a77/{1}\u00a79 sur un maximum de \u00a7c{2}\u00a79 joueurs en ligne. +listGroupTag={0}\u00a7f: listHiddenTag = \u00a77[MASQU\u00c9]\u00a7f loadWarpError=\u00c9chec du chargement du point de t\u00e9l\u00e9portation {0}. localFormat=Locale : <{0}> {1} @@ -212,6 +216,7 @@ nickOthersPermission=\u00a7cVous n'avez pas la permission de changer le surnom d nickSet=\u00a77Votre surnom est maintenant \u00a7c{0} noAccessCommand=\u00a7cVous n'avez pas acc\u00c3\u00a8s \u00e0 cette commande. noAccessPermission=\u00a7cVous n''avez pas la permissions d''acc\u00e9der \u00e0 cette {0} +noBreakBedrock=You are not allowed to destroy bedrock. noDestroyPermission=\u00a7cVous n''avez pas la permission de d\u00e9truire ce {0}. noGodWorldWarning=\u00a7cWarning! Le mode Dieu est d\u00e9sactiv\u00e9 dans ce monde. noHelpFound=\u00a7cAucune commande correspondante. @@ -302,6 +307,7 @@ seenBanReason=Reason: {0} seenOffline=Le joueur {0} est hors ligne depuis {1} seenOnline=Le joueur {0} est en ligne depuis {1} serverFull=Le serveur est plein. +serverTotal=Server Total: {0} setSpawner=Type de g\u00e9n\u00e9rateur chang\u00e9 en {0} sheepMalformedColor=Couleur mal form\u00e9e. shoutFormat=\u00a77[Crie]\u00a7f {0} @@ -314,11 +320,13 @@ slimeMalformedSize=Taille mal form\u00e9e. soloMob=Ce cr\u00e9ature aime \u00eatre seul. spawnSet=\u00a77Le point de d\u00e9part a \u00e9t\u00e9 d\u00e9fini pour le groupe {0}. spawned=invoqu\u00e9(s) +sudoExempt=You cannot sudo this user +sudoRun=Forcing {0} to run: /{1} {2} suicideMessage=\u00a77Au revoir monde cruel... suicideSuccess=\u00a77{0} s''est suicid\u00e9. survival=survie takenFromAccount=\u00a7c{0} ont \u00e9t\u00e9 retir\u00e9 de votre compte. -takenFromOthersAccount=\u00a7c{0} a \u00e9t\u00e9 r\u00e9tir\u00e9 du compte de {1}. +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Demande de t\u00e9l\u00e9portation envoy\u00e9e \u00e0 tous les joueurs... teleportAll=\u00a77T\u00e9l\u00e9poration de tous les joueurs. teleportAtoB=\u00a77{0}\u00a77 vous a t\u00e9l\u00e9port\u00e9 \u00e0 {1}\u00a77. @@ -397,6 +405,7 @@ whoisGod=\u00a79 - Mode Dieu : {0} whoisHealth=\u00a79 - Sant\u00e9 : {0} / 20 whoisIPAddress=\u00a79 - Adresse IP : {0} whoisIs={0} est {1} +whoisJail=\u00a79 - Jail: {0} whoisLocation=\u00a79 - Emplacement : ({0}, {1}, {2}, {3}) whoisMoney=\u00a79 - Argent : {0} whoisOP=\u00a79 - OP : {0} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index f78fd59c8..8068318b1 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -4,7 +4,7 @@ # by: Geertje123 action=* {0} {1} addedToAccount=\u00a7a{0} is gestort op je account. -addedToOthersAccount=\u00a7a{0} is overgemaakt naar {1}''s rekening +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=gebroken: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bij: {3} alertPlaced=geplaatst: @@ -49,6 +49,7 @@ couldNotFindTemplate=Het sjabloon kon niet worden gevonden {0} creatingConfigFromTemplate=Bezig met aanmaken van een config vanaf sjabloon: {0} creatingEmptyConfig=Bezig met een lege config aanmaken: {0} creative=creative +currency={0}{1} day=dag days=dagen defaultBanReason=De Ban Hamer heeft gesproken! @@ -109,6 +110,7 @@ haveBeenReleased=\u00a77Je bent bevrijdt heal=\u00a77Je bent genezen. healOther=\u00a77Je geneezde {0}. helpConsole=type ? om de consolehelp weer te geven. +helpLine=\u00a76/{0}\u00a7f: {1} helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f: holeInFloor=Gat in de vloer @@ -129,6 +131,7 @@ 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. +invalidHome=Home {0} doesn't exist invalidMob=Ongeldig mob type. invalidServer=Ongeldige server! invalidSignLine=Regel {0} op het bordje is ongeldig. @@ -169,6 +172,7 @@ lightningUse=\u00a77Brand {0} listAfkTag = \u00a77[AFK]\u00a7f listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79 players online. listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online. +listGroupTag={0}\u00a7f: listHiddenTag = \u00a77[HIDDEN]\u00a7f loadWarpError=Fout bij het laden van warp {0} localFormat=Local: <{0}> {1} @@ -212,6 +216,7 @@ nickOthersPermission=\u00a7cJe hebt geen toestemming om de nickname van anderen nickSet=\u00a77Je nickname is nu \u00a7c{0} noAccessCommand=\u00a7cJe hebt geen toegang tot die opdracht. noAccessPermission=\u00a7cJe hebt hier geen toegang voor {0}. +noBreakBedrock=You are not allowed to destroy bedrock. noDestroyPermission=\u00a7cJe hebt geen toegang om dat te vernietigen {0}. noGodWorldWarning=\u00a7cWarning! God mode in this world disabled. noHelpFound=\u00a7cNo matching commands. @@ -302,6 +307,7 @@ seenBanReason=Reason: {0} seenOffline=Speler {0} is offline vanaf {1} seenOnline=Speler {0} is online vanaf {1} serverFull=Server is vol +serverTotal=Server Total: {0} setSpawner=Changed spawner type to {0} sheepMalformedColor=Misvoormde kleur. shoutFormat=\u00a77[Shout]\u00a7f {0} @@ -314,11 +320,13 @@ slimeMalformedSize=Misvoormde grootte. soloMob=Die mob is liever in zijn eentje spawnSet=\u00a77Spawn locatie voor de groep {0} ingesteld. spawned=gespawned +sudoExempt=You cannot sudo this user +sudoRun=Forcing {0} to run: /{1} {2} suicideMessage=\u00a77Vaarwel vreedzame wereld... suicideSuccess= \u00a77{0} pleegde zelfmoord survival=survival takenFromAccount=\u00a7c{0} is van je bank rekening afgehaald. -takenFromOthersAccount=\u00a7c{0} is overgenomen uit {1} account. +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Bezig met teleporteren van alle spelers... teleportAtoB=\u00a77{0}\u00a77 is naar {1}\u00a77 geteleporteerd. @@ -397,6 +405,7 @@ whoisGod=\u00a79 - God mode: {0} whoisHealth=\u00a79 - Levens: {0}/20 whoisIPAddress=\u00a79 - IP Adres: {0} whoisIs={0} is {1} +whoisJail=\u00a79 - Jail: {0} whoisLocation=\u00a79 - Locatie: ({0}, {1}, {2}, {3}) whoisMoney=\u00a79 - Geld: {0} whoisOP=\u00a79 - OP: {0} diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index dd92300a7..2e9f80bb1 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -13,8 +13,8 @@ commands: aliases: [eafk] antioch: description: 'A little surprise for operators.' - usage: /<command> - aliases: [eantioch] + usage: /<command> [message] + aliases: [eantioch,grenade,tnt,egrenade,etnt] back: description: Teleports you to your location prior to tp/spawn/warp. usage: /<command> @@ -26,7 +26,7 @@ commands: balance: description: States the current balance of a player. usage: /<command> [player] - aliases: [bal,emoney,ebalance,ebal] + aliases: [bal,money,emoney,ebalance,ebal] balancetop: description: Gets the top balance values. usage: /<command> <page> @@ -58,11 +58,11 @@ commands: clearinventory: description: Clear all items in your inventory. usage: /<command> - aliases: [ci,eci,eclearinventory] + aliases: [ci,eci,clearinvent,clean,eclean,eclearinvent,eclearinventory] compass: description: Describes your current bearing. usage: /<command> - aliases: [ecompass] + aliases: [ecompass,direction,edirection] delhome: description: Removes a home usage: /<command> [player:]<name> @@ -97,7 +97,7 @@ commands: feed: description: Satisfy the hunger. usage: /<command> [player] - aliases: [efeed] + aliases: [efeed,eat,eeat] itemdb: description: Searches for an item. usage: /<command> <item> @@ -113,7 +113,7 @@ commands: getpos: description: Get your current coordinates or those of a player. usage: /<command> [player] - aliases: [coords,egetpos,whereami,ewhereami] + aliases: [coords,egetpos,position,eposition,whereami,ewhereami] gc: description: Reports garbage collection info; useful to developers. usage: /<command> @@ -141,7 +141,7 @@ commands: home: description: Teleport to your home. usage: /<command> [player:][name] - aliases: [ehome] + aliases: [ehome,homes,ehomes] ignore: description: Ignore other players. usage: /<command> <player> @@ -165,7 +165,7 @@ commands: jump: description: Jumps to the nearest block in the line of sight. usage: /<command> - aliases: [j,ejump] + aliases: [j,ej,jumpto,ejumpto,ejump] kick: description: Kicks a specified player with a reason. usage: /<command> <player> [reason] @@ -177,7 +177,7 @@ commands: kit: description: Obtains the specified kit or views all available kits. usage: /<command> [kit] - aliases: [ekit,kits] + aliases: [ekit,kits,ekits] kill: description: Kills specified player. usage: /<command> <player> @@ -186,10 +186,13 @@ commands: description: Kill all mobs in a world. usage: /<command> [mobType] [radius] aliases: [ekillall,butcher,ebutcher] + kittycannon: + description: Throw an exploding kitten at your opponent + usage: /<command> list: description: List all online players. usage: /<command> - aliases: [playerlist,who,online,elist,ewho,eplayerlist,eonline] + aliases: [playerlist,who,online,plist,eplist,elist,ewho,eplayerlist,eonline] lightning: description: The power of Thor. Strike at cursor or player. usage: /<command> [player] [power] @@ -237,7 +240,7 @@ commands: ping: description: Pong! usage: /<command> - aliases: [pong,eping,epong] + aliases: [pong,echo,echo,eping,epong] powertool: description: Assigns a command to the item in hand, {player} will be replaced by the name of the player that you click. usage: /<command> [l:|a:|r:|c:|d:][command] [arguments] @@ -245,7 +248,7 @@ commands: powertooltoggle: description: Enables or disables all current powertools usage: /<command> - aliases: [ptt,epowertooltoggle,eptt] + aliases: [ptt,epowertooltoggle,pttoggle,epttoggle,eptt] ptime: description: Adjust player's client time. Add @ prefix to fix. usage: /<command> [list|reset|day|night|dawn|17:30|4pm|4000ticks] [player|*] @@ -296,7 +299,7 @@ commands: aliases: [createwarp,esetwarp] setworth: description: Set the sell value of an item. - usage: /<command> <itemname|id> <price> + usage: /<command> [itemname|id] <price> aliases: [esetworth] socialspy: description: Toggles if you can see msg/mail commands in chat. @@ -345,11 +348,11 @@ commands: tp: description: Teleport to a player. usage: /<command> <player> [otherplayer] - aliases: [tele,etele,etp,tp2p,etp2p] + aliases: [tele,teleport,eteleport,etele,etp,tp2p,etp2p] tpa: description: Request to teleport to the specified player. usage: /<command> <player> - aliases: [call,join,etpa,ecall,ejoin] + aliases: [call,tpask,etpask,etpa,ecall] tpaall: description: Requests all players online to teleport to you. usage: /<command> <player> @@ -397,11 +400,11 @@ commands: unban: description: Unbans the specified player. usage: /<command> <player> - aliases: [pardon,eunban] + aliases: [pardon,eunban,epardon] unbanip: description: Unbans the specified IP address. usage: /<command> <address> - aliases: [eunbanip,pardonip] + aliases: [eunbanip,pardonip,epardonip] unlimited: description: Allows the unlimited placing of items. usage: /<command> <list|item|clear> [player] @@ -409,7 +412,7 @@ commands: warp: description: List all warps or warp to the specified location. usage: /<command> <pagenumber|warp> [player] - aliases: [ewarp,warps] + aliases: [ewarp,warps,ewarps] weather: description: Setting the weather. usage: /<command> <storm/sun> [duration] @@ -425,4 +428,4 @@ commands: worth: description: Calculates the worth of items in hand or as specified. usage: /<command> [item] [amount] - aliases: [eworth] + aliases: [eworth,price,eprice] diff --git a/Essentials/test/com/earth2me/essentials/FakeServer.java b/Essentials/test/com/earth2me/essentials/FakeServer.java index 71c8f60a8..c0e0812d7 100644 --- a/Essentials/test/com/earth2me/essentials/FakeServer.java +++ b/Essentials/test/com/earth2me/essentials/FakeServer.java @@ -16,6 +16,7 @@ import org.bukkit.event.Event; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryType; +import org.bukkit.generator.ChunkGenerator; import org.bukkit.help.HelpMap; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryHolder; @@ -860,19 +861,27 @@ public class FakeServer implements Server throw new UnsupportedOperationException("Not supported yet."); } - public HelpMap getHelpMap() { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public HelpMap getHelpMap() + { + throw new UnsupportedOperationException("Not supported yet."); + } - public Inventory createInventory(InventoryHolder owner, InventoryType type) { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public Inventory createInventory(InventoryHolder ih, InventoryType it) + { + throw new UnsupportedOperationException("Not supported yet."); + } - public Inventory createInventory(InventoryHolder owner, int size) { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public Inventory createInventory(InventoryHolder ih, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } - public Inventory createInventory(InventoryHolder owner, int size, String title) { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public Inventory createInventory(InventoryHolder ih, int i, String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials/test/com/earth2me/essentials/FakeWorld.java b/Essentials/test/com/earth2me/essentials/FakeWorld.java index f156f1185..38026611f 100644 --- a/Essentials/test/com/earth2me/essentials/FakeWorld.java +++ b/Essentials/test/com/earth2me/essentials/FakeWorld.java @@ -586,31 +586,45 @@ public class FakeWorld implements World throw new UnsupportedOperationException("Not supported yet."); } - public LivingEntity spawnCreature(Location loc, EntityType type) { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public LivingEntity spawnCreature(Location arg0, EntityType arg1) + { + throw new UnsupportedOperationException("Not supported yet."); + } - public <T> void playEffect(Location location, Effect effect, T data) { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public <T> void playEffect(Location lctn, Effect effect, T t) + { + throw new UnsupportedOperationException("Not supported yet."); + } - public <T> void playEffect(Location location, Effect effect, T data, int radius) { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public <T> void playEffect(Location lctn, Effect effect, T t, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } - public void setMetadata(String metadataKey, MetadataValue newMetadataValue) { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public void setMetadata(String string, MetadataValue mv) + { + throw new UnsupportedOperationException("Not supported yet."); + } - public List<MetadataValue> getMetadata(String metadataKey) { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public List<MetadataValue> getMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } - public boolean hasMetadata(String metadataKey) { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public boolean hasMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } - public void removeMetadata(String metadataKey, Plugin owningPlugin) { - throw new UnsupportedOperationException("Not supported yet."); - } + @Override + public void removeMetadata(String string, Plugin plugin) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java index a8c85f956..2ad1fbb4b 100644 --- a/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java +++ b/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java @@ -269,18 +269,18 @@ public class EssentialsUpgrade if (config.hasProperty("powertools")) { @SuppressWarnings("unchecked") - final Map<Integer, Object> powertools = (Map<Integer, Object>)config.getProperty("powertools"); + final Map<String, Object> powertools = config.getConfigurationSection("powertools").getValues(false); if (powertools == null) { continue; } - for (Map.Entry<Integer, Object> entry : powertools.entrySet()) + for (Map.Entry<String, Object> entry : powertools.entrySet()) { if (entry.getValue() instanceof String) { List<String> temp = new ArrayList<String>(); temp.add((String)entry.getValue()); - ((Map<Integer, Object>)powertools).put(entry.getKey(), temp); + ((Map<String, Object>)powertools).put(entry.getKey(), temp); } } config.save(); diff --git a/Essentials2Compat/src/com/earth2me/essentials/api/Economy.java b/Essentials2Compat/src/com/earth2me/essentials/api/Economy.java index 0aeb7bdc9..27bdf8233 100644 --- a/Essentials2Compat/src/com/earth2me/essentials/api/Economy.java +++ b/Essentials2Compat/src/com/earth2me/essentials/api/Economy.java @@ -169,7 +169,7 @@ public final class Economy { throw new RuntimeException(noCallBeforeLoad); } - return Util.formatCurrency(amount, ess); + return Util.displayCurrency(amount, ess); } /** diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 31d40413f..9d7187690 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -141,4 +141,9 @@ v 1.9: - Change Service registration to register WorldsHolder instead of AnjoPermissionsHandler. This is the correct entry point for all data.
- Depreciate PlayerTeleportEvent, PlayerRespawnEvent and PlayerPortalEvent as it's all handled in PlayerChangedWorldEvent.
This also means we no longer update permissions before we change worlds.
- - A command of '/manload' with no world arguments now performs a full reload of GM.
\ No newline at end of file + - A command of '/manload' with no world arguments now performs a full reload of GM.
+ - Update for Bukkit R5 compatability.
+ - Removed BukkitPermsOverride as this is now the default with bukkit handling child nodes.
+ - Prevent adding inheritances and info nodes to globalgroups. These are permissions collections, not player groups.
+ - Prevent promoting players to, and demoting to GlobalGroups.
+ - Make 'manload' reload the config correctly.
\ No newline at end of file diff --git a/EssentialsGroupManager/src/config.yml b/EssentialsGroupManager/src/config.yml index 13b59d343..cc90bea6f 100644 --- a/EssentialsGroupManager/src/config.yml +++ b/EssentialsGroupManager/src/config.yml @@ -4,10 +4,6 @@ settings: # The user will be able to promote players to the same group or even above. opOverrides: true - # If enabled any bukkit permissiosn which default to true will be left enabled. - # If the player is op any permissions set to Op will follow suit. - bukkit_perms_override: true - # Default setting for 'mantoglevalidate' # true will cause GroupManager to attempt name matching by default. validate_toggle: true diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java index d830696e7..98ff075dd 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java @@ -57,9 +57,6 @@ public class GMConfiguration { public boolean isOpOverride() { return GMconfig.getBoolean("settings.config.opOverrides", true); } - public boolean isBukkitPermsOverride() { - return GMconfig.getBoolean("settings.config.bukkit_perms_override", false); - } public boolean isToggleValidate() { return GMconfig.getBoolean("settings.config.validate_toggle", true); } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index d8d151200..00c71a41e 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -121,15 +121,15 @@ public class GroupManager extends JavaPlugin { ch = new GMLoggerHandler(); GroupManager.logger.addHandler(ch); logger.setLevel(Level.ALL); - if (worldsHolder == null) { - // Create the backup folder, if it doesn't exist. - prepareFileFields(); - // Load the config.yml - prepareConfig(); - // Load the global groups - globalGroups = new GlobalGroups(this); - worldsHolder = new WorldsHolder(this); - } + + // Create the backup folder, if it doesn't exist. + prepareFileFields(); + // Load the config.yml + prepareConfig(); + // Load the global groups + globalGroups = new GlobalGroups(this); + worldsHolder = new WorldsHolder(this); + PluginDescriptionFile pdfFile = this.getDescription(); if (worldsHolder == null) { @@ -398,6 +398,10 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Group not found!"); return false; } + if (auxGroup.isGlobal()) { + sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly."); + return false; + } // VALIDANDO PERMISSAO if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { @@ -1019,6 +1023,11 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Group 2 does not exists!"); return false; } + if (auxGroup.isGlobal()) { + sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support inheritance."); + return false; + } + // VALIDANDO PERMISSAO if (permissionHandler.searchGroupInInheritance(auxGroup, auxGroup2.getName(), null)) { sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " already inherits " + auxGroup2.getName() + " (might not be directly)"); @@ -1052,6 +1061,11 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Group 2 does not exists!"); return false; } + if (auxGroup.isGlobal()) { + sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support inheritance."); + return false; + } + // VALIDANDO PERMISSAO if (!permissionHandler.searchGroupInInheritance(auxGroup, auxGroup2.getName(), null)) { sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " does not inherits " + auxGroup2.getName() + "."); @@ -1222,6 +1236,10 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Group does not exists!"); return false; } + if (auxGroup.isGlobal()) { + sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes."); + return false; + } // VALIDANDO PERMISSAO // PARECE OK auxString = ""; @@ -1251,6 +1269,10 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Group does not exists!"); return false; } + if (auxGroup.isGlobal()) { + sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes."); + return false; + } // VALIDANDO PERMISSAO if (!auxGroup.getVariables().hasVar(args[1])) { sender.sendMessage(ChatColor.RED + "The group doesn't have directly that variable!"); @@ -1276,6 +1298,10 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Group does not exists!"); return false; } + if (auxGroup.isGlobal()) { + sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes."); + return false; + } // VALIDANDO PERMISSAO // PARECE OK auxString = ""; @@ -1313,6 +1339,10 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Group does not exists!"); return false; } + if (auxGroup.isGlobal()) { + sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes."); + return false; + } // VALIDANDO PERMISSAO auxGroup2 = permissionHandler.nextGroupWithVariable(auxGroup, args[1], null); if (auxGroup2 == null) { @@ -1578,6 +1608,10 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Group not found!"); return false; } + if (auxGroup.isGlobal()) { + sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly."); + return false; + } // VALIDANDO PERMISSAO if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher."); @@ -1634,6 +1668,10 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Group not found!"); return false; } + if (auxGroup.isGlobal()) { + sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly."); + return false; + } // VALIDANDO PERMISSAO if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher."); diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java index 5a39600b6..396240ec6 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java @@ -48,6 +48,15 @@ public class Group extends DataUnit implements Cloneable { public Group(String name) { super(name); } + + /** + * Is this a GlobalGroup + * + * @return + */ + public boolean isGlobal() { + return (getDataSource() == null); + } /** * Clone this group @@ -57,7 +66,7 @@ public class Group extends DataUnit implements Cloneable { public Group clone() { Group clone; - if (getDataSource() == null) { + if (isGlobal()) { clone = new Group(this.getName()); } else { clone = new Group(getDataSource(), this.getName()); @@ -85,7 +94,7 @@ public class Group extends DataUnit implements Cloneable { Group clone = dataSource.createGroup(this.getName()); // Don't add inheritance for GlobalGroups - if (getDataSource() != null) { + if (!isGlobal()) { clone.inherits = new ArrayList<String>(this.getInherits()); } for (String perm : this.getPermissionList()) { @@ -110,26 +119,30 @@ public class Group extends DataUnit implements Cloneable { * @param inherit the inherits to set */ public void addInherits(Group inherit) { - if (!this.getDataSource().groupExists(inherit.getName())) { - getDataSource().addGroup(inherit); - } - if (!inherits.contains(inherit.getName().toLowerCase())) { - inherits.add(inherit.getName().toLowerCase()); - } - flagAsChanged(); - if (GroupManager.isLoaded()) { - GroupManager.BukkitPermissions.updateAllPlayers(); - GroupManagerEventHandler.callEvent(this, Action.GROUP_INHERITANCE_CHANGED); - } + if (!isGlobal()) { + if (!this.getDataSource().groupExists(inherit.getName())) { + getDataSource().addGroup(inherit); + } + if (!inherits.contains(inherit.getName().toLowerCase())) { + inherits.add(inherit.getName().toLowerCase()); + } + flagAsChanged(); + if (GroupManager.isLoaded()) { + GroupManager.BukkitPermissions.updateAllPlayers(); + GroupManagerEventHandler.callEvent(this, Action.GROUP_INHERITANCE_CHANGED); + } + } } public boolean removeInherits(String inherit) { - if (this.inherits.contains(inherit.toLowerCase())) { - this.inherits.remove(inherit.toLowerCase()); - flagAsChanged(); - GroupManagerEventHandler.callEvent(this, Action.GROUP_INHERITANCE_CHANGED); - return true; - } + if (!isGlobal()) { + if (this.inherits.contains(inherit.toLowerCase())) { + this.inherits.remove(inherit.toLowerCase()); + flagAsChanged(); + GroupManagerEventHandler.callEvent(this, Action.GROUP_INHERITANCE_CHANGED); + return true; + } + } return false; } @@ -145,15 +158,17 @@ public class Group extends DataUnit implements Cloneable { * @param varList */ public void setVariables(Map<String, Object> varList) { - GroupVariables temp = new GroupVariables(this, varList); - variables.clearVars(); - for (String key : temp.getVarKeyList()) { - variables.addVar(key, temp.getVarObject(key)); - } - flagAsChanged(); - if (GroupManager.isLoaded()) { - GroupManager.BukkitPermissions.updateAllPlayers(); - GroupManagerEventHandler.callEvent(this, Action.GROUP_INFO_CHANGED); - } + if (!isGlobal()) { + GroupVariables temp = new GroupVariables(this, varList); + variables.clearVars(); + for (String key : temp.getVarKeyList()) { + variables.addVar(key, temp.getVarObject(key)); + } + flagAsChanged(); + if (GroupManager.isLoaded()) { + GroupManager.BukkitPermissions.updateAllPlayers(); + GroupManagerEventHandler.callEvent(this, Action.GROUP_INFO_CHANGED); + } + } } } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMGroupEvent.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMGroupEvent.java index f109cf4f7..fc9b8433b 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMGroupEvent.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMGroupEvent.java @@ -16,7 +16,6 @@ public class GMGroupEvent extends Event { /**
*
*/
- private static final long serialVersionUID = -5294917600434510451L;
private static final HandlerList handlers = new HandlerList();
@Override
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java index 6f4c0ea08..210960876 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java @@ -15,7 +15,6 @@ public class GMSystemEvent extends Event { /**
*
*/
- private static final long serialVersionUID = -8786811924448821548L;
private static final HandlerList handlers = new HandlerList();
@Override
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMUserEvent.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMUserEvent.java index 543580f41..206de8c86 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMUserEvent.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMUserEvent.java @@ -16,7 +16,6 @@ public class GMUserEvent extends Event { /**
*
*/
- private static final long serialVersionUID = -5294917600434510451L;
private static final HandlerList handlers = new HandlerList();
@Override
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index 9a754a374..9766a1a11 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -332,7 +332,7 @@ public class EssentialsProtectEntityListener implements Listener settings.acquireReadLock(); try { - if (settings.getData().getPrevent().isEndermanPickup()) + if (event.getEntityType() == EntityType.ENDERMAN && settings.getData().getPrevent().isEndermanPickup()) { event.setCancelled(true); } diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/EssentialsSign.java b/EssentialsSigns/src/com/earth2me/essentials/signs/EssentialsSign.java index 2a654600a..bfd9085a6 100644 --- a/EssentialsSigns/src/com/earth2me/essentials/signs/EssentialsSign.java +++ b/EssentialsSigns/src/com/earth2me/essentials/signs/EssentialsSign.java @@ -267,7 +267,7 @@ public class EssentialsSign final Double money = trade.getMoney(); if (money != null) { - sign.setLine(index, Util.formatCurrency(money, ess)); + sign.setLine(index, Util.shortCurrency(money, ess)); } } diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignDisposal.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignDisposal.java index a6c64ca0b..056c79e67 100644 --- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignDisposal.java +++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignDisposal.java @@ -2,7 +2,6 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.api.IEssentials; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.craftbukkit.ShowInventory; public class SignDisposal extends EssentialsSign @@ -15,7 +14,10 @@ public class SignDisposal extends EssentialsSign @Override protected boolean onSignInteract(final ISign sign, final IUser player, final String username, final IEssentials ess) { - ShowInventory.showEmptyInventory(player.getBase()); + player.sendMessage("Bukkit broke this sign :("); + //TODO: wait for a fix in bukkit + //Problem: Items can be duplicated + //player.getBase().openInventory(ess.getServer().createInventory(player, 36)); return true; } } diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignFree.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignFree.java index 4e77a2ad7..96ae2fdce 100644 --- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignFree.java +++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignFree.java @@ -4,8 +4,10 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.Trade; import com.earth2me.essentials.api.IEssentials; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.craftbukkit.ShowInventory; +import com.earth2me.essentials.craftbukkit.InventoryWorkaround; import org.bukkit.Material; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -32,8 +34,15 @@ public class SignFree extends EssentialsSign throw new SignException(_("cantSpawnItem", "Air")); } - item.setAmount(item.getType().getMaxStackSize() * 9 * 4); - ShowInventory.showFilledInventory(player.getBase(), item); + item.setAmount(item.getType().getMaxStackSize()); + InventoryWorkaround.addItem(player.getInventory(), true, item); + player.sendMessage("Item added to your inventory."); + player.updateInventory(); + //TODO: wait for a fix in bukkit + //Problem: Items can be duplicated + //Inventory i = ess.getServer().createInventory(player, InventoryType.CHEST); + //i.addItem(item); + //player.openInventory(i); Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), sign.getBlock().getLocation(), ess); return true; } diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignKit.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignKit.java index f658f7e11..e150edfa2 100644 --- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignKit.java +++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignKit.java @@ -20,7 +20,7 @@ public class SignKit extends EssentialsSign protected boolean onSignCreate(final ISign sign, final IUser player, final String username, final IEssentials ess) throws SignException { validateTrade(sign, 3, ess); - + final String kitName = sign.getLine(1).toLowerCase(Locale.ENGLISH); if (kitName.isEmpty()) @@ -62,6 +62,7 @@ public class SignKit extends EssentialsSign final Kit kit = ess.getKits().getKit(kitName); ess.getKits().sendKit(player, kit); + //TODO: Implement Kits from 2.9 charge.charge(player); } catch (Exception ex) diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignTrade.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignTrade.java index d72043f56..21cdbf441 100644 --- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignTrade.java +++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignTrade.java @@ -139,11 +139,11 @@ public class SignTrade extends EssentialsSign final Double money = getMoney(split[0]); if (money != null) { - if (Util.formatCurrency(money, ess).length() * 2 > 15) + if (Util.shortCurrency(money, ess).length() * 2 > 15) { throw new SignException("Line can be too long!"); } - sign.setLine(index, Util.formatCurrency(money, ess) + ":0"); + sign.setLine(index, Util.shortCurrency(money, ess) + ":0"); return; } } @@ -159,7 +159,7 @@ public class SignTrade extends EssentialsSign { throw new SignException(_("moreThanZero")); } - sign.setLine(index, Util.formatCurrency(money, ess) + ":" + Util.formatCurrency(amount, ess).substring(1)); + sign.setLine(index, Util.shortCurrency(money, ess) + ":" + Util.shortCurrency(amount, ess).substring(1)); return; } } @@ -317,7 +317,7 @@ public class SignTrade extends EssentialsSign final Double amount = getDouble(split[1]); if (money != null && amount != null) { - final String newline = Util.formatCurrency(money, ess) + ":" + Util.formatCurrency(amount + value, ess).substring(1); + final String newline = Util.shortCurrency(money, ess) + ":" + Util.shortCurrency(amount + value, ess).substring(1); if (newline.length() > 15) { throw new SignException("This sign is full: Line too long!"); diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java index 3a71c25ed..2f27421f9 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.update.states; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; + public class InstallationFinishedEvent extends Event { private static final HandlerList handlers = new HandlerList(); |