From 96b0f27c5117c189a2686f6d1fc534a462e433c2 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 12 Jun 2011 02:47:50 +0200 Subject: Fix for Craftbukkit Bug 912 --- .../spawn/EssentialsSpawnPlayerListener.java | 31 +++++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index e1e804e58..96915bd89 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -15,7 +15,7 @@ import org.bukkit.event.player.PlayerRespawnEvent; public class EssentialsSpawnPlayerListener extends PlayerListener { @Override - public void onPlayerRespawn(PlayerRespawnEvent event) + public void onPlayerRespawn(final PlayerRespawnEvent event) { final IEssentials ess = Essentials.getStatic(); final User user = ess.getUser(event.getPlayer()); @@ -25,7 +25,8 @@ public class EssentialsSpawnPlayerListener extends PlayerListener if (ess.getSettings().getRespawnAtHome()) { Location home = user.getHome(user.getLocation()); - if (home == null) { + if (home == null) + { throw new Exception(); } event.setRespawnLocation(home); @@ -36,28 +37,38 @@ public class EssentialsSpawnPlayerListener extends PlayerListener { } Location spawn = ess.getSpawn().getSpawn(user.getGroup()); - if (spawn == null) { + if (spawn == null) + { return; } event.setRespawnLocation(spawn); } @Override - public void onPlayerJoin(PlayerJoinEvent event) + public void onPlayerJoin(final PlayerJoinEvent event) { final IEssentials ess = Essentials.getStatic(); final User user = ess.getUser(event.getPlayer()); - + if (!user.isNew()) { return; } user.setNew(false); - try { - user.getTeleport().now(ess.getSpawn().getSpawn(ess.getSettings().getNewbieSpawn())); - } catch (Exception ex) { - Logger.getLogger("Minecraft").log(Level.WARNING, Util.i18n("teleportNewPlayerError"), ex); - } + ess.scheduleSyncDelayedTask(new Runnable() + { + public void run() + { + try + { + user.getTeleport().now(ess.getSpawn().getSpawn(ess.getSettings().getNewbieSpawn())); + } + catch (Exception ex) + { + Logger.getLogger("Minecraft").log(Level.WARNING, Util.i18n("teleportNewPlayerError"), ex); + } + } + }); if (ess.getSettings().getAnnounceNewPlayers()) { -- cgit v1.2.3 From 27c84ceaac8bf7ad7f192e087fcd324616a23611 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sat, 25 Jun 2011 15:34:33 +0200 Subject: Remove the restriction of EssEcoApi to not use iConomy or BOSE --- Essentials/src/com/earth2me/essentials/api/Economy.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/api/Economy.java b/Essentials/src/com/earth2me/essentials/api/Economy.java index 768168a24..bf071b733 100644 --- a/Essentials/src/com/earth2me/essentials/api/Economy.java +++ b/Essentials/src/com/earth2me/essentials/api/Economy.java @@ -3,7 +3,6 @@ package com.earth2me.essentials.api; import com.earth2me.essentials.Essentials; import com.earth2me.essentials.EssentialsConf; import com.earth2me.essentials.User; -import com.earth2me.essentials.UserData; import com.earth2me.essentials.Util; import java.io.File; import java.util.logging.Level; @@ -79,8 +78,7 @@ public final class Economy if (user == null) { throw new UserDoesNotExistException(name); } - // Use UserData to avoid calls to iConomy and Register - return ((UserData)user).getMoney(); + return user.getMoney(); } /** @@ -100,8 +98,7 @@ public final class Economy { throw new NoLoanPermittedException(); } - // Use UserData to avoid calls to iConomy and Register - ((UserData)user).setMoney(balance); + user.setMoney(balance); } /** -- cgit v1.2.3 From b63ae9b771b10a4c0a5122501b98597ab939c62c Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 26 Jun 2011 01:43:19 +0200 Subject: SEVERE error messages for other plugins, that try to manually enable Essentials, FakePermissions or GroupManager --- Essentials/src/com/earth2me/essentials/Essentials.java | 4 ++++ .../src/com/nijikokun/bukkit/Permissions/Permissions.java | 5 +++++ .../src/org/anjocaido/groupmanager/GroupManager.java | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index ae886aab7..99063111a 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -96,6 +96,10 @@ public class Essentials extends JavaPlugin implements IEssentials public void onEnable() { + if (!Thread.currentThread().getStackTrace()[5].getMethodName().equals("loadPlugin")) { + logger.log(Level.SEVERE, "Another plugin is trying to enable Essentials manually. Don't do this! It's probably " + + Thread.currentThread().getStackTrace()[5].getClassName()); + } if (enableErrorLogging) { logger.addHandler(errorHandler); diff --git a/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java b/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java index cf0d09a35..153747ad1 100644 --- a/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java +++ b/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java @@ -3,6 +3,7 @@ package com.nijikokun.bukkit.Permissions; import com.nijiko.Misc; import com.nijiko.configuration.DefaultConfiguration; import com.nijiko.permissions.PermissionHandler; +import java.util.logging.Level; import java.util.logging.Logger; import org.anjocaido.groupmanager.GroupManager; import org.anjocaido.groupmanager.permissions.NijikoPermissionsProxy; @@ -55,6 +56,10 @@ public class Permissions extends JavaPlugin { @Override public void onEnable() { + if (!Thread.currentThread().getStackTrace()[5].getMethodName().equals("loadPlugin")) { + Logger.getLogger("Minecraft").log(Level.SEVERE, "Another plugin is trying to enable Essentials manually. Don't do this! It's probably " + + Thread.currentThread().getStackTrace()[5].getClassName()); + } Server = this.getServer(); PluginDescriptionFile pdfFile = this.getDescription(); diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 1594755de..64db276d2 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -63,6 +63,10 @@ public class GroupManager extends JavaPlugin { @Override public void onEnable() { + if (!Thread.currentThread().getStackTrace()[5].getMethodName().equals("loadPlugin")) { + logger.log(Level.SEVERE, "Another plugin is trying to enable Essentials manually. Don't do this! It's probably " + + Thread.currentThread().getStackTrace()[5].getClassName()); + } GroupManager.logger.setUseParentHandlers(false); GMLoggerHandler ch = new GMLoggerHandler(); GroupManager.logger.addHandler(ch); -- cgit v1.2.3 From 28db891aa51dcea8d15e8eb0bc3c5eb55ee24b59 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 26 Jun 2011 01:43:59 +0200 Subject: Fix for Register inside Essentials --- .../com/earth2me/essentials/register/payment/Methods.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/register/payment/Methods.java b/Essentials/src/com/earth2me/essentials/register/payment/Methods.java index 927d4de4c..e5ba9a991 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/Methods.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/Methods.java @@ -68,14 +68,6 @@ public class Methods { if(method.getDescription().getName().equals(name)) plugin = method; else plugin = manager.getPlugin(name); if(plugin == null) continue; - if(!plugin.isEnabled()) { - this.self = true; - Logger.getLogger("Minecraft").log(Level.SEVERE, name + " Plugin was found, but not enabled before Essentials. Read the Essentials thread for help."); - //manager.enablePlugin(plugin); - } - - if(plugin == null) continue; - Method current = this.createMethod(plugin); if(current == null) continue; @@ -99,9 +91,7 @@ public class Methods { break; } - if(this.preferred.isEmpty()) this.Method = attached; - - if(count == 0) { + if(count != 0) { if(this.preferred.equalsIgnoreCase(attached.getName())) this.Method = attached; } else { -- cgit v1.2.3 From e652ed2981888e39687fe0040b84683e04f74228 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 26 Jun 2011 02:00:57 +0200 Subject: Copy&Paste is bad. --- .../src/com/nijikokun/bukkit/Permissions/Permissions.java | 2 +- EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java b/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java index 153747ad1..c689c8749 100644 --- a/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java +++ b/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java @@ -57,7 +57,7 @@ public class Permissions extends JavaPlugin { @Override public void onEnable() { if (!Thread.currentThread().getStackTrace()[5].getMethodName().equals("loadPlugin")) { - Logger.getLogger("Minecraft").log(Level.SEVERE, "Another plugin is trying to enable Essentials manually. Don't do this! It's probably " + Logger.getLogger("Minecraft").log(Level.SEVERE, "Another plugin is trying to enable Permissions manually. Don't do this! It's probably " + Thread.currentThread().getStackTrace()[5].getClassName()); } Server = this.getServer(); diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 64db276d2..e99e76ba7 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -64,7 +64,7 @@ public class GroupManager extends JavaPlugin { @Override public void onEnable() { if (!Thread.currentThread().getStackTrace()[5].getMethodName().equals("loadPlugin")) { - logger.log(Level.SEVERE, "Another plugin is trying to enable Essentials manually. Don't do this! It's probably " + logger.log(Level.SEVERE, "Another plugin is trying to enable GroupManager manually. Don't do this! It's probably " + Thread.currentThread().getStackTrace()[5].getClassName()); } GroupManager.logger.setUseParentHandlers(false); -- cgit v1.2.3 From 3dc0659f664e0ac7f56f1e555da2fa9e97d7b2e8 Mon Sep 17 00:00:00 2001 From: snowleo Date: Mon, 27 Jun 2011 11:53:57 +0200 Subject: Another fix to /spawnmob Merged for release --- Essentials/src/com/earth2me/essentials/Mob.java | 105 +++++++-------------- .../essentials/commands/Commandspawnmob.java | 49 ++++------ 2 files changed, 56 insertions(+), 98 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Mob.java b/Essentials/src/com/earth2me/essentials/Mob.java index 771d54abe..f5e1aea3d 100644 --- a/Essentials/src/com/earth2me/essentials/Mob.java +++ b/Essentials/src/com/earth2me/essentials/Mob.java @@ -1,75 +1,55 @@ package com.earth2me.essentials; -import java.lang.reflect.Constructor; import java.util.HashMap; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; -import net.minecraft.server.Entity; -import net.minecraft.server.WorldServer; +import org.bukkit.Location; import org.bukkit.Server; -import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.entity.CreatureType; +import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; public enum Mob { - CHICKEN("Chicken", Enemies.FRIENDLY), - COW("Cow", Enemies.FRIENDLY), - CREEPER("Creeper", Enemies.ENEMY), - GHAST("Ghast", Enemies.ENEMY), - GIANT("Giant", "GiantZombie", Enemies.ENEMY), - PIG("Pig", Enemies.FRIENDLY), - PIGZOMB("PigZombie", Enemies.NEUTRAL), - SHEEP("Sheep", Enemies.FRIENDLY, ""), - SKELETON("Skeleton", Enemies.ENEMY), - SLIME("Slime", Enemies.ENEMY), - SPIDER("Spider", Enemies.ENEMY), - SQUID("Squid", Enemies.FRIENDLY), - ZOMBIE("Zombie", Enemies.ENEMY), - MONSTER("Monster", Enemies.ENEMY), - WOLF("Wolf", Enemies.NEUTRAL); + 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), + MONSTER("Monster", Enemies.ENEMY, CreatureType.MONSTER), + WOLF("Wolf", Enemies.NEUTRAL, CreatureType.WOLF); public static final Logger logger = Logger.getLogger("Minecraft"); - private Mob(String n, Enemies en, String s) + private Mob(String n, Enemies en, String s, CreatureType type) { - this.s = s; + this.suffix = s; this.name = n; - this.craftClass = n; - this.entityClass = n; this.type = en; + this.bukkitType = type; } - private Mob(String n, Enemies en) + private Mob(String n, Enemies en, CreatureType type) { this.name = n; - this.craftClass = n; - this.entityClass = n; this.type = en; + this.bukkitType = type; } - private Mob(String n, String ec, Enemies en) - { - this.name = n; - this.craftClass = n; - this.entityClass = ec; - this.type = en; - } - - private Mob(String n, String ec, String cc, Enemies en) - { - this.name = n; - this.entityClass = ec; - this.craftClass = cc; - this.type = en; - } - public String s = "s"; - public String name; - public Enemies type; - private String entityClass; - private String craftClass; + public String suffix = "s"; + final public String name; + final public Enemies type; + final private CreatureType bukkitType; private static final Map hashMap = new HashMap(); static @@ -80,24 +60,16 @@ public enum Mob } } - @SuppressWarnings( - { - "unchecked", "CallToThreadDumpStack" - }) - public CraftEntity spawn(Player player, Server server) throws MobException + public LivingEntity spawn(final Player player, final Server server, final Location loc) throws MobException { - try - { - WorldServer world = ((org.bukkit.craftbukkit.CraftWorld)player.getWorld()).getHandle(); - Constructor craft = (Constructor)ClassLoader.getSystemClassLoader().loadClass("org.bukkit.craftbukkit.entity.Craft" + craftClass).getConstructors()[0]; - Constructor entity = (Constructor)ClassLoader.getSystemClassLoader().loadClass("net.minecraft.server.Entity" + entityClass).getConstructors()[0]; - return craft.newInstance((CraftServer)server, entity.newInstance(world)); - } - catch (Exception ex) + + final LivingEntity entity = player.getWorld().spawnCreature(loc, this.bukkitType); + if (entity == null) { - logger.log(Level.WARNING, Util.i18n("unableToSpawnMob"), ex); - throw new MobException(ex); + logger.log(Level.WARNING, Util.i18n("unableToSpawnMob")); + throw new MobException(); } + return entity; } @@ -107,22 +79,17 @@ public enum Mob NEUTRAL("neutral"), ENEMY("enemy"); - private Enemies(String t) + private Enemies(final String t) { this.type = t; } - protected String type; + final protected String type; } public static class MobException extends Exception { private static final long serialVersionUID = 1L; - - private MobException(Exception ex) - { - super(ex); - } } public static Mob fromName(String n) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 480e23aea..0f0b838b4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -3,8 +3,6 @@ package com.earth2me.essentials.commands; import net.minecraft.server.WorldServer; import org.bukkit.Location; import org.bukkit.Server; -import org.bukkit.craftbukkit.entity.CraftEntity; -import com.earth2me.essentials.Essentials; import com.earth2me.essentials.User; import com.earth2me.essentials.Mob; import com.earth2me.essentials.Mob.MobException; @@ -20,6 +18,7 @@ import org.bukkit.craftbukkit.entity.CraftCreeper; import org.bukkit.craftbukkit.entity.CraftSheep; import org.bukkit.craftbukkit.entity.CraftSlime; import org.bukkit.craftbukkit.entity.CraftWolf; +import org.bukkit.entity.Entity; public class Commandspawnmob extends EssentialsCommand @@ -62,9 +61,9 @@ public class Commandspawnmob extends EssentialsCommand } - CraftEntity spawnedMob = null; + Entity spawnedMob = null; Mob mob = null; - CraftEntity spawnedMount = null; + Entity spawnedMount = null; Mob mobMount = null; mob = Mob.fromName(mobType); @@ -74,16 +73,6 @@ public class Commandspawnmob extends EssentialsCommand return; } charge(user); - WorldServer world = ((CraftWorld)user.getWorld()).getHandle(); - try - { - spawnedMob = mob.spawn(user, server); - } - catch (MobException e) - { - user.sendMessage(Util.i18n("unableToSpawnMob")); - return; - } int[] ignore = { 8, 9 @@ -96,8 +85,16 @@ public class Commandspawnmob extends EssentialsCommand loc.setY(loc.getY() + 1); block = user.getWorld().getBlockAt(loc); } - spawnedMob.teleportTo(loc); - world.addEntity(spawnedMob.getHandle()); + + try + { + spawnedMob = mob.spawn(user, server, loc); + } + catch (MobException e) + { + user.sendMessage(Util.i18n("unableToSpawnMob")); + return; + } if (mountType != null) { @@ -109,16 +106,14 @@ public class Commandspawnmob extends EssentialsCommand } try { - spawnedMount = mobMount.spawn(user, server); + spawnedMount = mobMount.spawn(user, server, loc); } catch (MobException e) { user.sendMessage(Util.i18n("unableToSpawnMob")); return; } - spawnedMount.teleportTo(spawnedMob); - spawnedMount.getHandle().setPassengerOf(spawnedMob.getHandle()); - world.addEntity(spawnedMount.getHandle()); + spawnedMob.setPassenger(spawnedMount); } if (mobData != null) { @@ -142,23 +137,19 @@ public class Commandspawnmob extends EssentialsCommand { for (int i = 1; i < mobCount; i++) { - spawnedMob = mob.spawn(user, server); - spawnedMob.teleportTo(loc); - world.addEntity(spawnedMob.getHandle()); + spawnedMob = mob.spawn(user, server, loc); if (mobMount != null) { try { - spawnedMount = mobMount.spawn(user, server); + spawnedMount = mobMount.spawn(user, server, loc); } catch (MobException e) { user.sendMessage(Util.i18n("unableToSpawnMob")); return; } - spawnedMount.teleportTo(spawnedMob); - spawnedMount.getHandle().setPassengerOf(spawnedMob.getHandle()); - world.addEntity(spawnedMount.getHandle()); + spawnedMob.setPassenger(spawnedMount); } if (mobData != null) { @@ -169,7 +160,7 @@ public class Commandspawnmob extends EssentialsCommand changeMobData(mobMount.name, spawnedMount, mountData, user); } } - user.sendMessage(args[1] + " " + mob.name.toLowerCase() + mob.s + Util.i18n("spawned")); + user.sendMessage(args[1] + " " + mob.name.toLowerCase() + mob.suffix + Util.i18n("spawned")); } catch (MobException e1) { @@ -195,7 +186,7 @@ public class Commandspawnmob extends EssentialsCommand return s.toUpperCase().charAt(0) + s.toLowerCase().substring(1); } - private void changeMobData(String type, CraftEntity spawned, String data, User user) throws Exception + private void changeMobData(String type, Entity spawned, String data, User user) throws Exception { if ("Slime".equalsIgnoreCase(type)) { -- cgit v1.2.3 From 40e106db13fd58351bee9b82733b1900e96dc6a0 Mon Sep 17 00:00:00 2001 From: snowleo Date: Mon, 27 Jun 2011 11:57:03 +0200 Subject: Fix /spawner command The name had to be first letter uppercase, the rest lowercase --- .../src/com/earth2me/essentials/commands/Commandspawner.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java index f351019bc..df2f7f954 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java @@ -6,6 +6,7 @@ import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.block.Block; import org.bukkit.block.CreatureSpawner; +import org.bukkit.craftbukkit.block.CraftCreatureSpawner; import org.bukkit.entity.CreatureType; @@ -19,12 +20,12 @@ public class Commandspawner extends EssentialsCommand @Override protected void run(Server server, User user, String commandLabel, String[] args) throws Exception { - if (args.length < 1) + if (args.length < 1 || args[0].length() < 2) { throw new NotEnoughArgumentsException(); } - Block target = user.getTarget().getTargetBlock(); + final Block target = user.getTarget().getTargetBlock(); if (target.getType() != Material.MOB_SPAWNER) { throw new Exception(Util.i18n("mobSpawnTarget")); @@ -33,7 +34,8 @@ public class Commandspawner extends EssentialsCommand charge(user); try { - ((CreatureSpawner)target).setCreatureType(CreatureType.fromName(args[0])); + final String name = args[0].substring(0, 1).toUpperCase() + args[0].substring(1).toLowerCase(); + new CraftCreatureSpawner(target).setCreatureType(CreatureType.fromName(name)); } catch (Throwable ex) { -- cgit v1.2.3 From 4b35e1b72982295358e1a557f8cd78a38c81bc0e Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 30 Jun 2011 18:43:23 +0200 Subject: CB #946 B #750 --- lib/bukkit-0.0.1-SNAPSHOT.jar | Bin 2680810 -> 2695176 bytes lib/craftbukkit-0.0.1-SNAPSHOT.jar | Bin 7673648 -> 7701825 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/bukkit-0.0.1-SNAPSHOT.jar b/lib/bukkit-0.0.1-SNAPSHOT.jar index 955d97e7e..2423740a8 100644 Binary files a/lib/bukkit-0.0.1-SNAPSHOT.jar and b/lib/bukkit-0.0.1-SNAPSHOT.jar differ diff --git a/lib/craftbukkit-0.0.1-SNAPSHOT.jar b/lib/craftbukkit-0.0.1-SNAPSHOT.jar index 4bc5c9043..d7286e059 100644 Binary files a/lib/craftbukkit-0.0.1-SNAPSHOT.jar and b/lib/craftbukkit-0.0.1-SNAPSHOT.jar differ -- cgit v1.2.3 From b53fc9cadc5a3f77c73bf34e768bd6f968537967 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 30 Jun 2011 18:54:05 +0200 Subject: Renamed functions --- .../src/com/earth2me/essentials/commands/Commandspawnmob.java | 6 +++--- .../essentials/protect/EssentialsProtectEntityListener.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 0f0b838b4..36beaad5d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -213,11 +213,11 @@ public class Commandspawnmob extends EssentialsCommand if ("Wolf".equalsIgnoreCase(type) && data.equalsIgnoreCase("tamed")) { EntityWolf wolf = ((CraftWolf)spawned).getHandle(); - wolf.d(true); - wolf.a((PathEntity)null); + wolf.setTamed(true); + wolf.setPathEntity((PathEntity)null); wolf.setSitting(true); wolf.health = 20; - wolf.a(user.getName()); + wolf.setOwnerName(user.getName()); wolf.world.a(wolf, (byte)7); } if ("Wolf".equalsIgnoreCase(type) && data.equalsIgnoreCase("angry")) diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index 89afc7cff..9c421fe4b 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -217,7 +217,7 @@ public class EssentialsProtectEntityListener extends EntityListener } } - ((CraftServer)parent.getServer()).getHandle().a(loc.getX(), loc.getY(), loc.getZ(), 64.0D, ((CraftWorld)loc.getWorld()).getHandle().worldProvider.dimension, + ((CraftServer)parent.getServer()).getHandle().sendPacketNearby(loc.getX(), loc.getY(), loc.getZ(), 64.0D, ((CraftWorld)loc.getWorld()).getHandle().worldProvider.dimension, new Packet60Explosion(loc.getX(), loc.getY(), loc.getZ(), 3.0f, set)); event.setCancelled(true); return; -- cgit v1.2.3 From ea2649db5e6ded860b4fd096ad9938246f8857f7 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 30 Jun 2011 19:16:50 +0200 Subject: Updated items.csv --- Essentials/src/items.csv | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index 43a554f8b..6cb4946d3 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -447,6 +447,10 @@ detecttrack,28,0 detectrail,28,0 dtrack,28,0 drail,28,0 +pistonstickybase,29,0 +stickypiston,29,0 +stickyp,29,0 +psticky,29,0 spiderweb,30,0 sweb,30,0 web,30,0 @@ -462,6 +466,10 @@ deadshrub,32,0 shrubdead,32,0 dshrub,32,0 shrubd,32,0 +pistonbase,33,0 +piston,33,0 +pistonextension,34,0 +pistonext,34,0 whitecloth,35,0 whitewool,35,0 whitecotton,35,0 @@ -591,6 +599,9 @@ blackcotton,35,15 blacloth,35,15 blawool,35,15 blacotton,35,15 +pistonmovingpiece,36,0 +pistonmp,36,0 +ppusher,36,0 yellowflower,37,0 yflower,37,0 flower,37,0 @@ -1951,6 +1962,7 @@ diode,356,0 cookie,357,0 map,358,0 chart,358,0 +shears,359,0 goldmusicrecord,2256,0 goldmusicdisk,2256,0 goldmusiccd,2256,0 -- cgit v1.2.3 From e5eb1ca0cb610409ec719beb3d0ffc5603e0b28e Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 1 Jul 2011 10:52:59 +0200 Subject: More names for pistons (items.csv) Fix for /unlimited and pistons --- Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java | 2 ++ Essentials/src/items.csv | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java index 8069d8f83..7abe500f8 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java @@ -241,6 +241,8 @@ public class EssentialsBlockListener extends BlockListener case JACK_O_LANTERN: case WOOD_PLATE: case STONE_PLATE: + case PISTON_STICKY_BASE: + case PISTON_BASE: is.setDurability((short)0); break; } diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index 6cb4946d3..2a30bd806 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -451,6 +451,8 @@ pistonstickybase,29,0 stickypiston,29,0 stickyp,29,0 psticky,29,0 +spiston,29,0 +pistons,29,0 spiderweb,30,0 sweb,30,0 web,30,0 @@ -468,6 +470,7 @@ dshrub,32,0 shrubd,32,0 pistonbase,33,0 piston,33,0 +pistonblock,33,0 pistonextension,34,0 pistonext,34,0 whitecloth,35,0 @@ -601,7 +604,6 @@ blawool,35,15 blacotton,35,15 pistonmovingpiece,36,0 pistonmp,36,0 -ppusher,36,0 yellowflower,37,0 yflower,37,0 flower,37,0 -- cgit v1.2.3 From e763b362d9f65941f6423e0613a0f5433fabb475 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sat, 2 Jul 2011 01:09:19 +0200 Subject: CB# 953 B# 754 --- lib/bukkit-0.0.1-SNAPSHOT.jar | Bin 2695176 -> 2696052 bytes lib/craftbukkit-0.0.1-SNAPSHOT.jar | Bin 7701825 -> 7704329 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/bukkit-0.0.1-SNAPSHOT.jar b/lib/bukkit-0.0.1-SNAPSHOT.jar index 2423740a8..862601752 100644 Binary files a/lib/bukkit-0.0.1-SNAPSHOT.jar and b/lib/bukkit-0.0.1-SNAPSHOT.jar differ diff --git a/lib/craftbukkit-0.0.1-SNAPSHOT.jar b/lib/craftbukkit-0.0.1-SNAPSHOT.jar index d7286e059..216a4a943 100644 Binary files a/lib/craftbukkit-0.0.1-SNAPSHOT.jar and b/lib/craftbukkit-0.0.1-SNAPSHOT.jar differ -- cgit v1.2.3 From d93120257b170526a74a3620ef0064301f14dc58 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sat, 2 Jul 2011 01:10:48 +0200 Subject: Update of bukkit version number in essentials class --- Essentials/src/com/earth2me/essentials/Essentials.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 99063111a..40325ba97 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -43,7 +43,7 @@ import org.bukkit.plugin.java.*; public class Essentials extends JavaPlugin implements IEssentials { public static final String AUTHORS = "Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans and Xeology"; - public static final int minBukkitBuildVersion = 860; + public static final int minBukkitBuildVersion = 953; private static final Logger logger = Logger.getLogger("Minecraft"); private Settings settings; private EssentialsPlayerListener playerListener; -- cgit v1.2.3 From ea590c2ed1c67009c1170680f28e15f4cec22534 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 5 Jun 2011 00:00:41 +0000 Subject: NPE fix for offline users in UserData git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1583 e251c2fe-e539-e718-e476-b85c1f46cddb --- Essentials/src/com/earth2me/essentials/UserData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index e9f05b8bd..8261ba7a9 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -324,7 +324,7 @@ public abstract class UserData extends PlayerExtension implements IConf private ItemStack[] _getSavedInventory() { int size = config.getInt("inventory.size", 0); - if (size < 1 || size > getInventory().getSize()) + if (getInventory() != null && (size < 1 || size > getInventory().getSize())) { return null; } -- cgit v1.2.3 From 367e9840cc51b3fc56ca556574035fbeebc2847c Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 7 Jun 2011 22:18:57 +0200 Subject: Fix save inventory after logout for new players. --- Essentials/src/com/earth2me/essentials/UserData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 8261ba7a9..5aa98eeb4 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -324,7 +324,7 @@ public abstract class UserData extends PlayerExtension implements IConf private ItemStack[] _getSavedInventory() { int size = config.getInt("inventory.size", 0); - if (getInventory() != null && (size < 1 || size > getInventory().getSize())) + if (size < 1 || (getInventory() != null && size > getInventory().getSize())) { return null; } -- cgit v1.2.3 From 747776344b275b02f37a7857b560d198c9ba0838 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sat, 16 Jul 2011 13:32:10 +0200 Subject: Fixing merge error --- Essentials/src/com/earth2me/essentials/commands/Commandspawner.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java index 1acbf13b8..5e95bad65 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java @@ -5,10 +5,6 @@ import com.earth2me.essentials.Util; import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.block.Block; -<<<<<<< HEAD -import org.bukkit.block.CreatureSpawner; -======= ->>>>>>> master import org.bukkit.craftbukkit.block.CraftCreatureSpawner; import org.bukkit.entity.CreatureType; -- cgit v1.2.3 From 84ac520353ce7f80f762e7f5b4098d951567e239 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sat, 23 Jul 2011 20:05:44 +0200 Subject: Master and Release branch are now identical again. Removed warning for an older bukkit version. --- .../src/com/nijikokun/bukkit/Permissions/Permissions.java | 5 ----- .../src/org/anjocaido/groupmanager/GroupManager.java | 4 ---- 2 files changed, 9 deletions(-) diff --git a/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java b/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java index c689c8749..cf0d09a35 100644 --- a/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java +++ b/EssentialsGroupBridge/src/com/nijikokun/bukkit/Permissions/Permissions.java @@ -3,7 +3,6 @@ package com.nijikokun.bukkit.Permissions; import com.nijiko.Misc; import com.nijiko.configuration.DefaultConfiguration; import com.nijiko.permissions.PermissionHandler; -import java.util.logging.Level; import java.util.logging.Logger; import org.anjocaido.groupmanager.GroupManager; import org.anjocaido.groupmanager.permissions.NijikoPermissionsProxy; @@ -56,10 +55,6 @@ public class Permissions extends JavaPlugin { @Override public void onEnable() { - if (!Thread.currentThread().getStackTrace()[5].getMethodName().equals("loadPlugin")) { - Logger.getLogger("Minecraft").log(Level.SEVERE, "Another plugin is trying to enable Permissions manually. Don't do this! It's probably " - + Thread.currentThread().getStackTrace()[5].getClassName()); - } Server = this.getServer(); PluginDescriptionFile pdfFile = this.getDescription(); diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 95781f40b..890af718b 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -65,10 +65,6 @@ public class GroupManager extends JavaPlugin { @Override public void onEnable() { - if (!Thread.currentThread().getStackTrace()[5].getMethodName().equals("loadPlugin")) { - logger.log(Level.SEVERE, "Another plugin is trying to enable GroupManager manually. Don't do this! It's probably " - + Thread.currentThread().getStackTrace()[5].getClassName()); - } GroupManager.logger.setUseParentHandlers(false); ch = new GMLoggerHandler(); GroupManager.logger.addHandler(ch); -- cgit v1.2.3 From 4aecc034c26d6d9c71024f90183e25e431217b7b Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 11 Oct 2011 22:51:30 +0100 Subject: Fixing typo in release build. --- EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index ac822908f..43a57c419 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -1773,7 +1773,7 @@ public class GroupManager extends JavaPlugin { test.sendMessage(ChatColor.YELLOW + name +" was " + msg); } else if ((player != null) && ((player.hasPermission("groupmanager.notify.self")) || (player.hasPermission("groupmanager.notify.other")))) - player.sendMessage(ChatColor.YELLOW + "You we're " + msg); + player.sendMessage(ChatColor.YELLOW + "You were " + msg); } } -- cgit v1.2.3 From 839ce3d526ce666e189998e1722f1ad98e9955f9 Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 20 Dec 2011 11:57:22 +0100 Subject: Fix sending our player object to other plugins. --- Essentials/src/com/earth2me/essentials/commands/Commandbreak.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java index a1db8e0b2..2691ad4f2 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java @@ -31,7 +31,7 @@ public class Commandbreak extends EssentialsCommand { throw new Exception("You are not allowed to destroy bedrock."); //TODO: Translation } - final BlockBreakEvent event = new BlockBreakEvent(block, user); + final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase()); server.getPluginManager().callEvent(event); if (event.isCancelled()) { -- cgit v1.2.3 From ee5e015a637b6ef9a573dc5aef273ade60f90bb4 Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 20 Dec 2011 12:20:12 +0100 Subject: Correctly match release and non release versions of bukkit. --- Essentials/src/com/earth2me/essentials/Essentials.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 648a99ce3..29c46622e 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -124,7 +124,7 @@ 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]+-b([0-9]+)jnks.*").matcher(getServer().getVersion()); + final Matcher versionMatch = Pattern.compile("git-Bukkit-([0-9]+).([0-9]+).([0-9]+)-R[0-9]+-(?:[0-9]+-g[0-9a-f]+-)?b([0-9]+)jnks.*").matcher(getServer().getVersion()); if (versionMatch.matches()) { final int versionNumber = Integer.parseInt(versionMatch.group(4)); -- cgit v1.2.3 From 4425d536640d5deebc95e72a0f3f9f6c760563e1 Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 20 Dec 2011 12:24:59 +0100 Subject: Only info not a warning if a file is missing --- .../earth2me/essentials/storage/AbstractDelayedYamlFileReader.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java b/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java index 43bfc358d..d48b4a060 100644 --- a/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java +++ b/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java @@ -6,10 +6,8 @@ import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.logging.Level; -import java.util.logging.Logger; import org.bukkit.Bukkit; import org.bukkit.plugin.Plugin; -import org.yaml.snakeyaml.error.YAMLException; public abstract class AbstractDelayedYamlFileReader implements Runnable @@ -56,7 +54,7 @@ public abstract class AbstractDelayedYamlFileReader imp catch (FileNotFoundException ex) { onException(); - Bukkit.getLogger().log(Level.WARNING, "File not found: " + file.toString()); + Bukkit.getLogger().log(Level.INFO, "File not found: " + file.toString()); } catch (ObjectLoadException ex) { -- cgit v1.2.3 From 9bd0c33fef968ecac42054888437de96509a433c Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 21 Feb 2012 18:41:27 +0100 Subject: Never give our user object to other plugins! --- Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java b/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java index 64f7fe04a..d6afe707a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java @@ -16,7 +16,7 @@ public class Commandsuicide extends EssentialsCommand @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - EntityDamageEvent ede = new EntityDamageEvent(user, EntityDamageEvent.DamageCause.SUICIDE, 1000); + EntityDamageEvent ede = new EntityDamageEvent(user.getBase(), EntityDamageEvent.DamageCause.SUICIDE, 1000); server.getPluginManager().callEvent(ede); user.damage(1000); user.setHealth(0); -- cgit v1.2.3 From c0df77153958bb3cbd3f07c5be305027440a773e Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 21 Feb 2012 18:38:08 +0000 Subject: Update for Bukkit R5 compatability. Removed some unused variables. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/events/GMGroupEvent.java | 1 - .../src/org/anjocaido/groupmanager/events/GMSystemEvent.java | 1 - .../src/org/anjocaido/groupmanager/events/GMUserEvent.java | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 31d40413f..0566ef676 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -141,4 +141,5 @@ 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. \ No newline at end of file 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 -- cgit v1.2.3 From 9c68cbae727f84a7b4dfb2594c458c3353a739d3 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 21 Feb 2012 18:40:54 +0000 Subject: Removed BukkitPermsOverride as this is now the default with bukkit handling child nodes. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- EssentialsGroupManager/src/config.yml | 4 ---- .../src/org/anjocaido/groupmanager/GMConfiguration.java | 3 --- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 0566ef676..cb14c4e6e 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -142,4 +142,5 @@ v 1.9: - 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. - - Update for Bukkit R5 compatability. \ No newline at end of file + - Update for Bukkit R5 compatability. + - Removed BukkitPermsOverride as this is now the default with bukkit handling child nodes. \ 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); } -- cgit v1.2.3 From ed7fe9213f260147b00dc33088fb4f788cf74078 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 21 Feb 2012 21:39:25 +0000 Subject: Fix /sudo message display. --- Essentials/src/com/earth2me/essentials/commands/Commandsudo.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java index 86394e502..d43d486b9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java @@ -1,6 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; import org.bukkit.Server; import org.bukkit.command.CommandSender; import org.bukkit.command.PluginCommand; @@ -36,7 +37,7 @@ public class Commandsudo extends EssentialsCommand } //TODO: Translate this. - sender.sendMessage("Forcing " + user.getDisplayName() + " to run: /" + command + " " + arguments); + sender.sendMessage("Forcing " + user.getDisplayName() + " to run: /" + command + " " + getFinalArg(arguments, 0)); final PluginCommand execCommand = ess.getServer().getPluginCommand(command); if (execCommand != null) -- cgit v1.2.3 From 6d46fc66ce1f762de998824a13a38811c8364f0c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 21 Feb 2012 22:12:37 +0000 Subject: Fixing home list. --- Essentials/src/com/earth2me/essentials/UserData.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 44ac096b9..643c45868 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -2,6 +2,7 @@ package com.earth2me.essentials; import java.io.File; import java.util.*; +import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Location; import org.bukkit.Material; @@ -94,17 +95,7 @@ public abstract class UserData extends PlayerExtension implements IConf private Map _getHomes() { - Object o = config.getProperty("homes"); - - if (o instanceof Map) - { - return (Map)o; - } - else - { - return new HashMap(); - } - + return config.getConfigurationSection("homes").getValues(false); } public Location getHome(String name) throws Exception @@ -154,6 +145,7 @@ public abstract class UserData extends PlayerExtension implements IConf public List getHomes() { + ess.getLogger().log(Level.INFO, "player " + this.getName() + " homecount: " + homes.size()); return new ArrayList(homes.keySet()); } -- cgit v1.2.3 From 46f05ee92f1deabe18dde1f527494fb717a079bd Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 21 Feb 2012 22:14:11 +0000 Subject: Check to see if home section exists. --- Essentials/src/com/earth2me/essentials/UserData.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 643c45868..e540bd998 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -2,7 +2,6 @@ package com.earth2me.essentials; import java.io.File; import java.util.*; -import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Location; import org.bukkit.Material; @@ -95,7 +94,10 @@ public abstract class UserData extends PlayerExtension implements IConf private Map _getHomes() { - return config.getConfigurationSection("homes").getValues(false); + if (config.isConfigurationSection("homes")) { + return config.getConfigurationSection("homes").getValues(false); + } + return new HashMap(); } public Location getHome(String name) throws Exception @@ -145,7 +147,6 @@ public abstract class UserData extends PlayerExtension implements IConf public List getHomes() { - ess.getLogger().log(Level.INFO, "player " + this.getName() + " homecount: " + homes.size()); return new ArrayList(homes.keySet()); } -- cgit v1.2.3 From 945ba6f8ab8a9d3094e61fe6ccd943638eaa792a Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 22 Feb 2012 00:10:13 +0000 Subject: Fix powertools with new config format. --- .../src/com/earth2me/essentials/UserData.java | 33 +++++++++------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index e540bd998..ea3201f28 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -94,8 +94,9 @@ public abstract class UserData extends PlayerExtension implements IConf private Map _getHomes() { - if (config.isConfigurationSection("homes")) { - return config.getConfigurationSection("homes").getValues(false); + if (config.isConfigurationSection("homes")) + { + return config.getConfigurationSection("homes").getValues(false); } return new HashMap(); } @@ -228,22 +229,15 @@ public abstract class UserData extends PlayerExtension implements IConf config.setProperty("unlimited", unlimited); config.save(); } - private Map powertools; + private Map powertools; - @SuppressWarnings("unchecked") - private Map _getPowertools() + private Map _getPowertools() { - Object o = config.getProperty("powertools"); - - if (o instanceof Map) - { - return (Map)o; - } - else + if (config.isConfigurationSection("powertools")) { - return new HashMap(); + return config.getConfigurationSection("powertools").getValues(false); } - + return new HashMap(); } public void clearAllPowertools() @@ -255,23 +249,23 @@ public abstract class UserData extends PlayerExtension implements IConf public List getPowertool(ItemStack stack) { - return (List)powertools.get(stack.getTypeId()); + return (List)powertools.get("" + stack.getTypeId()); } - + public List getPowertool(int id) { - return (List)powertools.get(id); + return (List)powertools.get("" + id); } public void setPowertool(ItemStack stack, List commandList) { if (commandList == null || commandList.isEmpty()) { - powertools.remove(stack.getTypeId()); + powertools.remove("" + stack.getTypeId()); } else { - powertools.put(stack.getTypeId(), commandList); + powertools.put("" + stack.getTypeId(), commandList); } config.setProperty("powertools", powertools); config.save(); @@ -732,7 +726,6 @@ public abstract class UserData extends PlayerExtension implements IConf return ret; } private boolean newplayer; - private String geolocation; private String _getGeoLocation() -- cgit v1.2.3 From 34f13ba89cdb270e42fbc0f0225e0634d80b9676 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 22 Feb 2012 00:11:21 +0000 Subject: Switch powertools to use different event. Reduce multiple triggering of powertool events. Abort event when used with powertool. --- .../essentials/EssentialsPlayerListener.java | 101 ++++++++++++--------- 1 file changed, 56 insertions(+), 45 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 8e151c3e9..a3b4559a2 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -282,44 +282,6 @@ public class EssentialsPlayerListener implements Listener { final User user = ess.getUser(event.getPlayer()); user.updateActivity(true); - if (event.getAnimationType() == PlayerAnimationType.ARM_SWING - && user.hasPowerTools() && user.arePowerToolsEnabled()) - { - usePowertools(user); - } - } - - private void usePowertools(final User user) - { - final ItemStack is = user.getItemInHand(); - int id; - if (is == null || (id = is.getTypeId()) == 0) - { - return; - } - final List commandList = user.getPowertool(id); - 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); - } - } } @EventHandler(priority = EventPriority.MONITOR) @@ -365,19 +327,68 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.MONITOR) public void onPlayerInteract(final PlayerInteractEvent event) { - if (event.isCancelled()) + switch (event.getAction()) { - return; + case RIGHT_CLICK_BLOCK: + if (event.isCancelled()) + { + return; + } + if (ess.getSettings().getUpdateBedAtDaytime() && event.getClickedBlock().getType() == Material.BED_BLOCK) + { + event.getPlayer().setBedSpawnLocation(event.getClickedBlock().getLocation()); + } + break; + case LEFT_CLICK_AIR: + case LEFT_CLICK_BLOCK: + final User user = ess.getUser(event.getPlayer()); + if (user.hasPowerTools() && user.arePowerToolsEnabled()) + { + if (usePowertools(user)) + { + event.setCancelled(true); + } + } + break; + default: + break; } - if (event.getAction() != Action.RIGHT_CLICK_BLOCK) + } + + private boolean usePowertools(final User user) + { + final ItemStack is = user.getItemInHand(); + int id; + if (is == null || (id = is.getTypeId()) == 0) { - return; + return false; } - - if (ess.getSettings().getUpdateBedAtDaytime() && event.getClickedBlock().getType() == Material.BED_BLOCK) + final List commandList = user.getPowertool(id); + 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 (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; + user.getServer().dispatchCommand(user.getBase(), command); + } } + return used; } @EventHandler(priority = EventPriority.LOW) -- cgit v1.2.3 From 358edff798e8388a95b2640edd5735b188025c5c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 22 Feb 2012 00:22:22 +0000 Subject: Powertools dispatch commands as delayed tasks (should reduce any conflict issues). --- .../com/earth2me/essentials/EssentialsPlayerListener.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index a3b4559a2..9b964364b 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -370,7 +370,7 @@ public class EssentialsPlayerListener implements Listener } boolean used = false; // We need to loop through each command and execute - for (String command : commandList) + for (final String command : commandList) { if (command.matches(".*\\{player\\}.*")) { @@ -385,7 +385,15 @@ public class EssentialsPlayerListener implements Listener else { used = true; - user.getServer().dispatchCommand(user.getBase(), command); + ess.scheduleSyncDelayedTask( + new Runnable() + { + @Override + public void run() + { + user.getServer().dispatchCommand(user.getBase(), command); + } + }); } } return used; -- cgit v1.2.3 From e1749fecd1293759fd899594e275a253646b5890 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 22 Feb 2012 01:29:37 +0000 Subject: Extra command aliases. --- Essentials/src/plugin.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index b9cbd5227..9165febb2 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -26,7 +26,7 @@ commands: balance: description: States the current balance of a player. usage: / [player] - aliases: [bal,emoney,ebalance,ebal] + aliases: [bal,money,emoney,ebalance,ebal] balancetop: description: Gets the top balance values. usage: / @@ -58,11 +58,11 @@ commands: clearinventory: description: Clear all items in your inventory. usage: / - aliases: [ci,eci,eclearinventory] + aliases: [ci,eci,clearinvent,eclearinvent,eclearinventory] compass: description: Describes your current bearing. usage: / - aliases: [ecompass] + aliases: [ecompass,direction,edirection] delhome: description: Removes a home usage: / [player:] @@ -97,7 +97,7 @@ commands: feed: description: Satisfy the hunger. usage: / [player] - aliases: [efeed] + aliases: [efeed,eat,eeat] itemdb: description: Searches for an item. usage: / @@ -113,7 +113,7 @@ commands: getpos: description: Get your current coordinates or those of a player. usage: / [player] - aliases: [coords,egetpos,whereami,ewhereami] + aliases: [coords,egetpos,position,eposition,whereami,ewhereami] gc: description: Reports garbage collection info; useful to developers. usage: / @@ -141,7 +141,7 @@ commands: home: description: Teleport to your home. usage: / [player:][name] - aliases: [ehome] + aliases: [ehome,homes,ehomes] ignore: description: Ignore other players. usage: / @@ -165,7 +165,7 @@ commands: jump: description: Jumps to the nearest block in the line of sight. usage: / - aliases: [j,ejump] + aliases: [j,ej,jumpto,ejumpto,ejump] kick: description: Kicks a specified player with a reason. usage: / [reason] @@ -177,7 +177,7 @@ commands: kit: description: Obtains the specified kit or views all available kits. usage: / [kit] - aliases: [ekit,kits] + aliases: [ekit,kits,ekits] kill: description: Kills specified player. usage: / @@ -189,7 +189,7 @@ commands: list: description: List all online players. usage: / - 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: / [player] [power] @@ -237,7 +237,7 @@ commands: ping: description: Pong! usage: / - 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: / [l:|a:|r:|c:|d:][command] [arguments] @@ -245,7 +245,7 @@ commands: powertooltoggle: description: Enables or disables all current powertools usage: / - aliases: [ptt,epowertooltoggle,eptt] + aliases: [ptt,epowertooltoggle,pttoggle,epttoggle,eptt] ptime: description: Adjust player's client time. Add @ prefix to fix. usage: / [list|reset|day|night|dawn|17:30|4pm|4000ticks] [player|*] @@ -337,11 +337,11 @@ commands: tp: description: Teleport to a player. usage: / [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: / - aliases: [call,etpa,ecall] + aliases: [call,tpask,etpask,etpa,ecall] tpaall: description: Requests all players online to teleport to you. usage: / @@ -389,11 +389,11 @@ commands: unban: description: Unbans the specified player. usage: / - aliases: [pardon,eunban] + aliases: [pardon,eunban,epardon] unbanip: description: Unbans the specified IP address. usage: /
- aliases: [eunbanip,pardonip] + aliases: [eunbanip,pardonip,epardonip] unlimited: description: Allows the unlimited placing of items. usage: / [player] @@ -401,7 +401,7 @@ commands: warp: description: List all warps or warp to the specified location. usage: / [player] - aliases: [ewarp,warps] + aliases: [ewarp,warps,ewarps] weather: description: Setting the weather. usage: / [duration] @@ -417,4 +417,4 @@ commands: worth: description: Calculates the worth of items in hand or as specified. usage: / [item] [amount] - aliases: [eworth] + aliases: [eworth,price,eprice] -- cgit v1.2.3 From e5b91dae73839b4311bf67ea6510ed88a9f4af80 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 22 Feb 2012 12:32:51 +0000 Subject: Fixing kits for new config classes. --- .../src/com/earth2me/essentials/ISettings.java | 5 +++-- Essentials/src/com/earth2me/essentials/Kit.java | 7 ++++--- .../src/com/earth2me/essentials/Settings.java | 24 ++++++++++++++-------- .../earth2me/essentials/commands/Commandkit.java | 8 ++++---- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index b7a128ebc..e567673b6 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import org.bukkit.ChatColor; +import org.bukkit.configuration.ConfigurationSection; import org.bukkit.event.EventPriority; @@ -39,9 +40,9 @@ public interface ISettings extends IConf double getHealCooldown(); - Object getKit(String name); + Map getKit(String name); - Map getKits(); + ConfigurationSection getKits(); String getLocale(); diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index 53d2e8784..88816368c 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -5,6 +5,7 @@ import com.earth2me.essentials.commands.NoChargeException; import com.earth2me.essentials.craftbukkit.InventoryWorkaround; import java.util.*; import org.bukkit.Material; +import org.bukkit.configuration.ConfigurationSection; import org.bukkit.inventory.ItemStack; @@ -15,16 +16,16 @@ public class Kit { try { - final Map kits = ess.getSettings().getKits(); + final ConfigurationSection kits = ess.getSettings().getKits(); final StringBuilder list = new StringBuilder(); - for (String kiteItem : kits.keySet()) + for (String kiteItem : kits.getKeys(false)) { if (user.isAuthorized("essentials.kit." + kiteItem.toLowerCase(Locale.ENGLISH))) { list.append(" ").append(kiteItem); } } - return list.toString(); + return list.toString().trim(); } catch (Exception ex) { diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 218a9163c..40fb47f6c 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -14,6 +14,7 @@ import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.ChatColor; +import org.bukkit.configuration.ConfigurationSection; import org.bukkit.event.EventPriority; import org.bukkit.inventory.ItemStack; @@ -211,23 +212,28 @@ public class Settings implements ISettings } @Override - public Object getKit(String name) + public Map getKit(String name) { - Map kits = (Map)config.get("kits"); - for (Map.Entry entry : kits.entrySet()) + name = name.replace('.', '_').replace('/', '_'); + if (config.isConfigurationSection("kits")) { - if (entry.getKey().equalsIgnoreCase(name.replace('.', '_').replace('/', '_'))) + final ConfigurationSection kits = getKits(); + if (kits.isConfigurationSection(name)) { - return entry.getValue(); - } + return kits.getConfigurationSection(name).getValues(true); + } } return null; } @Override - public Map getKits() + public ConfigurationSection getKits() { - return (Map)config.get("kits"); + if (config.isConfigurationSection("kits")) + { + return config.getConfigurationSection("kits"); + } + return null; } @Override @@ -328,7 +334,7 @@ public class Settings implements ISettings @Override public IText getAnnounceNewPlayerFormat() { - return new SimpleTextInput(Util.replaceColor(config.getString("newbies.announce-format", "&dWelcome {DISPLAYNAME} to the server!"))); + return new SimpleTextInput(Util.replaceColor(config.getString("newbies.announce-format", "&dWelcome {DISPLAYNAME} to the server!"))); } @Override diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java index c003d28ac..aee0af910 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java @@ -32,16 +32,16 @@ public class Commandkit extends EssentialsCommand else { final String kitName = args[0].toLowerCase(Locale.ENGLISH); - final Object kit = ess.getSettings().getKit(kitName); + final Map kit = ess.getSettings().getKit(kitName); if (!user.isAuthorized("essentials.kit." + kitName)) { throw new Exception(_("noKitPermission", "essentials.kit." + kitName)); } - final Map els = (Map)kit; - final List items = Kit.getItems(user, els); + + final List items = Kit.getItems(user, kit); - Kit.checkTime(user, kitName, els); + Kit.checkTime(user, kitName, kit); final Trade charge = new Trade("kit-" + kitName, ess); charge.isAffordableFor(user); -- cgit v1.2.3 From 9f605e9a885022144999b1f27bb74627c47b97b6 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 23 Feb 2012 14:49:23 +0000 Subject: Fixing upgrade script to allow powertool upgrade. --- Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java index 26e6f25bc..f70f0c091 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java @@ -271,18 +271,18 @@ public class EssentialsUpgrade if (config.hasProperty("powertools")) { @SuppressWarnings("unchecked") - final Map powertools = (Map)config.getProperty("powertools"); + final Map powertools = config.getConfigurationSection("powertools").getValues(false); if (powertools == null) { continue; } - for (Map.Entry entry : powertools.entrySet()) + for (Map.Entry entry : powertools.entrySet()) { if (entry.getValue() instanceof String) { List temp = new ArrayList(); temp.add((String)entry.getValue()); - ((Map)powertools).put(entry.getKey(), temp); + ((Map)powertools).put(entry.getKey(), temp); } } config.save(); -- cgit v1.2.3 From 6fb8dad0eca654c0a4a07ae8337419562088b914 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 23 Feb 2012 15:17:23 +0000 Subject: Balance top now has server total on first line. Balance top will update ess balance backup if using register/vault eco. --- Essentials/src/com/earth2me/essentials/User.java | 8 +++ .../essentials/commands/Commandbalancetop.java | 10 ++- Essentials/src/messages.properties | 75 ++++++++++----------- Essentials/src/messages_da.properties | 77 +++++++++++----------- Essentials/src/messages_de.properties | 3 +- Essentials/src/messages_en.properties | 77 +++++++++++----------- Essentials/src/messages_es.properties | 75 ++++++++++----------- Essentials/src/messages_fr.properties | 77 +++++++++++----------- Essentials/src/messages_nl.properties | 75 ++++++++++----------- 9 files changed, 249 insertions(+), 228 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index b289333aa..ce4d1ce27 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -381,6 +381,14 @@ public class User extends UserData implements Comparable, IReplyTo, IUser super.setMoney(value); } + public void updateMoneyCache(final double value) + { + if (ess.getPaymentMethod().hasMethod()) + { + super.setMoney(value); + } + } + @Override public void setAfk(final boolean set) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java index 672f1c6ca..fffb69ea4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java @@ -105,14 +105,18 @@ public class Commandbalancetop extends EssentialsCommand { if (force || cacheage <= System.currentTimeMillis() - CACHETIME) { - cache.getLines().clear(); + cache.getLines().clear(); final Map balances = new HashMap(); + double totalMoney = 0d; for (String u : ess.getUserMap().getAllUniqueUsers()) { final User 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); } } @@ -125,6 +129,8 @@ public class Commandbalancetop extends EssentialsCommand return -entry1.getValue().compareTo(entry2.getValue()); } }); + + cache.getLines().add(_("serverTotal", Util.formatCurrency(totalMoney, ess))); int pos = 1; for (Map.Entry entry : sortedEntries) { diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index ec55210b0..8489b6262 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -11,9 +11,9 @@ alertPlaced=placed: alertUsed=used: autoAfkKickReason=You have been kicked for idling more than {0} minutes. backAfterDeath=\u00a77Use the /back command to return to your death point. -backUsageMsg=\u00a77Returning to previous location. backupFinished=Backup finished backupStarted=Backup started +backUsageMsg=\u00a77Returning to previous location. balance=\u00a77Balance: {0} balanceTop=\u00a77Top balances ({0}) banExempt=\u00a7cYou can not ban that player. @@ -64,14 +64,14 @@ depth=\u00a77You are at sea level. depthAboveSea=\u00a77You are {0} block(s) above sea level. depthBelowSea=\u00a77You are {0} block(s) below sea level. destinationNotSet=Destination not set -disableUnlimited=\u00a77Disabled unlimited placing of {0} for {1}. disabled=disabled disabledToSpawnMob=Spawning this mob was disabled in the config file. +disableUnlimited=\u00a77Disabled unlimited placing of {0} for {1}. dontMoveMessage=\u00a77Teleportation will commence in {0}. Don''t move. downloadingGeoIp=Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB) duplicatedUserdata=Duplicated userdata: {0} and {1} -enableUnlimited=\u00a77Giving unlimited amount of {0} to {1}. enabled=enabled +enableUnlimited=\u00a77Giving unlimited amount of {0} to {1}. enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand. enchantmentNotFound = \u00a7cEnchantment not found enchantmentPerm = \u00a7cYou do not have the permission for {0} @@ -99,9 +99,9 @@ gcentities= entities gcfree=Free memory: {0} MB gcmax=Maximum memory: {0} MB gctotal=Allocated memory: {0} MB +geoipJoinFormat=Player {0} comes from {1} geoIpUrlEmpty=GeoIP download url is empty. geoIpUrlInvalid=GeoIP download url is invalid. -geoipJoinFormat=Player {0} comes from {1} godDisabledFor=disabled for {0} godEnabledFor=enabled for {0} godMode=\u00a77God mode {0}. @@ -112,9 +112,9 @@ helpConsole=To view help from the console, type ?. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: holeInFloor=Hole in floor +homes=Homes: {0} homeSet=\u00a77Home set. homeSetToBed=\u00a77Your home is now set to this bed. -homes=Homes: {0} hour=hour hours=hours ignorePlayer=You ignore player {0} from now on. @@ -124,28 +124,28 @@ infoChapterPages=Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f: infoFileDoesNotExist=File info.txt does not exist. Creating one for you. infoPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: infoUnknownChapter=Unknown chapter. -invBigger=The other users inventory is bigger than yours. -invRestored=Your inventory has been restored. -invSee=You see the inventory of {0}. -invSeeHelp=Use /invsee to restore your inventory. invalidCharge=\u00a7cInvalid charge. invalidMob=Invalid mob type. invalidServer=Invalid server! invalidSignLine=Line {0} on sign is invalid. invalidWorld=\u00a7cInvalid world. +invBigger=The other users inventory is bigger than yours. inventoryCleared=\u00a77Inventory Cleared. inventoryClearedOthers=\u00a77Inventory of \u00a7c{0}\u00a77 cleared. +invRestored=Your inventory has been restored. +invSee=You see the inventory of {0}. +invSeeHelp=Use /invsee to restore your inventory. is=is itemCannotBeSold=That item cannot be sold to the server. itemMustBeStacked=Item must be traded in stacks. A quantity of 2s would be two stacks, etc. itemNotEnough1=\u00a7cYou do not have enough of that item to sell. itemNotEnough2=\u00a77If you meant to sell all of your items of that type, use /sell itemname itemNotEnough3=\u00a77/sell itemname -1 will sell all but one item, etc. +itemsCsvNotLoaded=Could not load items.csv. itemSellAir=You really tried to sell Air? Put an item in your hand. itemSold=\u00a77Sold for \u00a7c{0} \u00a77({1} {2} at {3} each) itemSoldConsole={0} sold {1} for \u00a77{2} \u00a77({3} items at {4} each) itemSpawn=\u00a77Giving {0} of {1} -itemsCsvNotLoaded=Could not load items.csv. jailAlreadyIncarcerated=\u00a7cPerson is already in jail: {0} jailMessage=\u00a7cYou do the crime, you do the time. jailNotExist=That jail does not exist. @@ -162,8 +162,8 @@ kitError=\u00a7cThere are no valid kits. kitErrorHelp=\u00a7cPerhaps an item is missing a quantity in the configuration? kitGive=\u00a77Giving kit {0}. kitInvFull=\u00a7cYour inventory was full, placing kit on the floor -kitTimed=\u00a7cYou can''t use that kit again for another {0}. kits=\u00a77Kits: {0} +kitTimed=\u00a7cYou can''t use that kit again for another {0}. lightningSmited=\u00a77You have just been smited lightningUse=\u00a77Smiting {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +175,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cTo mark your mail as read, type /mail clear mailCleared=\u00a77Mail Cleared! mailSent=\u00a77Mail sent! -markMailAsRead=\u00a7cTo mark your mail as read, type /mail clear markedAsAway=\u00a77You are now marked as away. markedAsNotAway=\u00a77You are no longer marked as away. +markMailAsRead=\u00a7cTo mark your mail as read, type /mail clear maxHomes=You cannot set more than {0} homes. mayNotJail=\u00a7cYou may not jail that person me=me @@ -185,10 +185,10 @@ minute=minute minutes=minutes missingItems=You do not have {0}x {1}. missingPrefixSuffix=Missing a prefix or suffix for {0} +mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Error while changing mob spawner. mobSpawnLimit=Mob quantity limited to server limit mobSpawnTarget=Target block must be a mob spawner. -mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} has been received from {1} moneySentTo=\u00a7a{0} has been sent to {1} moneyTaken={0} taken from your bank account. @@ -196,10 +196,10 @@ month=month months=months moreThanZero=Quantities must be greater than 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} -muteExempt=\u00a7cYou may not mute that player. mutedPlayer=Player {0} muted. mutedPlayerFor=Player {0} muted for {1}. mutedUserSpeaks={0} tried to speak, but is muted. +muteExempt=\u00a7cYou may not mute that player. nearbyPlayers=Players nearby: {0} needTpohere=You need access to /tpohere to teleport other players. negativeBalanceError=User is not allowed to have a negative balance. @@ -221,6 +221,7 @@ noKitPermission=\u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit noKits=\u00a77There are no kits available yet noMail=You do not have any mail noMotd=\u00a7cThere is no message of the day. +none=none noNewMail=\u00a77You have no new mail. noPendingRequest=You do not have a pending request. noPerm=\u00a7cYou do not have the \u00a7f{0}\u00a7c permission. @@ -228,30 +229,21 @@ noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob. noPlacePermission=\u00a7cYou do not have permission to place a block near that sign. noPowerTools=You have no power tools assigned. noRules=\u00a7cThere are no rules specified yet. -noWarpsDefined=No warps defined -none=none notAllowedToQuestion=\u00a7cYou are not authorized to use question. notAllowedToShout=\u00a7cYou are not authorized to shout. notEnoughExperience=You do not have enough experience. notEnoughMoney=You do not have sufficient funds. +nothingInHand = \u00a7cYou have nothing in your hand. notRecommendedBukkit= * ! * Bukkit version is not the recommended build for Essentials. notSupportedYet=Not supported yet. -nothingInHand = \u00a7cYou have nothing in your hand. now=now +noWarpsDefined=No warps defined nuke=May death rain upon them numberRequired=A number goes there, silly. onlyDayNight=/time only supports day/night. onlyPlayers=Only in-game players can use {0}. onlySunStorm=/weather only supports sun/storm. orderBalances=Ordering balances of {0} users, please wait ... -pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. -pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. -pTimePlayers=These players have their own time: -pTimeReset=Player time has been reset for: \u00a7e{0} -pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} -pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} parseError=Error parsing {0} on line {1} pendingTeleportCancelled=\u00a7cPending teleportation request cancelled. permissionsError=Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled. @@ -279,6 +271,14 @@ powerToolRemoveAll=All commands removed from {0}. powerToolsDisabled=All of your power tools have been disabled. powerToolsEnabled=All of your power tools have been enabled. protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0} +pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. +pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. +pTimePlayers=These players have their own time: +pTimeReset=Player time has been reset for: \u00a7e{0} +pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} +pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Question]\u00a7f {0} readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Reloaded all plugins. @@ -301,6 +301,7 @@ seconds=seconds 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} @@ -311,8 +312,8 @@ signProtectInvalidLocation=\u00a74You are not allowed to create sign here. similarWarpExist=A warp with a similar name already exists. slimeMalformedSize=Malformed size. soloMob=That mob likes to be alone -spawnSet=\u00a77Spawn location set for group {0}. spawned=spawned +spawnSet=\u00a77Spawn location set for group {0}. suicideMessage=\u00a77Goodbye Cruel World... suicideSuccess= \u00a77{0} took their own life survival=survival @@ -320,20 +321,20 @@ takenFromAccount=\u00a7c{0} has been taken from your account. takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... +teleportationCommencing=\u00a77Teleportation commencing... +teleportationDisabled=\u00a77Teleportation disabled. +teleportationEnabled=\u00a77Teleportation enabled. teleportAtoB=\u00a77{0}\u00a77 teleported you to {1}\u00a77. teleportDisabled={0} has teleportation disabled. teleportHereRequest=\u00a7c{0}\u00a7c has requested that you teleport to them. +teleporting=\u00a77Teleporting... +teleportingPortal=\u00a77Teleporting via portal. teleportNewPlayerError=Failed to teleport new player teleportRequest=\u00a7c{0}\u00a7c has requested to teleport to you. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teleporting to top. -teleportationCommencing=\u00a77Teleportation commencing... -teleportationDisabled=\u00a77Teleportation disabled. -teleportationEnabled=\u00a77Teleportation enabled. -teleporting=\u00a77Teleporting... -teleportingPortal=\u00a77Teleporting via portal. -tempBanned=Temporarily banned from server for {0} tempbanExempt=\u00a77You may not tempban that player +tempBanned=Temporarily banned from server for {0} thunder= You {0} thunder in your world thunderDuration=You {0} thunder in your world for {1} seconds. timeBeforeHeal=Time before next heal: {0} @@ -364,25 +365,25 @@ unlimitedItemPermission=\u00a7cNo permission for unlimited item {0}. unlimitedItems=Unlimited items: unmutedPlayer=Player {0} unmuted. upgradingFilesError=Error while upgrading the files +userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} +userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp userDoesNotExist=The user {0} does not exist. userIsAway={0} is now AFK userIsNotAway={0} is no longer AFK userJailed=\u00a77You have been jailed userUsedPortal={0} used an existing exit portal. -userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} -userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp usingTempFolderForTesting=Using temp folder for testing: versionMismatch=Version mismatch! Please update {0} to the same version. versionMismatchAll=Version mismatch! Please update all Essentials jars to the same version. voiceSilenced=\u00a77Your voice has been silenced warpDeleteError=Problem deleting the warp file. +warpingTo=\u00a77Warping to {0}. warpListPermission=\u00a7cYou do not have Permission to list warps. warpNotExist=That warp does not exist. -warpSet=\u00a77Warp {0} set. -warpUsePermission=\u00a7cYou do not have Permission to use that warp. -warpingTo=\u00a77Warping to {0}. warps=Warps: {0} warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. +warpSet=\u00a77Warp {0} set. +warpUsePermission=\u00a7cYou do not have Permission to use that warp. weatherStorm=\u00a77You set the weather to storm in {0} weatherStormFor=\u00a77You set the weather to storm in {0} for {1} seconds weatherSun=\u00a77You set the weather to sun in {0} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 03bbe6f78..82145afc1 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -11,11 +11,11 @@ alertPlaced=placerede: alertUsed=brugte: autoAfkKickReason=Du er blevet kicked for at idle mere end {0} minutter. backAfterDeath=\u00a77Brug /back kommandoen for at teleportere til dit d\u00f8dspunkt. -backUsageMsg=\u00a77Teleporterer til tidligere placering. backupFinished=Backup sluttet backupStarted=Backup startet +backUsageMsg=\u00a77Teleporterer til tidligere placering. 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 @@ -64,14 +64,14 @@ depth=\u00a77Du er ved havoverfladen. depthAboveSea=\u00a77Du er {0} blok(ke) over havets overflade. depthBelowSea=\u00a77Du er {0} blok(ke) under havets overflade. destinationNotSet=Destination ikke sat -disableUnlimited=\u00a77Deaktiverede ubergr\u00e6nset placering af {0} for {1}. disabled=deaktiveret disabledToSpawnMob=Skabelse af denne mob er deaktiveret i configfilen. +disableUnlimited=\u00a77Deaktiverede ubergr\u00e6nset placering af {0} for {1}. dontMoveMessage=\u00a77Teleportering vil begynde om {0}. Bev\u00e6g dig ikke. downloadingGeoIp=Downloader GeoIP database... det her kan tage et stykke tid (land: 0.6 MB, by: 27MB) duplicatedUserdata=Duplikerede userdata: {0} og {1} -enableUnlimited=\u00a77Giver ubegr\u00e6nset m\u00e6ngde af {0} til {1}. enabled=aktiveret +enableUnlimited=\u00a77Giver ubegr\u00e6nset m\u00e6ngde af {0} til {1}. enchantmentApplied = \u00a77Enchantment {0} er blevet tilf\u00c3\u00b8jet til tingen i din h\u00c3\u00a5nd. enchantmentNotFound = \u00a7cEnchantment ikke fundet. enchantmentPerm = \u00a7cDu har ikke tilladelse til at {0} @@ -99,9 +99,9 @@ gcentities= entities gcfree=Free memory: {0} MB gcmax=Maximum memory: {0} MB gctotal=Allocated memory: {0} MB +geoipJoinFormat=Spilleren {0} kommer fra {1} geoIpUrlEmpty=GeoIP download url er tom. geoIpUrlInvalid=GeoIP download url er ugyldig. -geoipJoinFormat=Spilleren {0} kommer fra {1} godDisabledFor=deaktiveret for {0} godEnabledFor=aktiveret for {0} godMode=\u00a77Gud mode {0}. @@ -112,9 +112,9 @@ helpConsole=For at se hj\u00e6lp fra konsolen, skriv ?. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f: holeInFloor=Hul i gulv +homes=Hjem: {0} homeSet=\u00a77Hjem sat. homeSetToBed=\u00a77Dit hjem er nu sat til denne seng. -homes=Hjem: {0} hour=time hours=timer ignorePlayer=Du ignorerer spiller {0} fra nu af. @@ -124,28 +124,28 @@ infoChapterPages=Kapitel {0}, side \u00a7c{1}\u00a7f af \u00a7c{2}\u00a7f: infoFileDoesNotExist=Fil info.txt eksisterer ikke. Fixer liiige en for dig. infoPages=Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f: infoUnknownChapter=Ukendt kapitel. -invBigger=Den anden brugers inventory er st\u00f8rre end din. -invRestored=Din inventory er blevet genoprettet. -invSee=Du ser {0}''s inventory. -invSeeHelp=Brug /invsee for at genoprette din inventory. invalidCharge=\u00a7cUgyldig opladning (korrekt oversat?). invalidMob=Ugyldig mob type. invalidServer=Ugyldig server! invalidSignLine=Linje {0} p\u00e5 skilt er ugyldig. invalidWorld=\u00a7cUgyldig verden. +invBigger=Den anden brugers inventory er st\u00f8rre end din. inventoryCleared=\u00a77Inventory ryddet. inventoryClearedOthers=\u00a7c{0}\u00a77''s inventory ryddet. +invRestored=Din inventory er blevet genoprettet. +invSee=Du ser {0}''s inventory. +invSeeHelp=Brug /invsee for at genoprette din inventory. is=er itemCannotBeSold=Denne ting kan ikke s\u00e6lges til serveren. itemMustBeStacked=Tingen skal handles i stakke. En m\u00e6ngde af 2s ville v\u00e6re to stakke, osv. itemNotEnough1=\u00a7cDu har ikke nok af denne ting til at kunne s\u00e6lge. itemNotEnough2=\u00a77Hvis du mente, at du ville s\u00c3\u00a6lge alle ting af den type, brug da /sell tingens-navn itemNotEnough3=\u00a77/sell ting-navn -1 vil s\u00e6lge alle enheder, undtagen \u00c3\u00a9n, osv. +itemsCsvNotLoaded=Kunne ikke loade items.csv. itemSellAir=Fors\u00f8gte du virkelig at s\u00e6lge luft? Kom en ting i h\u00e5nden, hattemand. itemSold=\u00a77Solgte til \u00a7c{0} \u00a77({1} {2} ting for {3} pr. stk.) itemSoldConsole={0} solgte {1} til \u00a77{2} \u00a77({3} ting for {4} pr. stk.) itemSpawn=\u00a77Giver {0} af {1} -itemsCsvNotLoaded=Kunne ikke loade items.csv. jailAlreadyIncarcerated=\u00a7cSpilleren er allerede i f\u00c3\u00a6ngsel: {0} jailMessage=\u00a7cDu bryder reglerne, du tager straffen. jailNotExist=Det f\u00e6ngsel eksisterer ikke. @@ -162,8 +162,8 @@ kitError=\u00a7cDer er ikke nogen gyldige kits. kitErrorHelp=\u00a7cM\u00e5ske mangler en ting en m\u00e6ngde i konfigurationen? Eller m\u00c3\u00a5ske er der nisser p\u00c3\u00a5 spil? kitGive=\u00a77Giver kit til {0} (oversat korrekt?). kitInvFull=\u00a7cDin inventory er fuld, placerer kit p\u00e5 gulvet. -kitTimed=\u00a7cDu kan ikke benytte dette kit igen i {0}. kits=\u00a77Kits: {0} +kitTimed=\u00a7cDu kan ikke benytte dette kit igen i {0}. lightningSmited=\u00a77Du er blevet ramt af Guds vrede (din admin) lightningUse=\u00a77Kaster lyn efter {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +175,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cFor at markere din flaskepost som l\u00e6st, skriv /mail clear mailCleared=\u00a77Flaskepot ryddet! mailSent=\u00a77Flaskepot sendt! -markMailAsRead=\u00a7cFor at markere din flaskepost som l\u00e6st, skriv /mail clear markedAsAway=\u00a77Du er nu markeret som v\u00c3\u00a6rende ikke tilstede. markedAsNotAway=\u00a77Du er ikke l\u00e6ngere markeret som v\u00c3\u00a6rende ikke tilstede. +markMailAsRead=\u00a7cFor at markere din flaskepost som l\u00e6st, skriv /mail clear maxHomes=Du kan ikke have mere end {0} hjem. mayNotJail=\u00a7cDu kan ikke smide denne person i f\u00c3\u00a6ngsel. me=mig @@ -185,10 +185,10 @@ minute=minut minutes=minutter missingItems=Du har ikke {0}x {1}. missingPrefixSuffix=Mangler et pr\u00e6fiks eller suffiks for {0} +mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Fejl ved \u00e6ndring af mob spawner. mobSpawnLimit=Mob m\u00e6ngde begr\u00e6nset til serverens fastsatte gr\u00e6nse. mobSpawnTarget=M\u00e5l blok skal v\u00e6re en mob spawner. -mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} er modtaget fra {1} moneySentTo=\u00a7a{0} er sendt til {1} moneyTaken={0} blev taget fra din bankkonto. @@ -196,10 +196,10 @@ month=m\u00e5nede months=m\u00e5neder moreThanZero=M\u00e6ngder skal v\u00e6re st\u00f8rre end 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} -muteExempt=\u00a7cDu kan ikke mute denne spiller. mutedPlayer=Spiller {0} muted. mutedPlayerFor=Spiller {0} muted i {1}. mutedUserSpeaks={0} pr\u00f8vede at snakke, men er muted. +muteExempt=\u00a7cDu kan ikke mute denne spiller. nearbyPlayers=Spillere i n\u00c3\u00a6rheden: {0} needTpohere=Du skal have adgang til /tpohere for at teleportere andre spillere. negativeBalanceError=Brugeren har ikke tilladelse til at have en negativ saldo. @@ -221,6 +221,7 @@ noKitPermission=\u00a7cDu har brug for \u00a7c{0}\u00a7c permission for at bruge noKits=\u00a77Der er ikke nogen kits tilg\u00e6ngelige endnu noMail=Du har ikke noget flaskepost. noMotd=\u00a7cDer er ingen Message of the day. +none=ingen noNewMail=\u00a77Du har ingen ny flaskepost. noPendingRequest=Du har ikke en ventende anmodning. noPerm=\u00a7cDu har ikke \u00a7f{0}\u00a7c permission. @@ -228,30 +229,21 @@ noPermToSpawnMob=\u00a7cDu har ikke tilladelse til at spawne denne mob. noPlacePermission=\u00a7cDu har ikke tiladelse til at placere en block n\u00c3\u00a6r det skilt. noPowerTools= Du har ingen power tools tilf\u00c3\u00b8jet. noRules=\u00a7cDer er ingen regler endnu. ANARKI! -noWarpsDefined=Ingen warps er defineret -none=ingen notAllowedToQuestion=\u00a7cDu har ikke tilladelse til at bruge sp\u00f8rgsm\u00e5l. notAllowedToShout=\u00a7cDu har ikke tilladelse til at r\u00e5be. notEnoughExperience=You do not have enough experience. notEnoughMoney=Du har ikke tilstr\u00e6kkeligt med penge. +nothingInHand = \u00a7cDu har intet i din h\u00c3\u00a5nd. notRecommendedBukkit=* ! * Bukkit version er ikke den anbefalede build til Essentials. notSupportedYet=Ikke underst\u00f8ttet endnu. -nothingInHand = \u00a7cDu har intet i din h\u00c3\u00a5nd. now=nu +noWarpsDefined=Ingen warps er defineret nuke=May death rain upon them numberRequired=Et nummer skal v\u00e6re, din tardo. onlyDayNight=/time underst\u00f8tter kun day/night. onlyPlayers=Kun in-game spillere kan bruge {0}. onlySunStorm=/weather underst\u00c3\u00b8tter kun sun/storm. orderBalances=Tjekker saldoer af {0} spillere, vent venligst... -pTimeCurrent=\u00a7e{0}''s\u00a7f Tiden er {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f Tiden er fastsat til {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f Tiden er normal og matcher serveren. -pTimeOthersPermission=\u00a7cDu har ikke tilladelse til at \u00c3\u00a6ndre andre spilleres tid. -pTimePlayers=Disse spillere har deres egen tid: -pTimeReset=Spiler-tid er blevet nulstillet for: \u00a7e{0} (oversat korrekt?) -pTimeSet=Spiller-tid er blevet sat til \u00a73{0}\u00a7f for: \u00a7e{1} (oversat korrekt?) -pTimeSetFixed=Spiller-tid er fastsat til \u00a73{0}\u00a7f for: \u00a7e{1} parseError=Fejl ved parsing af {0} p\u00e5 linje {1} pendingTeleportCancelled=\u00a7cAnmodning om teleport er blevet afvist. permissionsError=Mangler Permissions/GroupManager; chat pr\u00e6fikser/suffikser vil v\u00e6re deaktiveret. @@ -279,6 +271,14 @@ powerToolRemoveAll=Alle kommandoer fjernet fra {0}. powerToolsDisabled= Alle dine power tools er blevet deaktiveret. powerToolsEnabled= Alle dine power tools er blevet aktiveret. protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0} +pTimeCurrent=\u00a7e{0}''s\u00a7f Tiden er {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f Tiden er fastsat til {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f Tiden er normal og matcher serveren. +pTimeOthersPermission=\u00a7cDu har ikke tilladelse til at \u00c3\u00a6ndre andre spilleres tid. +pTimePlayers=Disse spillere har deres egen tid: +pTimeReset=Spiler-tid er blevet nulstillet for: \u00a7e{0} (oversat korrekt?) +pTimeSet=Spiller-tid er blevet sat til \u00a73{0}\u00a7f for: \u00a7e{1} (oversat korrekt?) +pTimeSetFixed=Spiller-tid er fastsat til \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Sp\u00f8rgsm\u00e5l]\u00a7f {0} readNextPage=Skriv /{0} {1} for at l\u00c3\u00a6se n\u00c3\u00a6ste side. reloadAllPlugins=\u00a77Reload alle plugins. @@ -301,6 +301,7 @@ seconds=sekunder seenOffline=Spilleren {0} har v\u00c3\u00a6ret offline i {1} seenOnline=Spilleren {0} har v\u00c3\u00a6ret online i {1} serverFull=Serveren er sgu fuld. Den b\u00c3\u00b8r melde sig til AA. +serverTotal=Server Total: {0} setSpawner=\u00c3\u0086ndrede spawner type til {0} sheepMalformedColor=Forkert farve. (Korrekt oversat?) shoutFormat=\u00a77[Shout]\u00a7f {0} @@ -311,8 +312,8 @@ signProtectInvalidLocation=\u00a74Du har ikke tilladelse til at lave et skilt he similarWarpExist=En warp med dette navn eksisterer allerede. slimeMalformedSize=Forkert st\u00f8rrelse. (Korrekt oversat?) soloMob=Denne mob kan godt lide at v\u00e6re alene. Den hygger sig. -spawnSet=\u00a77Spawnplacering fastsat for gruppe: {0}. spawned=spawnet +spawnSet=\u00a77Spawnplacering fastsat for gruppe: {0}. suicideMessage=\u00a77Farvel grusomme verden... suicideSuccess= \u00a77{0} tog sit eget liv survival=survival @@ -320,20 +321,20 @@ takenFromAccount=\u00a7c{0} er blevet taget fra din konto. takenFromOthersAccount=\u00a7c{0} er blevet taget fra {1}''s konto. teleportAAll=\u00a77Anmodning om teleport er sendt til alle spillere. teleportAll=\u00a77Teleporterer alle spillere... +teleportationCommencing=\u00a77Teleport begynder... +teleportationDisabled=\u00a77Teleport deaktiveret. +teleportationEnabled=\u00a77Teleport aktiveret. teleportAtoB=\u00a77{0}\u00a77 teleporterede dig til {1}\u00a77. teleportDisabled={0} har ikke teleportation aktiveret. teleportHereRequest=\u00a7c{0}\u00a7c har anmodet om, at du teleporterer dig til ham/hende. +teleporting=\u00a77Teleporterer... +teleportingPortal=\u00a77Teleporterede via portal. teleportNewPlayerError=Fejlede ved teleportering af ny spiller teleportRequest=\u00a7c{0}\u00a7c har anmodet om at teleportere til dig. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teleporterer til toppen. -teleportationCommencing=\u00a77Teleport begynder... -teleportationDisabled=\u00a77Teleport deaktiveret. -teleportationEnabled=\u00a77Teleport aktiveret. -teleporting=\u00a77Teleporterer... -teleportingPortal=\u00a77Teleporterede via portal. -tempBanned=Midlertidigt bannet fra serveren for {0} tempbanExempt=\u00a77Du m\u00c3\u00a5 ikke tempbanne denne spiller! Slemme, slemme du! +tempBanned=Midlertidigt bannet fra serveren for {0} thunder= Du har nu {0} torden i din verden thunderDuration=Du har nu {0} torden i din verden i {1} sekunder. timeBeforeHeal=Tid f\u00c3\u00b8r du kan heale igen: {0} @@ -364,25 +365,25 @@ unlimitedItemPermission=\u00a7cIngen tilladelse til ubegr\u00e6nset ting {0}. unlimitedItems=Ubegr\u00c3\u00a6nsede ting: unmutedPlayer=Spilleren {0} unmuted. upgradingFilesError=Fejl under opgradering af filerne. +userdataMoveBackError=Kunne ikke flytte userdata/{0}.tmp til userdata/{1} +userdataMoveError=Kunne ikke flytte userdata/{0} til userdata/{1}.tmp userDoesNotExist=Brugeren {0} eksisterer ikke. userIsAway={0} er nu AFK. Skub ham i havet eller bur ham inde! userIsNotAway={0} er ikke l\u00e6ngere AFK. userJailed=\u00a77Du er blevet f\u00e6ngslet. userUsedPortal={0} brugte en eksisterende udgangsportal. -userdataMoveBackError=Kunne ikke flytte userdata/{0}.tmp til userdata/{1} -userdataMoveError=Kunne ikke flytte userdata/{0} til userdata/{1}.tmp usingTempFolderForTesting=Bruger temp-mappe til testing: versionMismatch=Versioner matcher ikke! Opdater venligst {0} til den nyeste version. versionMismatchAll=Versioner matcher ikke! Opdater venligst alle Essentials jar-filer til samme version. voiceSilenced=\u00a77Din stemme er blevet gjort stille. warpDeleteError=Ah, shit; kunne sgu ikke fjerne warp-filen. Jeg giver en \u00c3\u00b8l i lufthavnen. +warpingTo=\u00a77Warper til {0}. warpListPermission=\u00a7cDu har ikke tilladelse til at vise listen over warps. warpNotExist=Den warp eksisterer ikke. -warpSet=\u00a77Warp {0} sat. -warpUsePermission=\u00a7cDu har ikke tilladelse til at benytte den warp. -warpingTo=\u00a77Warper til {0}. warps=Warps: {0} warpsCount=\u00a77Der er {0} warps. Viser side {1} af {2}. +warpSet=\u00a77Warp {0} sat. +warpUsePermission=\u00a7cDu har ikke tilladelse til at benytte den warp. weatherStorm=\u00a77Du har sat vejret til ''storm'' i {0} weatherStormFor=\u00a77Du har sat vejret til ''storm'' i {0} i {1} sekunder weatherSun=\u00a77Du har sat vejret til ''sol'' i {0} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index edffe33ac..2572f7cf2 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -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 @@ -301,6 +301,7 @@ seconds=Sekunden 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} diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index b03a49812..a2acdf9a2 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -11,11 +11,11 @@ alertPlaced=placed: alertUsed=used: autoAfkKickReason=You have been kicked for idling more than {0} minutes. backAfterDeath=\u00a77Use the /back command to return to your death point. -backUsageMsg=\u00a77Returning to previous location. backupFinished=Backup finished backupStarted=Backup started +backUsageMsg=\u00a77Returning to previous location. balance=\u00a77Balance: {0} -balanceTop=\u00a77 Top balances ({0}) +balanceTop=\u00a77Top balances ({0}) banExempt=\u00a7cYou can not ban that player. banIpAddress=\u00a77Banned IP address bannedIpsFileError=Error reading banned-ips.txt @@ -64,14 +64,14 @@ depth=\u00a77You are at sea level. depthAboveSea=\u00a77You are {0} block(s) above sea level. depthBelowSea=\u00a77You are {0} block(s) below sea level. destinationNotSet=Destination not set -disableUnlimited=\u00a77Disabled unlimited placing of {0} for {1}. disabled=disabled disabledToSpawnMob=Spawning this mob was disabled in the config file. +disableUnlimited=\u00a77Disabled unlimited placing of {0} for {1}. dontMoveMessage=\u00a77Teleportation will commence in {0}. Don''t move. downloadingGeoIp=Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB) duplicatedUserdata=Duplicated userdata: {0} and {1} -enableUnlimited=\u00a77Giving unlimited amount of {0} to {1}. enabled=enabled +enableUnlimited=\u00a77Giving unlimited amount of {0} to {1}. enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand. enchantmentNotFound = \u00a7cEnchantment not found enchantmentPerm = \u00a7cYou do not have the permission for {0} @@ -99,9 +99,9 @@ gcentities= entities gcfree=Free memory: {0} MB gcmax=Maximum memory: {0} MB gctotal=Allocated memory: {0} MB +geoipJoinFormat=Player {0} comes from {1} geoIpUrlEmpty=GeoIP download url is empty. geoIpUrlInvalid=GeoIP download url is invalid. -geoipJoinFormat=Player {0} comes from {1} godDisabledFor=disabled for {0} godEnabledFor=enabled for {0} godMode=\u00a77God mode {0}. @@ -112,9 +112,9 @@ helpConsole=To view help from the console, type ?. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: holeInFloor=Hole in floor +homes=Homes: {0} homeSet=\u00a77Home set. homeSetToBed=\u00a77Your home is now set to this bed. -homes=Homes: {0} hour=hour hours=hours ignorePlayer=You ignore player {0} from now on. @@ -124,28 +124,28 @@ infoChapterPages=Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f: infoFileDoesNotExist=File info.txt does not exist. Creating one for you. infoPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: infoUnknownChapter=Unknown chapter. -invBigger=The other users inventory is bigger than yours. -invRestored=Your inventory has been restored. -invSee=You see the inventory of {0}. -invSeeHelp=Use /invsee to restore your inventory. invalidCharge=\u00a7cInvalid charge. invalidMob=Invalid mob type. invalidServer=Invalid server! invalidSignLine=Line {0} on sign is invalid. invalidWorld=\u00a7cInvalid world. +invBigger=The other users inventory is bigger than yours. inventoryCleared=\u00a77Inventory Cleared. inventoryClearedOthers=\u00a77Inventory of \u00a7c{0}\u00a77 cleared. +invRestored=Your inventory has been restored. +invSee=You see the inventory of {0}. +invSeeHelp=Use /invsee to restore your inventory. is=is itemCannotBeSold=That item cannot be sold to the server. itemMustBeStacked=Item must be traded in stacks. A quantity of 2s would be two stacks, etc. itemNotEnough1=\u00a7cYou do not have enough of that item to sell. itemNotEnough2=\u00a77If you meant to sell all of your items of that type, use /sell itemname itemNotEnough3=\u00a77/sell itemname -1 will sell all but one item, etc. +itemsCsvNotLoaded=Could not load items.csv. itemSellAir=You really tried to sell Air? Put an item in your hand. itemSold=\u00a77Sold for \u00a7c{0} \u00a77({1} {2} at {3} each) itemSoldConsole={0} sold {1} for \u00a77{2} \u00a77({3} items at {4} each) itemSpawn=\u00a77Giving {0} of {1} -itemsCsvNotLoaded=Could not load items.csv. jailAlreadyIncarcerated=\u00a7cPerson is already in jail: {0} jailMessage=\u00a7cYou do the crime, you do the time. jailNotExist=That jail does not exist. @@ -162,8 +162,8 @@ kitError=\u00a7cThere are no valid kits. kitErrorHelp=\u00a7cPerhaps an item is missing a quantity in the configuration? kitGive=\u00a77Giving kit {0}. kitInvFull=\u00a7cYour inventory was full, placing kit on the floor -kitTimed=\u00a7cYou can''t use that kit again for another {0}. kits=\u00a77Kits: {0} +kitTimed=\u00a7cYou can''t use that kit again for another {0}. lightningSmited=\u00a77You have just been smited lightningUse=\u00a77Smiting {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +175,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cTo mark your mail as read, type /mail clear mailCleared=\u00a77Mail Cleared! mailSent=\u00a77Mail sent! -markMailAsRead=\u00a7cTo mark your mail as read, type /mail clear markedAsAway=\u00a77You are now marked as away. markedAsNotAway=\u00a77You are no longer marked as away. +markMailAsRead=\u00a7cTo mark your mail as read, type /mail clear maxHomes=You cannot set more than {0} homes. mayNotJail=\u00a7cYou may not jail that person me=me @@ -185,10 +185,10 @@ minute=minute minutes=minutes missingItems=You do not have {0}x {1}. missingPrefixSuffix=Missing a prefix or suffix for {0} +mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Error while changing mob spawner. mobSpawnLimit=Mob quantity limited to server limit mobSpawnTarget=Target block must be a mob spawner. -mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} has been received from {1} moneySentTo=\u00a7a{0} has been sent to {1} moneyTaken={0} taken from your bank account. @@ -196,10 +196,10 @@ month=month months=months moreThanZero=Quantities must be greater than 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} -muteExempt=\u00a7cYou may not mute that player. mutedPlayer=Player {0} muted. mutedPlayerFor=Player {0} muted for {1}. mutedUserSpeaks={0} tried to speak, but is muted. +muteExempt=\u00a7cYou may not mute that player. nearbyPlayers=Players nearby: {0} needTpohere=You need access to /tpohere to teleport other players. negativeBalanceError=User is not allowed to have a negative balance. @@ -221,6 +221,7 @@ noKitPermission=\u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit noKits=\u00a77There are no kits available yet noMail=You do not have any mail noMotd=\u00a7cThere is no message of the day. +none=none noNewMail=\u00a77You have no new mail. noPendingRequest=You do not have a pending request. noPerm=\u00a7cYou do not have the \u00a7f{0}\u00a7c permission. @@ -228,30 +229,21 @@ noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob. noPlacePermission=\u00a7cYou do not have permission to place a block near that sign. noPowerTools=You have no power tools assigned. noRules=\u00a7cThere are no rules specified yet. -noWarpsDefined=No warps defined -none=none notAllowedToQuestion=\u00a7cYou are not authorized to use question. notAllowedToShout=\u00a7cYou are not authorized to shout. notEnoughExperience=You do not have enough experience. notEnoughMoney=You do not have sufficient funds. +nothingInHand = \u00a7cYou have nothing in your hand. notRecommendedBukkit=* ! * Bukkit version is not the recommended build for Essentials. notSupportedYet=Not supported yet. -nothingInHand = \u00a7cYou have nothing in your hand. now=now +noWarpsDefined=No warps defined nuke=May death rain upon them numberRequired=A number goes there, silly. onlyDayNight=/time only supports day/night. onlyPlayers=Only in-game players can use {0}. onlySunStorm=/weather only supports sun/storm. orderBalances=Ordering balances of {0} users, please wait ... -pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. -pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. -pTimePlayers=These players have their own time: -pTimeReset=Player time has been reset for: \u00a7e{0} -pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} -pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} parseError=Error parsing {0} on line {1} pendingTeleportCancelled=\u00a7cPending teleportation request cancelled. permissionsError=Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled. @@ -279,6 +271,14 @@ powerToolRemoveAll=All commands removed from {0}. powerToolsDisabled=All of your power tools have been enabled. powerToolsEnabled=All of your power tools have been enabled. protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0} +pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. +pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. +pTimePlayers=These players have their own time: +pTimeReset=Player time has been reset for: \u00a7e{0} +pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} +pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Question]\u00a7f {0} readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Reloaded all plugins. @@ -301,6 +301,7 @@ seconds=seconds 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} @@ -311,8 +312,8 @@ signProtectInvalidLocation=\u00a74You are not allowed to create sign here. similarWarpExist=A warp with a similar name already exists. slimeMalformedSize=Malformed size. soloMob=That mob likes to be alone -spawnSet=\u00a77Spawn location set for group {0}. spawned=spawned +spawnSet=\u00a77Spawn location set for group {0}. suicideMessage=\u00a77Goodbye Cruel World... suicideSuccess= \u00a77{0} took their own life survival=survival @@ -320,20 +321,20 @@ takenFromAccount=\u00a7c{0} has been taken from your account. takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... +teleportationCommencing=\u00a77Teleportation commencing... +teleportationDisabled=\u00a77Teleportation disabled. +teleportationEnabled=\u00a77Teleportation enabled. teleportAtoB=\u00a77{0}\u00a77 teleported you to {1}\u00a77. teleportDisabled={0} has teleportation disabled. teleportHereRequest=\u00a7c{0}\u00a7c has requested that you teleport to them. +teleporting=\u00a77Teleporting... +teleportingPortal=\u00a77Teleporting via portal. teleportNewPlayerError=Failed to teleport new player teleportRequest=\u00a7c{0}\u00a7c has requested to teleport to you. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teleporting to top. -teleportationCommencing=\u00a77Teleportation commencing... -teleportationDisabled=\u00a77Teleportation disabled. -teleportationEnabled=\u00a77Teleportation enabled. -teleporting=\u00a77Teleporting... -teleportingPortal=\u00a77Teleporting via portal. -tempBanned=Temporarily banned from server for {0} tempbanExempt=\u00a77You may not tempban that player +tempBanned=Temporarily banned from server for {0} thunder= You {0} thunder in your world thunderDuration=You {0} thunder in your world for {1} seconds. timeBeforeHeal=Time before next heal: {0} @@ -364,25 +365,25 @@ unlimitedItemPermission=\u00a7cNo permission for unlimited item {0}. unlimitedItems=Unlimited items: unmutedPlayer=Player {0} unmuted. upgradingFilesError=Error while upgrading the files +userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} +userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp userDoesNotExist=The user {0} does not exist. userIsAway={0} is now AFK userIsNotAway={0} is no longer AFK userJailed=\u00a77You have been jailed userUsedPortal={0} used an existing exit portal. -userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} -userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp usingTempFolderForTesting=Using temp folder for testing: versionMismatch=Version mismatch! Please update {0} to the same version. versionMismatchAll=Version mismatch! Please update all Essentials jars to the same version. voiceSilenced=\u00a77Your voice has been silenced warpDeleteError=Problem deleting the warp file. +warpingTo=\u00a77Warping to {0}. warpListPermission=\u00a7cYou do not have Permission to list that warps. warpNotExist=That warp does not exist. -warpSet=\u00a77Warp {0} set. -warpUsePermission=\u00a7cYou do not have Permission to use that warp. -warpingTo=\u00a77Warping to {0}. warps=Warps: {0} warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. +warpSet=\u00a77Warp {0} set. +warpUsePermission=\u00a7cYou do not have Permission to use that warp. weatherStorm=\u00a77You set the weather to storm in {0} weatherStormFor=\u00a77You set the weather to storm in {0} for {1} seconds weatherSun=\u00a77You set the weather to sun in {0} diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 4f3da7738..38d62f6c4 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -11,9 +11,9 @@ alertPlaced=situado: alertUsed=usado: autoAfkKickReason=Has sido echado por ausentarte mas de {0} minutos. backAfterDeath=\u00a77Usa el comando /back para volver al punto en el que moriste. -backUsageMsg=\u00a77Volviendo a la localizacion anterior. backupFinished=Copia de seguridad completada backupStarted=Comenzando copia de seguridad +backUsageMsg=\u00a77Volviendo a la localizacion anterior. balance=\u00a77Cantidad: {0} balanceTop=\u00a77Top cantidades ({0}) banExempt=\u00a7cNo puedes banear a ese jugador @@ -64,14 +64,14 @@ depth=\u00a77Estas al nivel del mar. depthAboveSea=\u00a77Estas {0} bloque(s) por encima del mar. depthBelowSea=\u00a77Estas {0} bloque(s) por debajo del mar. destinationNotSet=Destino no establecido. -disableUnlimited=\u00a77Desactivando colocacion ilimitada de {0} para {1}. disabled=desactivado disabledToSpawnMob=Spawning this mob was disabled in the config file. +disableUnlimited=\u00a77Desactivando colocacion ilimitada de {0} para {1}. dontMoveMessage=\u00a77Teletransporte comenzara en {0}. No te muevas. downloadingGeoIp=Descargando base de datos de GeoIP ... puede llevar un tiempo (pais: 0.6 MB, ciudad: 20MB) duplicatedUserdata=Datos de usuario duplicados: {0} y {1} -enableUnlimited=\u00a77Dando cantidad ilimitada de {0} a {1}. enabled=activado +enableUnlimited=\u00a77Dando cantidad ilimitada de {0} a {1}. enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand. enchantmentNotFound = \u00a7cEnchantment not found enchantmentPerm = \u00a7cYou do not have the permission for {0} @@ -99,9 +99,9 @@ gcentities= entidades gcfree=Memoria libre: {0} MB gcmax=Memoria maxima: {0} MB gctotal=Memoria localizada: {0} MB +geoipJoinFormat=El jugador {0} viene de {1} geoIpUrlEmpty=Link para descargar GeoIP esta vacio. geoIpUrlInvalid=Link para descargar GeoIP es invalido. -geoipJoinFormat=El jugador {0} viene de {1} godDisabledFor=Desactivado para {0} godEnabledFor=Activado para {0} godMode=\u00a77Modo Dios {0}. @@ -112,9 +112,9 @@ helpConsole=Para obtener ayuda de la consola, escribe ?. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Pagina \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f: holeInFloor=Agujero en el suelo +homes=Hogares: {0} homeSet=\u00a77Hogar establecido. homeSetToBed=\u00a77Tu hogar esta ahora establecido a esta cama. -homes=Hogares: {0} hour=hora hours=horas ignorePlayer=A partir de ahora ignoras al jugador {0}. @@ -124,28 +124,28 @@ infoChapterPages=Seccion {0}, pagina \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f: infoFileDoesNotExist=El archivo info.txt no existe. Creando uno para ti. infoPages=Pagina \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f: infoUnknownChapter=Seccion desconocida. -invBigger=El inventario del otro usuario es mas grande que el tuyo -invRestored=Tu inventario ha sido recuperado. -invSee=Estas viendo el inventario de {0}. -invSeeHelp=Usa /invsee para recuperar tu inventario. invalidCharge=\u00a7cCargo invalido. invalidMob=Mob invalido. invalidServer=Servidor invalido! invalidSignLine=Linea {0} en el signo es invalida. invalidWorld=\u00a7cMundo invalido. +invBigger=El inventario del otro usuario es mas grande que el tuyo inventoryCleared=\u00a77Inventario limpiado. inventoryClearedOthers=\u00a77Inventario de \u00a7c{0}\u00a77 limpiado. +invRestored=Tu inventario ha sido recuperado. +invSee=Estas viendo el inventario de {0}. +invSeeHelp=Usa /invsee para recuperar tu inventario. is=es itemCannotBeSold=Ese objeto no puede ser vendido al servidor. itemMustBeStacked=El objeto tiene que ser intercambiado en pilas. Una cantidad de 2s seria de dos pilas, etc. itemNotEnough1=\u00a7cNo tienes suficientes ejemplares de ese objeto para venderlo. itemNotEnough2=\u00a77Si pensabas en vender todos tus objetos de ese tipo, usa /sell nombredeobjeto itemNotEnough3=\u00a77/sell nombredeobjeto -1 vendera todos excepto un objeto, etc. +itemsCsvNotLoaded=Error al leer items.csv. itemSellAir=Realmente has intentado vender Aire? Pon un objeto en tu mano! itemSold=\u00a77Vendido para \u00a7c {0} \u00a77 ({1} {2} a {3} cada uno) itemSoldConsole={0} Vendido {1} para\u00a77 {2} \u00a77({3} objetos a {4} cada uno) itemSpawn=\u00a77Dando {0} de {1} -itemsCsvNotLoaded=Error al leer items.csv. jailAlreadyIncarcerated=\u00a7cLa persona ya esta en la carcel: {0} jailMessage=\u00a7cPor hacer el mal, tiempo en la carcel estaras. jailNotExist=Esa carcel no existe. @@ -162,8 +162,8 @@ kitError=\u00a7cNo hay ningun kit valido. kitErrorHelp=\u00a7cPerhaps an item is missing a quantity in the configuration? kitGive=\u00a77Dando kit a {0}. kitInvFull=\u00a7cTu inventario esta lleno, su kit se pondra en el suelo -kitTimed=\u00a7c No puedes usar ese kit de nuevo para otro{0}. kits=\u00a77Kits: {0} +kitTimed=\u00a7c No puedes usar ese kit de nuevo para otro{0}. lightningSmited=\u00a77Acabas de ser golpeado lightningUse=\u00a77Golpeando a {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +175,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cPara marcar tu email como leido, escribe /mail clear mailCleared=\u00a77Email limpiado! mailSent=\u00a77Email enviado!! -markMailAsRead=\u00a7cPara marcar tu email como leido, escribe /mail clear markedAsAway=\u00a77Has sido puesto como AFK. markedAsNotAway=\u00a77Ya no estas AFK. +markMailAsRead=\u00a7cPara marcar tu email como leido, escribe /mail clear maxHomes=No puedes establecer mas de {0} hogares. mayNotJail=\u00a7cNo puedes encarcelar a esa persona me=yo @@ -185,10 +185,10 @@ minute=minuto minutes=minutos missingItems=No tienes {0}x de {1}. missingPrefixSuffix=Falta un prefijo o un sufijo para {0} +mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Error al cambiar la localizacion para el nacimiento de los mobs. mobSpawnLimit=Cantidad de Mobs limitados al limite del server mobSpawnTarget=El block seleccionado sera el lugar donde van a nacer los mobs. -mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} ha sido recivido de {1} moneySentTo=\u00a7a{0} ha sido enviado a {1} moneyTaken={0} han sido sacados de tu cuenta bancaria. @@ -196,10 +196,10 @@ month=mes months=meses moreThanZero=Las cantidades han de ser mayores que 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} -muteExempt=\u00a7cNo puedes silenciar a ese jugador. mutedPlayer=Player {0} silenciado. mutedPlayerFor=Player {0} silenciado durante {1}. mutedUserSpeaks={0} intento hablar, pero esta silenciado. +muteExempt=\u00a7cNo puedes silenciar a ese jugador. nearbyPlayers=Players nearby: {0} needTpohere=Necesitas acceso a /tpohere para teletransportar a otros jugadores. negativeBalanceError=El usuario no tiene permitido tener un saldo negativo. @@ -221,6 +221,7 @@ noKitPermission=\u00a7cNecesitas los \u00a7c{0}\u00a7c permisos para usar ese ki noKits=\u00a77No hay kits disponibles todavia noMail=No tienes ningun email recivido noMotd=\u00a7cNo hay ningun mensaje del dia. +none=ninguno noNewMail=\u00a77No tienes ningun correo nuevo. noPendingRequest=No tienes ninguna peticion pendiente. noPerm=\u00a7cNo tienes el permiso de \u00a7f{0}\u00a7c. @@ -228,30 +229,21 @@ noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob. noPlacePermission=\u00a7cNo tienes permiso para situar ese bloque en ese lugar. noPowerTools=You have no power tools assigned. noRules=\u00a7cNo hay reglas especificadas todavia. -noWarpsDefined=No hay teletransportes definidos aun -none=ninguno notAllowedToQuestion=\u00a7cYou estas autorizado para usar las preguntas. notAllowedToShout=\u00a7cNo estas autorizado para gritar. notEnoughExperience=You do not have enough experience. notEnoughMoney=No tienes el dinero suficiente. +nothingInHand = \u00a7cYou have nothing in your hand. notRecommendedBukkit=* ! * La version de bukkit no es la recomendada para esta version de Essentials. notSupportedYet=No esta soportado aun. -nothingInHand = \u00a7cYou have nothing in your hand. now=ahora +noWarpsDefined=No hay teletransportes definidos aun nuke=May death rain upon them numberRequired=Un numero es necesario, amigo. onlyDayNight=/time solo soporta day/night. (dia/noche) onlyPlayers=Solo los jugadores conectados pueden usar {0}. onlySunStorm=/weather solo soporta sun/storm. (sol/tormenta) orderBalances=Ordering balances of {0} users, please wait ... -pTimeCurrent=\u00a7e{0}''s\u00a7f la hora es {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f la hora ha sido cambiada a {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f el tiempo es normal y coincide con el servidor. -pTimeOthersPermission=\u00a7cNo estas autorizado para especificar'' la hora de otros usuarios. -pTimePlayers=Estos usuarios tienen su propia hora: -pTimeReset=La hora del usuario ha sido reiniciada a las: \u00a7e{0} -pTimeSet=La hora del jugador ha sido cambiada para las: \u00a73{0}\u00a7f for: \u00a7e{1} -pTimeSetFixed=La hora del jugador ha sido arreglada para las: \u00a73{0}\u00a7f for: \u00a7e{1} parseError=error analizando {0} en la linea {1} pendingTeleportCancelled=\u00a7cPeticion de teletransporte pendiente cancelado. permissionsError=Falta el plugin Permissions/GroupManager; Los prefijos/sufijos de chat seran desactivados. @@ -279,6 +271,14 @@ powerToolRemoveAll=Todos los comandos borrados desde {0}. powerToolsDisabled=All of your power tools have been disabled. powerToolsEnabled=All of your power tools have been enabled. protectionOwner=\u00a76[EssentialsProtect] Dueño de la proteccion: {0} +pTimeCurrent=\u00a7e{0}''s\u00a7f la hora es {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f la hora ha sido cambiada a {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f el tiempo es normal y coincide con el servidor. +pTimeOthersPermission=\u00a7cNo estas autorizado para especificar'' la hora de otros usuarios. +pTimePlayers=Estos usuarios tienen su propia hora: +pTimeReset=La hora del usuario ha sido reiniciada a las: \u00a7e{0} +pTimeSet=La hora del jugador ha sido cambiada para las: \u00a73{0}\u00a7f for: \u00a7e{1} +pTimeSetFixed=La hora del jugador ha sido arreglada para las: \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Pregunta]\u00a7f {0} readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Todos los plugins recargados. @@ -301,6 +301,7 @@ seconds=segundos 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} @@ -311,8 +312,8 @@ signProtectInvalidLocation=\u00a74No puedes poner carteles en ese sitio. similarWarpExist=Ya existe un teletransporte con ese nombre. slimeMalformedSize=Medidas malformadas. soloMob=A este mob le gusta estar solo -spawnSet=\u00a77El lugar de nacimiento ha sido puesto para el grupo {0}. spawned=nacido +spawnSet=\u00a77El lugar de nacimiento ha sido puesto para el grupo {0}. suicideMessage=\u00a77Adios mundo cruel... suicideSuccess= \u00a77{0} se quito su propia vida survival=survival @@ -320,20 +321,20 @@ takenFromAccount=\u00a7c{0} ha sido sacado de tu cuenta. takenFromOthersAccount=\u00a7c{0} ha sido sacado de la cuenta de {1}. teleportAAll=\u00a77Peticion de teletransporte enviada a todos los jugadores... teleportAll=\u00a77Teletransportando a todos los jugadores... +teleportationCommencing=\u00a77Comenzando teletransporte... +teleportationDisabled=\u00a77Teletransporte desactivado. +teleportationEnabled=\u00a77Teletransporte activado. teleportAtoB=\u00a77{0}\u00a77 te teletransporto a {1}\u00a77. teleportDisabled={0} tiene desactivado los teletransportes. teleportHereRequest=\u00a7c{0}\u00a7c ha pedido que te teletransportes con el. +teleporting=\u00a77Teletransportando... +teleportingPortal=\u00a77Teletransportando via portal. teleportNewPlayerError=Error al teletransportar al nuevo jugador teleportRequest=\u00a7c{0}\u00a7c te ha pedido teletransportarse contigo. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teletransportandote a la cima. -teleportationCommencing=\u00a77Comenzando teletransporte... -teleportationDisabled=\u00a77Teletransporte desactivado. -teleportationEnabled=\u00a77Teletransporte activado. -teleporting=\u00a77Teletransportando... -teleportingPortal=\u00a77Teletransportando via portal. -tempBanned=Baneado temporalmente del servidor por {0} tempbanExempt=\u00a77No puedes banear temporalmente a ese jugador +tempBanned=Baneado temporalmente del servidor por {0} thunder= Tu has {0} los truenos en tu mundo. thunderDuration=Tu has {0} los truenos en tu mundo durante {1} seconds. timeBeforeHeal=Tiempo antes de la siguiente curacion: {0} @@ -364,25 +365,25 @@ unlimitedItemPermission=\u00a7cNo tienes permiso para objetos ilimitados {0}. unlimitedItems=Objetos ilimitados. unmutedPlayer=Jugador {0} desmuteado. upgradingFilesError=Error mientras se actualizaban los archivos +userdataMoveBackError=Error al mover userdata/{0}.tmp a userdata/{1} +userdataMoveError=Error al mover userdata/{0} a userdata/{1}.tmp userDoesNotExist=El usuario {0} no existe userIsAway={0} esta ahora ausente! userIsNotAway={0} ya no esta ausente! userJailed=\u00a77Has sido encarcelado! userUsedPortal={0} uso un portal de salida existente. -userdataMoveBackError=Error al mover userdata/{0}.tmp a userdata/{1} -userdataMoveError=Error al mover userdata/{0} a userdata/{1}.tmp usingTempFolderForTesting=Usando carpeta temporal para pruebas: versionMismatch=La version no coincide! Por favor actualiza {0} a la misma version. versionMismatchAll=La version no coincide! Por favor actualiza todos los jars de Essentials a la misma version. voiceSilenced=\u00a77Tu voz ha sido silenciada warpDeleteError=Problema al borrar el archivo de teletransporte. +warpingTo=\u00a77Teletransportandote a {0}. warpListPermission=\u00a7cNo tienes permiso para listar esos teletransportes. warpNotExist=Ese teletransporte no existe. -warpSet=\u00a77Teletransporte {0} establecido. -warpUsePermission=\u00a7cNo tienes permisos para usar ese teletransporte. -warpingTo=\u00a77Teletransportandote a {0}. warps=Warps: {0} warpsCount=\u00a77Hay {0} teletransportes. Mostrando pagina {1} de {2}. +warpSet=\u00a77Teletransporte {0} establecido. +warpUsePermission=\u00a7cNo tienes permisos para usar ese teletransporte. weatherStorm=\u00a77Has establecido el tiempo a tormenta en este mundo. weatherStormFor=\u00a77Has establecido el tiempo a tormenta en este {1} durante {0} segundos. weatherSun=\u00a77Has establecido el tiempo a sol en este mundo. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 1649a552a..290c1b668 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -11,11 +11,11 @@ alertPlaced=a plac\u00e9 : alertUsed=a utilis\u00e9 : autoAfkKickReason=Vous avez \u00e9t\u00e9 \u00e9ject\u00e9 pour inactivit\u00e9e sup\u00e9rieure \u00e0 {0} minutes. backAfterDeath=\u00a77Utilisez la commande /back pour retourner \u00e0 l''endroit ou vous \u00eates mort. -backUsageMsg=\u00a77Retour \u00e0 votre emplacement pr\u00e9c\u00c3\u00a8dent. backupFinished=Sauvegarde termin\u00e9 backupStarted=D\u00e9but de la sauvegarde... +backUsageMsg=\u00a77Retour \u00e0 votre emplacement pr\u00e9c\u00c3\u00a8dent. 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 @@ -64,14 +64,14 @@ depth=\u00a77Vous \u00eates au niveau de la mer. depthAboveSea=\u00a77Vous \u00eates \u00e0 {0} bloc(s) au-dessus du niveau de la mer. depthBelowSea=\u00a77Vous \u00eates \u00e0 {0} bloc(s) en-dessous du niveau de la mer. destinationNotSet=Destination non d\u00e9finie -disableUnlimited=\u00a77D\u00e9sactivation du placement illimit\u00e9 de {0} pour {1}. disabled=d\u00e9sactiv\u00e9 disabledToSpawnMob=Spawning this mob was disabled in the config file. +disableUnlimited=\u00a77D\u00e9sactivation du placement illimit\u00e9 de {0} pour {1}. dontMoveMessage=\u00a77La t\u00e9l\u00e9portation commence dans {0}. Ne bougez pas. downloadingGeoIp=T\u00e9l\u00e9chargement de la base de donn\u00e9es GeoIP ... Cela peut prendre un moment (Pays : 0.6 Mo, villes : 20Mo) duplicatedUserdata=Donn\u00e9e utilisateur dupliqu\u00e9e : {0} et {1} -enableUnlimited=\u00a77Quantit\u00e9 illimit\u00e9e de {0} \u00e0 {1}. enabled=activ\u00e9 +enableUnlimited=\u00a77Quantit\u00e9 illimit\u00e9e de {0} \u00e0 {1}. enchantmentApplied = \u00a77L''enchantement {0} a \u00e9t\u00e9 appliqu\u00e9 \u00e0 l''objet dans votre main. enchantmentNotFound = \u00a7cEnchantement non-trouv\u00e9 enchantmentPerm = \u00a7cVous n''avez pas les droits pour {0}. @@ -99,9 +99,9 @@ gcentities=entit\u00e9s gcfree=M\u00e9moire libre : {0} Mo gcmax=M\u00e9moire maximale : {0} Mo gctotal=M\u00e9moire utilis\u00e9e : {0} Mo +geoipJoinFormat=Joueur {0} vient de {1} geoIpUrlEmpty=L''URL de t\u00e9l\u00e9chargement de GeoIP est vide. geoIpUrlInvalid=L''URL de t\u00e9l\u00e9chargement de GeoIP est invalide. -geoipJoinFormat=Joueur {0} vient de {1} godDisabledFor=d\u00e9sactiv\u00e9 pour {0} godEnabledFor=activ\u00e9 pour {0} godMode=\u00a77Mode Dieu {0}. @@ -112,9 +112,9 @@ helpConsole=Pour voir l''aide tapez ? helpOp=\u00a7c[Aide Admin]\u00a7f \u00a77{0} : \u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f sur \u00a7c{1}\u00a7f. holeInFloor=Trou dans le Sol. +homes=R\u00e9sidences : {0} homeSet=\u00a77R\u00e9sidence d\u00e9finie. homeSetToBed=\u00a77Votre r\u00e9sidence est d\u00e9sormais li\u00e9e \u00e0 ce lit. -homes=R\u00e9sidences : {0} hour=heure hours=heures ignorePlayer=Vous ignorez d\u00e9sormais {0}. @@ -124,28 +124,28 @@ infoChapterPages=Chapitre {0}, page \u00a7c{1}\u00a7f sur \u00a7c{2}\u00a7f: infoFileDoesNotExist=Le fichier info.txt n'existe pas. Le fichier est en cours de cr\u00e9ation pour vous. infoPages=Page \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f. infoUnknownChapter=Chapitre inconnu. -invBigger=Les inventaires des autres joueurs sont plus gros que le v\u00f4tre. -invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu. -invSee=Vous voyez l''inventaire de {0}. -invSeeHelp=Utilisez /invsee pour revenir \u00e0 votre inventaire. invalidCharge=\u00a7cCharge invalide. invalidMob=Mauvias type de cr\u00e9ature. invalidServer=Serveur non valide. invalidSignLine=La ligne {0} du panneau est invalide. invalidWorld=\u00a7cMonde invalide. +invBigger=Les inventaires des autres joueurs sont plus gros que le v\u00f4tre. inventoryCleared=\u00a77Inventaire nettoy\u00e9. inventoryClearedOthers=\u00a77L''inventaire de \u00a7c{0}\u00a77 a \u00e9t\u00e9 nettoy\u00e9. +invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu. +invSee=Vous voyez l''inventaire de {0}. +invSeeHelp=Utilisez /invsee pour revenir \u00e0 votre inventaire. is=est itemCannotBeSold=Cet objet ne peut \u00eatre vendu au serveur. itemMustBeStacked=Cet objet doit \u00eatre vendu par 64. Une quantit\u00e9 de 2 serait deux fois 64. itemNotEnough1=\u00a7cVous n'avez pas assez de cet objet pour le vendre. itemNotEnough2=\u00a77Si vous voulez vendre l'int\u00e9gralit\u00e9 de vos objets de ce type l\u00e0, utilisez /sell nomObjet itemNotEnough3=\u00a77/sell nomObjet -1 vendra tout sauf un objet, etc. +itemsCsvNotLoaded=N'a pas pu charger items.csv. itemSellAir=Vouliez-vous vraiment vendre de l'air ? Mettez un objet dans votre main. itemSold=\u00a77Vendu pour \u00a7c{0} \u00a77({1} {2} \u00e0 {3} chacun) itemSoldConsole={0} vendu {1} pour \u00a77{2} \u00a77({3} objet(s) \u00e0 {4} chacun) itemSpawn=\u00a77Donne {0} de {1} -itemsCsvNotLoaded=N'a pas pu charger items.csv. jailAlreadyIncarcerated=\u00a7cJoueur d\u00e9j\u00e0 emprisonn\u00e9 : {0} jailMessage=\u00a7cVous avez commis un crime, vous en payez le prix. jailNotExist=Cette prison n'existe pas. @@ -162,8 +162,8 @@ kitError=\u00a7cIl n'y a pas de kits valides. kitErrorHelp=\u00a7cPeut-\u00eatre qu'un objet manque d'une quantit\u00e9 dans la configuration ? kitGive=\u00a77Donner le kit {0}. kitInvFull=\u00a7cVotre inventaire \u00e9tait plein, le kit est parre-terre. -kitTimed=\u00a7cVous ne pouvez pas utiliser ce kit pendant encore {0}. kits=\u00a77Kits :{0} +kitTimed=\u00a7cVous ne pouvez pas utiliser ce kit pendant encore {0}. lightningSmited=\u00a77Vous venez d'\u00eatre foudroy\u00e9. lightningUse=\u00a77{0} a \u00e9t\u00e9 foudroy\u00e9. listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +175,9 @@ localFormat=Locale : <{0}> {1} mailClear=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear mailCleared=\u00a77Courrier supprim\u00e9 ! mailSent=\u00a77Courrier envoy\u00e9 ! -markMailAsRead=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear markedAsAway=\u00a77Vous \u00eates d\u00e9sormais AFK. markedAsNotAway=\u00a77Vous n'\u00eates d\u00e9sormais plus AFK. +markMailAsRead=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear maxHomes=Vous ne pouvez pas cr\u00e9er plus de {0} r\u00e9sidences. mayNotJail=\u00a7cVous ne pouvez pas emprisonner cette personne. me=moi @@ -185,10 +185,10 @@ minute=minute minutes=minutes missingItems=Vous n''avez pas {0} x {1}. missingPrefixSuffix=Pr\u00e9fixe ou Suffixe manquant pour {0} +mobsAvailable=\u00a77cr\u00e9atures : {0} mobSpawnError=Erreur lors du changement du g\u00e9n\u00e9rateur de cr\u00e9atures. mobSpawnLimit=Quantit\u00e9 de cr\u00e9atures limit\u00e9 \u00e0 au maximum du serveur. mobSpawnTarget=Le bloc cible doit \u00eatre un g\u00e9n\u00e9rateur de cr\u00e9atures. -mobsAvailable=\u00a77cr\u00e9atures : {0} moneyRecievedFrom=\u00a7a{0} a \u00e9t\u00e9 re\u00e7u de {1} moneySentTo=\u00a7a{0} a \u00e9t\u00e9 envoy\u00e9 \u00e0 {1} moneyTaken={0} pr\u00e9lev\u00e9(s) de votre compte. @@ -196,10 +196,10 @@ month=mois months=mois moreThanZero=Les quantit\u00e9s doivent \u00eatre sup\u00e9rieures \u00e0 z\u00e9ro. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} -muteExempt=\u00a7cVous ne pouvez pas r\u00e9duire ce joueur au silence. mutedPlayer=Le joueur {0} est d\u00e9sormais muet. mutedPlayerFor={0} a \u00e9t\u00e9 muet pour {1}. mutedUserSpeaks={0} a essay\u00e9 de parler mais est muet. +muteExempt=\u00a7cVous ne pouvez pas r\u00e9duire ce joueur au silence. nearbyPlayers=Joueurs dans les environs : {0} needTpohere=Vous avez besoin de l'acc\u00c3\u00a8s \u00e0 /tpohere pour t\u00e9l\u00e9porter d'autres joueurs. negativeBalanceError=L'utilisateur n'est pas autoris\u00e9 \u00e0 avoir un solde n\u00e9gatif. @@ -221,6 +221,7 @@ noKitPermission=\u00a7cVous avez besoin de la permission \u00a7c{0}\u00a7c pour noKits=\u00a77Il n'y a pas encore de kits disponibles. noMail=Vous n'avez pas de courrier noMotd=\u00a7cIl n'y a pas de message su jour. +none=aucun noNewMail=\u00a77Vous n'avez pas de courrier. noPendingRequest=Vous n'avez pas de requ\u00eate non lue. noPerm=\u00a7cVous n''avez pas la permission \u00a7f{0}\u00a7c. @@ -228,30 +229,21 @@ noPermToSpawnMob=\u00a7cVous n'avez pas la permission d'invoquer cette cr\u00e9a noPlacePermission=\u00a7cVous n'avez pas la permission de placer un bloc pr\u00c3\u00a8 de cette pancarte. noPowerTools=Vous n'avez pas d'outil macro associ\u00e9. noRules=\u00a7cIl n'y a pas encore de r\u00e8gles d\u00e9finies. -noWarpsDefined=Aucun point de t\u00e9l\u00e9portation d\u00e9fini. -none=aucun notAllowedToQuestion=\u00a7cVous n'\u00eates pas autoris\u00e9 \u00e0 poser des questions. notAllowedToShout=\u00a7cVous n'\u00eates pas autoris\u00e9 \u00e0 crier. notEnoughExperience=Vous n'avez pas assez d'exp\u00e9rience. notEnoughMoney=Vous n'avez pas les fonds n\u00e9cessaires. +nothingInHand = \u00a7cVous n'avez rien en main. notRecommendedBukkit=* ! * La version de Bukkit n'est pas celle qui est recommand\u00e9 pour cette version de Essentials. notSupportedYet=Pas encore pris en charge. -nothingInHand = \u00a7cVous n'avez rien en main. now=maintenant +noWarpsDefined=Aucun point de t\u00e9l\u00e9portation d\u00e9fini. nuke=Que la mort s'abatte sur eux ! numberRequired=Il faut fournir un nombre ici. onlyDayNight=/time ne supporte que (jour) day/night (nuit). onlyPlayers=Seulement les joueurs en jeu peuvent utiliser {0}. onlySunStorm=/weather ne supporte que (soleil) sun/storm (temp\u00eate). orderBalances=Classement des balance de {0} utilisateurs, patientez ... -pTimeCurrent=Pour \u00a7e{0}\u00a7f l''heure est {1}. -pTimeCurrentFixed=L''heure de \u00a7e{0}\u00a7f est fix\u00e9e \u00e0 {1}. -pTimeNormal=\u00a7fPour \u00a7e{0}\u00a7f l'heure est normale et correspond au server. -pTimeOthersPermission=\u00a7cVous n'etes pas autoris\u00e9 \u00e0 changer l'heure des autres joueurs. -pTimePlayers=Ces joueurs ont leur propre horraire : -pTimeReset=l''heure a \u00e9t\u00e9 r\u00e9initialis\u00e9e \u00e0 : \u00a7e{0} -pTimeSet=l''heure du joueur a \u00e9t\u00e9 r\u00e9egl\u00e9ee \u00e0 \u00a73{0}\u00a7f pour : \u00a7e{1} -pTimeSetFixed=l''heure du joueur a \u00e9t\u00e9 fix\u00e9e \u00e0 : \u00a7e{1} parseError=Erreur de conversion {0} \u00e0 la ligne {1} pendingTeleportCancelled=\u00a7cRequete de t\u00e9l\u00e9portation annul\u00e9e. permissionsError=Permissions/GroupManager manquant, les pr\u00e9fixes et suffixes ne seront pas affich\u00e9s. @@ -279,6 +271,14 @@ powerToolRemoveAll=Toutes les commandes retir\u00e9es de {0}. powerToolsDisabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 retir\u00e9es. powerToolsEnabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 activ\u00e9es. protectionOwner=\u00a76[EssentialsProtect] Propri\u00e9taire de la protection : {0} +pTimeCurrent=Pour \u00a7e{0}\u00a7f l''heure est {1}. +pTimeCurrentFixed=L''heure de \u00a7e{0}\u00a7f est fix\u00e9e \u00e0 {1}. +pTimeNormal=\u00a7fPour \u00a7e{0}\u00a7f l'heure est normale et correspond au server. +pTimeOthersPermission=\u00a7cVous n'etes pas autoris\u00e9 \u00e0 changer l'heure des autres joueurs. +pTimePlayers=Ces joueurs ont leur propre horraire : +pTimeReset=l''heure a \u00e9t\u00e9 r\u00e9initialis\u00e9e \u00e0 : \u00a7e{0} +pTimeSet=l''heure du joueur a \u00e9t\u00e9 r\u00e9egl\u00e9ee \u00e0 \u00a73{0}\u00a7f pour : \u00a7e{1} +pTimeSetFixed=l''heure du joueur a \u00e9t\u00e9 fix\u00e9e \u00e0 : \u00a7e{1} questionFormat=\u00a77[Question]\u00a7f {0} readNextPage=Utilisez /{0} {1} pour lire la page suivante. reloadAllPlugins=\u00a77Toutes les extensions ont \u00e9t\u00e9 recharg\u00e9es. @@ -301,6 +301,7 @@ seconds=secondes seenOffline=Le joueur {0} est hors ligne depuis {1} seenOnline=Le joueur {0} est en ligne depuis {1} serverFull=Le serveur est plein. +serverTotal=Server Total: {0} setSpawner=Type de g\u00e9n\u00e9rateur chang\u00e9 en {0} sheepMalformedColor=Couleur mal form\u00e9e. shoutFormat=\u00a77[Crie]\u00a7f {0} @@ -311,8 +312,8 @@ signProtectInvalidLocation=\u00a74Vous n'avez pas l'autorisation de cr\u00e9er u similarWarpExist=Un point de t\u00e9l\u00e9portation avec un nom similaire existe d\u00e9j\u00e0. slimeMalformedSize=Taille mal form\u00e9e. soloMob=Ce cr\u00e9ature aime \u00eatre seul. -spawnSet=\u00a77Le point de d\u00e9part a \u00e9t\u00e9 d\u00e9fini pour le groupe {0}. spawned=invoqu\u00e9(s) +spawnSet=\u00a77Le point de d\u00e9part a \u00e9t\u00e9 d\u00e9fini pour le groupe {0}. suicideMessage=\u00a77Au revoir monde cruel... suicideSuccess=\u00a77{0} s''est suicid\u00e9. survival=survie @@ -320,20 +321,20 @@ takenFromAccount=\u00a7c{0} ont \u00e9t\u00e9 retir\u00e9 de votre compte. takenFromOthersAccount=\u00a7c{0} a \u00e9t\u00e9 r\u00e9tir\u00e9 du compte de {1}. teleportAAll=\u00a77Demande de t\u00e9l\u00e9portation envoy\u00e9e \u00e0 tous les joueurs... teleportAll=\u00a77T\u00e9l\u00e9poration de tous les joueurs. +teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation... +teleportationDisabled=\u00a77T\u00e9l\u00e9poration d\u00e9sactiv\u00e9. +teleportationEnabled=\u00a77T\u00e9l\u00e9portation activ\u00e9e. teleportAtoB=\u00a77{0}\u00a77 vous a t\u00e9l\u00e9port\u00e9 \u00e0 {1}\u00a77. teleportDisabled={0} a la t\u00e9l\u00e9portation d\u00e9sactiv\u00e9. teleportHereRequest=\u00a7c{0}\u00a7c Vous a demand\u00e9 de vous t\u00e9l\u00e9porter \u00e0 lui/elle. +teleporting=\u00a77T\u00e9l\u00e9poration en cours... +teleportingPortal=\u00a77T\u00e9l\u00e9portation via portail. teleportNewPlayerError=\u00c9chec de la t\u00e9l\u00e9portation du nouveau joueur. teleportRequest=\u00a7c{0}\u00a7c vous demande s''il peut se t\u00e9l\u00e9porter vers vous. teleportRequestTimeoutInfo=\u00a77Cette demande de t\u00e9l\u00e9portation expirera dans {0} secondes. teleportTop=\u00a77T\u00e9l\u00e9portation vers le haut. -teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation... -teleportationDisabled=\u00a77T\u00e9l\u00e9poration d\u00e9sactiv\u00e9. -teleportationEnabled=\u00a77T\u00e9l\u00e9portation activ\u00e9e. -teleporting=\u00a77T\u00e9l\u00e9poration en cours... -teleportingPortal=\u00a77T\u00e9l\u00e9portation via portail. -tempBanned=Banni temporairement du serveur pour {0} tempbanExempt=\u00a77Vous ne pouvez pas bannir temporairement ce joueur. +tempBanned=Banni temporairement du serveur pour {0} thunder=Vous avez {0} la foudre dans votre monde. thunderDuration=Vous avez {0} la foudre dans le serveur pendant {1} secondes. timeBeforeHeal=Temps avant le prochain soin : {0} @@ -364,25 +365,25 @@ unlimitedItemPermission=\u00a7cPas de permission pour l''objet illimit\u00e9 {0} unlimitedItems=Objets illimit\u00e9s: unmutedPlayer=Le joueur {0} n''est plus muet. upgradingFilesError=Erreur durant la mise \u00e0 jour des fichiers. +userdataMoveBackError=Echec du d\u00e9placement de userdata/{0}.tmp vers userdata/{1} +userdataMoveError=Echec du d\u00e9placement de userdata/{0} vers userdata/{1}.tmp userDoesNotExist=L''utilisateur {0} n''existe pas. userIsAway={0} s'est mis en AFK userIsNotAway={0} n'est plus AFK userJailed=\u00a77Vous avez \u00e9t\u00e9 emprisonn\u00e9. userUsedPortal={0} a utilis\u00e9 un portail existant. -userdataMoveBackError=Echec du d\u00e9placement de userdata/{0}.tmp vers userdata/{1} -userdataMoveError=Echec du d\u00e9placement de userdata/{0} vers userdata/{1}.tmp usingTempFolderForTesting=Utilise un fichier temporaire pour un test. versionMismatch=Versions diff\u00e9rentes ! Mettez s''il vous plait {0} \u00e0 la m\u00eame version. versionMismatchAll=Mauvaise version ! S'il vous plait mettez des jars Essentials de version identique. voiceSilenced=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duit au silence. warpDeleteError=Probl\u00c3\u00a8me concernant la suppression du fichier warp. +warpingTo=\u00a77T\u00e9l\u00e9portation vers {0}. warpListPermission=\u00a7cVous n'avez pas la permission d'afficher la liste des points de t\u00e9l\u00e9portation. warpNotExist=Ce point de t\u00e9l\u00e9portation n'existe pas. -warpSet=\u00a77Le point de t\u00e9l\u00e9portation {0} a \u00e9t\u00e9 cr\u00e9\u00e9. -warpUsePermission=\u00a7cVous n'avez pas la permission d'utiliser ce point de t\u00e9l\u00e9portation. -warpingTo=\u00a77T\u00e9l\u00e9portation vers {0}. warps=point de t\u00e9l\u00e9portations : {0} warpsCount=\u00a77Il y a {0} points de t\u00e9l\u00e9portations. Page {1} sur {2}. +warpSet=\u00a77Le point de t\u00e9l\u00e9portation {0} a \u00e9t\u00e9 cr\u00e9\u00e9. +warpUsePermission=\u00a7cVous n'avez pas la permission d'utiliser ce point de t\u00e9l\u00e9portation. weatherStorm=\u00a77Vous avez programm\u00e9 l''orage dans {0} weatherStormFor=\u00a77Vous avez programm\u00e9 l''orage dans {0} pour {1} secondes. weatherSun=\u00a77Vous avez programm\u00e9 le beau temps dans {0} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 16d942b0d..8997bfec6 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -11,9 +11,9 @@ alertPlaced=geplaatst: alertUsed=gebruikt: autoAfkKickReason=You have been kicked for idling more than {0} minutes. backAfterDeath=\u00a77Gebruik het /back command om terug te keren naar je sterfplaats. -backUsageMsg=\u00a77Naar de vorige locatie aan het gaan. backupFinished=Backup voltooid backupStarted=Backup gestart +backUsageMsg=\u00a77Naar de vorige locatie aan het gaan. balance=\u00a77Saldo: {0} balanceTop=\u00a77 Top saldi ({0}) banExempt=\u00a77Je kunt deze speler niet verbannen. @@ -64,14 +64,14 @@ depth=\u00a77Je zit op zeeniveau. depthAboveSea=\u00a77Je zit {0} blok(ken) boven zeeniveau. depthBelowSea=\u00a77Je zit {0} blok(ken) onder zeeniveau. destinationNotSet=Bestemming niet ingesteld -disableUnlimited=\u00a77Oneindig plaatsen van {0} uitgeschakeld voor {1}. disabled=uitgeschakeld disabledToSpawnMob=Spawning this mob was disabled in the config file. +disableUnlimited=\u00a77Oneindig plaatsen van {0} uitgeschakeld voor {1}. dontMoveMessage=\u00a77Beginnen met teleporteren in {0}. Niet bewegen. downloadingGeoIp=Bezig met downloaden van GeoIP database ... Dit kan een tijdje duren (country: 0.6 MB, city: 20MB) duplicatedUserdata=Dubbele userdata: {0} en {1}. -enableUnlimited=\u00a77Oneindig aantal {0} aan {1} gegeven. enabled=ingeschakeld +enableUnlimited=\u00a77Oneindig aantal {0} aan {1} gegeven. enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand. enchantmentNotFound = \u00a7cEnchantment not found enchantmentPerm = \u00a7cYou do not have the permission for {0} @@ -99,9 +99,9 @@ gcentities= entities gcfree=Vrij geheugen: {0} MB gcmax=Maximaal geheugen: {0} MB gctotal=Gealloceerd geheugen: {0} MB +geoipJoinFormat=Speler {0} komt uit {1} geoIpUrlEmpty=GeoIP download url is leeg. geoIpUrlInvalid=GeoIP download url is ongeldig. -geoipJoinFormat=Speler {0} komt uit {1} godDisabledFor=uitgeschakeld voor {0} godEnabledFor=ingeschakeld voor {0} godMode=\u00a77God mode {0}. @@ -112,9 +112,9 @@ helpConsole=type ? om de consolehelp weer te geven. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f: holeInFloor=Gat in de vloer +homes=Homes: {0} homeSet=\u00a77Home ingesteld. homeSetToBed=\u00a77Je home is is nu verplaatst naar dit bed. -homes=Homes: {0} hour=uur hours=uren ignorePlayer=Je negeert {0} vanaf nu. @@ -124,28 +124,28 @@ infoChapterPages=Hoofdstuk {0}, Pagina \u00a7c{1}\u00a7f van de \u00a7c{2}\u00a7 infoFileDoesNotExist=Bestand info.txt bestaat niet. Bezig met aanmaken. infoPages=Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f: infoUnknownChapter=Onbekend hoofdstuk. -invBigger=De inventory van de andere speler is groter dan die van jou. -invRestored=Je inventory is hersteld. -invSee=Je kijkt naar de inventory van {0}. -invSeeHelp=Type /invsee om je inventory te herstellen. invalidCharge=\u00a7cOngeldig te laden. invalidMob=Ongeldig mob type. invalidServer=Ongeldige server! invalidSignLine=Regel {0} op het bordje is ongeldig. invalidWorld=\u00a7cOngeldige wereld. +invBigger=De inventory van de andere speler is groter dan die van jou. inventoryCleared=\u00a77inventory leeggemaakt. inventoryClearedOthers=\u00a77inventory van \u00a7c{0}\u00a77 leeggemaakt. +invRestored=Je inventory is hersteld. +invSee=Je kijkt naar de inventory van {0}. +invSeeHelp=Type /invsee om je inventory te herstellen. is=is itemCannotBeSold=Dat voorwerp kan niet aan de server worden verkocht. itemMustBeStacked=Voorwerp moet geruild worden als stapel. Een hoeveelheid van 2 moet dus geruild worden als twee stapels, etc. itemNotEnough1=\u00a7cJe hebt niet genoeg van dat voorwerp om te verkopen. itemNotEnough2=\u00a77Type /sell itemname Als je alles daarvan wilt verkopen itemNotEnough3=\u00a77/sell itemname -1 zorgt ervoor dat ze allemaal behalve 1 worden verkocht, etc. +itemsCsvNotLoaded=De item kunnen niet geladen worden.csv. itemSellAir=Je wilde serieus lucht verkopen? Plaats een voorwerp in je hand. itemSold=\u00a77Verkocht voor \u00a7c{0} \u00a77({1} {2} voorwerpen voor {3} per stuk) itemSoldConsole={0} verkocht {1} voor \u00a77{2} \u00a77({3} voorwerpen voor {4} per stuk) itemSpawn=\u00a77Geeft {0} {1} -itemsCsvNotLoaded=De item kunnen niet geladen worden.csv. jailAlreadyIncarcerated=\u00a7cPerson is already in jail: {0} jailMessage=\u00a7cYou do the crime, you do the time. jailNotExist=Die gevangenis bestaat niet. @@ -162,8 +162,8 @@ kitError=\u00a7cEr zijn geen geldige kits. kitErrorHelp=\u00a7cMisschien mist er een hoeveelheid van het item in de configuratie? kitGive=\u00a77Kit {0} wordt gegeven. kitInvFull=\u00a7cJe inventory was vol, de kit wordt op de grond geplaatst -kitTimed=\u00a7cJe kan die kit pas weer gebruiken over {0}. kits=\u00a77Kits: {0} +kitTimed=\u00a7cJe kan die kit pas weer gebruiken over {0}. lightningSmited=\u00a77Je bent zojuist verbrand lightningUse=\u00a77Brand {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +175,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cType /mail clear, om ej berichten als gelezen te markeren. mailCleared=\u00a77Bericht geklaard! mailSent=\u00a77Bericht verzonden! -markMailAsRead=\u00a7cType /mail clear, om je berichten als gelezen te markeren markedAsAway=\u00a77Je staat nu als afwezig gemeld. markedAsNotAway=\u00a77Je staat niet meer als afwezig gemeld. +markMailAsRead=\u00a7cType /mail clear, om je berichten als gelezen te markeren maxHomes=You cannot set more than {0} homes. mayNotJail=\u00a7cJe mag die speler niet in de gevangenis zetten. me=me @@ -185,10 +185,10 @@ minute=minuut minutes=minuten missingItems=Je hebt geen {0}x {1}. missingPrefixSuffix=Er mist een prefix of suffix voor {0} +mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Fout bij het veranderen van de mob spawner. mobSpawnLimit=Grootte van de mob hang af van het server limiet mobSpawnTarget=Target blok moet een mob spawner zijn. -mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} is ontvangen van {1} moneySentTo=\u00a7a{0} is verzonden naar {1} moneyTaken={0} van je bankrekening afgehaald. @@ -196,10 +196,10 @@ month=maand months=maanden moreThanZero=Het aantal moet groter zijn dan 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} -muteExempt=\u00a7cJe kan deze speler niet muten. mutedPlayer=Speler {0} gemute. mutedPlayerFor=Speler {0} is gemute voor {1}. mutedUserSpeaks={0} probeerde te praten, maar is gemute. +muteExempt=\u00a7cJe kan deze speler niet muten. nearbyPlayers=Players nearby: {0} needTpohere=Je moet toegang krijgen tot /tpohere om naar andere spelers te teleporteren. negativeBalanceError=Speler is niet toegestaan om een negatief saldo te hebben. @@ -221,6 +221,7 @@ noKitPermission=\u00a7cJe hebt de \u00a7c{0}\u00a7c toestemming nodig om die kit noKits=\u00a77Er zijn nog geen kits beschikbaar noMail=Je hebt geen berichten noMotd=\u00a7cEr is geen bericht van de dag. +none=geen noNewMail=\u00a77Je hebt geen nieuwe berichten. noPendingRequest=Je hebt geen aanvragen. noPerm=\u00a7cJe hebt de \u00a7f{0}\u00a7c toestemming niet. @@ -228,30 +229,21 @@ noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob. noPlacePermission=\u00a7cJe hebt geen toestemming om een blok naast die sign te plaatsen. noPowerTools=You have no power tools assigned. noRules=\u00a7cEr zijn nog geen regels gegeven. -noWarpsDefined=Geen warps gedefinieerd -none=geen notAllowedToQuestion=\u00a7cJe bent niet bevoegd om de vraag functie te gebruiken. notAllowedToShout=\u00a7cJe bent niet bevoegd om de roep functie te gebruiken. notEnoughExperience=You do not have enough experience. notEnoughMoney=Je hebt niet voldoende middelen. +nothingInHand = \u00a7cYou have nothing in your hand. notRecommendedBukkit=* ! * De Bukkit versie is niet de aangeraden build voor Essentials. notSupportedYet=Nog niet ondersteund. -nothingInHand = \u00a7cYou have nothing in your hand. now=nu +noWarpsDefined=Geen warps gedefinieerd nuke=May death rain upon them numberRequired=Er moet daar een nummer, grapjas. onlyDayNight=/time ondersteund alleen day/night. onlyPlayers=Alleen in-game spelers kunnen {0} gebruiken. onlySunStorm=/weather only supports sun/storm. orderBalances=Ordering balances of {0} users, please wait ... -pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. -pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. -pTimePlayers=These players have their own time: -pTimeReset=Player time has been reset for: \u00a7e{0} -pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} -pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} parseError=Fout bij ontleding {0} op regel {1} pendingTeleportCancelled=\u00a7cAangevraagde teleportatie afgelast. permissionsError=Permissions/GroupManager ontbreekt; chat prefixes/suffixes worden uitgeschakeld. @@ -279,6 +271,14 @@ powerToolRemoveAll=All commands removed from {0}. powerToolsDisabled=All of your power tools have been disabled. powerToolsEnabled=All of your power tools have been enabled. protectionOwner=\u00a76[EssentialsProtect] Beschermingeigenaar: {0} +pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. +pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. +pTimePlayers=These players have their own time: +pTimeReset=Player time has been reset for: \u00a7e{0} +pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} +pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Vraag]\u00a7f {0} readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Alle plugins zijn herladen. @@ -301,6 +301,7 @@ seconds=seconde 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} @@ -311,8 +312,8 @@ signProtectInvalidLocation=\u00a74You are not allowed to create sign here. similarWarpExist=Er bestaat al een warp met dezelfde naam. slimeMalformedSize=Misvoormde grootte. soloMob=Die mob is liever in zijn eentje -spawnSet=\u00a77Spawn locatie voor de groep {0} ingesteld. spawned=gespawned +spawnSet=\u00a77Spawn locatie voor de groep {0} ingesteld. suicideMessage=\u00a77Vaarwel vreedzame wereld... suicideSuccess= \u00a77{0} pleegde zelfmoord survival=survival @@ -320,20 +321,20 @@ takenFromAccount=\u00a7c{0} is van je bank rekening afgehaald. takenFromOthersAccount=\u00a7c{0} is overgenomen uit {1} account. teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Bezig met teleporteren van alle spelers... +teleportationCommencing=\u00a77Aan het beginnen met teleporteren... +teleportationDisabled=\u00a77Teleportatie uitgeschakeld. +teleportationEnabled=\u00a77Teleportatie ingeschakeld. teleportAtoB=\u00a77{0}\u00a77 is naar {1}\u00a77 geteleporteerd. teleportDisabled={0} heeft teleporteren uit gezet. teleportHereRequest=\u00a7c{0}\u00a7c Heeft gevraagd of hij/zij naar jou mag teleporteren. +teleporting=\u00a77Bezig met teleporteren... +teleportingPortal=\u00a77Bezig met teleporteren via de portal. teleportNewPlayerError=Fout bij het teleporteren van nieuwe speler. teleportRequest=\u00a7c{0}\u00a7c vraagt of hij jou kan teleporteren. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Bezig met teleporteren naar de top. -teleportationCommencing=\u00a77Aan het beginnen met teleporteren... -teleportationDisabled=\u00a77Teleportatie uitgeschakeld. -teleportationEnabled=\u00a77Teleportatie ingeschakeld. -teleporting=\u00a77Bezig met teleporteren... -teleportingPortal=\u00a77Bezig met teleporteren via de portal. -tempBanned=Tijdelijk geband voor {0} tempbanExempt=\u00a77Je mag deze speler niet een tempban geven +tempBanned=Tijdelijk geband voor {0} thunder= Je {0} onweert de wereld thunderDuration=Je {0} onweert de wereld voor {1} seconde. timeBeforeHeal=Afkoeltijd tot de volgende heal: {0} @@ -364,25 +365,25 @@ unlimitedItemPermission=\u00a7cOnbevoegd om oneindig {0} te hebben. unlimitedItems=Oneindige voorwerpen: unmutedPlayer=Speler {0} mag weer spreken. upgradingFilesError=Fout tijdens het upgraden van de bestanden +userdataMoveBackError=Fout bij het verplaasten van userdata/{0}.tmp naar userdata/{1} +userdataMoveError=Fout bij het verplaasten van userdata/{0} naar userdata/{1}.tmp userDoesNotExist=Speler {0} bestaat niet. userIsAway={0} is nu AFK userIsNotAway={0} is niet meer AFK userJailed=\u00a77Je bent in de gevangenis gezet. userUsedPortal={0} gebruikte een bestaande uitgangs portal. -userdataMoveBackError=Fout bij het verplaasten van userdata/{0}.tmp naar userdata/{1} -userdataMoveError=Fout bij het verplaasten van userdata/{0} naar userdata/{1}.tmp usingTempFolderForTesting=Tijdelijke map om te testen: versionMismatch=Verkeerde versie! Update {0} naar dezelfde versie. versionMismatchAll=Verkeerde versie! Update alle Essentials jars naar dezelfde versie. voiceSilenced=\u00a77Je kan niet meer praten warpDeleteError=Fout bij het verwijderen van het warp bestand. +warpingTo=\u00a77Aan het warpen naar {0}. warpListPermission=\u00a7cJe hebt geen toegang om die warp te maken. warpNotExist=Die warp bestaat niet. -warpSet=\u00a77Warp {0} ingesteld. -warpUsePermission=\u00a7cOnbevoegd om die warp te gebruiken. -warpingTo=\u00a77Aan het warpen naar {0}. warps=Warps: {0} warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. +warpSet=\u00a77Warp {0} ingesteld. +warpUsePermission=\u00a7cOnbevoegd om die warp te gebruiken. weatherStorm=\u00a77Je hebt het weer naar storm gezet in de {0} weatherStormFor=\u00a77Je hebt het weer in de {0} naar storm gezet voor {1} seconde weatherSun=\u00a77Je hebt het weer naar zon gezet in de {0} -- cgit v1.2.3 From 28f478dd04c16d3deb21625aebf74a25b57665b2 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 23 Feb 2012 17:25:00 +0000 Subject: Write to user files less, on money update. --- Essentials/src/com/earth2me/essentials/User.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index ce4d1ce27..7225e1dba 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -383,8 +383,8 @@ public class User extends UserData implements Comparable, IReplyTo, IUser public void updateMoneyCache(final double value) { - if (ess.getPaymentMethod().hasMethod()) - { + if (ess.getPaymentMethod().hasMethod() && super.getMoney() != value) + { super.setMoney(value); } } -- cgit v1.2.3 From fa49fc91d2454b2da193ed2b757356b2496d504c Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 25 Feb 2012 09:22:54 +0000 Subject: Prevent adding inheritances to globalgroups. These are permissions collections, not player groups. --- EssentialsGroupManager/src/Changelog.txt | 3 +- .../org/anjocaido/groupmanager/GroupManager.java | 10 +++ .../src/org/anjocaido/groupmanager/data/Group.java | 73 +++++++++++++--------- 3 files changed, 56 insertions(+), 30 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index cb14c4e6e..bb5cbf550 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -143,4 +143,5 @@ v 1.9: 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. - Update for Bukkit R5 compatability. - - Removed BukkitPermsOverride as this is now the default with bukkit handling child nodes. \ No newline at end of file + - Removed BukkitPermsOverride as this is now the default with bukkit handling child nodes. + - Prevent adding inheritances to globalgroups. These are permissions collections, not player groups. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index d8d151200..3c39c24d7 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -1019,6 +1019,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 +1057,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() + "."); 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(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 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); + } + } } } -- cgit v1.2.3 From 50bd5869bf18421918c6ef9f5ffe0fa46ccfb894 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 25 Feb 2012 09:29:54 +0000 Subject: Prevent promoting players to, and demoting to GlobalGroups. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../org/anjocaido/groupmanager/GroupManager.java | 28 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index bb5cbf550..1159607ed 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -144,4 +144,5 @@ v 1.9: - 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 to globalgroups. These are permissions collections, not player groups. \ No newline at end of file + - Prevent adding inheritances and info nodes to globalgroups. These are permissions collections, not player groups. + - Prevent promoting players to, and demoting to GlobalGroups. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 3c39c24d7..b0d46ca1a 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -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)) { @@ -1232,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 = ""; @@ -1261,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!"); @@ -1286,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 = ""; @@ -1323,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) { @@ -1588,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."); @@ -1644,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."); -- cgit v1.2.3 From 13d3cc33061ff0810efd815efa64338e5eaeb70e Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 25 Feb 2012 17:40:00 +0000 Subject: Lowering min bukkit to r4 - 1838, this build should still be compatible. --- Essentials/src/com/earth2me/essentials/Essentials.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index d8d1f5554..a75e12aad 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,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 = 1938; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); -- cgit v1.2.3 From 5d048d2c1dbfccf2db5188a7b2e3f9f303d9c273 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 25 Feb 2012 17:57:26 +0000 Subject: Updating Bukkit: CB #1858, B #1334 --- .../src/com/earth2me/essentials/Essentials.java | 2 +- .../src/com/earth2me/essentials/OfflinePlayer.java | 17 ++++++++++++----- .../earth2me/essentials/craftbukkit/FakeWorld.java | 6 ++++++ lib/bukkit.jar | Bin 4614591 -> 4620068 bytes lib/craftbukkit.jar | Bin 10786423 -> 10793996 bytes 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index a75e12aad..ff082efa7 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 1938; + public static final int BUKKIT_VERSION = 1958; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index 440d3fad3..ba5f97c71 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -172,11 +172,6 @@ public class OfflinePlayer implements Player return false; } - public boolean isPlayer() - { - return false; - } - @Override public int getRemainingAir() { @@ -901,4 +896,16 @@ public class OfflinePlayer implements Player { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public T launchProjectile(Class arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public EntityType getType() + { + return EntityType.PLAYER; + } } diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java index 0ea06e72b..f39c6e451 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java @@ -584,4 +584,10 @@ public class FakeWorld implements World { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public LivingEntity spawnCreature(Location arg0, EntityType arg1) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/lib/bukkit.jar b/lib/bukkit.jar index e343a9723..aa22b004e 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index d51826640..24d7801c3 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From a5b38ce1a492edb69c14239d976ff72db84915ef Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 04:15:14 +0000 Subject: Add Minimum Balance, to allow people to manage overdrafts. --- Essentials/src/com/earth2me/essentials/ISettings.java | 2 ++ Essentials/src/com/earth2me/essentials/IUser.java | 2 ++ Essentials/src/com/earth2me/essentials/Settings.java | 16 ++++++++++++++++ Essentials/src/com/earth2me/essentials/Trade.java | 6 ++---- Essentials/src/com/earth2me/essentials/User.java | 13 +++++++++++-- Essentials/src/com/earth2me/essentials/api/Economy.java | 4 ++++ .../src/com/earth2me/essentials/commands/Commandeco.java | 4 ++++ Essentials/src/com/earth2me/essentials/user/User.java | 11 +++++++++++ Essentials/src/config.yml | 6 +++++- 9 files changed, 57 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index e567673b6..cded5bde5 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -115,6 +115,8 @@ public interface ISettings extends IConf boolean warnOnSmite(); double getMaxMoney(); + + double getMinMoney(); boolean isEcoLogEnabled(); diff --git a/Essentials/src/com/earth2me/essentials/IUser.java b/Essentials/src/com/earth2me/essentials/IUser.java index bff556ab4..df5401886 100644 --- a/Essentials/src/com/earth2me/essentials/IUser.java +++ b/Essentials/src/com/earth2me/essentials/IUser.java @@ -32,6 +32,8 @@ public interface IUser extends Player void takeMoney(double value); void giveMoney(double value); + + boolean canAfford(double value); String getGroup(); diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 40fb47f6c..39179b957 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -539,6 +539,22 @@ public class Settings implements ISettings } return max; } + + private final static double MINMONEY = -10000000000000.0; + + @Override + public double getMinMoney() + { + double min = config.getDouble("min-money", MINMONEY); + if (min > 0) { + min = -min; + } + if (min < MINMONEY) + { + min = MINMONEY; + } + return min; + } @Override public boolean isEcoLogEnabled() diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java index 933b54b3f..5ed80d35b 100644 --- a/Essentials/src/com/earth2me/essentials/Trade.java +++ b/Essentials/src/com/earth2me/essentials/Trade.java @@ -143,8 +143,7 @@ public class Trade { if (getMoney() != null) { - final double mon = user.getMoney(); - if (mon < getMoney() && getMoney() > 0 && !user.isAuthorized("essentials.eco.loan")) + if (!user.canAfford(getMoney()) && getMoney() > 0) { throw new ChargeException(_("notEnoughMoney")); } @@ -163,9 +162,8 @@ public class Trade && !user.isAuthorized("essentials.nocommandcost.all") && !user.isAuthorized("essentials.nocommandcost." + command)) { - final double mon = user.getMoney(); final double cost = ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command); - if (mon < cost && cost > 0 && !user.isAuthorized("essentials.eco.loan")) + if (!user.canAfford(cost) && cost > 0) { throw new ChargeException(_("notEnoughMoney")); } diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 7225e1dba..a799653a8 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -153,9 +153,18 @@ public class User extends UserData implements Comparable, IReplyTo, IUser } public boolean canAfford(final double cost) + { + return canAfford(cost, true); + } + + public boolean canAfford(final double cost, final boolean permcheck) { final double mon = getMoney(); - return mon >= cost || isAuthorized("essentials.eco.loan"); + if (!permcheck || isAuthorized("essentials.eco.loan")) + { + return (mon + cost) > ess.getSettings().getMinMoney(); + } + return cost <= mon; } public void dispose() @@ -384,7 +393,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser public void updateMoneyCache(final double value) { if (ess.getPaymentMethod().hasMethod() && super.getMoney() != value) - { + { super.setMoney(value); } } diff --git a/Essentials/src/com/earth2me/essentials/api/Economy.java b/Essentials/src/com/earth2me/essentials/api/Economy.java index 1d45c8df9..a1d421c38 100644 --- a/Essentials/src/com/earth2me/essentials/api/Economy.java +++ b/Essentials/src/com/earth2me/essentials/api/Economy.java @@ -115,6 +115,10 @@ public final class Economy { throw new UserDoesNotExistException(name); } + if (balance < ess.getSettings().getMinMoney()) + { + throw new NoLoanPermittedException(); + } if (balance < 0.0 && !user.isAuthorized("essentials.eco.loan")) { throw new NoLoanPermittedException(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java index 8f432ca6e..d2efc1845 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.commands; +import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import java.util.Locale; import org.bukkit.Server; @@ -45,6 +46,9 @@ public class Commandeco extends EssentialsCommand break; case TAKE: + if (!player.canAfford(amount, false)) { + throw new Exception(_("notEnoughMoney")); + } player.takeMoney(amount); break; diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index 0e544ae06..5249c8718 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -196,4 +196,15 @@ public class User extends UserBase implements IUser unlock(); } } + + @Override + public boolean canAfford(final double cost) + { + final double mon = getMoney(); + if (isAuthorized("essentials.eco.loan")) + { + return (mon + cost) > ess.getSettings().getMinMoney(); + } + return cost <= mon; + } } diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 00585f35f..97b73e4c5 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -281,10 +281,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 @@ -321,6 +321,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 +# Setting this to 0, will disable overdrafts/loans compeltely. Users need 'essentials.eco.loan' perm to go below 0. +min-money: -10000000000000 + # Enable this to log all interactions with trade/buy/sell signs and sell command economy-log-enabled: false -- cgit v1.2.3 From d24f77dbd5816e018de99a9bf5ab9ed07bdf53d5 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 04:27:13 +0000 Subject: Display users new balance on /eco give/take. --- Essentials/src/com/earth2me/essentials/User.java | 4 ++-- Essentials/src/com/earth2me/essentials/commands/Commandeco.java | 9 +++++++-- Essentials/src/messages.properties | 4 ++-- Essentials/src/messages_da.properties | 4 ++-- Essentials/src/messages_de.properties | 4 ++-- Essentials/src/messages_en.properties | 4 ++-- Essentials/src/messages_es.properties | 4 ++-- Essentials/src/messages_fr.properties | 4 ++-- Essentials/src/messages_nl.properties | 4 ++-- 9 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index a799653a8..501577878 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -109,7 +109,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser sendMessage(_("addedToAccount", Util.formatCurrency(value, ess))); if (initiator != null) { - initiator.sendMessage(_("addedToOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName())); + initiator.sendMessage(_("addedToOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName(), Util.formatCurrency(getMoney(), ess))); } } @@ -148,7 +148,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser sendMessage(_("takenFromAccount", Util.formatCurrency(value, ess))); if (initiator != null) { - initiator.sendMessage(_("takenFromOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName())); + initiator.sendMessage(_("takenFromOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName(), Util.formatCurrency(getMoney(), ess))); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java index d2efc1845..b9694ee49 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java @@ -46,8 +46,9 @@ public class Commandeco extends EssentialsCommand break; case TAKE: - if (!player.canAfford(amount, false)) { - throw new Exception(_("notEnoughMoney")); + if (!player.canAfford(amount, false)) + { + throw new Exception(_("notEnoughMoney")); } player.takeMoney(amount); break; @@ -68,6 +69,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/messages.properties b/Essentials/src/messages.properties index 8489b6262..118c61ca4 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} has been added to {1} account. New balance: {2} alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=placed: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... teleportationCommencing=\u00a77Teleportation commencing... diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 82145afc1..a2719ddd1 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} has been added to {1} account. New balance: {2} alertBroke=\u00f8delagde: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} ved: {3} alertPlaced=placerede: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Anmodning om teleport er sendt til alle spillere. teleportAll=\u00a77Teleporterer alle spillere... teleportationCommencing=\u00a77Teleport begynder... diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 2572f7cf2..b5ca8a800 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} has been added to {1} account. New balance: {2} alertBroke=zerst\u00f6rt: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bei: {3} alertPlaced=platziert: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Teleportierungsanfrage zu allen Spielern gesendet... teleportAll=\u00a77Teleportiere alle Spieler... teleportAtoB=\u00a77{0}\u00a77 teleportiert dich zu {1}\u00a77. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index a2acdf9a2..dac209927 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} has been added to {1} account. New balance: {2} alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=placed: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... teleportationCommencing=\u00a77Teleportation commencing... diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 38d62f6c4..0c1ca7452 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} has been added to {1} account. New balance: {2} alertBroke=roto: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} en: {3} alertPlaced=situado: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Peticion de teletransporte enviada a todos los jugadores... teleportAll=\u00a77Teletransportando a todos los jugadores... teleportationCommencing=\u00a77Comenzando teletransporte... diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 290c1b668..bd93cb8e8 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} has been added to {1} account. New balance: {2} alertBroke=a cass\u00e9 : alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} \u00e0:{3} alertPlaced=a plac\u00e9 : @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Demande de t\u00e9l\u00e9portation envoy\u00e9e \u00e0 tous les joueurs... teleportAll=\u00a77T\u00e9l\u00e9poration de tous les joueurs. teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation... diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 8997bfec6..f2c9f9b2f 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} has been added to {1} account. New balance: {2} alertBroke=gebroken: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bij: {3} alertPlaced=geplaatst: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Bezig met teleporteren van alle spelers... teleportationCommencing=\u00a77Aan het beginnen met teleporteren... -- cgit v1.2.3 From ad08d275042c9841b48bc3945abd694649fd7529 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 05:01:40 +0000 Subject: Adjustments to negative eco give/take. --- Essentials/src/com/earth2me/essentials/User.java | 3 ++- Essentials/src/com/earth2me/essentials/user/User.java | 2 +- Essentials/src/messages.properties | 4 ++-- Essentials/src/messages_da.properties | 4 ++-- Essentials/src/messages_de.properties | 4 ++-- Essentials/src/messages_en.properties | 4 ++-- Essentials/src/messages_es.properties | 4 ++-- Essentials/src/messages_fr.properties | 4 ++-- Essentials/src/messages_nl.properties | 4 ++-- 9 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 501577878..bd712bf87 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -160,9 +160,10 @@ public class User extends UserData implements Comparable, IReplyTo, IUser public boolean canAfford(final double cost, final boolean permcheck) { final double mon = getMoney(); + ess.getLogger().log(Level.INFO, "min cash is " + ess.getSettings().getMinMoney()); if (!permcheck || isAuthorized("essentials.eco.loan")) { - return (mon + cost) > ess.getSettings().getMinMoney(); + return (mon - cost) > ess.getSettings().getMinMoney(); } return cost <= mon; } diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index 5249c8718..d77790938 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -203,7 +203,7 @@ public class User extends UserBase implements IUser final double mon = getMoney(); if (isAuthorized("essentials.eco.loan")) { - return (mon + cost) > ess.getSettings().getMinMoney(); + return (mon - cost) > ess.getSettings().getMinMoney(); } return cost <= mon; } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 118c61ca4..f7958319d 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. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=placed: @@ -318,7 +318,7 @@ 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. New balance: {2} +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... teleportationCommencing=\u00a77Teleportation commencing... diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index a2719ddd1..0d8260947 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} has been added to {1} account. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=\u00f8delagde: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} ved: {3} alertPlaced=placerede: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Anmodning om teleport er sendt til alle spillere. teleportAll=\u00a77Teleporterer alle spillere... teleportationCommencing=\u00a77Teleport begynder... diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index b5ca8a800..815972f03 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} has been added to {1} account. New balance: {2} +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: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} +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. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index dac209927..dfc7600dc 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. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=placed: @@ -318,7 +318,7 @@ 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. New balance: {2} +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... teleportationCommencing=\u00a77Teleportation commencing... diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 0c1ca7452..909ec7434 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} has been added to {1} account. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=roto: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} en: {3} alertPlaced=situado: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} +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... teleportationCommencing=\u00a77Comenzando teletransporte... diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index bd93cb8e8..a74be475b 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} has been added to {1} account. New balance: {2} +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 : @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} +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. teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation... diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index f2c9f9b2f..51bbe2bed 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} has been added to {1} account. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=gebroken: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bij: {3} alertPlaced=geplaatst: @@ -318,7 +318,7 @@ suicideMessage=\u00a77Vaarwel vreedzame wereld... suicideSuccess= \u00a77{0} pleegde zelfmoord survival=survival takenFromAccount=\u00a7c{0} is van je bank rekening afgehaald. -takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} +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... teleportationCommencing=\u00a77Aan het beginnen met teleporteren... -- cgit v1.2.3 From bcf903de924cf9e682a501ec419d2bd72b71831c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 05:06:03 +0000 Subject: Cleanup. --- Essentials/src/com/earth2me/essentials/Settings.java | 14 ++++++-------- Essentials/src/com/earth2me/essentials/User.java | 2 -- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 39179b957..b6b1f4994 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -5,9 +5,7 @@ import com.earth2me.essentials.commands.IEssentialsCommand; import com.earth2me.essentials.signs.EssentialsSign; import com.earth2me.essentials.signs.Signs; import com.earth2me.essentials.textreader.IText; -import com.earth2me.essentials.textreader.KeywordReplacer; import com.earth2me.essentials.textreader.SimpleTextInput; -import com.earth2me.essentials.textreader.SimpleTextPager; import java.io.File; import java.text.MessageFormat; import java.util.*; @@ -218,10 +216,10 @@ public class Settings implements ISettings if (config.isConfigurationSection("kits")) { final ConfigurationSection kits = getKits(); - if (kits.isConfigurationSection(name)) + if (kits.isConfigurationSection(name)) { return kits.getConfigurationSection(name).getValues(true); - } + } } return null; } @@ -539,15 +537,15 @@ public class Settings implements ISettings } return max; } - private final static double MINMONEY = -10000000000000.0; - + @Override public double getMinMoney() { double min = config.getDouble("min-money", MINMONEY); - if (min > 0) { - min = -min; + if (min > 0) + { + min = -min; } if (min < MINMONEY) { diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index bd712bf87..86a3bcbfe 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -7,7 +7,6 @@ import java.util.Calendar; import java.util.GregorianCalendar; import java.util.logging.Level; import java.util.logging.Logger; -import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -160,7 +159,6 @@ public class User extends UserData implements Comparable, IReplyTo, IUser public boolean canAfford(final double cost, final boolean permcheck) { final double mon = getMoney(); - ess.getLogger().log(Level.INFO, "min cash is " + ess.getSettings().getMinMoney()); if (!permcheck || isAuthorized("essentials.eco.loan")) { return (mon - cost) > ess.getSettings().getMinMoney(); -- cgit v1.2.3 From 10ae9c3aa2f0a206c8d715717b0cbaf5247752c1 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 05:10:04 +0000 Subject: Allow people to hit exactly 'min money'. --- Essentials/src/com/earth2me/essentials/User.java | 2 +- Essentials/src/com/earth2me/essentials/user/User.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 86a3bcbfe..0be375c88 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -161,7 +161,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser final double mon = getMoney(); if (!permcheck || isAuthorized("essentials.eco.loan")) { - return (mon - cost) > ess.getSettings().getMinMoney(); + return (mon - cost) >= ess.getSettings().getMinMoney(); } return cost <= mon; } diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index d77790938..0e77dd6a9 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -203,7 +203,7 @@ public class User extends UserBase implements IUser final double mon = getMoney(); if (isAuthorized("essentials.eco.loan")) { - return (mon - cost) > ess.getSettings().getMinMoney(); + return (mon - cost) >= ess.getSettings().getMinMoney(); } return cost <= mon; } -- cgit v1.2.3 From a5e3182dadec976ab5117d755b678f75acda8a4f Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 27 Feb 2012 03:24:58 +0000 Subject: Change jail listener to catch respawn at Highest --- Essentials/src/com/earth2me/essentials/Jails.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java index 0011905ec..7217992ad 100644 --- a/Essentials/src/com/earth2me/essentials/Jails.java +++ b/Essentials/src/com/earth2me/essentials/Jails.java @@ -193,7 +193,7 @@ public class Jails extends AsyncStorageObjectHolder Date: Mon, 27 Feb 2012 03:40:18 +0000 Subject: Prevent EssSpawn trying to handle spawning of jailed players. --- .../com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index 083fd66a5..c7a17845a 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -35,6 +35,11 @@ public class EssentialsSpawnPlayerListener implements Listener { final User user = ess.getUser(event.getPlayer()); + if (user.isJailed() && user.getJail() != null && !user.getJail().isEmpty()) + { + return; + } + if (ess.getSettings().getRespawnAtHome()) { Location home; -- cgit v1.2.3 From 833a5b2b552f297a9c5aeec3e11d58f0486c7e24 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 27 Feb 2012 15:31:43 +0000 Subject: Adding option to log all eco api transactions. --- Essentials/src/com/earth2me/essentials/ISettings.java | 2 ++ Essentials/src/com/earth2me/essentials/Settings.java | 6 ++++++ Essentials/src/com/earth2me/essentials/Trade.java | 3 ++- Essentials/src/com/earth2me/essentials/User.java | 3 ++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index cded5bde5..6186736b4 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -119,6 +119,8 @@ public interface ISettings extends IConf double getMinMoney(); boolean isEcoLogEnabled(); + + boolean isEcoLogUpdateEnabled(); boolean removeGodOnDisconnect(); diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index b6b1f4994..732b5485c 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -559,6 +559,12 @@ public class Settings implements ISettings { return config.getBoolean("economy-log-enabled", false); } + + @Override + public boolean isEcoLogUpdateEnabled() + { + return config.getBoolean("economy-log-update-enabled", false); + } @Override public boolean removeGodOnDisconnect() diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java index 5ed80d35b..3594c3137 100644 --- a/Essentials/src/com/earth2me/essentials/Trade.java +++ b/Essentials/src/com/earth2me/essentials/Trade.java @@ -198,7 +198,8 @@ public class Trade public static void log(String type, String subtype, String event, String sender, Trade charge, String receiver, Trade pay, Location loc, IEssentials ess) { - if (!ess.getSettings().isEcoLogEnabled()) + if ((loc == null && !ess.getSettings().isEcoLogUpdateEnabled()) + || (loc != null && !ess.getSettings().isEcoLogEnabled())) { return; } diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 0be375c88..ba34548fe 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -385,8 +385,9 @@ public class User extends UserData implements Comparable, IReplyTo, IUser catch (Throwable ex) { } - } + } super.setMoney(value); + Trade.log("Update", "Set", "API", getName(), new Trade(value, ess), null, null, null, ess); } public void updateMoneyCache(final double value) -- cgit v1.2.3 From 9f893e68e98252fae5999760ee67e0bac3810fda Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 04:15:14 +0000 Subject: Add Minimum Balance, to allow people to manage overdrafts. --- Essentials/src/com/earth2me/essentials/ISettings.java | 2 ++ Essentials/src/com/earth2me/essentials/IUser.java | 2 ++ Essentials/src/com/earth2me/essentials/Settings.java | 16 ++++++++++++++++ Essentials/src/com/earth2me/essentials/Trade.java | 6 ++---- Essentials/src/com/earth2me/essentials/User.java | 13 +++++++++++-- Essentials/src/com/earth2me/essentials/api/Economy.java | 4 ++++ .../src/com/earth2me/essentials/commands/Commandeco.java | 4 ++++ Essentials/src/com/earth2me/essentials/user/User.java | 11 +++++++++++ Essentials/src/config.yml | 6 +++++- 9 files changed, 57 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index e567673b6..cded5bde5 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -115,6 +115,8 @@ public interface ISettings extends IConf boolean warnOnSmite(); double getMaxMoney(); + + double getMinMoney(); boolean isEcoLogEnabled(); diff --git a/Essentials/src/com/earth2me/essentials/IUser.java b/Essentials/src/com/earth2me/essentials/IUser.java index bff556ab4..df5401886 100644 --- a/Essentials/src/com/earth2me/essentials/IUser.java +++ b/Essentials/src/com/earth2me/essentials/IUser.java @@ -32,6 +32,8 @@ public interface IUser extends Player void takeMoney(double value); void giveMoney(double value); + + boolean canAfford(double value); String getGroup(); diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 40fb47f6c..39179b957 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -539,6 +539,22 @@ public class Settings implements ISettings } return max; } + + private final static double MINMONEY = -10000000000000.0; + + @Override + public double getMinMoney() + { + double min = config.getDouble("min-money", MINMONEY); + if (min > 0) { + min = -min; + } + if (min < MINMONEY) + { + min = MINMONEY; + } + return min; + } @Override public boolean isEcoLogEnabled() diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java index 933b54b3f..5ed80d35b 100644 --- a/Essentials/src/com/earth2me/essentials/Trade.java +++ b/Essentials/src/com/earth2me/essentials/Trade.java @@ -143,8 +143,7 @@ public class Trade { if (getMoney() != null) { - final double mon = user.getMoney(); - if (mon < getMoney() && getMoney() > 0 && !user.isAuthorized("essentials.eco.loan")) + if (!user.canAfford(getMoney()) && getMoney() > 0) { throw new ChargeException(_("notEnoughMoney")); } @@ -163,9 +162,8 @@ public class Trade && !user.isAuthorized("essentials.nocommandcost.all") && !user.isAuthorized("essentials.nocommandcost." + command)) { - final double mon = user.getMoney(); final double cost = ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command); - if (mon < cost && cost > 0 && !user.isAuthorized("essentials.eco.loan")) + if (!user.canAfford(cost) && cost > 0) { throw new ChargeException(_("notEnoughMoney")); } diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 7225e1dba..a799653a8 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -153,9 +153,18 @@ public class User extends UserData implements Comparable, IReplyTo, IUser } public boolean canAfford(final double cost) + { + return canAfford(cost, true); + } + + public boolean canAfford(final double cost, final boolean permcheck) { final double mon = getMoney(); - return mon >= cost || isAuthorized("essentials.eco.loan"); + if (!permcheck || isAuthorized("essentials.eco.loan")) + { + return (mon + cost) > ess.getSettings().getMinMoney(); + } + return cost <= mon; } public void dispose() @@ -384,7 +393,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser public void updateMoneyCache(final double value) { if (ess.getPaymentMethod().hasMethod() && super.getMoney() != value) - { + { super.setMoney(value); } } diff --git a/Essentials/src/com/earth2me/essentials/api/Economy.java b/Essentials/src/com/earth2me/essentials/api/Economy.java index 1d45c8df9..a1d421c38 100644 --- a/Essentials/src/com/earth2me/essentials/api/Economy.java +++ b/Essentials/src/com/earth2me/essentials/api/Economy.java @@ -115,6 +115,10 @@ public final class Economy { throw new UserDoesNotExistException(name); } + if (balance < ess.getSettings().getMinMoney()) + { + throw new NoLoanPermittedException(); + } if (balance < 0.0 && !user.isAuthorized("essentials.eco.loan")) { throw new NoLoanPermittedException(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java index 8f432ca6e..d2efc1845 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.commands; +import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import java.util.Locale; import org.bukkit.Server; @@ -45,6 +46,9 @@ public class Commandeco extends EssentialsCommand break; case TAKE: + if (!player.canAfford(amount, false)) { + throw new Exception(_("notEnoughMoney")); + } player.takeMoney(amount); break; diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index 0e544ae06..5249c8718 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -196,4 +196,15 @@ public class User extends UserBase implements IUser unlock(); } } + + @Override + public boolean canAfford(final double cost) + { + final double mon = getMoney(); + if (isAuthorized("essentials.eco.loan")) + { + return (mon + cost) > ess.getSettings().getMinMoney(); + } + return cost <= mon; + } } diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 00585f35f..97b73e4c5 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -281,10 +281,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 @@ -321,6 +321,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 +# Setting this to 0, will disable overdrafts/loans compeltely. Users need 'essentials.eco.loan' perm to go below 0. +min-money: -10000000000000 + # Enable this to log all interactions with trade/buy/sell signs and sell command economy-log-enabled: false -- cgit v1.2.3 From e277acf80eab14b75c999881b009616a949f52a5 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 04:27:13 +0000 Subject: Display users new balance on /eco give/take. --- Essentials/src/com/earth2me/essentials/User.java | 4 ++-- Essentials/src/com/earth2me/essentials/commands/Commandeco.java | 9 +++++++-- Essentials/src/messages.properties | 4 ++-- Essentials/src/messages_da.properties | 4 ++-- Essentials/src/messages_de.properties | 4 ++-- Essentials/src/messages_en.properties | 4 ++-- Essentials/src/messages_es.properties | 4 ++-- Essentials/src/messages_fr.properties | 4 ++-- Essentials/src/messages_nl.properties | 4 ++-- 9 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index a799653a8..501577878 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -109,7 +109,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser sendMessage(_("addedToAccount", Util.formatCurrency(value, ess))); if (initiator != null) { - initiator.sendMessage(_("addedToOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName())); + initiator.sendMessage(_("addedToOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName(), Util.formatCurrency(getMoney(), ess))); } } @@ -148,7 +148,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser sendMessage(_("takenFromAccount", Util.formatCurrency(value, ess))); if (initiator != null) { - initiator.sendMessage(_("takenFromOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName())); + initiator.sendMessage(_("takenFromOthersAccount", Util.formatCurrency(value, ess), this.getDisplayName(), Util.formatCurrency(getMoney(), ess))); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java index d2efc1845..b9694ee49 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java @@ -46,8 +46,9 @@ public class Commandeco extends EssentialsCommand break; case TAKE: - if (!player.canAfford(amount, false)) { - throw new Exception(_("notEnoughMoney")); + if (!player.canAfford(amount, false)) + { + throw new Exception(_("notEnoughMoney")); } player.takeMoney(amount); break; @@ -68,6 +69,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/messages.properties b/Essentials/src/messages.properties index 8489b6262..118c61ca4 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} has been added to {1} account. New balance: {2} alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=placed: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... teleportationCommencing=\u00a77Teleportation commencing... diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 82145afc1..a2719ddd1 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} has been added to {1} account. New balance: {2} alertBroke=\u00f8delagde: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} ved: {3} alertPlaced=placerede: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Anmodning om teleport er sendt til alle spillere. teleportAll=\u00a77Teleporterer alle spillere... teleportationCommencing=\u00a77Teleport begynder... diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 2572f7cf2..b5ca8a800 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} has been added to {1} account. New balance: {2} alertBroke=zerst\u00f6rt: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bei: {3} alertPlaced=platziert: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Teleportierungsanfrage zu allen Spielern gesendet... teleportAll=\u00a77Teleportiere alle Spieler... teleportAtoB=\u00a77{0}\u00a77 teleportiert dich zu {1}\u00a77. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index a2acdf9a2..dac209927 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} has been added to {1} account. New balance: {2} alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=placed: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... teleportationCommencing=\u00a77Teleportation commencing... diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 38d62f6c4..0c1ca7452 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} has been added to {1} account. New balance: {2} alertBroke=roto: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} en: {3} alertPlaced=situado: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Peticion de teletransporte enviada a todos los jugadores... teleportAll=\u00a77Teletransportando a todos los jugadores... teleportationCommencing=\u00a77Comenzando teletransporte... diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 290c1b668..bd93cb8e8 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} has been added to {1} account. New balance: {2} alertBroke=a cass\u00e9 : alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} \u00e0:{3} alertPlaced=a plac\u00e9 : @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Demande de t\u00e9l\u00e9portation envoy\u00e9e \u00e0 tous les joueurs... teleportAll=\u00a77T\u00e9l\u00e9poration de tous les joueurs. teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation... diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 8997bfec6..f2c9f9b2f 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} has been added to {1} account. New balance: {2} alertBroke=gebroken: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bij: {3} alertPlaced=geplaatst: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Bezig met teleporteren van alle spelers... teleportationCommencing=\u00a77Aan het beginnen met teleporteren... -- cgit v1.2.3 From 862f3aad599bb04a570411c774cfa23a5a2f1bb1 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 05:01:40 +0000 Subject: Adjustments to negative eco give/take. --- Essentials/src/com/earth2me/essentials/User.java | 3 ++- Essentials/src/com/earth2me/essentials/user/User.java | 2 +- Essentials/src/messages.properties | 4 ++-- Essentials/src/messages_da.properties | 4 ++-- Essentials/src/messages_de.properties | 4 ++-- Essentials/src/messages_en.properties | 4 ++-- Essentials/src/messages_es.properties | 4 ++-- Essentials/src/messages_fr.properties | 4 ++-- Essentials/src/messages_nl.properties | 4 ++-- 9 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 501577878..bd712bf87 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -160,9 +160,10 @@ public class User extends UserData implements Comparable, IReplyTo, IUser public boolean canAfford(final double cost, final boolean permcheck) { final double mon = getMoney(); + ess.getLogger().log(Level.INFO, "min cash is " + ess.getSettings().getMinMoney()); if (!permcheck || isAuthorized("essentials.eco.loan")) { - return (mon + cost) > ess.getSettings().getMinMoney(); + return (mon - cost) > ess.getSettings().getMinMoney(); } return cost <= mon; } diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index 5249c8718..d77790938 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -203,7 +203,7 @@ public class User extends UserBase implements IUser final double mon = getMoney(); if (isAuthorized("essentials.eco.loan")) { - return (mon + cost) > ess.getSettings().getMinMoney(); + return (mon - cost) > ess.getSettings().getMinMoney(); } return cost <= mon; } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 118c61ca4..f7958319d 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. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=placed: @@ -318,7 +318,7 @@ 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. New balance: {2} +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... teleportationCommencing=\u00a77Teleportation commencing... diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index a2719ddd1..0d8260947 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} has been added to {1} account. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=\u00f8delagde: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} ved: {3} alertPlaced=placerede: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Anmodning om teleport er sendt til alle spillere. teleportAll=\u00a77Teleporterer alle spillere... teleportationCommencing=\u00a77Teleport begynder... diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index b5ca8a800..815972f03 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} has been added to {1} account. New balance: {2} +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: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} +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. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index dac209927..dfc7600dc 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. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=placed: @@ -318,7 +318,7 @@ 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. New balance: {2} +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... teleportationCommencing=\u00a77Teleportation commencing... diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 0c1ca7452..909ec7434 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} has been added to {1} account. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=roto: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} en: {3} alertPlaced=situado: @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} +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... teleportationCommencing=\u00a77Comenzando teletransporte... diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index bd93cb8e8..a74be475b 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} has been added to {1} account. New balance: {2} +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 : @@ -318,7 +318,7 @@ 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} has been taken from {1} account. New balance: {2} +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. teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation... diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index f2c9f9b2f..51bbe2bed 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} has been added to {1} account. New balance: {2} +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} alertBroke=gebroken: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} bij: {3} alertPlaced=geplaatst: @@ -318,7 +318,7 @@ suicideMessage=\u00a77Vaarwel vreedzame wereld... suicideSuccess= \u00a77{0} pleegde zelfmoord survival=survival takenFromAccount=\u00a7c{0} is van je bank rekening afgehaald. -takenFromOthersAccount=\u00a7c{0} has been taken from {1} account. New balance: {2} +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... teleportationCommencing=\u00a77Aan het beginnen met teleporteren... -- cgit v1.2.3 From 6ab57b9abefd0e0f9676127fda741da1507b2629 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 05:06:03 +0000 Subject: Cleanup. --- Essentials/src/com/earth2me/essentials/Settings.java | 14 ++++++-------- Essentials/src/com/earth2me/essentials/User.java | 2 -- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 39179b957..b6b1f4994 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -5,9 +5,7 @@ import com.earth2me.essentials.commands.IEssentialsCommand; import com.earth2me.essentials.signs.EssentialsSign; import com.earth2me.essentials.signs.Signs; import com.earth2me.essentials.textreader.IText; -import com.earth2me.essentials.textreader.KeywordReplacer; import com.earth2me.essentials.textreader.SimpleTextInput; -import com.earth2me.essentials.textreader.SimpleTextPager; import java.io.File; import java.text.MessageFormat; import java.util.*; @@ -218,10 +216,10 @@ public class Settings implements ISettings if (config.isConfigurationSection("kits")) { final ConfigurationSection kits = getKits(); - if (kits.isConfigurationSection(name)) + if (kits.isConfigurationSection(name)) { return kits.getConfigurationSection(name).getValues(true); - } + } } return null; } @@ -539,15 +537,15 @@ public class Settings implements ISettings } return max; } - private final static double MINMONEY = -10000000000000.0; - + @Override public double getMinMoney() { double min = config.getDouble("min-money", MINMONEY); - if (min > 0) { - min = -min; + if (min > 0) + { + min = -min; } if (min < MINMONEY) { diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index bd712bf87..86a3bcbfe 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -7,7 +7,6 @@ import java.util.Calendar; import java.util.GregorianCalendar; import java.util.logging.Level; import java.util.logging.Logger; -import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -160,7 +159,6 @@ public class User extends UserData implements Comparable, IReplyTo, IUser public boolean canAfford(final double cost, final boolean permcheck) { final double mon = getMoney(); - ess.getLogger().log(Level.INFO, "min cash is " + ess.getSettings().getMinMoney()); if (!permcheck || isAuthorized("essentials.eco.loan")) { return (mon - cost) > ess.getSettings().getMinMoney(); -- cgit v1.2.3 From 332f19177e961a60c984e674e499c78a87f4fb49 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 26 Feb 2012 05:10:04 +0000 Subject: Allow people to hit exactly 'min money'. --- Essentials/src/com/earth2me/essentials/User.java | 2 +- Essentials/src/com/earth2me/essentials/user/User.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 86a3bcbfe..0be375c88 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -161,7 +161,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser final double mon = getMoney(); if (!permcheck || isAuthorized("essentials.eco.loan")) { - return (mon - cost) > ess.getSettings().getMinMoney(); + return (mon - cost) >= ess.getSettings().getMinMoney(); } return cost <= mon; } diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index d77790938..0e77dd6a9 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -203,7 +203,7 @@ public class User extends UserBase implements IUser final double mon = getMoney(); if (isAuthorized("essentials.eco.loan")) { - return (mon - cost) > ess.getSettings().getMinMoney(); + return (mon - cost) >= ess.getSettings().getMinMoney(); } return cost <= mon; } -- cgit v1.2.3 From ac3e65a82947431b1504d79444d4b0219e20f366 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 27 Feb 2012 03:24:58 +0000 Subject: Change jail listener to catch respawn at Highest --- Essentials/src/com/earth2me/essentials/Jails.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java index 0011905ec..7217992ad 100644 --- a/Essentials/src/com/earth2me/essentials/Jails.java +++ b/Essentials/src/com/earth2me/essentials/Jails.java @@ -193,7 +193,7 @@ public class Jails extends AsyncStorageObjectHolder Date: Mon, 27 Feb 2012 03:40:18 +0000 Subject: Prevent EssSpawn trying to handle spawning of jailed players. --- .../com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index 083fd66a5..c7a17845a 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -35,6 +35,11 @@ public class EssentialsSpawnPlayerListener implements Listener { final User user = ess.getUser(event.getPlayer()); + if (user.isJailed() && user.getJail() != null && !user.getJail().isEmpty()) + { + return; + } + if (ess.getSettings().getRespawnAtHome()) { Location home; -- cgit v1.2.3 From 1c2221f52fdb523aa5d4aaef74d8b105c38badc3 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 27 Feb 2012 15:31:43 +0000 Subject: Adding option to log all eco api transactions. --- Essentials/src/com/earth2me/essentials/ISettings.java | 2 ++ Essentials/src/com/earth2me/essentials/Settings.java | 6 ++++++ Essentials/src/com/earth2me/essentials/Trade.java | 3 ++- Essentials/src/com/earth2me/essentials/User.java | 3 ++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index cded5bde5..6186736b4 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -119,6 +119,8 @@ public interface ISettings extends IConf double getMinMoney(); boolean isEcoLogEnabled(); + + boolean isEcoLogUpdateEnabled(); boolean removeGodOnDisconnect(); diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index b6b1f4994..732b5485c 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -559,6 +559,12 @@ public class Settings implements ISettings { return config.getBoolean("economy-log-enabled", false); } + + @Override + public boolean isEcoLogUpdateEnabled() + { + return config.getBoolean("economy-log-update-enabled", false); + } @Override public boolean removeGodOnDisconnect() diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java index 5ed80d35b..3594c3137 100644 --- a/Essentials/src/com/earth2me/essentials/Trade.java +++ b/Essentials/src/com/earth2me/essentials/Trade.java @@ -198,7 +198,8 @@ public class Trade public static void log(String type, String subtype, String event, String sender, Trade charge, String receiver, Trade pay, Location loc, IEssentials ess) { - if (!ess.getSettings().isEcoLogEnabled()) + if ((loc == null && !ess.getSettings().isEcoLogUpdateEnabled()) + || (loc != null && !ess.getSettings().isEcoLogEnabled())) { return; } diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 0be375c88..ba34548fe 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -385,8 +385,9 @@ public class User extends UserData implements Comparable, IReplyTo, IUser catch (Throwable ex) { } - } + } super.setMoney(value); + Trade.log("Update", "Set", "API", getName(), new Trade(value, ess), null, null, null, ess); } public void updateMoneyCache(final double value) -- cgit v1.2.3 From 3823e7a108eaff2ecc65cb9221ad344d36f8c9ef Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 28 Feb 2012 10:46:10 +0000 Subject: Make 'manload' reload the config correctly. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GroupManager.java | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 1159607ed..9d7187690 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -145,4 +145,5 @@ v 1.9: - 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. \ No newline at end of file + - 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/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index b0d46ca1a..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) { -- cgit v1.2.3 From bae337cc4946374640433700f8abb0f10c25dd24 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 1 Mar 2012 12:27:59 +1100 Subject: Remove old, unwanted manifest.mf files --- EssentialsGeoIP/manifest.mf | 3 --- EssentialsProtect/MANIFEST.MF | 1 - EssentialsUpdate/manifest.mf | 3 --- EssentialsXMPP/manifest.mf | 3 --- 4 files changed, 10 deletions(-) delete mode 100644 EssentialsGeoIP/manifest.mf delete mode 100644 EssentialsProtect/MANIFEST.MF delete mode 100644 EssentialsUpdate/manifest.mf delete mode 100644 EssentialsXMPP/manifest.mf diff --git a/EssentialsGeoIP/manifest.mf b/EssentialsGeoIP/manifest.mf deleted file mode 100644 index 328e8e5bc..000000000 --- a/EssentialsGeoIP/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - diff --git a/EssentialsProtect/MANIFEST.MF b/EssentialsProtect/MANIFEST.MF deleted file mode 100644 index 9d885be53..000000000 --- a/EssentialsProtect/MANIFEST.MF +++ /dev/null @@ -1 +0,0 @@ -Manifest-Version: 1.0 diff --git a/EssentialsUpdate/manifest.mf b/EssentialsUpdate/manifest.mf deleted file mode 100644 index 328e8e5bc..000000000 --- a/EssentialsUpdate/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - diff --git a/EssentialsXMPP/manifest.mf b/EssentialsXMPP/manifest.mf deleted file mode 100644 index 328e8e5bc..000000000 --- a/EssentialsXMPP/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - -- cgit v1.2.3 From 3f26d4ad9841b4ab30253222217edaaa60db3075 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 1 Mar 2012 14:40:57 +1100 Subject: Separate config sections evenly --- Essentials/src/config.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 00585f35f..0c9f00f1e 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) | # @@ -368,8 +366,6 @@ chat: # If your using group formats make sure to remove the '#' to allow the setting to be read. - - ############################################################ # +------------------------------------------------------+ # # | EssentialsProtect | # @@ -525,7 +521,6 @@ protect: # Should we tell people they are not allowed to build warn-on-build-disallow: true - # Disable weather options weather: storm: false -- cgit v1.2.3 From d1001274bb043fb4ada717577b4b6da7aaa87e96 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 15:56:17 +0100 Subject: CB# 1988 B# 1360 --- lib/bukkit.jar | Bin 4620068 -> 4686754 bytes lib/craftbukkit.jar | Bin 10793996 -> 10919232 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/bukkit.jar b/lib/bukkit.jar index aa22b004e..28e143709 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index 24d7801c3..ce2ecfeb8 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From 6d1c270976bc417206bf53ffc408c4b5c08e7f33 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 16:15:37 +0100 Subject: Updated to R6 --- .../src/com/earth2me/essentials/OfflinePlayer.java | 121 ++++++++++++++++++++- .../essentials/commands/Commandkillall.java | 8 +- .../essentials/craftbukkit/FakeInventory.java | 35 ++++++ .../earth2me/essentials/craftbukkit/FakeWorld.java | 37 +++++++ .../essentials/craftbukkit/ShowInventory.java | 46 -------- .../earth2me/essentials/signs/SignDisposal.java | 4 +- .../com/earth2me/essentials/signs/SignFree.java | 7 +- .../earth2me/essentials/textreader/HelpInput.java | 6 +- .../test/com/earth2me/essentials/FakeServer.java | 28 +++++ .../earth2me/essentials/update/VersionInfo.java | 2 +- .../update/states/InstallationFinishedEvent.java | 7 ++ 11 files changed, 242 insertions(+), 59 deletions(-) delete mode 100644 Essentials/src/com/earth2me/essentials/craftbukkit/ShowInventory.java diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index ba5f97c71..a1c46c3ea 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -1,18 +1,22 @@ package com.earth2me.essentials; -import com.earth2me.essentials.craftbukkit.OfflineBedLocation; import static com.earth2me.essentials.I18n._; import java.net.InetSocketAddress; import java.util.*; import lombok.Delegate; import org.bukkit.*; import org.bukkit.block.Block; +import org.bukkit.conversations.Conversation; import org.bukkit.entity.*; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryView; +import org.bukkit.inventory.InventoryView.Property; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; import org.bukkit.map.MapView; +import org.bukkit.metadata.MetadataValue; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionAttachment; import org.bukkit.permissions.PermissionAttachmentInfo; @@ -908,4 +912,119 @@ public class OfflinePlayer implements Player { return EntityType.PLAYER; } + + @Override + public void playEffect(Location lctn, Effect effect, T t) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean setWindowProperty(Property prprt, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView getOpenInventory() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openInventory(Inventory invntr) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openWorkbench(Location lctn, boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openEnchanting(Location lctn, boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void openInventory(InventoryView iv) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void closeInventory() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ItemStack getItemOnCursor() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setItemOnCursor(ItemStack is) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMetadata(String string, MetadataValue mv) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeMetadata(String string, Plugin plugin) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + + @Override + public boolean isConversing() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void acceptConversationInput(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean beginConversation(Conversation c) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void abandonConversation(Conversation c) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendMessage(String[] strings) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java index b9679e8b9..c0b47d20f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java @@ -125,7 +125,7 @@ public class Commandkillall extends EssentialsCommand { if (entity instanceof Animals || entity instanceof NPC || entity instanceof Snowman || entity instanceof WaterMob) { - EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST); + EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST); ess.getServer().getPluginManager().callEvent(event); entity.remove(); numKills++; @@ -135,7 +135,7 @@ public class Commandkillall extends EssentialsCommand { if (entity instanceof Monster || entity instanceof ComplexLivingEntity || entity instanceof Flying || entity instanceof Slime) { - EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST); + EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST); ess.getServer().getPluginManager().callEvent(event); entity.remove(); numKills++; @@ -143,14 +143,14 @@ public class Commandkillall extends EssentialsCommand } else if (all) { - EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST); + EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST); ess.getServer().getPluginManager().callEvent(event); entity.remove(); numKills++; } else if (entityClass != null && entityClass.isAssignableFrom(entity.getClass())) { - EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST); + EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST); ess.getServer().getPluginManager().callEvent(event); entity.remove(); numKills++; diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java index 992791710..01e7bd5b2 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java @@ -1,8 +1,13 @@ package com.earth2me.essentials.craftbukkit; import java.util.HashMap; +import java.util.List; +import java.util.ListIterator; import org.bukkit.Material; +import org.bukkit.entity.HumanEntity; +import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; @@ -187,4 +192,34 @@ public class FakeInventory implements Inventory items[i] = null; } } + + @Override + public List getViewers() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getTitle() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryType getType() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryHolder getHolder() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ListIterator iterator() + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java index f39c6e451..91e5d5239 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java @@ -12,6 +12,7 @@ import org.bukkit.entity.*; import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.ChunkGenerator; import org.bukkit.inventory.ItemStack; +import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; import org.bukkit.util.Vector; @@ -590,4 +591,40 @@ public class FakeWorld implements World { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public void playEffect(Location lctn, Effect effect, T t) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playEffect(Location lctn, Effect effect, T t, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMetadata(String string, MetadataValue mv) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeMetadata(String string, Plugin plugin) + { + 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 fb2050ce4..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.a((IInventory)inv.getInventory()); - } - catch (Throwable ex) - { - Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex); - } - } - - public static void showFilledInventory(final Player player, final ItemStack stack) - { - try - { - final EntityPlayer entityPlayer = ((CraftPlayer)player).getHandle(); - final CraftInventoryPlayer inv = new CraftInventoryPlayer(new PlayerInventory(((CraftPlayer)player).getHandle())); - inv.clear(); - InventoryWorkaround.addItem(inv, true, stack); - entityPlayer.a((IInventory)inv.getInventory()); - } - catch (Throwable ex) - { - Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex); - } - } -} diff --git a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java index f747ac07c..77e6164e5 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.User; -import com.earth2me.essentials.craftbukkit.ShowInventory; +import org.bukkit.event.inventory.InventoryType; public class SignDisposal extends EssentialsSign @@ -15,7 +15,7 @@ public class SignDisposal extends EssentialsSign @Override protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) { - ShowInventory.showEmptyInventory(player.getBase()); + player.getBase().openInventory(ess.getServer().createInventory(player, InventoryType.CHEST)); return true; } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java index 7af7dffd7..a69b4155f 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java @@ -4,8 +4,9 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; -import com.earth2me.essentials.craftbukkit.ShowInventory; import org.bukkit.Material; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -33,7 +34,9 @@ public class SignFree extends EssentialsSign } item.setAmount(item.getType().getMaxStackSize() * 9 * 4); - ShowInventory.showFilledInventory(player.getBase(), item); + 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/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java index 85c00c1b6..efe66d585 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java @@ -30,9 +30,9 @@ public class HelpInput implements IText try { final PluginDescriptionFile desc = p.getDescription(); - final HashMap> cmds = (HashMap>)desc.getCommands(); + final Map> cmds = desc.getCommands(); pluginName = p.getDescription().getName().toLowerCase(Locale.ENGLISH); - for (Map.Entry> k : cmds.entrySet()) + for (Map.Entry> k : cmds.entrySet()) { try { @@ -57,7 +57,7 @@ public class HelpInput implements IText { if (ess.getSettings().showNonEssCommandsInHelp()) { - final HashMap value = k.getValue(); + final Map value = k.getValue(); Object permissions = null; if (value.containsKey(PERMISSION)) { diff --git a/Essentials/test/com/earth2me/essentials/FakeServer.java b/Essentials/test/com/earth2me/essentials/FakeServer.java index a7335a957..58fdfc5fe 100644 --- a/Essentials/test/com/earth2me/essentials/FakeServer.java +++ b/Essentials/test/com/earth2me/essentials/FakeServer.java @@ -13,7 +13,11 @@ import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; import org.bukkit.command.PluginCommand; import org.bukkit.entity.Player; +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; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.Recipe; import org.bukkit.map.MapView; @@ -677,4 +681,28 @@ public class FakeServer implements Server { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public HelpMap getHelpMap() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Inventory createInventory(InventoryHolder ih, InventoryType it) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Inventory createInventory(InventoryHolder ih, int i) + { + 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/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java b/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java index b9cddc38c..c06aa2e64 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java @@ -16,7 +16,7 @@ public class VersionInfo public VersionInfo(final Configuration updateConfig, final String path) { - changelog = updateConfig.getList(path + ".changelog", Collections.emptyList()); + changelog = updateConfig.getStringList(path + ".changelog"); minBukkit = updateConfig.getInt(path + ".min-bukkit", 0); maxBukkit = updateConfig.getInt(path + ".max-bukkit", 0); modules = new HashMap(); diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java index 02b35c3d6..82d9ee627 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java @@ -1,6 +1,7 @@ package com.earth2me.essentials.update.states; import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; public class InstallationFinishedEvent extends Event @@ -9,4 +10,10 @@ public class InstallationFinishedEvent extends Event { super(); } + + @Override + public HandlerList getHandlers() + { + throw new UnsupportedOperationException("Not supported yet."); + } } -- cgit v1.2.3 From 454f7d30de818268e4e1c2baf5daace6e3592908 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 16:17:40 +0100 Subject: Requires #1988 because of the new Inventory stuff --- Essentials/src/com/earth2me/essentials/Essentials.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index ff082efa7..f480d9e8f 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 1958; + public static final int BUKKIT_VERSION = 1988; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); -- cgit v1.2.3 From 056303b53c953f4a9effa661b1a61d35893a8858 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 17:33:09 +0100 Subject: EntityType instead of CreatureType --- Essentials/src/com/earth2me/essentials/Mob.java | 56 +++++++++++----------- .../essentials/commands/Commandspawner.java | 3 +- .../essentials/commands/Commandspawnmob.java | 24 +++++----- 3 files changed, 42 insertions(+), 41 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Mob.java b/Essentials/src/com/earth2me/essentials/Mob.java index 049f7b8a3..7be698950 100644 --- a/Essentials/src/com/earth2me/essentials/Mob.java +++ b/Essentials/src/com/earth2me/essentials/Mob.java @@ -9,40 +9,40 @@ 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); 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 +50,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 +59,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 hashMap = new HashMap(); static @@ -99,7 +99,7 @@ public enum Mob final protected String type; } - public CreatureType getType() + public EntityType getType() { return bukkitType; } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java index d52315241..1cd65a743 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java @@ -10,6 +10,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.block.CreatureSpawner; +import org.bukkit.entity.EntityType; public class Commandspawner extends EssentialsCommand @@ -54,7 +55,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 948c82871..4971c7922 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -197,9 +197,9 @@ public class Commandspawnmob extends EssentialsCommand } } - private void changeMobData(final CreatureType type, final Entity spawned, final String data, final User user) throws Exception + private void changeMobData(final EntityType type, final Entity spawned, final String data, final User user) throws Exception { - if (type == CreatureType.SLIME || type == CreatureType.MAGMA_CUBE) + if (type == EntityType.SLIME || type == EntityType.MAGMA_CUBE) { try { @@ -210,18 +210,18 @@ 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) + if ((type == EntityType.SHEEP + || type == EntityType.COW + || type == EntityType.MUSHROOM_COW + || type == EntityType.CHICKEN + || type == EntityType.PIG + || type == EntityType.WOLF) && data.equalsIgnoreCase("baby")) { ((Animals)spawned).setAge(-24000); return; } - if (type == CreatureType.SHEEP) + if (type == EntityType.SHEEP) { if (data.toLowerCase(Locale.ENGLISH).contains("baby")) { @@ -246,7 +246,7 @@ public class Commandspawnmob extends EssentialsCommand throw new Exception(_("sheepMalformedColor"), e); } } - if (type == CreatureType.WOLF + if (type == EntityType.WOLF && data.toLowerCase(Locale.ENGLISH).startsWith("tamed")) { final Wolf wolf = ((Wolf)spawned); @@ -258,7 +258,7 @@ public class Commandspawnmob extends EssentialsCommand ((Animals)spawned).setAge(-24000); } } - if (type == CreatureType.WOLF + if (type == EntityType.WOLF && data.toLowerCase(Locale.ENGLISH).startsWith("angry")) { ((Wolf)spawned).setAngry(true); @@ -267,7 +267,7 @@ public class Commandspawnmob extends EssentialsCommand ((Animals)spawned).setAge(-24000); } } - if (type == CreatureType.CREEPER && data.equalsIgnoreCase("powered")) + if (type == EntityType.CREEPER && data.equalsIgnoreCase("powered")) { ((Creeper)spawned).setPowered(true); } -- cgit v1.2.3 From 0670ece7f3602602794b9636da073c21b7076377 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 25 Feb 2012 17:57:26 +0000 Subject: Updating Bukkit: CB #1858, B #1334 --- .../src/com/earth2me/essentials/Essentials.java | 2 +- .../src/com/earth2me/essentials/OfflinePlayer.java | 17 ++++++++++++----- .../earth2me/essentials/craftbukkit/FakeWorld.java | 6 ++++++ lib/bukkit.jar | Bin 4614591 -> 4620068 bytes lib/craftbukkit.jar | Bin 10786423 -> 10793996 bytes 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index a75e12aad..ff082efa7 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 1938; + public static final int BUKKIT_VERSION = 1958; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index 440d3fad3..ba5f97c71 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -172,11 +172,6 @@ public class OfflinePlayer implements Player return false; } - public boolean isPlayer() - { - return false; - } - @Override public int getRemainingAir() { @@ -901,4 +896,16 @@ public class OfflinePlayer implements Player { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public T launchProjectile(Class arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public EntityType getType() + { + return EntityType.PLAYER; + } } diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java index 0ea06e72b..f39c6e451 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java @@ -584,4 +584,10 @@ public class FakeWorld implements World { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public LivingEntity spawnCreature(Location arg0, EntityType arg1) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/lib/bukkit.jar b/lib/bukkit.jar index e343a9723..aa22b004e 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index d51826640..24d7801c3 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From ba346bd797ee101fba94b028861683f215d661d0 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 28 Feb 2012 10:46:10 +0000 Subject: Make 'manload' reload the config correctly. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GroupManager.java | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 1159607ed..9d7187690 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -145,4 +145,5 @@ v 1.9: - 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. \ No newline at end of file + - 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/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index b0d46ca1a..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) { -- cgit v1.2.3 From e5081db7e40b41e2755d2483400d1afd100f7db5 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 1 Mar 2012 12:27:59 +1100 Subject: Remove old, unwanted manifest.mf files --- EssentialsGeoIP/manifest.mf | 3 --- EssentialsProtect/MANIFEST.MF | 1 - EssentialsUpdate/manifest.mf | 3 --- EssentialsXMPP/manifest.mf | 3 --- 4 files changed, 10 deletions(-) delete mode 100644 EssentialsGeoIP/manifest.mf delete mode 100644 EssentialsProtect/MANIFEST.MF delete mode 100644 EssentialsUpdate/manifest.mf delete mode 100644 EssentialsXMPP/manifest.mf diff --git a/EssentialsGeoIP/manifest.mf b/EssentialsGeoIP/manifest.mf deleted file mode 100644 index 328e8e5bc..000000000 --- a/EssentialsGeoIP/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - diff --git a/EssentialsProtect/MANIFEST.MF b/EssentialsProtect/MANIFEST.MF deleted file mode 100644 index 9d885be53..000000000 --- a/EssentialsProtect/MANIFEST.MF +++ /dev/null @@ -1 +0,0 @@ -Manifest-Version: 1.0 diff --git a/EssentialsUpdate/manifest.mf b/EssentialsUpdate/manifest.mf deleted file mode 100644 index 328e8e5bc..000000000 --- a/EssentialsUpdate/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - diff --git a/EssentialsXMPP/manifest.mf b/EssentialsXMPP/manifest.mf deleted file mode 100644 index 328e8e5bc..000000000 --- a/EssentialsXMPP/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - -- cgit v1.2.3 From e1818f7e62b56f0e4970923518cd953db9edbe11 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 1 Mar 2012 14:40:57 +1100 Subject: Separate config sections evenly --- Essentials/src/config.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 97b73e4c5..81d911c82 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) | # @@ -372,8 +370,6 @@ chat: # If your using group formats make sure to remove the '#' to allow the setting to be read. - - ############################################################ # +------------------------------------------------------+ # # | EssentialsProtect | # @@ -529,7 +525,6 @@ protect: # Should we tell people they are not allowed to build warn-on-build-disallow: true - # Disable weather options weather: storm: false -- cgit v1.2.3 From b44d738867544386b905e23bd32c4066863de5d4 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 15:56:17 +0100 Subject: CB# 1988 B# 1360 --- lib/bukkit.jar | Bin 4620068 -> 4686754 bytes lib/craftbukkit.jar | Bin 10793996 -> 10919232 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/bukkit.jar b/lib/bukkit.jar index aa22b004e..28e143709 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index 24d7801c3..ce2ecfeb8 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From 02c1cb05c7d5f4f8d472d714b24c57b9a0de4f5e Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 16:15:37 +0100 Subject: Updated to R6 --- .../src/com/earth2me/essentials/OfflinePlayer.java | 121 ++++++++++++++++++++- .../essentials/commands/Commandkillall.java | 8 +- .../essentials/craftbukkit/FakeInventory.java | 35 ++++++ .../earth2me/essentials/craftbukkit/FakeWorld.java | 37 +++++++ .../essentials/craftbukkit/ShowInventory.java | 46 -------- .../earth2me/essentials/signs/SignDisposal.java | 4 +- .../com/earth2me/essentials/signs/SignFree.java | 7 +- .../earth2me/essentials/textreader/HelpInput.java | 6 +- .../test/com/earth2me/essentials/FakeServer.java | 28 +++++ .../earth2me/essentials/update/VersionInfo.java | 2 +- .../update/states/InstallationFinishedEvent.java | 7 ++ 11 files changed, 242 insertions(+), 59 deletions(-) delete mode 100644 Essentials/src/com/earth2me/essentials/craftbukkit/ShowInventory.java diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index ba5f97c71..a1c46c3ea 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -1,18 +1,22 @@ package com.earth2me.essentials; -import com.earth2me.essentials.craftbukkit.OfflineBedLocation; import static com.earth2me.essentials.I18n._; import java.net.InetSocketAddress; import java.util.*; import lombok.Delegate; import org.bukkit.*; import org.bukkit.block.Block; +import org.bukkit.conversations.Conversation; import org.bukkit.entity.*; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryView; +import org.bukkit.inventory.InventoryView.Property; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; import org.bukkit.map.MapView; +import org.bukkit.metadata.MetadataValue; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionAttachment; import org.bukkit.permissions.PermissionAttachmentInfo; @@ -908,4 +912,119 @@ public class OfflinePlayer implements Player { return EntityType.PLAYER; } + + @Override + public void playEffect(Location lctn, Effect effect, T t) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean setWindowProperty(Property prprt, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView getOpenInventory() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openInventory(Inventory invntr) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openWorkbench(Location lctn, boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openEnchanting(Location lctn, boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void openInventory(InventoryView iv) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void closeInventory() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ItemStack getItemOnCursor() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setItemOnCursor(ItemStack is) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMetadata(String string, MetadataValue mv) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeMetadata(String string, Plugin plugin) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + + @Override + public boolean isConversing() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void acceptConversationInput(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean beginConversation(Conversation c) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void abandonConversation(Conversation c) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendMessage(String[] strings) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java index b9679e8b9..c0b47d20f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java @@ -125,7 +125,7 @@ public class Commandkillall extends EssentialsCommand { if (entity instanceof Animals || entity instanceof NPC || entity instanceof Snowman || entity instanceof WaterMob) { - EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST); + EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST); ess.getServer().getPluginManager().callEvent(event); entity.remove(); numKills++; @@ -135,7 +135,7 @@ public class Commandkillall extends EssentialsCommand { if (entity instanceof Monster || entity instanceof ComplexLivingEntity || entity instanceof Flying || entity instanceof Slime) { - EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST); + EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST); ess.getServer().getPluginManager().callEvent(event); entity.remove(); numKills++; @@ -143,14 +143,14 @@ public class Commandkillall extends EssentialsCommand } else if (all) { - EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST); + EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST); ess.getServer().getPluginManager().callEvent(event); entity.remove(); numKills++; } else if (entityClass != null && entityClass.isAssignableFrom(entity.getClass())) { - EntityDeathEvent event = new EntityDeathEvent(entity, Collections.EMPTY_LIST); + EntityDeathEvent event = new EntityDeathEvent((LivingEntity)entity, Collections.EMPTY_LIST); ess.getServer().getPluginManager().callEvent(event); entity.remove(); numKills++; diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java index 992791710..01e7bd5b2 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java @@ -1,8 +1,13 @@ package com.earth2me.essentials.craftbukkit; import java.util.HashMap; +import java.util.List; +import java.util.ListIterator; import org.bukkit.Material; +import org.bukkit.entity.HumanEntity; +import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; @@ -187,4 +192,34 @@ public class FakeInventory implements Inventory items[i] = null; } } + + @Override + public List getViewers() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getTitle() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryType getType() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryHolder getHolder() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ListIterator iterator() + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java index f39c6e451..91e5d5239 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java @@ -12,6 +12,7 @@ import org.bukkit.entity.*; import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.ChunkGenerator; import org.bukkit.inventory.ItemStack; +import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; import org.bukkit.util.Vector; @@ -590,4 +591,40 @@ public class FakeWorld implements World { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public void playEffect(Location lctn, Effect effect, T t) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playEffect(Location lctn, Effect effect, T t, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMetadata(String string, MetadataValue mv) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeMetadata(String string, Plugin plugin) + { + 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 fb2050ce4..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.a((IInventory)inv.getInventory()); - } - catch (Throwable ex) - { - Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex); - } - } - - public static void showFilledInventory(final Player player, final ItemStack stack) - { - try - { - final EntityPlayer entityPlayer = ((CraftPlayer)player).getHandle(); - final CraftInventoryPlayer inv = new CraftInventoryPlayer(new PlayerInventory(((CraftPlayer)player).getHandle())); - inv.clear(); - InventoryWorkaround.addItem(inv, true, stack); - entityPlayer.a((IInventory)inv.getInventory()); - } - catch (Throwable ex) - { - Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex); - } - } -} diff --git a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java index f747ac07c..77e6164e5 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.User; -import com.earth2me.essentials.craftbukkit.ShowInventory; +import org.bukkit.event.inventory.InventoryType; public class SignDisposal extends EssentialsSign @@ -15,7 +15,7 @@ public class SignDisposal extends EssentialsSign @Override protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) { - ShowInventory.showEmptyInventory(player.getBase()); + player.getBase().openInventory(ess.getServer().createInventory(player, InventoryType.CHEST)); return true; } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java index 7af7dffd7..a69b4155f 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java @@ -4,8 +4,9 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; -import com.earth2me.essentials.craftbukkit.ShowInventory; import org.bukkit.Material; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -33,7 +34,9 @@ public class SignFree extends EssentialsSign } item.setAmount(item.getType().getMaxStackSize() * 9 * 4); - ShowInventory.showFilledInventory(player.getBase(), item); + 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/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java index 85c00c1b6..efe66d585 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java @@ -30,9 +30,9 @@ public class HelpInput implements IText try { final PluginDescriptionFile desc = p.getDescription(); - final HashMap> cmds = (HashMap>)desc.getCommands(); + final Map> cmds = desc.getCommands(); pluginName = p.getDescription().getName().toLowerCase(Locale.ENGLISH); - for (Map.Entry> k : cmds.entrySet()) + for (Map.Entry> k : cmds.entrySet()) { try { @@ -57,7 +57,7 @@ public class HelpInput implements IText { if (ess.getSettings().showNonEssCommandsInHelp()) { - final HashMap value = k.getValue(); + final Map value = k.getValue(); Object permissions = null; if (value.containsKey(PERMISSION)) { diff --git a/Essentials/test/com/earth2me/essentials/FakeServer.java b/Essentials/test/com/earth2me/essentials/FakeServer.java index a7335a957..58fdfc5fe 100644 --- a/Essentials/test/com/earth2me/essentials/FakeServer.java +++ b/Essentials/test/com/earth2me/essentials/FakeServer.java @@ -13,7 +13,11 @@ import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; import org.bukkit.command.PluginCommand; import org.bukkit.entity.Player; +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; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.Recipe; import org.bukkit.map.MapView; @@ -677,4 +681,28 @@ public class FakeServer implements Server { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public HelpMap getHelpMap() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Inventory createInventory(InventoryHolder ih, InventoryType it) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Inventory createInventory(InventoryHolder ih, int i) + { + 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/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java b/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java index b9cddc38c..c06aa2e64 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/VersionInfo.java @@ -16,7 +16,7 @@ public class VersionInfo public VersionInfo(final Configuration updateConfig, final String path) { - changelog = updateConfig.getList(path + ".changelog", Collections.emptyList()); + changelog = updateConfig.getStringList(path + ".changelog"); minBukkit = updateConfig.getInt(path + ".min-bukkit", 0); maxBukkit = updateConfig.getInt(path + ".max-bukkit", 0); modules = new HashMap(); diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java index 02b35c3d6..82d9ee627 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java @@ -1,6 +1,7 @@ package com.earth2me.essentials.update.states; import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; public class InstallationFinishedEvent extends Event @@ -9,4 +10,10 @@ public class InstallationFinishedEvent extends Event { super(); } + + @Override + public HandlerList getHandlers() + { + throw new UnsupportedOperationException("Not supported yet."); + } } -- cgit v1.2.3 From e43a62f99251570e02c00be1445f1e992cd51a60 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 16:17:40 +0100 Subject: Requires #1988 because of the new Inventory stuff --- Essentials/src/com/earth2me/essentials/Essentials.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index ff082efa7..f480d9e8f 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 1958; + public static final int BUKKIT_VERSION = 1988; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); -- cgit v1.2.3 From 696b930fb24a7739f2e7b13d20b924ffb5f10ca9 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 17:33:09 +0100 Subject: EntityType instead of CreatureType --- Essentials/src/com/earth2me/essentials/Mob.java | 56 +++++++++++----------- .../essentials/commands/Commandspawner.java | 3 +- .../essentials/commands/Commandspawnmob.java | 24 +++++----- 3 files changed, 42 insertions(+), 41 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Mob.java b/Essentials/src/com/earth2me/essentials/Mob.java index 049f7b8a3..7be698950 100644 --- a/Essentials/src/com/earth2me/essentials/Mob.java +++ b/Essentials/src/com/earth2me/essentials/Mob.java @@ -9,40 +9,40 @@ 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); 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 +50,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 +59,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 hashMap = new HashMap(); static @@ -99,7 +99,7 @@ public enum Mob final protected String type; } - public CreatureType getType() + public EntityType getType() { return bukkitType; } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java index d52315241..1cd65a743 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java @@ -10,6 +10,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.block.CreatureSpawner; +import org.bukkit.entity.EntityType; public class Commandspawner extends EssentialsCommand @@ -54,7 +55,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 948c82871..4971c7922 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -197,9 +197,9 @@ public class Commandspawnmob extends EssentialsCommand } } - private void changeMobData(final CreatureType type, final Entity spawned, final String data, final User user) throws Exception + private void changeMobData(final EntityType type, final Entity spawned, final String data, final User user) throws Exception { - if (type == CreatureType.SLIME || type == CreatureType.MAGMA_CUBE) + if (type == EntityType.SLIME || type == EntityType.MAGMA_CUBE) { try { @@ -210,18 +210,18 @@ 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) + if ((type == EntityType.SHEEP + || type == EntityType.COW + || type == EntityType.MUSHROOM_COW + || type == EntityType.CHICKEN + || type == EntityType.PIG + || type == EntityType.WOLF) && data.equalsIgnoreCase("baby")) { ((Animals)spawned).setAge(-24000); return; } - if (type == CreatureType.SHEEP) + if (type == EntityType.SHEEP) { if (data.toLowerCase(Locale.ENGLISH).contains("baby")) { @@ -246,7 +246,7 @@ public class Commandspawnmob extends EssentialsCommand throw new Exception(_("sheepMalformedColor"), e); } } - if (type == CreatureType.WOLF + if (type == EntityType.WOLF && data.toLowerCase(Locale.ENGLISH).startsWith("tamed")) { final Wolf wolf = ((Wolf)spawned); @@ -258,7 +258,7 @@ public class Commandspawnmob extends EssentialsCommand ((Animals)spawned).setAge(-24000); } } - if (type == CreatureType.WOLF + if (type == EntityType.WOLF && data.toLowerCase(Locale.ENGLISH).startsWith("angry")) { ((Wolf)spawned).setAngry(true); @@ -267,7 +267,7 @@ public class Commandspawnmob extends EssentialsCommand ((Animals)spawned).setAge(-24000); } } - if (type == CreatureType.CREEPER && data.equalsIgnoreCase("powered")) + if (type == EntityType.CREEPER && data.equalsIgnoreCase("powered")) { ((Creeper)spawned).setPowered(true); } -- cgit v1.2.3 From b0552019f53df8d76f051ceca26120ae1e524abf Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 1 Mar 2012 21:47:01 +0000 Subject: Fix version matching. --- Essentials/src/com/earth2me/essentials/Essentials.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index f480d9e8f..24ac0ad6e 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -129,10 +129,10 @@ 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)); + final int versionNumber = Integer.parseInt(versionMatch.group(1)); if (versionNumber < BUKKIT_VERSION) { LOGGER.log(Level.SEVERE, _("notRecommendedBukkit")); -- cgit v1.2.3 From 2e788802fe8856344235c1056bb5f6d66fecf23e Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 1 Mar 2012 22:04:50 +0000 Subject: Fix kit timers resetting on server restart. --- Essentials/src/com/earth2me/essentials/UserData.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index ea3201f28..cda2fa511 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -817,16 +817,12 @@ public abstract class UserData extends PlayerExtension implements IConf private Map _getKitTimestamps() { - final Object map = config.getProperty("timestamps.kits"); - - if (map instanceof Map) - { - return (Map)map; - } - else + + if (config.isConfigurationSection("timestamps.kits")) { - return new HashMap(); + return config.getConfigurationSection("timestamps.kits").getValues(false); } + return new HashMap(); } public Long getKitTimestamp(final String name) -- cgit v1.2.3 From c36ca65e09b8612731c7466b5c5f2b93e946e8ff Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 23:09:48 +0100 Subject: Bukkit broke this sign :( --- .../src/com/earth2me/essentials/signs/SignDisposal.java | 6 ++++-- Essentials/src/com/earth2me/essentials/signs/SignFree.java | 13 +++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java index 77e6164e5..aa6376fa0 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java @@ -2,7 +2,6 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.User; -import org.bukkit.event.inventory.InventoryType; public class SignDisposal extends EssentialsSign @@ -15,7 +14,10 @@ public class SignDisposal extends EssentialsSign @Override protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) { - player.getBase().openInventory(ess.getServer().createInventory(player, InventoryType.CHEST)); + 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/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java index a69b4155f..7ab771833 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java @@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; +import com.earth2me.essentials.craftbukkit.InventoryWorkaround; import org.bukkit.Material; import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.Inventory; @@ -33,10 +34,14 @@ public class SignFree extends EssentialsSign throw new SignException(_("cantSpawnItem", "Air")); } - item.setAmount(item.getType().getMaxStackSize() * 9 * 4); - Inventory i = ess.getServer().createInventory(player, InventoryType.CHEST); - i.addItem(item); - player.openInventory(i); + item.setAmount(item.getType().getMaxStackSize()); + InventoryWorkaround.addItem(player.getInventory(), true, item); + player.sendMessage("Item added to your inventory."); + //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; } -- cgit v1.2.3 From 6df3b9008a50922987c5100b17b400f9458d4a65 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 23:23:23 +0100 Subject: update inventory --- Essentials/src/com/earth2me/essentials/signs/SignFree.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java index 7ab771833..f5f32c38c 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java @@ -37,6 +37,7 @@ public class SignFree extends EssentialsSign 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); -- cgit v1.2.3 From b3d3928db8b9d5cf28436980834b82d36658b6c1 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 1 Mar 2012 22:36:51 +0000 Subject: Kit sign cleanup --- Essentials/src/com/earth2me/essentials/signs/SignKit.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/signs/SignKit.java b/Essentials/src/com/earth2me/essentials/signs/SignKit.java index 32a169592..102bd01b9 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignKit.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignKit.java @@ -17,7 +17,7 @@ public class SignKit extends EssentialsSign protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException { validateTrade(sign, 3, ess); - + final String kitName = sign.getLine(1).toLowerCase(Locale.ENGLISH); if (kitName.isEmpty()) @@ -56,10 +56,9 @@ public class SignKit extends EssentialsSign charge.isAffordableFor(player); try { - final Object kit = ess.getSettings().getKit(kitName); - final Map els = (Map)kit; - final List items = Kit.getItems(player, els); - Kit.expandItems(ess, player, items); + final Map kit = ess.getSettings().getKit(kitName); + final List items = Kit.getItems(player, kit); + Kit.expandItems(ess, player, items); charge.charge(player); } catch (Exception ex) -- cgit v1.2.3 From f75779aa7a08034682041931a124ef0c5e6f6564 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 1 Mar 2012 23:57:34 +0100 Subject: CB#2004 B#1368 --- lib/bukkit.jar | Bin 4686754 -> 4689493 bytes lib/craftbukkit.jar | Bin 10919232 -> 11036845 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/bukkit.jar b/lib/bukkit.jar index 28e143709..33a03e364 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index ce2ecfeb8..45958c144 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From 64d866a77dd42a3e26edf2aac83412003fe7df32 Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 2 Mar 2012 00:06:57 +0100 Subject: New Entities and Items for 1.2 --- Essentials/src/com/earth2me/essentials/Mob.java | 4 +++- .../com/earth2me/essentials/commands/Commandspawnmob.java | 12 ++++++++++++ Essentials/src/items.csv | 7 +++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Mob.java b/Essentials/src/com/earth2me/essentials/Mob.java index 7be698950..656ed6bc1 100644 --- a/Essentials/src/com/earth2me/essentials/Mob.java +++ b/Essentials/src/com/earth2me/essentials/Mob.java @@ -38,7 +38,9 @@ public enum Mob 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); + 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"); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 4971c7922..c793c9ab3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -271,5 +271,17 @@ public class Commandspawnmob extends EssentialsCommand { ((Creeper)spawned).setPowered(true); } + if (type == EntityType.OCELOT && data.equalsIgnoreCase("siamese")) + { + ((Ocelot)spawned).setCatType(Ocelot.Type.SIAMESE_CAT); + } + if (type == EntityType.OCELOT && data.equalsIgnoreCase("red")) + { + ((Ocelot)spawned).setCatType(Ocelot.Type.RED_CAT); + } + if (type == EntityType.OCELOT && data.equalsIgnoreCase("black")) + { + ((Ocelot)spawned).setCatType(Ocelot.Type.BLACK_CAT); + } } } diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index 98c25c327..2c8a65a1e 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 @@ -2453,6 +2456,10 @@ wolfegg,383,95 mooshroomegg,383,96 mushroomcowegg,383,96 villageregg,383,120 +bottleofenchanting,384,0 +enchantingbottle,384,0 +expbottle,384,0 +xpbottle,384,0 goldmusicrecord,2256,0 goldmusicdisk,2256,0 goldmusiccd,2256,0 -- cgit v1.2.3 From 49eb451a764f3d3cc57f673a4351788f56be5e5c Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 2 Mar 2012 00:09:50 +0100 Subject: New eggs --- Essentials/src/items.csv | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index 2c8a65a1e..acec277cc 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -2455,6 +2455,9 @@ 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 -- cgit v1.2.3 From b9aecbe1d4aac5046c871bcb4439ea3ad11eee5c Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 2 Mar 2012 00:12:22 +0100 Subject: Min version CB# 2004 --- Essentials/src/com/earth2me/essentials/Essentials.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 24ac0ad6e..53a31bb35 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 1988; + public static final int BUKKIT_VERSION = 2004; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); @@ -129,7 +129,7 @@ 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]+-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(1)); -- cgit v1.2.3 From 7564ebf79e3207c651bdbae5d0616260cbffc5c1 Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 2 Mar 2012 00:18:31 +0100 Subject: Fix world heights --- Essentials/src/com/earth2me/essentials/Util.java | 4 ++-- Essentials/src/com/earth2me/essentials/commands/Commandnuke.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index 3e3a7efd0..238ff0c00 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -293,7 +293,7 @@ public class Util while (isBlockUnsafe(world, x, y, z)) { y += 1; - if (y >= 127) + if (y >= world.getHighestBlockYAt(x, z)) { x += 1; break; @@ -304,8 +304,8 @@ public 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")); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java index ac92110cd..19695233e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java @@ -51,7 +51,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); } } -- cgit v1.2.3 From f1aed4b52172232d765b4379cf15c134700e960f Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 2 Mar 2012 00:40:50 +0100 Subject: Better cats --- .../essentials/commands/Commandspawnmob.java | 47 +++++++++++++--------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index c793c9ab3..341a702ff 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -197,8 +197,9 @@ public class Commandspawnmob extends EssentialsCommand } } - private void changeMobData(final EntityType type, final Entity spawned, final String data, final User user) throws Exception + private void changeMobData(final EntityType type, final Entity spawned, String data, final User user) throws Exception { + data = data.toLowerCase(Locale.ENGLISH); if (type == EntityType.SLIME || type == EntityType.MAGMA_CUBE) { try @@ -216,14 +217,14 @@ public class Commandspawnmob extends EssentialsCommand || type == EntityType.CHICKEN || type == EntityType.PIG || type == EntityType.WOLF) - && data.equalsIgnoreCase("baby")) + && data.equals("baby")) { ((Animals)spawned).setAge(-24000); return; } if (type == EntityType.SHEEP) { - if (data.toLowerCase(Locale.ENGLISH).contains("baby")) + if (data.contains("baby")) { ((Sheep)spawned).setAge(-24000); } @@ -231,7 +232,7 @@ public class Commandspawnmob extends EssentialsCommand try { - if (color.equalsIgnoreCase("random")) + if (color.equals("RANDOM")) { Random rand = new Random(); ((Sheep)spawned).setColor(DyeColor.values()[rand.nextInt(DyeColor.values().length)]); @@ -247,41 +248,49 @@ public class Commandspawnmob extends EssentialsCommand } } if (type == EntityType.WOLF - && data.toLowerCase(Locale.ENGLISH).startsWith("tamed")) + && data.startsWith("tamed")) { final Wolf wolf = ((Wolf)spawned); wolf.setTamed(true); wolf.setOwner(user); wolf.setSitting(true); - if (data.equalsIgnoreCase("tamedbaby")) + if (data.equals("tamedbaby")) { ((Animals)spawned).setAge(-24000); } } if (type == EntityType.WOLF - && data.toLowerCase(Locale.ENGLISH).startsWith("angry")) + && data.startsWith("angry")) { ((Wolf)spawned).setAngry(true); - if (data.equalsIgnoreCase("angrybaby")) + if (data.equals("angrybaby")) { ((Animals)spawned).setAge(-24000); } } - if (type == EntityType.CREEPER && data.equalsIgnoreCase("powered")) + if (type == EntityType.CREEPER && data.equals("powered")) { ((Creeper)spawned).setPowered(true); } - if (type == EntityType.OCELOT && data.equalsIgnoreCase("siamese")) + if (type == EntityType.OCELOT) { - ((Ocelot)spawned).setCatType(Ocelot.Type.SIAMESE_CAT); - } - if (type == EntityType.OCELOT && data.equalsIgnoreCase("red")) - { - ((Ocelot)spawned).setCatType(Ocelot.Type.RED_CAT); - } - if (type == EntityType.OCELOT && data.equalsIgnoreCase("black")) - { - ((Ocelot)spawned).setCatType(Ocelot.Type.BLACK_CAT); + final Ocelot cat = ((Ocelot)spawned); + if (data.contains("siamese")) { + cat.setCatType(Ocelot.Type.SIAMESE_CAT); + } + if (data.contains("red")) { + cat.setCatType(Ocelot.Type.RED_CAT); + } + if (data.contains("black")) { + cat.setCatType(Ocelot.Type.BLACK_CAT); + } + if (data.contains("tamed")) { + cat.setTamed(true); + cat.setOwner(user); + } + if (data.contains("baby")) { + cat.setAge(-24000); + } } } } -- cgit v1.2.3 From 21a248e94d6ee28410838877b956cb94cc37a965 Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 2 Mar 2012 01:30:52 +0100 Subject: Will be removed until the next release XD --- .../essentials/commands/Commandkittycannon.java | 44 ++++++++++++++++++++++ Essentials/src/plugin.yml | 3 ++ 2 files changed, 47 insertions(+) create mode 100644 Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java 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..3d9846923 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java @@ -0,0 +1,44 @@ +package com.earth2me.essentials.commands; + +import com.earth2me.essentials.Mob; +import com.earth2me.essentials.User; +import java.util.Random; +import org.bukkit.Location; +import org.bukkit.Server; +import org.bukkit.entity.Ocelot; + + +public class Commandkittycannon extends EssentialsCommand +{ + private static Random random = new Random(); + + public Commandkittycannon() + { + super("kittycannon"); + } + + @Override + protected void run(final Server server, final User 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, 1f); + } + }, 20); + } +} diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 9165febb2..e63f8b758 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -186,6 +186,9 @@ commands: description: Kill all mobs in a world. usage: / [mobType] [radius] aliases: [ekillall,butcher,ebutcher] + kittycannon: + description: Throw an exploding kitten at your opponent + usage: / list: description: List all online players. usage: / -- cgit v1.2.3 From dce149511e63406b778e34934059d7888ec50c2c Mon Sep 17 00:00:00 2001 From: Iaccidentally Date: Thu, 1 Mar 2012 23:10:32 -0500 Subject: update messages.properties for the new bukkit download link (ci.bukkit,org no longer works) --- Essentials/src/messages.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index f7958319d..ad3ff11ac 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -294,7 +294,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 -- cgit v1.2.3 From 622ca4bf8a10337892e56cbc0958a6a2c2e464ec Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Mar 2012 16:29:06 +0000 Subject: Don't think we need animation event anymore. --- .../src/com/earth2me/essentials/EssentialsPlayerListener.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 9b964364b..ee247f465 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -277,13 +277,6 @@ public class EssentialsPlayerListener implements Listener } } - @EventHandler(priority = EventPriority.NORMAL) - public void onPlayerAnimation(final PlayerAnimationEvent event) - { - final User user = ess.getUser(event.getPlayer()); - user.updateActivity(true); - } - @EventHandler(priority = EventPriority.MONITOR) public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event) { -- cgit v1.2.3 From 7737d19c5a79938adb8f87e8280c01e20fa8680a Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Mar 2012 16:33:20 +0000 Subject: Shouldn't really be canceling events at priority monitor, oops. --- Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index ee247f465..0779c01ab 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -317,9 +317,11 @@ public class EssentialsPlayerListener implements Listener } } - @EventHandler(priority = EventPriority.MONITOR) + @EventHandler(priority = EventPriority.NORMAL) public void onPlayerInteract(final PlayerInteractEvent event) { + final User user = ess.getUser(event.getPlayer()); + user.updateActivity(true); switch (event.getAction()) { case RIGHT_CLICK_BLOCK: @@ -334,7 +336,6 @@ public class EssentialsPlayerListener implements Listener break; case LEFT_CLICK_AIR: case LEFT_CLICK_BLOCK: - final User user = ess.getUser(event.getPlayer()); if (user.hasPowerTools() && user.arePowerToolsEnabled()) { if (usePowertools(user)) -- cgit v1.2.3 From 25ebe68389a74ae5b5faa9780e76afff75a5a963 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Mar 2012 16:54:12 +0000 Subject: Entity event cleanup --- .../essentials/EssentialsEntityListener.java | 89 ++++++++++------------ 1 file changed, 42 insertions(+), 47 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java index e4879186d..45d78ebeb 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java @@ -24,48 +24,47 @@ public class EssentialsEntityListener implements Listener } @EventHandler(priority = EventPriority.LOWEST) - public void onEntityDamage(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) { - EntityDamageByEntityEvent edEvent = (EntityDamageByEntityEvent)event; - Entity eAttack = edEvent.getDamager(); - Entity eDefend = edEvent.getEntity(); - if (eDefend instanceof Player && eAttack instanceof Player) + final User defender = ess.getUser(eDefend); + final User attacker = ess.getUser(eAttack); + attacker.updateActivity(true); + final List commandList = attacker.getPowertool(attacker.getItemInHand()); + if (commandList != null && !commandList.isEmpty()) { - User defender = ess.getUser(eDefend); - User attacker = ess.getUser(eAttack); - attacker.updateActivity(true); - ItemStack is = attacker.getItemInHand(); - List commandList = attacker.getPowertool(is); - if (commandList != null && !commandList.isEmpty()) + for (String command : commandList) { - for (String command : commandList) + if (command != null && !command.isEmpty()) { - - if (command != null && !command.isEmpty()) - { - attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", defender.getName())); - event.setCancelled(true); - return; - } + attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", defender.getName())); + event.setCancelled(true); + return; } } } - if (eDefend instanceof Animals && eAttack instanceof Player) + } + else if (eDefend instanceof Animals && eAttack instanceof Player) + { + final User player = ess.getUser(eAttack); + final ItemStack hand = player.getItemInHand(); + if (hand != null && hand.getType() == Material.MILK_BUCKET) { - User player = ess.getUser(eAttack); - ItemStack hand = player.getItemInHand(); - if (hand != null && hand.getType() == Material.MILK_BUCKET) - { - ((Animals)eDefend).setAge(-24000); - hand.setType(Material.BUCKET); - player.setItemInHand(hand); - player.updateInventory(); - event.setCancelled(true); - } + ((Animals)eDefend).setAge(-24000); + hand.setType(Material.BUCKET); + player.setItemInHand(hand); + player.updateInventory(); + event.setCancelled(true); } } + } + + @EventHandler(priority = EventPriority.LOWEST) + public void onEntityDamage(final EntityDamageEvent event) + { if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled()) { final Player player = (Player)event.getEntity(); @@ -76,7 +75,7 @@ public class EssentialsEntityListener implements Listener } @EventHandler(priority = EventPriority.LOWEST) - public void onEntityCombust(EntityCombustEvent event) + public void onEntityCombust(final EntityCombustEvent event) { if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled()) { @@ -85,26 +84,22 @@ 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 User user = ess.getUser(event.getEntity()); + if (user.isAuthorized("essentials.back.ondeath") && !ess.getSettings().isCommandDisabled("back")) { - final PlayerDeathEvent pdevent = (PlayerDeathEvent)event; - final User user = ess.getUser(pdevent.getEntity()); - if (user.isAuthorized("essentials.back.ondeath") && !ess.getSettings().isCommandDisabled("back")) - { - user.setLastLocation(); - user.sendMessage(_("backAfterDeath")); - } - if (!ess.getSettings().areDeathMessagesEnabled()) - { - pdevent.setDeathMessage(""); - } + user.setLastLocation(); + user.sendMessage(_("backAfterDeath")); + } + if (!ess.getSettings().areDeathMessagesEnabled()) + { + event.setDeathMessage(""); } } @EventHandler(priority = EventPriority.LOWEST) - public void onFoodLevelChange(FoodLevelChangeEvent event) + public void onFoodLevelChange(final FoodLevelChangeEvent event) { if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled()) { @@ -113,7 +108,7 @@ public class EssentialsEntityListener implements Listener } @EventHandler(priority = EventPriority.LOWEST) - public void onEntityRegainHealth(EntityRegainHealthEvent event) + public void onEntityRegainHealth(final EntityRegainHealthEvent event) { if (event.getRegainReason() == RegainReason.SATIATED && event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isAfk() && ess.getSettings().getFreezeAfkPlayers()) -- cgit v1.2.3 From 1bbbfe1c96cf62fad3fe9f9eab5b56d28935e4e4 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Mar 2012 17:03:34 +0000 Subject: Make the antioch message optional. --- .../src/com/earth2me/essentials/commands/Commandantioch.java | 7 +++++-- Essentials/src/plugin.yml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java b/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java index 54277d466..968d0012c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java @@ -17,8 +17,11 @@ public class Commandantioch extends EssentialsCommand @Override public void run(final Server server, final User 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/plugin.yml b/Essentials/src/plugin.yml index e63f8b758..b6d90ae20 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -13,7 +13,7 @@ commands: aliases: [eafk] antioch: description: 'A little surprise for operators.' - usage: / + usage: / [message] aliases: [eantioch] back: description: Teleports you to your location prior to tp/spawn/warp. -- cgit v1.2.3 From 7a0f4da86099a2cdcf450312affa8f6385f7a413 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Mar 2012 17:05:55 +0000 Subject: Extra command aliases --- Essentials/src/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index b6d90ae20..be2c64b5c 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -14,7 +14,7 @@ commands: antioch: description: 'A little surprise for operators.' usage: / [message] - aliases: [eantioch] + aliases: [eantioch,grenade,tnt,egrenade,etnt] back: description: Teleports you to your location prior to tp/spawn/warp. usage: / -- cgit v1.2.3 From de7ab13c03f3b6086511566aa4c67376abaaed66 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Mar 2012 19:05:30 +0000 Subject: Only update displayname on world change, not every teleport. --- .../essentials/EssentialsPlayerListener.java | 15 +++++------ Essentials/src/com/earth2me/essentials/User.java | 29 +++++++++++----------- .../src/com/earth2me/essentials/UserData.java | 19 ++++++++++---- 3 files changed, 37 insertions(+), 26 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 0779c01ab..1b9464da4 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -233,18 +233,13 @@ public class EssentialsPlayerListener implements Listener return; } - final User user = ess.getUser(event.getPlayer()); //There is TeleportCause.COMMMAND but plugins have to actively pass the cause in on their teleports. if ((event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND) && ess.getSettings().registerBackInListener()) { + final User user = ess.getUser(event.getPlayer()); user.setLastLocation(); } - if (ess.getSettings().changeDisplayName()) - { - user.setDisplayNick(); - } - updateCompass(user); } @EventHandler(priority = EventPriority.HIGH) @@ -307,9 +302,15 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.MONITOR) public void onPlayerChangedWorld(final PlayerChangedWorldEvent event) { + final User user = ess.getUser(event.getPlayer()); + if (ess.getSettings().changeDisplayName()) + { + user.setDisplayNick(); + } + updateCompass(user); + if (ess.getSettings().getNoGodWorlds().contains(event.getPlayer().getLocation().getWorld().getName())) { - User user = ess.getUser(event.getPlayer()); if (user.isGodModeEnabledRaw()) { user.sendMessage(_("noGodWorldWarning")); diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index ba34548fe..125962da9 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -249,7 +249,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser return teleportRequestHere; } - public String getNick(boolean addprefixsuffix) + public String getNick(final boolean addprefixsuffix) { final StringBuilder nickname = new StringBuilder(); final String nick = getNickname(); @@ -261,28 +261,28 @@ public class User extends UserData implements Comparable, IReplyTo, IUser { nickname.append(ess.getSettings().getNicknamePrefix()).append(nick); } - if (isOp()) + + if (addprefixsuffix && ess.getSettings().addPrefixSuffix()) { - try - { - nickname.insert(0, ess.getSettings().getOperatorColor().toString()); - nickname.append("§f"); - } - catch (Exception e) + if (isOp()) { + try + { + nickname.insert(0, ess.getSettings().getOperatorColor().toString()); + } + catch (Exception e) + { + } } - } - if (addprefixsuffix && ess.getSettings().addPrefixSuffix()) - { if (!ess.getSettings().disablePrefix()) { - final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName()); + final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§'); nickname.insert(0, prefix); } if (!ess.getSettings().disableSuffix()) { - final String suffix = ess.getPermissionsHandler().getSuffix(base).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName()); + final String suffix = ess.getPermissionsHandler().getSuffix(base).replace('&', '§'); nickname.append(suffix); if (suffix.length() < 2 || !suffix.substring(suffix.length() - 2, suffix.length() - 1).equals("§")) { @@ -330,6 +330,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser return super.getDisplayName() == null ? super.getName() : super.getDisplayName(); } + @Override public Teleport getTeleport() { return teleport; @@ -385,7 +386,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser catch (Throwable ex) { } - } + } super.setMoney(value); Trade.log("Update", "Set", "API", getName(), new Trade(value, ess), null, null, null, ess); } diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index cda2fa511..1fdc98254 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -44,7 +44,7 @@ public abstract class UserData extends PlayerExtension implements IConf savedInventory = _getSavedInventory(); teleportEnabled = getTeleportEnabled(); ignoredPlayers = getIgnoredPlayers(); - godmode = getGodModeEnabled(); + godmode = _getGodModeEnabled(); muted = getMuted(); muteTimeout = _getMuteTimeout(); jailed = getJailed(); @@ -58,6 +58,7 @@ public abstract class UserData extends PlayerExtension implements IConf isNPC = _isNPC(); arePowerToolsEnabled = _arePowerToolsEnabled(); kitTimestamps = _getKitTimestamps(); + nickname = _getNickname(); } private double money; @@ -189,13 +190,21 @@ public abstract class UserData extends PlayerExtension implements IConf return false; } - public String getNickname() + private String nickname; + + public String _getNickname() { return config.getString("nickname"); } + + public String getNickname() + { + return nickname; + } public void setNickname(String nick) { + nickname = nick; config.setProperty("nickname", nick); config.save(); } @@ -515,7 +524,7 @@ public abstract class UserData extends PlayerExtension implements IConf } private boolean godmode; - private boolean getGodModeEnabled() + private boolean _getGodModeEnabled() { return config.getBoolean("godmode", false); } @@ -817,12 +826,12 @@ public abstract class UserData extends PlayerExtension implements IConf private Map _getKitTimestamps() { - + if (config.isConfigurationSection("timestamps.kits")) { return config.getConfigurationSection("timestamps.kits").getValues(false); } - return new HashMap(); + return new HashMap(); } public Long getKitTimestamp(final String name) -- cgit v1.2.3 From b6bbe237ea7c99eab0af8d07826ba84d4d766112 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 3 Mar 2012 05:09:03 +0000 Subject: I think switches are better. --- .../src/com/earth2me/essentials/EssentialsPlayerListener.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 1b9464da4..76668b615 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -182,10 +182,15 @@ 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) - { - return; + switch (event.getResult()) { + case ALLOWED: + case KICK_FULL: + case KICK_BANNED: + break; + default: + return; } + User user = ess.getUser(event.getPlayer()); user.setNPC(false); -- cgit v1.2.3 From 301b609e9357a21931653baffe9c3bed1f06dd8f Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 3 Mar 2012 05:27:02 +0000 Subject: *make it look like i'm doing something* --- .../com/earth2me/essentials/EssentialsBlockListener.java | 2 +- .../com/earth2me/essentials/EssentialsPlayerListener.java | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java index 648bfcef5..f2e2e8a77 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java @@ -32,7 +32,7 @@ public class EssentialsBlockListener implements Listener { return; } - boolean unlimitedForUser = user.hasUnlimited(is); + final boolean unlimitedForUser = user.hasUnlimited(is); if (unlimitedForUser && user.getGameMode() == GameMode.SURVIVAL) { ess.scheduleSyncDelayedTask( diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 76668b615..7ab1847f1 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -182,15 +182,16 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.HIGH) public void onPlayerLogin(final PlayerLoginEvent event) { - switch (event.getResult()) { + switch (event.getResult()) + { case ALLOWED: case KICK_FULL: - case KICK_BANNED: + case KICK_BANNED: break; default: - return; + return; } - + User user = ess.getUser(event.getPlayer()); user.setNPC(false); @@ -199,7 +200,7 @@ public class EssentialsPlayerListener implements Listener user.checkMuteTimeout(currentTime); user.checkJailTimeout(currentTime); - if (banExpired == false && (user.isBanned() || event.getResult() == Result.KICK_BANNED)) + if (!banExpired && (user.isBanned() || event.getResult() == Result.KICK_BANNED)) { final String banReason = user.getBanReason(); event.disallow(Result.KICK_BANNED, banReason != null && !banReason.isEmpty() && !banReason.equalsIgnoreCase("ban") ? banReason : _("defaultBanReason")); @@ -291,7 +292,7 @@ public class EssentialsPlayerListener implements Listener { for (Player player : ess.getServer().getOnlinePlayers()) { - User spyer = ess.getUser(player); + final User spyer = ess.getUser(player); if (spyer.isSocialSpyEnabled() && !user.equals(spyer)) { player.sendMessage(user.getDisplayName() + " : " + event.getMessage()); @@ -400,7 +401,7 @@ public class EssentialsPlayerListener implements Listener } @EventHandler(priority = EventPriority.LOW) - public void onPlayerPickupItem(PlayerPickupItemEvent event) + public void onPlayerPickupItem(final PlayerPickupItemEvent event) { if (event.isCancelled() || !ess.getSettings().getDisableItemPickupWhileAfk()) { -- cgit v1.2.3 From c0fa03ede259bedb8946bc559a0e64e54c9b464e Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 3 Mar 2012 07:03:54 +0000 Subject: Force all kits to lowercase. --- Essentials/src/com/earth2me/essentials/Kit.java | 8 +++-- .../src/com/earth2me/essentials/Settings.java | 41 +++++++++++++++------- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index 88816368c..138a12979 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -60,11 +60,15 @@ public class Kit } } - public static List getItems(final User user, final Map els) throws Exception + public static List getItems(final User user, final Map kit) throws Exception { + if (kit == null) { + throw new Exception(_("kitError2")); + } + try { - return (List)els.get("items"); + return (List)kit.get("items"); } catch (Exception e) { diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 732b5485c..e3992e52c 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -13,6 +13,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.ChatColor; import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.configuration.MemoryConfiguration; import org.bukkit.event.EventPriority; import org.bukkit.inventory.ItemStack; @@ -208,18 +209,22 @@ public class Settings implements ISettings { return config.getDouble("heal-cooldown", 0); } + private ConfigurationSection kits; - @Override - public Map getKit(String name) + public ConfigurationSection _getKits() { - name = name.replace('.', '_').replace('/', '_'); if (config.isConfigurationSection("kits")) { - final ConfigurationSection kits = getKits(); - if (kits.isConfigurationSection(name)) + final ConfigurationSection section = config.getConfigurationSection("kits"); + final ConfigurationSection newSection = new MemoryConfiguration(); + for (String kitItem : section.getKeys(false)) { - return kits.getConfigurationSection(name).getValues(true); + if (section.isConfigurationSection(kitItem)) + { + newSection.set(kitItem.toLowerCase(Locale.ENGLISH), section.getConfigurationSection(kitItem)); + } } + return newSection; } return null; } @@ -227,9 +232,20 @@ public class Settings implements ISettings @Override public ConfigurationSection getKits() { + return kits; + } + + @Override + public Map getKit(String name) + { + name = name.replace('.', '_').replace('/', '_'); if (config.isConfigurationSection("kits")) { - return config.getConfigurationSection("kits"); + final ConfigurationSection kits = getKits(); + if (kits.isConfigurationSection(name)) + { + return kits.getConfigurationSection(name).getValues(true); + } } return null; } @@ -358,8 +374,9 @@ public class Settings implements ISettings { config.load(); noGodWorlds = new HashSet(config.getStringList("no-god-in-worlds")); - enabledSigns = getEnabledSigns(); - itemSpawnBl = getItemSpawnBlacklist(); + enabledSigns = _getEnabledSigns(); + itemSpawnBl = _getItemSpawnBlacklist(); + kits = _getKits(); chatFormats.clear(); } private List itemSpawnBl = new ArrayList(); @@ -370,7 +387,7 @@ public class Settings implements ISettings return itemSpawnBl; } - private List getItemSpawnBlacklist() + private List _getItemSpawnBlacklist() { final List epItemSpwn = new ArrayList(); if (ess.getItemDb() == null) @@ -405,7 +422,7 @@ public class Settings implements ISettings return enabledSigns; } - private List getEnabledSigns() + private List _getEnabledSigns() { List newSigns = new ArrayList(); @@ -559,7 +576,7 @@ public class Settings implements ISettings { return config.getBoolean("economy-log-enabled", false); } - + @Override public boolean isEcoLogUpdateEnabled() { -- cgit v1.2.3 From 6da6e4d2e889b7bbeb15e4adf68a9fdc8b0b330f Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Sat, 3 Mar 2012 18:07:43 +1100 Subject: Cleanup Signed-off-by: Chris Ward --- .../src/com/earth2me/essentials/commands/Commandessentials.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index 14bbf5e02..0f390f4e0 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -35,6 +35,10 @@ public class Commandessentials extends EssentialsCommand { run_nya(server, sender, commandLabel, args); } + else if (args[0].equalsIgnoreCase("moo")) + { + run_moo(server, sender, commandLabel, args); + } else { run_reload(server, sender, commandLabel, args); } @@ -159,4 +163,9 @@ public class Commandessentials extends EssentialsCommand } noteBlocks.clear(); } + + private void run_moo(final Server server, final CommandSender sender, final String command, final String args[]) + { + sender.sendMessage(new String[]{" (__)", " (oo)", " /------\\/", " / | ||", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..." } ); + } } -- cgit v1.2.3 From 33605517ffa89bc5f84d841101e6a29f091a72d5 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 3 Mar 2012 07:09:41 +0000 Subject: Capital case for formatting. --- Essentials/src/com/earth2me/essentials/Kit.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index 138a12979..47e5e6ac2 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -1,6 +1,7 @@ package com.earth2me.essentials; import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.capitalCase; import com.earth2me.essentials.commands.NoChargeException; import com.earth2me.essentials.craftbukkit.InventoryWorkaround; import java.util.*; @@ -22,7 +23,7 @@ public class Kit { if (user.isAuthorized("essentials.kit." + kiteItem.toLowerCase(Locale.ENGLISH))) { - list.append(" ").append(kiteItem); + list.append(" ").append(capitalCase(kiteItem)); } } return list.toString().trim(); -- cgit v1.2.3 From 35576ab64ab05acee039d3e28b5bc0ef2d110bd7 Mon Sep 17 00:00:00 2001 From: Iaccidentally Date: Sat, 3 Mar 2012 03:04:54 -0500 Subject: add little babbys --- Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 341a702ff..c64d75d2b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -216,6 +216,8 @@ public class Commandspawnmob extends EssentialsCommand || type == EntityType.MUSHROOM_COW || type == EntityType.CHICKEN || type == EntityType.PIG + || type == EntityType.VILLAGER + || type == EntityType.OCELOT || type == EntityType.WOLF) && data.equals("baby")) { -- cgit v1.2.3 From 74a57553f68114948614eb6e77abe201ee0bcd36 Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Sat, 3 Mar 2012 19:21:27 +1100 Subject: Cleanup Signed-off-by: Chris Ward --- .../src/com/earth2me/essentials/commands/Commandessentials.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index 0f390f4e0..56432a91f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -9,6 +9,7 @@ import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.block.Block; import org.bukkit.command.CommandSender; +import org.bukkit.command.ConsoleCommandSender; import org.bukkit.entity.Player; @@ -166,6 +167,9 @@ public class Commandessentials extends EssentialsCommand private void run_moo(final Server server, final CommandSender sender, final String command, final String args[]) { - sender.sendMessage(new String[]{" (__)", " (oo)", " /------\\/", " / | ||", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..." } ); + if(sender instanceof ConsoleCommandSender) + sender.sendMessage(new String[]{" (__)", " (oo)", " /------\\/", " / | ||", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..." } ); + else + sender.sendMessage(new String[]{" (__)", " (oo)", " /------\\/", " / | | |", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..." } ); } } -- cgit v1.2.3 From d2d8d191dad6af966ee1bda365d72098a52b587b Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 3 Mar 2012 13:00:17 +0000 Subject: Minor optimization when checking bukkit permissions. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../groupmanager/permissions/AnjoPermissionsHandler.java | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 9d7187690..9ea8082c0 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -146,4 +146,5 @@ v 1.9: - 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 + - Make 'manload' reload the config correctly. + - Minor optimization when checking bukkit permissions. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index bd2829f38..b9315e849 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java @@ -17,9 +17,7 @@ import org.anjocaido.groupmanager.dataholder.WorldDataHolder; import org.anjocaido.groupmanager.data.User; import org.anjocaido.groupmanager.utils.PermissionCheckResult; import org.anjocaido.groupmanager.utils.PermissionCheckResult.Type; -import org.bukkit.Bukkit; import org.bukkit.entity.Player; -import org.bukkit.permissions.Permission; /** * Everything here maintains the model created by Nijikokun @@ -767,9 +765,9 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { // Check Bukkit perms to support plugins which add perms via code // (Heroes). final Player player = user.getBukkitPlayer(); - final Permission bukkitPerm = Bukkit.getPluginManager().getPermission(targetPermission); - if (player != null && bukkitPerm != null) { - result.resultType = player.hasPermission(bukkitPerm) ? PermissionCheckResult.Type.FOUND : PermissionCheckResult.Type.NEGATION; + //final Permission bukkitPerm = Bukkit.getPluginManager().getPermission(targetPermission); + if (player != null && player.hasPermission(targetPermission)) { + result.resultType = PermissionCheckResult.Type.FOUND; result.owner = user; return result; } -- cgit v1.2.3 From 6efd3eaa27a87fd41046d2ddc9bb96f6508d6851 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 3 Mar 2012 13:47:59 +0000 Subject: Fix a silly logic error when testing bukkit perms --- EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java | 2 +- .../org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java index 396240ec6..56ef7e870 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java @@ -52,7 +52,7 @@ public class Group extends DataUnit implements Cloneable { /** * Is this a GlobalGroup * - * @return + * @return true if this is a global group */ public boolean isGlobal() { return (getDataSource() == null); diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index b9315e849..6b6ae58ea 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java @@ -766,7 +766,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { // (Heroes). final Player player = user.getBukkitPlayer(); //final Permission bukkitPerm = Bukkit.getPluginManager().getPermission(targetPermission); - if (player != null && player.hasPermission(targetPermission)) { + if ((player != null) && player.hasPermission(targetPermission)) { result.resultType = PermissionCheckResult.Type.FOUND; result.owner = user; return result; -- cgit v1.2.3 From 8aa7b1f301764d747c5da2109601ec0e93570982 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 3 Mar 2012 13:48:58 +0000 Subject: Update CB #2032 B #1377 Min CB #2015 --- .../src/com/earth2me/essentials/Essentials.java | 2 +- lib/bukkit.jar | Bin 4689493 -> 4691009 bytes lib/craftbukkit.jar | Bin 11036845 -> 11039568 bytes 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 53a31bb35..e8b67107f 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 2004; + 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); diff --git a/lib/bukkit.jar b/lib/bukkit.jar index 33a03e364..b53ae8d18 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index 45958c144..c5bdd9c3c 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From c33499797ebe490b44618014459ab6341cb964c1 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 3 Mar 2012 14:03:52 +0000 Subject: Minor change to globalgroups --- EssentialsGroupManager/src/globalgroups.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/globalgroups.yml b/EssentialsGroupManager/src/globalgroups.yml index f21034237..e199622ee 100644 --- a/EssentialsGroupManager/src/globalgroups.yml +++ b/EssentialsGroupManager/src/globalgroups.yml @@ -181,11 +181,13 @@ groups: - towny.nation.* - towny.chat.tc - towny.chat.nc - - towny.wild.block.6.* + - towny.wild.block.6.build + - towny.wild.block.6.destroy - towny.wild.block.14.destroy - towny.wild.block.15.destroy - towny.wild.block.16.destroy - - towny.wild.block.17.* + - towny.wild.block.17.build + - towny.wild.block.17.destroy - towny.wild.block.18.destroy - towny.wild.block.21.destroy - towny.wild.block.31.destroy -- cgit v1.2.3 From e6181928e828802f41621d5f877bd3fa3a462431 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sat, 3 Mar 2012 17:01:53 +0100 Subject: Cleanup of /spawnmob --- .../essentials/commands/Commandspawnmob.java | 56 ++++++++-------------- 1 file changed, 19 insertions(+), 37 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index c64d75d2b..5c118eaaa 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -219,21 +219,16 @@ public class Commandspawnmob extends EssentialsCommand || type == EntityType.VILLAGER || type == EntityType.OCELOT || type == EntityType.WOLF) - && data.equals("baby")) + && data.contains("baby")) { - ((Animals)spawned).setAge(-24000); + ((Animals)spawned).setBaby(); return; } if (type == EntityType.SHEEP) { - if (data.contains("baby")) - { - ((Sheep)spawned).setAge(-24000); - } final String color = data.toUpperCase(Locale.ENGLISH).replace("BABY", ""); try { - if (color.equals("RANDOM")) { Random rand = new Random(); @@ -249,49 +244,36 @@ public class Commandspawnmob extends EssentialsCommand throw new Exception(_("sheepMalformedColor"), e); } } - if (type == EntityType.WOLF - && data.startsWith("tamed")) + if ((type == EntityType.WOLF + || type == EntityType.OCELOT) + && data.contains("tamed")) { - final Wolf wolf = ((Wolf)spawned); - wolf.setTamed(true); - wolf.setOwner(user); - wolf.setSitting(true); - if (data.equals("tamedbaby")) - { - ((Animals)spawned).setAge(-24000); - } + final Tameable tameable = ((Tameable)spawned); + tameable.setTamed(true); + tameable.setOwner(user.getBase()); } if (type == EntityType.WOLF - && data.startsWith("angry")) + && data.contains("angry")) { ((Wolf)spawned).setAngry(true); - if (data.equals("angrybaby")) - { - ((Animals)spawned).setAge(-24000); - } } - if (type == EntityType.CREEPER && data.equals("powered")) + if (type == EntityType.CREEPER && data.contains("powered")) { ((Creeper)spawned).setPowered(true); } if (type == EntityType.OCELOT) { - final Ocelot cat = ((Ocelot)spawned); - if (data.contains("siamese")) { - cat.setCatType(Ocelot.Type.SIAMESE_CAT); - } - if (data.contains("red")) { - cat.setCatType(Ocelot.Type.RED_CAT); - } - if (data.contains("black")) { - cat.setCatType(Ocelot.Type.BLACK_CAT); + if (data.contains("siamese")) + { + ((Ocelot)spawned).setCatType(Ocelot.Type.SIAMESE_CAT); } - if (data.contains("tamed")) { - cat.setTamed(true); - cat.setOwner(user); + if (data.contains("red")) + { + ((Ocelot)spawned).setCatType(Ocelot.Type.RED_CAT); } - if (data.contains("baby")) { - cat.setAge(-24000); + if (data.contains("black")) + { + ((Ocelot)spawned).setCatType(Ocelot.Type.BLACK_CAT); } } } -- cgit v1.2.3 From d9a8453995329a5984cf33a9ec6134dc7ad080cd Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 4 Mar 2012 15:43:00 +1100 Subject: Fix op colours, which KHobbits broke! --- Essentials/src/com/earth2me/essentials/User.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 125962da9..f89f1a5ad 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -262,19 +262,19 @@ public class User extends UserData implements Comparable, IReplyTo, IUser nickname.append(ess.getSettings().getNicknamePrefix()).append(nick); } - if (addprefixsuffix && ess.getSettings().addPrefixSuffix()) + if (isOp()) { - if (isOp()) + try { - try - { - nickname.insert(0, ess.getSettings().getOperatorColor().toString()); - } - catch (Exception e) - { - } + nickname.insert(0, ess.getSettings().getOperatorColor().toString()); + nickname.append("§f"); } - + catch (Exception e) + { + } + } + if (addprefixsuffix && ess.getSettings().addPrefixSuffix()) + { if (!ess.getSettings().disablePrefix()) { final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§'); -- cgit v1.2.3 From 53cfab229b8983a020d835e35b42c839fda08be3 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 08:18:25 +0000 Subject: Half-revert double backflip. 10 points. (op prefix changes that md-5 broke, thinking I broke op prefixes) --- Essentials/src/com/earth2me/essentials/User.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index f89f1a5ad..092b61880 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -262,12 +262,15 @@ public class User extends UserData implements Comparable, IReplyTo, IUser nickname.append(ess.getSettings().getNicknamePrefix()).append(nick); } - if (isOp()) + if (addprefixsuffix && isOp()) { try { - nickname.insert(0, ess.getSettings().getOperatorColor().toString()); - nickname.append("§f"); + final String opPrefix = ess.getSettings().getOperatorColor().toString(); + if (opPrefix.length() > 0) { + nickname.insert(0, opPrefix); + nickname.append("§f"); + } } catch (Exception e) { -- cgit v1.2.3 From c3fa56322bc9c81c00bbed7e8de8341a89c54d08 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 09:20:03 +0000 Subject: Adding option to modify all users balances (including offline) /eco reset ** --- .../earth2me/essentials/commands/Commandeco.java | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java index b9694ee49..dd6d6ad0d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java @@ -34,7 +34,31 @@ public class Commandeco extends EssentialsCommand throw new NotEnoughArgumentsException(ex); } - if (args[1].contentEquals("*")) + if (args[1].contentEquals("**")) + { + for (String sUser : ess.getUserMap().getAllUniqueUsers()) + { + final User 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: + player.setMoney(amount == 0 ? ess.getSettings().getStartingBalance() : amount); + break; + } + } + } + else if (args[1].contentEquals("*")) { for (Player onlinePlayer : server.getOnlinePlayers()) { -- cgit v1.2.3 From 6da705c86fb04f0baaae0a7bfe69288325433297 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 10:11:58 +0000 Subject: Allow more currency customization. Added currency key to messages. --- Essentials/src/com/earth2me/essentials/User.java | 12 ++-- Essentials/src/com/earth2me/essentials/Util.java | 16 ++++- .../src/com/earth2me/essentials/api/Economy.java | 2 +- .../essentials/commands/Commandbalance.java | 4 +- .../essentials/commands/Commandbalancetop.java | 4 +- .../earth2me/essentials/commands/Commandsell.java | 4 +- .../earth2me/essentials/commands/Commandwhois.java | 2 +- .../earth2me/essentials/commands/Commandworth.java | 16 ++--- .../earth2me/essentials/signs/EssentialsSign.java | 2 +- .../com/earth2me/essentials/signs/SignTrade.java | 8 +-- Essentials/src/messages.properties | 75 +++++++++++----------- Essentials/src/messages_da.properties | 75 +++++++++++----------- Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 75 +++++++++++----------- Essentials/src/messages_es.properties | 75 +++++++++++----------- Essentials/src/messages_fr.properties | 75 +++++++++++----------- Essentials/src/messages_nl.properties | 75 +++++++++++----------- 17 files changed, 269 insertions(+), 252 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 092b61880..b02a70a03 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -105,10 +105,10 @@ public class User extends UserData implements Comparable, IReplyTo, IUser return; } 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(), Util.formatCurrency(getMoney(), ess))); + initiator.sendMessage(_("addedToOthersAccount", Util.displayCurrency(value, ess), this.getDisplayName(), Util.displayCurrency(getMoney(), ess))); } } @@ -122,8 +122,8 @@ public class User extends UserData implements Comparable, IReplyTo, 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 { @@ -144,10 +144,10 @@ public class User extends UserData implements Comparable, IReplyTo, 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(), Util.formatCurrency(getMoney(), ess))); + initiator.sendMessage(_("takenFromOthersAccount", Util.displayCurrency(value, ess), this.getDisplayName(), Util.displayCurrency(getMoney(), ess))); } } diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index 238ff0c00..fbb8deb08 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -422,11 +422,11 @@ public 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) { - String str = ess.getSettings().getCurrencySymbol() + df.format(value); + String str = dFormat.format(value); if (str.endsWith(".00")) { str = str.substring(0, str.length() - 3); @@ -434,6 +434,16 @@ public class Util return str; } + public static String displayCurrency(final double value, final IEssentials ess) + { + return _("currency", ess.getSettings().getCurrencySymbol(), formatAsCurrency(value)); + } + + public static String shortCurrency(final double value, final IEssentials ess) + { + return ess.getSettings().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/Economy.java b/Essentials/src/com/earth2me/essentials/api/Economy.java index a1d421c38..6ed1829b3 100644 --- a/Essentials/src/com/earth2me/essentials/api/Economy.java +++ b/Essentials/src/com/earth2me/essentials/api/Economy.java @@ -249,7 +249,7 @@ public final class Economy { throw new RuntimeException(noCallBeforeLoad); } - return Util.formatCurrency(amount, ess); + return Util.displayCurrency(amount, ess); } /** diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java index 58f164ad6..15c3c9088 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java @@ -21,7 +21,7 @@ public class Commandbalance extends EssentialsCommand { throw new NotEnoughArgumentsException(); } - sender.sendMessage(_("balance", Util.formatCurrency(getPlayer(server, args, 0, true).getMoney(), ess))); + sender.sendMessage(_("balance", Util.displayCurrency(getPlayer(server, args, 0, true).getMoney(), ess))); } @Override @@ -32,6 +32,6 @@ public class Commandbalance extends EssentialsCommand || user.isAuthorized("essentials.balance.other")) ? user : getPlayer(server, 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 fffb69ea4..6c5e96b9f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java @@ -130,11 +130,11 @@ public class Commandbalancetop extends EssentialsCommand } }); - cache.getLines().add(_("serverTotal", Util.formatCurrency(totalMoney, ess))); + cache.getLines().add(_("serverTotal", Util.displayCurrency(totalMoney, ess))); int pos = 1; for (Map.Entry 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/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java index d59c09b1e..5958a5c0f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java @@ -160,8 +160,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/Commandwhois.java b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java index 7e211455e..d068aac9a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java @@ -60,7 +60,7 @@ public class Commandwhois extends EssentialsCommand sender.sendMessage(_("whoisLocation", user.getLocation().getWorld().getName(), user.getLocation().getBlockX(), user.getLocation().getBlockY(), user.getLocation().getBlockZ())); if (!ess.getSettings().isEcoDisabled()) { - sender.sendMessage(_("whoisMoney", Util.formatCurrency(user.getMoney(), ess))); + sender.sendMessage(_("whoisMoney", Util.displayCurrency(user.getMoney(), ess))); } sender.sendMessage(user.isAfk() ? _("whoisStatusAway") diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java index 586b31873..c8573ba25 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java @@ -51,14 +51,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 @@ -95,14 +95,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/signs/EssentialsSign.java b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java index b0df73a42..21e70516e 100644 --- a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java +++ b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java @@ -266,7 +266,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/Essentials/src/com/earth2me/essentials/signs/SignTrade.java b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java index 6b47ebc76..6ea4f5e80 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java @@ -135,11 +135,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; } } @@ -155,7 +155,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; } } @@ -313,7 +313,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/Essentials/src/messages.properties b/Essentials/src/messages.properties index ad3ff11ac..d10ec0908 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -11,9 +11,9 @@ alertPlaced=placed: alertUsed=used: autoAfkKickReason=You have been kicked for idling more than {0} minutes. backAfterDeath=\u00a77Use the /back command to return to your death point. +backUsageMsg=\u00a77Returning to previous location. backupFinished=Backup finished backupStarted=Backup started -backUsageMsg=\u00a77Returning to previous location. balance=\u00a77Balance: {0} balanceTop=\u00a77Top balances ({0}) banExempt=\u00a7cYou can not ban that player. @@ -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! @@ -64,14 +65,14 @@ depth=\u00a77You are at sea level. depthAboveSea=\u00a77You are {0} block(s) above sea level. depthBelowSea=\u00a77You are {0} block(s) below sea level. destinationNotSet=Destination not set +disableUnlimited=\u00a77Disabled unlimited placing of {0} for {1}. disabled=disabled disabledToSpawnMob=Spawning this mob was disabled in the config file. -disableUnlimited=\u00a77Disabled unlimited placing of {0} for {1}. dontMoveMessage=\u00a77Teleportation will commence in {0}. Don''t move. downloadingGeoIp=Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB) duplicatedUserdata=Duplicated userdata: {0} and {1} -enabled=enabled enableUnlimited=\u00a77Giving unlimited amount of {0} to {1}. +enabled=enabled enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand. enchantmentNotFound = \u00a7cEnchantment not found enchantmentPerm = \u00a7cYou do not have the permission for {0} @@ -99,9 +100,9 @@ gcentities= entities gcfree=Free memory: {0} MB gcmax=Maximum memory: {0} MB gctotal=Allocated memory: {0} MB -geoipJoinFormat=Player {0} comes from {1} geoIpUrlEmpty=GeoIP download url is empty. geoIpUrlInvalid=GeoIP download url is invalid. +geoipJoinFormat=Player {0} comes from {1} godDisabledFor=disabled for {0} godEnabledFor=enabled for {0} godMode=\u00a77God mode {0}. @@ -112,9 +113,9 @@ helpConsole=To view help from the console, type ?. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: holeInFloor=Hole in floor -homes=Homes: {0} homeSet=\u00a77Home set. homeSetToBed=\u00a77Your home is now set to this bed. +homes=Homes: {0} hour=hour hours=hours ignorePlayer=You ignore player {0} from now on. @@ -124,28 +125,28 @@ infoChapterPages=Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f: infoFileDoesNotExist=File info.txt does not exist. Creating one for you. infoPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: infoUnknownChapter=Unknown chapter. +invBigger=The other users inventory is bigger than yours. +invRestored=Your inventory has been restored. +invSee=You see the inventory of {0}. +invSeeHelp=Use /invsee to restore your inventory. invalidCharge=\u00a7cInvalid charge. invalidMob=Invalid mob type. invalidServer=Invalid server! invalidSignLine=Line {0} on sign is invalid. invalidWorld=\u00a7cInvalid world. -invBigger=The other users inventory is bigger than yours. inventoryCleared=\u00a77Inventory Cleared. inventoryClearedOthers=\u00a77Inventory of \u00a7c{0}\u00a77 cleared. -invRestored=Your inventory has been restored. -invSee=You see the inventory of {0}. -invSeeHelp=Use /invsee to restore your inventory. is=is itemCannotBeSold=That item cannot be sold to the server. itemMustBeStacked=Item must be traded in stacks. A quantity of 2s would be two stacks, etc. itemNotEnough1=\u00a7cYou do not have enough of that item to sell. itemNotEnough2=\u00a77If you meant to sell all of your items of that type, use /sell itemname itemNotEnough3=\u00a77/sell itemname -1 will sell all but one item, etc. -itemsCsvNotLoaded=Could not load items.csv. itemSellAir=You really tried to sell Air? Put an item in your hand. itemSold=\u00a77Sold for \u00a7c{0} \u00a77({1} {2} at {3} each) itemSoldConsole={0} sold {1} for \u00a77{2} \u00a77({3} items at {4} each) itemSpawn=\u00a77Giving {0} of {1} +itemsCsvNotLoaded=Could not load items.csv. jailAlreadyIncarcerated=\u00a7cPerson is already in jail: {0} jailMessage=\u00a7cYou do the crime, you do the time. jailNotExist=That jail does not exist. @@ -162,8 +163,8 @@ kitError=\u00a7cThere are no valid kits. kitErrorHelp=\u00a7cPerhaps an item is missing a quantity in the configuration? kitGive=\u00a77Giving kit {0}. kitInvFull=\u00a7cYour inventory was full, placing kit on the floor -kits=\u00a77Kits: {0} kitTimed=\u00a7cYou can''t use that kit again for another {0}. +kits=\u00a77Kits: {0} lightningSmited=\u00a77You have just been smited lightningUse=\u00a77Smiting {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +176,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cTo mark your mail as read, type /mail clear mailCleared=\u00a77Mail Cleared! mailSent=\u00a77Mail sent! +markMailAsRead=\u00a7cTo mark your mail as read, type /mail clear markedAsAway=\u00a77You are now marked as away. markedAsNotAway=\u00a77You are no longer marked as away. -markMailAsRead=\u00a7cTo mark your mail as read, type /mail clear maxHomes=You cannot set more than {0} homes. mayNotJail=\u00a7cYou may not jail that person me=me @@ -185,10 +186,10 @@ minute=minute minutes=minutes missingItems=You do not have {0}x {1}. missingPrefixSuffix=Missing a prefix or suffix for {0} -mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Error while changing mob spawner. mobSpawnLimit=Mob quantity limited to server limit mobSpawnTarget=Target block must be a mob spawner. +mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} has been received from {1} moneySentTo=\u00a7a{0} has been sent to {1} moneyTaken={0} taken from your bank account. @@ -196,10 +197,10 @@ month=month months=months moreThanZero=Quantities must be greater than 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cYou may not mute that player. mutedPlayer=Player {0} muted. mutedPlayerFor=Player {0} muted for {1}. mutedUserSpeaks={0} tried to speak, but is muted. -muteExempt=\u00a7cYou may not mute that player. nearbyPlayers=Players nearby: {0} needTpohere=You need access to /tpohere to teleport other players. negativeBalanceError=User is not allowed to have a negative balance. @@ -221,7 +222,6 @@ noKitPermission=\u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit noKits=\u00a77There are no kits available yet noMail=You do not have any mail noMotd=\u00a7cThere is no message of the day. -none=none noNewMail=\u00a77You have no new mail. noPendingRequest=You do not have a pending request. noPerm=\u00a7cYou do not have the \u00a7f{0}\u00a7c permission. @@ -229,21 +229,30 @@ noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob. noPlacePermission=\u00a7cYou do not have permission to place a block near that sign. noPowerTools=You have no power tools assigned. noRules=\u00a7cThere are no rules specified yet. +noWarpsDefined=No warps defined +none=none notAllowedToQuestion=\u00a7cYou are not authorized to use question. notAllowedToShout=\u00a7cYou are not authorized to shout. notEnoughExperience=You do not have enough experience. notEnoughMoney=You do not have sufficient funds. -nothingInHand = \u00a7cYou have nothing in your hand. notRecommendedBukkit= * ! * Bukkit version is not the recommended build for Essentials. notSupportedYet=Not supported yet. +nothingInHand = \u00a7cYou have nothing in your hand. now=now -noWarpsDefined=No warps defined nuke=May death rain upon them numberRequired=A number goes there, silly. onlyDayNight=/time only supports day/night. onlyPlayers=Only in-game players can use {0}. onlySunStorm=/weather only supports sun/storm. orderBalances=Ordering balances of {0} users, please wait ... +pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. +pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. +pTimePlayers=These players have their own time: +pTimeReset=Player time has been reset for: \u00a7e{0} +pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} +pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} parseError=Error parsing {0} on line {1} pendingTeleportCancelled=\u00a7cPending teleportation request cancelled. permissionsError=Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled. @@ -271,14 +280,6 @@ powerToolRemoveAll=All commands removed from {0}. powerToolsDisabled=All of your power tools have been disabled. powerToolsEnabled=All of your power tools have been enabled. protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0} -pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. -pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. -pTimePlayers=These players have their own time: -pTimeReset=Player time has been reset for: \u00a7e{0} -pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} -pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Question]\u00a7f {0} readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Reloaded all plugins. @@ -312,8 +313,8 @@ signProtectInvalidLocation=\u00a74You are not allowed to create sign here. similarWarpExist=A warp with a similar name already exists. slimeMalformedSize=Malformed size. soloMob=That mob likes to be alone -spawned=spawned spawnSet=\u00a77Spawn location set for group {0}. +spawned=spawned suicideMessage=\u00a77Goodbye Cruel World... suicideSuccess= \u00a77{0} took their own life survival=survival @@ -321,20 +322,20 @@ takenFromAccount=\u00a7c{0} has been taken from your account. takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... -teleportationCommencing=\u00a77Teleportation commencing... -teleportationDisabled=\u00a77Teleportation disabled. -teleportationEnabled=\u00a77Teleportation enabled. teleportAtoB=\u00a77{0}\u00a77 teleported you to {1}\u00a77. teleportDisabled={0} has teleportation disabled. teleportHereRequest=\u00a7c{0}\u00a7c has requested that you teleport to them. -teleporting=\u00a77Teleporting... -teleportingPortal=\u00a77Teleporting via portal. teleportNewPlayerError=Failed to teleport new player teleportRequest=\u00a7c{0}\u00a7c has requested to teleport to you. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teleporting to top. -tempbanExempt=\u00a77You may not tempban that player +teleportationCommencing=\u00a77Teleportation commencing... +teleportationDisabled=\u00a77Teleportation disabled. +teleportationEnabled=\u00a77Teleportation enabled. +teleporting=\u00a77Teleporting... +teleportingPortal=\u00a77Teleporting via portal. tempBanned=Temporarily banned from server for {0} +tempbanExempt=\u00a77You may not tempban that player thunder= You {0} thunder in your world thunderDuration=You {0} thunder in your world for {1} seconds. timeBeforeHeal=Time before next heal: {0} @@ -365,25 +366,25 @@ unlimitedItemPermission=\u00a7cNo permission for unlimited item {0}. unlimitedItems=Unlimited items: unmutedPlayer=Player {0} unmuted. upgradingFilesError=Error while upgrading the files -userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} -userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp userDoesNotExist=The user {0} does not exist. userIsAway={0} is now AFK userIsNotAway={0} is no longer AFK userJailed=\u00a77You have been jailed userUsedPortal={0} used an existing exit portal. +userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} +userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp usingTempFolderForTesting=Using temp folder for testing: versionMismatch=Version mismatch! Please update {0} to the same version. versionMismatchAll=Version mismatch! Please update all Essentials jars to the same version. voiceSilenced=\u00a77Your voice has been silenced warpDeleteError=Problem deleting the warp file. -warpingTo=\u00a77Warping to {0}. warpListPermission=\u00a7cYou do not have Permission to list warps. warpNotExist=That warp does not exist. -warps=Warps: {0} -warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. warpSet=\u00a77Warp {0} set. warpUsePermission=\u00a7cYou do not have Permission to use that warp. +warpingTo=\u00a77Warping to {0}. +warps=Warps: {0} +warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. weatherStorm=\u00a77You set the weather to storm in {0} weatherStormFor=\u00a77You set the weather to storm in {0} for {1} seconds weatherSun=\u00a77You set the weather to sun in {0} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 0d8260947..9bb84edba 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -11,9 +11,9 @@ alertPlaced=placerede: alertUsed=brugte: autoAfkKickReason=Du er blevet kicked for at idle mere end {0} minutter. backAfterDeath=\u00a77Brug /back kommandoen for at teleportere til dit d\u00f8dspunkt. +backUsageMsg=\u00a77Teleporterer til tidligere placering. backupFinished=Backup sluttet backupStarted=Backup startet -backUsageMsg=\u00a77Teleporterer til tidligere placering. balance=\u00a77Saldo: {0} balanceTop=\u00a77Top saldoer ({0}) banExempt=\u00a7cDu kan ikke banne den p\u00e5g\u00e6ldende spiller. @@ -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! @@ -64,14 +65,14 @@ depth=\u00a77Du er ved havoverfladen. depthAboveSea=\u00a77Du er {0} blok(ke) over havets overflade. depthBelowSea=\u00a77Du er {0} blok(ke) under havets overflade. destinationNotSet=Destination ikke sat +disableUnlimited=\u00a77Deaktiverede ubergr\u00e6nset placering af {0} for {1}. disabled=deaktiveret disabledToSpawnMob=Skabelse af denne mob er deaktiveret i configfilen. -disableUnlimited=\u00a77Deaktiverede ubergr\u00e6nset placering af {0} for {1}. dontMoveMessage=\u00a77Teleportering vil begynde om {0}. Bev\u00e6g dig ikke. downloadingGeoIp=Downloader GeoIP database... det her kan tage et stykke tid (land: 0.6 MB, by: 27MB) duplicatedUserdata=Duplikerede userdata: {0} og {1} -enabled=aktiveret enableUnlimited=\u00a77Giver ubegr\u00e6nset m\u00e6ngde af {0} til {1}. +enabled=aktiveret enchantmentApplied = \u00a77Enchantment {0} er blevet tilf\u00c3\u00b8jet til tingen i din h\u00c3\u00a5nd. enchantmentNotFound = \u00a7cEnchantment ikke fundet. enchantmentPerm = \u00a7cDu har ikke tilladelse til at {0} @@ -99,9 +100,9 @@ gcentities= entities gcfree=Free memory: {0} MB gcmax=Maximum memory: {0} MB gctotal=Allocated memory: {0} MB -geoipJoinFormat=Spilleren {0} kommer fra {1} geoIpUrlEmpty=GeoIP download url er tom. geoIpUrlInvalid=GeoIP download url er ugyldig. +geoipJoinFormat=Spilleren {0} kommer fra {1} godDisabledFor=deaktiveret for {0} godEnabledFor=aktiveret for {0} godMode=\u00a77Gud mode {0}. @@ -112,9 +113,9 @@ helpConsole=For at se hj\u00e6lp fra konsolen, skriv ?. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f: holeInFloor=Hul i gulv -homes=Hjem: {0} homeSet=\u00a77Hjem sat. homeSetToBed=\u00a77Dit hjem er nu sat til denne seng. +homes=Hjem: {0} hour=time hours=timer ignorePlayer=Du ignorerer spiller {0} fra nu af. @@ -124,28 +125,28 @@ infoChapterPages=Kapitel {0}, side \u00a7c{1}\u00a7f af \u00a7c{2}\u00a7f: infoFileDoesNotExist=Fil info.txt eksisterer ikke. Fixer liiige en for dig. infoPages=Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f: infoUnknownChapter=Ukendt kapitel. +invBigger=Den anden brugers inventory er st\u00f8rre end din. +invRestored=Din inventory er blevet genoprettet. +invSee=Du ser {0}''s inventory. +invSeeHelp=Brug /invsee for at genoprette din inventory. invalidCharge=\u00a7cUgyldig opladning (korrekt oversat?). invalidMob=Ugyldig mob type. invalidServer=Ugyldig server! invalidSignLine=Linje {0} p\u00e5 skilt er ugyldig. invalidWorld=\u00a7cUgyldig verden. -invBigger=Den anden brugers inventory er st\u00f8rre end din. inventoryCleared=\u00a77Inventory ryddet. inventoryClearedOthers=\u00a7c{0}\u00a77''s inventory ryddet. -invRestored=Din inventory er blevet genoprettet. -invSee=Du ser {0}''s inventory. -invSeeHelp=Brug /invsee for at genoprette din inventory. is=er itemCannotBeSold=Denne ting kan ikke s\u00e6lges til serveren. itemMustBeStacked=Tingen skal handles i stakke. En m\u00e6ngde af 2s ville v\u00e6re to stakke, osv. itemNotEnough1=\u00a7cDu har ikke nok af denne ting til at kunne s\u00e6lge. itemNotEnough2=\u00a77Hvis du mente, at du ville s\u00c3\u00a6lge alle ting af den type, brug da /sell tingens-navn itemNotEnough3=\u00a77/sell ting-navn -1 vil s\u00e6lge alle enheder, undtagen \u00c3\u00a9n, osv. -itemsCsvNotLoaded=Kunne ikke loade items.csv. itemSellAir=Fors\u00f8gte du virkelig at s\u00e6lge luft? Kom en ting i h\u00e5nden, hattemand. itemSold=\u00a77Solgte til \u00a7c{0} \u00a77({1} {2} ting for {3} pr. stk.) itemSoldConsole={0} solgte {1} til \u00a77{2} \u00a77({3} ting for {4} pr. stk.) itemSpawn=\u00a77Giver {0} af {1} +itemsCsvNotLoaded=Kunne ikke loade items.csv. jailAlreadyIncarcerated=\u00a7cSpilleren er allerede i f\u00c3\u00a6ngsel: {0} jailMessage=\u00a7cDu bryder reglerne, du tager straffen. jailNotExist=Det f\u00e6ngsel eksisterer ikke. @@ -162,8 +163,8 @@ kitError=\u00a7cDer er ikke nogen gyldige kits. kitErrorHelp=\u00a7cM\u00e5ske mangler en ting en m\u00e6ngde i konfigurationen? Eller m\u00c3\u00a5ske er der nisser p\u00c3\u00a5 spil? kitGive=\u00a77Giver kit til {0} (oversat korrekt?). kitInvFull=\u00a7cDin inventory er fuld, placerer kit p\u00e5 gulvet. -kits=\u00a77Kits: {0} kitTimed=\u00a7cDu kan ikke benytte dette kit igen i {0}. +kits=\u00a77Kits: {0} lightningSmited=\u00a77Du er blevet ramt af Guds vrede (din admin) lightningUse=\u00a77Kaster lyn efter {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +176,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cFor at markere din flaskepost som l\u00e6st, skriv /mail clear mailCleared=\u00a77Flaskepot ryddet! mailSent=\u00a77Flaskepot sendt! +markMailAsRead=\u00a7cFor at markere din flaskepost som l\u00e6st, skriv /mail clear markedAsAway=\u00a77Du er nu markeret som v\u00c3\u00a6rende ikke tilstede. markedAsNotAway=\u00a77Du er ikke l\u00e6ngere markeret som v\u00c3\u00a6rende ikke tilstede. -markMailAsRead=\u00a7cFor at markere din flaskepost som l\u00e6st, skriv /mail clear maxHomes=Du kan ikke have mere end {0} hjem. mayNotJail=\u00a7cDu kan ikke smide denne person i f\u00c3\u00a6ngsel. me=mig @@ -185,10 +186,10 @@ minute=minut minutes=minutter missingItems=Du har ikke {0}x {1}. missingPrefixSuffix=Mangler et pr\u00e6fiks eller suffiks for {0} -mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Fejl ved \u00e6ndring af mob spawner. mobSpawnLimit=Mob m\u00e6ngde begr\u00e6nset til serverens fastsatte gr\u00e6nse. mobSpawnTarget=M\u00e5l blok skal v\u00e6re en mob spawner. +mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} er modtaget fra {1} moneySentTo=\u00a7a{0} er sendt til {1} moneyTaken={0} blev taget fra din bankkonto. @@ -196,10 +197,10 @@ month=m\u00e5nede months=m\u00e5neder moreThanZero=M\u00e6ngder skal v\u00e6re st\u00f8rre end 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cDu kan ikke mute denne spiller. mutedPlayer=Spiller {0} muted. mutedPlayerFor=Spiller {0} muted i {1}. mutedUserSpeaks={0} pr\u00f8vede at snakke, men er muted. -muteExempt=\u00a7cDu kan ikke mute denne spiller. nearbyPlayers=Spillere i n\u00c3\u00a6rheden: {0} needTpohere=Du skal have adgang til /tpohere for at teleportere andre spillere. negativeBalanceError=Brugeren har ikke tilladelse til at have en negativ saldo. @@ -221,7 +222,6 @@ noKitPermission=\u00a7cDu har brug for \u00a7c{0}\u00a7c permission for at bruge noKits=\u00a77Der er ikke nogen kits tilg\u00e6ngelige endnu noMail=Du har ikke noget flaskepost. noMotd=\u00a7cDer er ingen Message of the day. -none=ingen noNewMail=\u00a77Du har ingen ny flaskepost. noPendingRequest=Du har ikke en ventende anmodning. noPerm=\u00a7cDu har ikke \u00a7f{0}\u00a7c permission. @@ -229,21 +229,30 @@ noPermToSpawnMob=\u00a7cDu har ikke tilladelse til at spawne denne mob. noPlacePermission=\u00a7cDu har ikke tiladelse til at placere en block n\u00c3\u00a6r det skilt. noPowerTools= Du har ingen power tools tilf\u00c3\u00b8jet. noRules=\u00a7cDer er ingen regler endnu. ANARKI! +noWarpsDefined=Ingen warps er defineret +none=ingen notAllowedToQuestion=\u00a7cDu har ikke tilladelse til at bruge sp\u00f8rgsm\u00e5l. notAllowedToShout=\u00a7cDu har ikke tilladelse til at r\u00e5be. notEnoughExperience=You do not have enough experience. notEnoughMoney=Du har ikke tilstr\u00e6kkeligt med penge. -nothingInHand = \u00a7cDu har intet i din h\u00c3\u00a5nd. notRecommendedBukkit=* ! * Bukkit version er ikke den anbefalede build til Essentials. notSupportedYet=Ikke underst\u00f8ttet endnu. +nothingInHand = \u00a7cDu har intet i din h\u00c3\u00a5nd. now=nu -noWarpsDefined=Ingen warps er defineret nuke=May death rain upon them numberRequired=Et nummer skal v\u00e6re, din tardo. onlyDayNight=/time underst\u00f8tter kun day/night. onlyPlayers=Kun in-game spillere kan bruge {0}. onlySunStorm=/weather underst\u00c3\u00b8tter kun sun/storm. orderBalances=Tjekker saldoer af {0} spillere, vent venligst... +pTimeCurrent=\u00a7e{0}''s\u00a7f Tiden er {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f Tiden er fastsat til {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f Tiden er normal og matcher serveren. +pTimeOthersPermission=\u00a7cDu har ikke tilladelse til at \u00c3\u00a6ndre andre spilleres tid. +pTimePlayers=Disse spillere har deres egen tid: +pTimeReset=Spiler-tid er blevet nulstillet for: \u00a7e{0} (oversat korrekt?) +pTimeSet=Spiller-tid er blevet sat til \u00a73{0}\u00a7f for: \u00a7e{1} (oversat korrekt?) +pTimeSetFixed=Spiller-tid er fastsat til \u00a73{0}\u00a7f for: \u00a7e{1} parseError=Fejl ved parsing af {0} p\u00e5 linje {1} pendingTeleportCancelled=\u00a7cAnmodning om teleport er blevet afvist. permissionsError=Mangler Permissions/GroupManager; chat pr\u00e6fikser/suffikser vil v\u00e6re deaktiveret. @@ -271,14 +280,6 @@ powerToolRemoveAll=Alle kommandoer fjernet fra {0}. powerToolsDisabled= Alle dine power tools er blevet deaktiveret. powerToolsEnabled= Alle dine power tools er blevet aktiveret. protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0} -pTimeCurrent=\u00a7e{0}''s\u00a7f Tiden er {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f Tiden er fastsat til {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f Tiden er normal og matcher serveren. -pTimeOthersPermission=\u00a7cDu har ikke tilladelse til at \u00c3\u00a6ndre andre spilleres tid. -pTimePlayers=Disse spillere har deres egen tid: -pTimeReset=Spiler-tid er blevet nulstillet for: \u00a7e{0} (oversat korrekt?) -pTimeSet=Spiller-tid er blevet sat til \u00a73{0}\u00a7f for: \u00a7e{1} (oversat korrekt?) -pTimeSetFixed=Spiller-tid er fastsat til \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Sp\u00f8rgsm\u00e5l]\u00a7f {0} readNextPage=Skriv /{0} {1} for at l\u00c3\u00a6se n\u00c3\u00a6ste side. reloadAllPlugins=\u00a77Reload alle plugins. @@ -312,8 +313,8 @@ signProtectInvalidLocation=\u00a74Du har ikke tilladelse til at lave et skilt he similarWarpExist=En warp med dette navn eksisterer allerede. slimeMalformedSize=Forkert st\u00f8rrelse. (Korrekt oversat?) soloMob=Denne mob kan godt lide at v\u00e6re alene. Den hygger sig. -spawned=spawnet spawnSet=\u00a77Spawnplacering fastsat for gruppe: {0}. +spawned=spawnet suicideMessage=\u00a77Farvel grusomme verden... suicideSuccess= \u00a77{0} tog sit eget liv survival=survival @@ -321,20 +322,20 @@ takenFromAccount=\u00a7c{0} er blevet taget fra din 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... -teleportationCommencing=\u00a77Teleport begynder... -teleportationDisabled=\u00a77Teleport deaktiveret. -teleportationEnabled=\u00a77Teleport aktiveret. teleportAtoB=\u00a77{0}\u00a77 teleporterede dig til {1}\u00a77. teleportDisabled={0} har ikke teleportation aktiveret. teleportHereRequest=\u00a7c{0}\u00a7c har anmodet om, at du teleporterer dig til ham/hende. -teleporting=\u00a77Teleporterer... -teleportingPortal=\u00a77Teleporterede via portal. teleportNewPlayerError=Fejlede ved teleportering af ny spiller teleportRequest=\u00a7c{0}\u00a7c har anmodet om at teleportere til dig. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teleporterer til toppen. -tempbanExempt=\u00a77Du m\u00c3\u00a5 ikke tempbanne denne spiller! Slemme, slemme du! +teleportationCommencing=\u00a77Teleport begynder... +teleportationDisabled=\u00a77Teleport deaktiveret. +teleportationEnabled=\u00a77Teleport aktiveret. +teleporting=\u00a77Teleporterer... +teleportingPortal=\u00a77Teleporterede via portal. tempBanned=Midlertidigt bannet fra serveren for {0} +tempbanExempt=\u00a77Du m\u00c3\u00a5 ikke tempbanne denne spiller! Slemme, slemme du! thunder= Du har nu {0} torden i din verden thunderDuration=Du har nu {0} torden i din verden i {1} sekunder. timeBeforeHeal=Tid f\u00c3\u00b8r du kan heale igen: {0} @@ -365,25 +366,25 @@ unlimitedItemPermission=\u00a7cIngen tilladelse til ubegr\u00e6nset ting {0}. unlimitedItems=Ubegr\u00c3\u00a6nsede ting: unmutedPlayer=Spilleren {0} unmuted. upgradingFilesError=Fejl under opgradering af filerne. -userdataMoveBackError=Kunne ikke flytte userdata/{0}.tmp til userdata/{1} -userdataMoveError=Kunne ikke flytte userdata/{0} til userdata/{1}.tmp userDoesNotExist=Brugeren {0} eksisterer ikke. userIsAway={0} er nu AFK. Skub ham i havet eller bur ham inde! userIsNotAway={0} er ikke l\u00e6ngere AFK. userJailed=\u00a77Du er blevet f\u00e6ngslet. userUsedPortal={0} brugte en eksisterende udgangsportal. +userdataMoveBackError=Kunne ikke flytte userdata/{0}.tmp til userdata/{1} +userdataMoveError=Kunne ikke flytte userdata/{0} til userdata/{1}.tmp usingTempFolderForTesting=Bruger temp-mappe til testing: versionMismatch=Versioner matcher ikke! Opdater venligst {0} til den nyeste version. versionMismatchAll=Versioner matcher ikke! Opdater venligst alle Essentials jar-filer til samme version. voiceSilenced=\u00a77Din stemme er blevet gjort stille. warpDeleteError=Ah, shit; kunne sgu ikke fjerne warp-filen. Jeg giver en \u00c3\u00b8l i lufthavnen. -warpingTo=\u00a77Warper til {0}. warpListPermission=\u00a7cDu har ikke tilladelse til at vise listen over warps. warpNotExist=Den warp eksisterer ikke. -warps=Warps: {0} -warpsCount=\u00a77Der er {0} warps. Viser side {1} af {2}. warpSet=\u00a77Warp {0} sat. warpUsePermission=\u00a7cDu har ikke tilladelse til at benytte den warp. +warpingTo=\u00a77Warper til {0}. +warps=Warps: {0} +warpsCount=\u00a77Der er {0} warps. Viser side {1} af {2}. weatherStorm=\u00a77Du har sat vejret til ''storm'' i {0} weatherStormFor=\u00a77Du har sat vejret til ''storm'' i {0} i {1} sekunder weatherSun=\u00a77Du har sat vejret til ''sol'' i {0} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 815972f03..944d5c7ef 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -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! diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index dfc7600dc..c38abd727 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -11,9 +11,9 @@ alertPlaced=placed: alertUsed=used: autoAfkKickReason=You have been kicked for idling more than {0} minutes. backAfterDeath=\u00a77Use the /back command to return to your death point. +backUsageMsg=\u00a77Returning to previous location. backupFinished=Backup finished backupStarted=Backup started -backUsageMsg=\u00a77Returning to previous location. balance=\u00a77Balance: {0} balanceTop=\u00a77Top balances ({0}) banExempt=\u00a7cYou can not ban that player. @@ -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! @@ -64,14 +65,14 @@ depth=\u00a77You are at sea level. depthAboveSea=\u00a77You are {0} block(s) above sea level. depthBelowSea=\u00a77You are {0} block(s) below sea level. destinationNotSet=Destination not set +disableUnlimited=\u00a77Disabled unlimited placing of {0} for {1}. disabled=disabled disabledToSpawnMob=Spawning this mob was disabled in the config file. -disableUnlimited=\u00a77Disabled unlimited placing of {0} for {1}. dontMoveMessage=\u00a77Teleportation will commence in {0}. Don''t move. downloadingGeoIp=Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB) duplicatedUserdata=Duplicated userdata: {0} and {1} -enabled=enabled enableUnlimited=\u00a77Giving unlimited amount of {0} to {1}. +enabled=enabled enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand. enchantmentNotFound = \u00a7cEnchantment not found enchantmentPerm = \u00a7cYou do not have the permission for {0} @@ -99,9 +100,9 @@ gcentities= entities gcfree=Free memory: {0} MB gcmax=Maximum memory: {0} MB gctotal=Allocated memory: {0} MB -geoipJoinFormat=Player {0} comes from {1} geoIpUrlEmpty=GeoIP download url is empty. geoIpUrlInvalid=GeoIP download url is invalid. +geoipJoinFormat=Player {0} comes from {1} godDisabledFor=disabled for {0} godEnabledFor=enabled for {0} godMode=\u00a77God mode {0}. @@ -112,9 +113,9 @@ helpConsole=To view help from the console, type ?. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: holeInFloor=Hole in floor -homes=Homes: {0} homeSet=\u00a77Home set. homeSetToBed=\u00a77Your home is now set to this bed. +homes=Homes: {0} hour=hour hours=hours ignorePlayer=You ignore player {0} from now on. @@ -124,28 +125,28 @@ infoChapterPages=Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f: infoFileDoesNotExist=File info.txt does not exist. Creating one for you. infoPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: infoUnknownChapter=Unknown chapter. +invBigger=The other users inventory is bigger than yours. +invRestored=Your inventory has been restored. +invSee=You see the inventory of {0}. +invSeeHelp=Use /invsee to restore your inventory. invalidCharge=\u00a7cInvalid charge. invalidMob=Invalid mob type. invalidServer=Invalid server! invalidSignLine=Line {0} on sign is invalid. invalidWorld=\u00a7cInvalid world. -invBigger=The other users inventory is bigger than yours. inventoryCleared=\u00a77Inventory Cleared. inventoryClearedOthers=\u00a77Inventory of \u00a7c{0}\u00a77 cleared. -invRestored=Your inventory has been restored. -invSee=You see the inventory of {0}. -invSeeHelp=Use /invsee to restore your inventory. is=is itemCannotBeSold=That item cannot be sold to the server. itemMustBeStacked=Item must be traded in stacks. A quantity of 2s would be two stacks, etc. itemNotEnough1=\u00a7cYou do not have enough of that item to sell. itemNotEnough2=\u00a77If you meant to sell all of your items of that type, use /sell itemname itemNotEnough3=\u00a77/sell itemname -1 will sell all but one item, etc. -itemsCsvNotLoaded=Could not load items.csv. itemSellAir=You really tried to sell Air? Put an item in your hand. itemSold=\u00a77Sold for \u00a7c{0} \u00a77({1} {2} at {3} each) itemSoldConsole={0} sold {1} for \u00a77{2} \u00a77({3} items at {4} each) itemSpawn=\u00a77Giving {0} of {1} +itemsCsvNotLoaded=Could not load items.csv. jailAlreadyIncarcerated=\u00a7cPerson is already in jail: {0} jailMessage=\u00a7cYou do the crime, you do the time. jailNotExist=That jail does not exist. @@ -162,8 +163,8 @@ kitError=\u00a7cThere are no valid kits. kitErrorHelp=\u00a7cPerhaps an item is missing a quantity in the configuration? kitGive=\u00a77Giving kit {0}. kitInvFull=\u00a7cYour inventory was full, placing kit on the floor -kits=\u00a77Kits: {0} kitTimed=\u00a7cYou can''t use that kit again for another {0}. +kits=\u00a77Kits: {0} lightningSmited=\u00a77You have just been smited lightningUse=\u00a77Smiting {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +176,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cTo mark your mail as read, type /mail clear mailCleared=\u00a77Mail Cleared! mailSent=\u00a77Mail sent! +markMailAsRead=\u00a7cTo mark your mail as read, type /mail clear markedAsAway=\u00a77You are now marked as away. markedAsNotAway=\u00a77You are no longer marked as away. -markMailAsRead=\u00a7cTo mark your mail as read, type /mail clear maxHomes=You cannot set more than {0} homes. mayNotJail=\u00a7cYou may not jail that person me=me @@ -185,10 +186,10 @@ minute=minute minutes=minutes missingItems=You do not have {0}x {1}. missingPrefixSuffix=Missing a prefix or suffix for {0} -mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Error while changing mob spawner. mobSpawnLimit=Mob quantity limited to server limit mobSpawnTarget=Target block must be a mob spawner. +mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} has been received from {1} moneySentTo=\u00a7a{0} has been sent to {1} moneyTaken={0} taken from your bank account. @@ -196,10 +197,10 @@ month=month months=months moreThanZero=Quantities must be greater than 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cYou may not mute that player. mutedPlayer=Player {0} muted. mutedPlayerFor=Player {0} muted for {1}. mutedUserSpeaks={0} tried to speak, but is muted. -muteExempt=\u00a7cYou may not mute that player. nearbyPlayers=Players nearby: {0} needTpohere=You need access to /tpohere to teleport other players. negativeBalanceError=User is not allowed to have a negative balance. @@ -221,7 +222,6 @@ noKitPermission=\u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit noKits=\u00a77There are no kits available yet noMail=You do not have any mail noMotd=\u00a7cThere is no message of the day. -none=none noNewMail=\u00a77You have no new mail. noPendingRequest=You do not have a pending request. noPerm=\u00a7cYou do not have the \u00a7f{0}\u00a7c permission. @@ -229,21 +229,30 @@ noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob. noPlacePermission=\u00a7cYou do not have permission to place a block near that sign. noPowerTools=You have no power tools assigned. noRules=\u00a7cThere are no rules specified yet. +noWarpsDefined=No warps defined +none=none notAllowedToQuestion=\u00a7cYou are not authorized to use question. notAllowedToShout=\u00a7cYou are not authorized to shout. notEnoughExperience=You do not have enough experience. notEnoughMoney=You do not have sufficient funds. -nothingInHand = \u00a7cYou have nothing in your hand. notRecommendedBukkit=* ! * Bukkit version is not the recommended build for Essentials. notSupportedYet=Not supported yet. +nothingInHand = \u00a7cYou have nothing in your hand. now=now -noWarpsDefined=No warps defined nuke=May death rain upon them numberRequired=A number goes there, silly. onlyDayNight=/time only supports day/night. onlyPlayers=Only in-game players can use {0}. onlySunStorm=/weather only supports sun/storm. orderBalances=Ordering balances of {0} users, please wait ... +pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. +pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. +pTimePlayers=These players have their own time: +pTimeReset=Player time has been reset for: \u00a7e{0} +pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} +pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} parseError=Error parsing {0} on line {1} pendingTeleportCancelled=\u00a7cPending teleportation request cancelled. permissionsError=Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled. @@ -271,14 +280,6 @@ powerToolRemoveAll=All commands removed from {0}. powerToolsDisabled=All of your power tools have been enabled. powerToolsEnabled=All of your power tools have been enabled. protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0} -pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. -pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. -pTimePlayers=These players have their own time: -pTimeReset=Player time has been reset for: \u00a7e{0} -pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} -pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Question]\u00a7f {0} readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Reloaded all plugins. @@ -312,8 +313,8 @@ signProtectInvalidLocation=\u00a74You are not allowed to create sign here. similarWarpExist=A warp with a similar name already exists. slimeMalformedSize=Malformed size. soloMob=That mob likes to be alone -spawned=spawned spawnSet=\u00a77Spawn location set for group {0}. +spawned=spawned suicideMessage=\u00a77Goodbye Cruel World... suicideSuccess= \u00a77{0} took their own life survival=survival @@ -321,20 +322,20 @@ takenFromAccount=\u00a7c{0} has been taken from your account. takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... -teleportationCommencing=\u00a77Teleportation commencing... -teleportationDisabled=\u00a77Teleportation disabled. -teleportationEnabled=\u00a77Teleportation enabled. teleportAtoB=\u00a77{0}\u00a77 teleported you to {1}\u00a77. teleportDisabled={0} has teleportation disabled. teleportHereRequest=\u00a7c{0}\u00a7c has requested that you teleport to them. -teleporting=\u00a77Teleporting... -teleportingPortal=\u00a77Teleporting via portal. teleportNewPlayerError=Failed to teleport new player teleportRequest=\u00a7c{0}\u00a7c has requested to teleport to you. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teleporting to top. -tempbanExempt=\u00a77You may not tempban that player +teleportationCommencing=\u00a77Teleportation commencing... +teleportationDisabled=\u00a77Teleportation disabled. +teleportationEnabled=\u00a77Teleportation enabled. +teleporting=\u00a77Teleporting... +teleportingPortal=\u00a77Teleporting via portal. tempBanned=Temporarily banned from server for {0} +tempbanExempt=\u00a77You may not tempban that player thunder= You {0} thunder in your world thunderDuration=You {0} thunder in your world for {1} seconds. timeBeforeHeal=Time before next heal: {0} @@ -365,25 +366,25 @@ unlimitedItemPermission=\u00a7cNo permission for unlimited item {0}. unlimitedItems=Unlimited items: unmutedPlayer=Player {0} unmuted. upgradingFilesError=Error while upgrading the files -userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} -userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp userDoesNotExist=The user {0} does not exist. userIsAway={0} is now AFK userIsNotAway={0} is no longer AFK userJailed=\u00a77You have been jailed userUsedPortal={0} used an existing exit portal. +userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} +userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp usingTempFolderForTesting=Using temp folder for testing: versionMismatch=Version mismatch! Please update {0} to the same version. versionMismatchAll=Version mismatch! Please update all Essentials jars to the same version. voiceSilenced=\u00a77Your voice has been silenced warpDeleteError=Problem deleting the warp file. -warpingTo=\u00a77Warping to {0}. warpListPermission=\u00a7cYou do not have Permission to list that warps. warpNotExist=That warp does not exist. -warps=Warps: {0} -warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. warpSet=\u00a77Warp {0} set. warpUsePermission=\u00a7cYou do not have Permission to use that warp. +warpingTo=\u00a77Warping to {0}. +warps=Warps: {0} +warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. weatherStorm=\u00a77You set the weather to storm in {0} weatherStormFor=\u00a77You set the weather to storm in {0} for {1} seconds weatherSun=\u00a77You set the weather to sun in {0} diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 909ec7434..07a788eb5 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -11,9 +11,9 @@ alertPlaced=situado: alertUsed=usado: autoAfkKickReason=Has sido echado por ausentarte mas de {0} minutos. backAfterDeath=\u00a77Usa el comando /back para volver al punto en el que moriste. +backUsageMsg=\u00a77Volviendo a la localizacion anterior. backupFinished=Copia de seguridad completada backupStarted=Comenzando copia de seguridad -backUsageMsg=\u00a77Volviendo a la localizacion anterior. balance=\u00a77Cantidad: {0} balanceTop=\u00a77Top cantidades ({0}) banExempt=\u00a7cNo puedes banear a ese jugador @@ -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! @@ -64,14 +65,14 @@ depth=\u00a77Estas al nivel del mar. depthAboveSea=\u00a77Estas {0} bloque(s) por encima del mar. depthBelowSea=\u00a77Estas {0} bloque(s) por debajo del mar. destinationNotSet=Destino no establecido. +disableUnlimited=\u00a77Desactivando colocacion ilimitada de {0} para {1}. disabled=desactivado disabledToSpawnMob=Spawning this mob was disabled in the config file. -disableUnlimited=\u00a77Desactivando colocacion ilimitada de {0} para {1}. dontMoveMessage=\u00a77Teletransporte comenzara en {0}. No te muevas. downloadingGeoIp=Descargando base de datos de GeoIP ... puede llevar un tiempo (pais: 0.6 MB, ciudad: 20MB) duplicatedUserdata=Datos de usuario duplicados: {0} y {1} -enabled=activado enableUnlimited=\u00a77Dando cantidad ilimitada de {0} a {1}. +enabled=activado enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand. enchantmentNotFound = \u00a7cEnchantment not found enchantmentPerm = \u00a7cYou do not have the permission for {0} @@ -99,9 +100,9 @@ gcentities= entidades gcfree=Memoria libre: {0} MB gcmax=Memoria maxima: {0} MB gctotal=Memoria localizada: {0} MB -geoipJoinFormat=El jugador {0} viene de {1} geoIpUrlEmpty=Link para descargar GeoIP esta vacio. geoIpUrlInvalid=Link para descargar GeoIP es invalido. +geoipJoinFormat=El jugador {0} viene de {1} godDisabledFor=Desactivado para {0} godEnabledFor=Activado para {0} godMode=\u00a77Modo Dios {0}. @@ -112,9 +113,9 @@ helpConsole=Para obtener ayuda de la consola, escribe ?. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Pagina \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f: holeInFloor=Agujero en el suelo -homes=Hogares: {0} homeSet=\u00a77Hogar establecido. homeSetToBed=\u00a77Tu hogar esta ahora establecido a esta cama. +homes=Hogares: {0} hour=hora hours=horas ignorePlayer=A partir de ahora ignoras al jugador {0}. @@ -124,28 +125,28 @@ infoChapterPages=Seccion {0}, pagina \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f: infoFileDoesNotExist=El archivo info.txt no existe. Creando uno para ti. infoPages=Pagina \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f: infoUnknownChapter=Seccion desconocida. +invBigger=El inventario del otro usuario es mas grande que el tuyo +invRestored=Tu inventario ha sido recuperado. +invSee=Estas viendo el inventario de {0}. +invSeeHelp=Usa /invsee para recuperar tu inventario. invalidCharge=\u00a7cCargo invalido. invalidMob=Mob invalido. invalidServer=Servidor invalido! invalidSignLine=Linea {0} en el signo es invalida. invalidWorld=\u00a7cMundo invalido. -invBigger=El inventario del otro usuario es mas grande que el tuyo inventoryCleared=\u00a77Inventario limpiado. inventoryClearedOthers=\u00a77Inventario de \u00a7c{0}\u00a77 limpiado. -invRestored=Tu inventario ha sido recuperado. -invSee=Estas viendo el inventario de {0}. -invSeeHelp=Usa /invsee para recuperar tu inventario. is=es itemCannotBeSold=Ese objeto no puede ser vendido al servidor. itemMustBeStacked=El objeto tiene que ser intercambiado en pilas. Una cantidad de 2s seria de dos pilas, etc. itemNotEnough1=\u00a7cNo tienes suficientes ejemplares de ese objeto para venderlo. itemNotEnough2=\u00a77Si pensabas en vender todos tus objetos de ese tipo, usa /sell nombredeobjeto itemNotEnough3=\u00a77/sell nombredeobjeto -1 vendera todos excepto un objeto, etc. -itemsCsvNotLoaded=Error al leer items.csv. itemSellAir=Realmente has intentado vender Aire? Pon un objeto en tu mano! itemSold=\u00a77Vendido para \u00a7c {0} \u00a77 ({1} {2} a {3} cada uno) itemSoldConsole={0} Vendido {1} para\u00a77 {2} \u00a77({3} objetos a {4} cada uno) itemSpawn=\u00a77Dando {0} de {1} +itemsCsvNotLoaded=Error al leer items.csv. jailAlreadyIncarcerated=\u00a7cLa persona ya esta en la carcel: {0} jailMessage=\u00a7cPor hacer el mal, tiempo en la carcel estaras. jailNotExist=Esa carcel no existe. @@ -162,8 +163,8 @@ kitError=\u00a7cNo hay ningun kit valido. kitErrorHelp=\u00a7cPerhaps an item is missing a quantity in the configuration? kitGive=\u00a77Dando kit a {0}. kitInvFull=\u00a7cTu inventario esta lleno, su kit se pondra en el suelo -kits=\u00a77Kits: {0} kitTimed=\u00a7c No puedes usar ese kit de nuevo para otro{0}. +kits=\u00a77Kits: {0} lightningSmited=\u00a77Acabas de ser golpeado lightningUse=\u00a77Golpeando a {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +176,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cPara marcar tu email como leido, escribe /mail clear mailCleared=\u00a77Email limpiado! mailSent=\u00a77Email enviado!! +markMailAsRead=\u00a7cPara marcar tu email como leido, escribe /mail clear markedAsAway=\u00a77Has sido puesto como AFK. markedAsNotAway=\u00a77Ya no estas AFK. -markMailAsRead=\u00a7cPara marcar tu email como leido, escribe /mail clear maxHomes=No puedes establecer mas de {0} hogares. mayNotJail=\u00a7cNo puedes encarcelar a esa persona me=yo @@ -185,10 +186,10 @@ minute=minuto minutes=minutos missingItems=No tienes {0}x de {1}. missingPrefixSuffix=Falta un prefijo o un sufijo para {0} -mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Error al cambiar la localizacion para el nacimiento de los mobs. mobSpawnLimit=Cantidad de Mobs limitados al limite del server mobSpawnTarget=El block seleccionado sera el lugar donde van a nacer los mobs. +mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} ha sido recivido de {1} moneySentTo=\u00a7a{0} ha sido enviado a {1} moneyTaken={0} han sido sacados de tu cuenta bancaria. @@ -196,10 +197,10 @@ month=mes months=meses moreThanZero=Las cantidades han de ser mayores que 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cNo puedes silenciar a ese jugador. mutedPlayer=Player {0} silenciado. mutedPlayerFor=Player {0} silenciado durante {1}. mutedUserSpeaks={0} intento hablar, pero esta silenciado. -muteExempt=\u00a7cNo puedes silenciar a ese jugador. nearbyPlayers=Players nearby: {0} needTpohere=Necesitas acceso a /tpohere para teletransportar a otros jugadores. negativeBalanceError=El usuario no tiene permitido tener un saldo negativo. @@ -221,7 +222,6 @@ noKitPermission=\u00a7cNecesitas los \u00a7c{0}\u00a7c permisos para usar ese ki noKits=\u00a77No hay kits disponibles todavia noMail=No tienes ningun email recivido noMotd=\u00a7cNo hay ningun mensaje del dia. -none=ninguno noNewMail=\u00a77No tienes ningun correo nuevo. noPendingRequest=No tienes ninguna peticion pendiente. noPerm=\u00a7cNo tienes el permiso de \u00a7f{0}\u00a7c. @@ -229,21 +229,30 @@ noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob. noPlacePermission=\u00a7cNo tienes permiso para situar ese bloque en ese lugar. noPowerTools=You have no power tools assigned. noRules=\u00a7cNo hay reglas especificadas todavia. +noWarpsDefined=No hay teletransportes definidos aun +none=ninguno notAllowedToQuestion=\u00a7cYou estas autorizado para usar las preguntas. notAllowedToShout=\u00a7cNo estas autorizado para gritar. notEnoughExperience=You do not have enough experience. notEnoughMoney=No tienes el dinero suficiente. -nothingInHand = \u00a7cYou have nothing in your hand. notRecommendedBukkit=* ! * La version de bukkit no es la recomendada para esta version de Essentials. notSupportedYet=No esta soportado aun. +nothingInHand = \u00a7cYou have nothing in your hand. now=ahora -noWarpsDefined=No hay teletransportes definidos aun nuke=May death rain upon them numberRequired=Un numero es necesario, amigo. onlyDayNight=/time solo soporta day/night. (dia/noche) onlyPlayers=Solo los jugadores conectados pueden usar {0}. onlySunStorm=/weather solo soporta sun/storm. (sol/tormenta) orderBalances=Ordering balances of {0} users, please wait ... +pTimeCurrent=\u00a7e{0}''s\u00a7f la hora es {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f la hora ha sido cambiada a {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f el tiempo es normal y coincide con el servidor. +pTimeOthersPermission=\u00a7cNo estas autorizado para especificar'' la hora de otros usuarios. +pTimePlayers=Estos usuarios tienen su propia hora: +pTimeReset=La hora del usuario ha sido reiniciada a las: \u00a7e{0} +pTimeSet=La hora del jugador ha sido cambiada para las: \u00a73{0}\u00a7f for: \u00a7e{1} +pTimeSetFixed=La hora del jugador ha sido arreglada para las: \u00a73{0}\u00a7f for: \u00a7e{1} parseError=error analizando {0} en la linea {1} pendingTeleportCancelled=\u00a7cPeticion de teletransporte pendiente cancelado. permissionsError=Falta el plugin Permissions/GroupManager; Los prefijos/sufijos de chat seran desactivados. @@ -271,14 +280,6 @@ powerToolRemoveAll=Todos los comandos borrados desde {0}. powerToolsDisabled=All of your power tools have been disabled. powerToolsEnabled=All of your power tools have been enabled. protectionOwner=\u00a76[EssentialsProtect] Dueño de la proteccion: {0} -pTimeCurrent=\u00a7e{0}''s\u00a7f la hora es {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f la hora ha sido cambiada a {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f el tiempo es normal y coincide con el servidor. -pTimeOthersPermission=\u00a7cNo estas autorizado para especificar'' la hora de otros usuarios. -pTimePlayers=Estos usuarios tienen su propia hora: -pTimeReset=La hora del usuario ha sido reiniciada a las: \u00a7e{0} -pTimeSet=La hora del jugador ha sido cambiada para las: \u00a73{0}\u00a7f for: \u00a7e{1} -pTimeSetFixed=La hora del jugador ha sido arreglada para las: \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Pregunta]\u00a7f {0} readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Todos los plugins recargados. @@ -312,8 +313,8 @@ signProtectInvalidLocation=\u00a74No puedes poner carteles en ese sitio. similarWarpExist=Ya existe un teletransporte con ese nombre. slimeMalformedSize=Medidas malformadas. soloMob=A este mob le gusta estar solo -spawned=nacido spawnSet=\u00a77El lugar de nacimiento ha sido puesto para el grupo {0}. +spawned=nacido suicideMessage=\u00a77Adios mundo cruel... suicideSuccess= \u00a77{0} se quito su propia vida survival=survival @@ -321,20 +322,20 @@ takenFromAccount=\u00a7c{0} ha sido sacado de tu cuenta. 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... -teleportationCommencing=\u00a77Comenzando teletransporte... -teleportationDisabled=\u00a77Teletransporte desactivado. -teleportationEnabled=\u00a77Teletransporte activado. teleportAtoB=\u00a77{0}\u00a77 te teletransporto a {1}\u00a77. teleportDisabled={0} tiene desactivado los teletransportes. teleportHereRequest=\u00a7c{0}\u00a7c ha pedido que te teletransportes con el. -teleporting=\u00a77Teletransportando... -teleportingPortal=\u00a77Teletransportando via portal. teleportNewPlayerError=Error al teletransportar al nuevo jugador teleportRequest=\u00a7c{0}\u00a7c te ha pedido teletransportarse contigo. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teletransportandote a la cima. -tempbanExempt=\u00a77No puedes banear temporalmente a ese jugador +teleportationCommencing=\u00a77Comenzando teletransporte... +teleportationDisabled=\u00a77Teletransporte desactivado. +teleportationEnabled=\u00a77Teletransporte activado. +teleporting=\u00a77Teletransportando... +teleportingPortal=\u00a77Teletransportando via portal. tempBanned=Baneado temporalmente del servidor por {0} +tempbanExempt=\u00a77No puedes banear temporalmente a ese jugador thunder= Tu has {0} los truenos en tu mundo. thunderDuration=Tu has {0} los truenos en tu mundo durante {1} seconds. timeBeforeHeal=Tiempo antes de la siguiente curacion: {0} @@ -365,25 +366,25 @@ unlimitedItemPermission=\u00a7cNo tienes permiso para objetos ilimitados {0}. unlimitedItems=Objetos ilimitados. unmutedPlayer=Jugador {0} desmuteado. upgradingFilesError=Error mientras se actualizaban los archivos -userdataMoveBackError=Error al mover userdata/{0}.tmp a userdata/{1} -userdataMoveError=Error al mover userdata/{0} a userdata/{1}.tmp userDoesNotExist=El usuario {0} no existe userIsAway={0} esta ahora ausente! userIsNotAway={0} ya no esta ausente! userJailed=\u00a77Has sido encarcelado! userUsedPortal={0} uso un portal de salida existente. +userdataMoveBackError=Error al mover userdata/{0}.tmp a userdata/{1} +userdataMoveError=Error al mover userdata/{0} a userdata/{1}.tmp usingTempFolderForTesting=Usando carpeta temporal para pruebas: versionMismatch=La version no coincide! Por favor actualiza {0} a la misma version. versionMismatchAll=La version no coincide! Por favor actualiza todos los jars de Essentials a la misma version. voiceSilenced=\u00a77Tu voz ha sido silenciada warpDeleteError=Problema al borrar el archivo de teletransporte. -warpingTo=\u00a77Teletransportandote a {0}. warpListPermission=\u00a7cNo tienes permiso para listar esos teletransportes. warpNotExist=Ese teletransporte no existe. -warps=Warps: {0} -warpsCount=\u00a77Hay {0} teletransportes. Mostrando pagina {1} de {2}. warpSet=\u00a77Teletransporte {0} establecido. warpUsePermission=\u00a7cNo tienes permisos para usar ese teletransporte. +warpingTo=\u00a77Teletransportandote a {0}. +warps=Warps: {0} +warpsCount=\u00a77Hay {0} teletransportes. Mostrando pagina {1} de {2}. weatherStorm=\u00a77Has establecido el tiempo a tormenta en este mundo. weatherStormFor=\u00a77Has establecido el tiempo a tormenta en este {1} durante {0} segundos. weatherSun=\u00a77Has establecido el tiempo a sol en este mundo. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index a74be475b..8afe6cb0c 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -11,9 +11,9 @@ alertPlaced=a plac\u00e9 : alertUsed=a utilis\u00e9 : autoAfkKickReason=Vous avez \u00e9t\u00e9 \u00e9ject\u00e9 pour inactivit\u00e9e sup\u00e9rieure \u00e0 {0} minutes. backAfterDeath=\u00a77Utilisez la commande /back pour retourner \u00e0 l''endroit ou vous \u00eates mort. +backUsageMsg=\u00a77Retour \u00e0 votre emplacement pr\u00e9c\u00c3\u00a8dent. backupFinished=Sauvegarde termin\u00e9 backupStarted=D\u00e9but de la sauvegarde... -backUsageMsg=\u00a77Retour \u00e0 votre emplacement pr\u00e9c\u00c3\u00a8dent. balance=\u00a77Solde : {0} balanceTop=\u00a77Meilleurs soldes au ({0}) banExempt=\u00a77Vous ne pouvez pas bannir ce joueur. @@ -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 ! @@ -64,14 +65,14 @@ depth=\u00a77Vous \u00eates au niveau de la mer. depthAboveSea=\u00a77Vous \u00eates \u00e0 {0} bloc(s) au-dessus du niveau de la mer. depthBelowSea=\u00a77Vous \u00eates \u00e0 {0} bloc(s) en-dessous du niveau de la mer. destinationNotSet=Destination non d\u00e9finie +disableUnlimited=\u00a77D\u00e9sactivation du placement illimit\u00e9 de {0} pour {1}. disabled=d\u00e9sactiv\u00e9 disabledToSpawnMob=Spawning this mob was disabled in the config file. -disableUnlimited=\u00a77D\u00e9sactivation du placement illimit\u00e9 de {0} pour {1}. dontMoveMessage=\u00a77La t\u00e9l\u00e9portation commence dans {0}. Ne bougez pas. downloadingGeoIp=T\u00e9l\u00e9chargement de la base de donn\u00e9es GeoIP ... Cela peut prendre un moment (Pays : 0.6 Mo, villes : 20Mo) duplicatedUserdata=Donn\u00e9e utilisateur dupliqu\u00e9e : {0} et {1} -enabled=activ\u00e9 enableUnlimited=\u00a77Quantit\u00e9 illimit\u00e9e de {0} \u00e0 {1}. +enabled=activ\u00e9 enchantmentApplied = \u00a77L''enchantement {0} a \u00e9t\u00e9 appliqu\u00e9 \u00e0 l''objet dans votre main. enchantmentNotFound = \u00a7cEnchantement non-trouv\u00e9 enchantmentPerm = \u00a7cVous n''avez pas les droits pour {0}. @@ -99,9 +100,9 @@ gcentities=entit\u00e9s gcfree=M\u00e9moire libre : {0} Mo gcmax=M\u00e9moire maximale : {0} Mo gctotal=M\u00e9moire utilis\u00e9e : {0} Mo -geoipJoinFormat=Joueur {0} vient de {1} geoIpUrlEmpty=L''URL de t\u00e9l\u00e9chargement de GeoIP est vide. geoIpUrlInvalid=L''URL de t\u00e9l\u00e9chargement de GeoIP est invalide. +geoipJoinFormat=Joueur {0} vient de {1} godDisabledFor=d\u00e9sactiv\u00e9 pour {0} godEnabledFor=activ\u00e9 pour {0} godMode=\u00a77Mode Dieu {0}. @@ -112,9 +113,9 @@ helpConsole=Pour voir l''aide tapez ? helpOp=\u00a7c[Aide Admin]\u00a7f \u00a77{0} : \u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f sur \u00a7c{1}\u00a7f. holeInFloor=Trou dans le Sol. -homes=R\u00e9sidences : {0} homeSet=\u00a77R\u00e9sidence d\u00e9finie. homeSetToBed=\u00a77Votre r\u00e9sidence est d\u00e9sormais li\u00e9e \u00e0 ce lit. +homes=R\u00e9sidences : {0} hour=heure hours=heures ignorePlayer=Vous ignorez d\u00e9sormais {0}. @@ -124,28 +125,28 @@ infoChapterPages=Chapitre {0}, page \u00a7c{1}\u00a7f sur \u00a7c{2}\u00a7f: infoFileDoesNotExist=Le fichier info.txt n'existe pas. Le fichier est en cours de cr\u00e9ation pour vous. infoPages=Page \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f. infoUnknownChapter=Chapitre inconnu. +invBigger=Les inventaires des autres joueurs sont plus gros que le v\u00f4tre. +invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu. +invSee=Vous voyez l''inventaire de {0}. +invSeeHelp=Utilisez /invsee pour revenir \u00e0 votre inventaire. invalidCharge=\u00a7cCharge invalide. invalidMob=Mauvias type de cr\u00e9ature. invalidServer=Serveur non valide. invalidSignLine=La ligne {0} du panneau est invalide. invalidWorld=\u00a7cMonde invalide. -invBigger=Les inventaires des autres joueurs sont plus gros que le v\u00f4tre. inventoryCleared=\u00a77Inventaire nettoy\u00e9. inventoryClearedOthers=\u00a77L''inventaire de \u00a7c{0}\u00a77 a \u00e9t\u00e9 nettoy\u00e9. -invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu. -invSee=Vous voyez l''inventaire de {0}. -invSeeHelp=Utilisez /invsee pour revenir \u00e0 votre inventaire. is=est itemCannotBeSold=Cet objet ne peut \u00eatre vendu au serveur. itemMustBeStacked=Cet objet doit \u00eatre vendu par 64. Une quantit\u00e9 de 2 serait deux fois 64. itemNotEnough1=\u00a7cVous n'avez pas assez de cet objet pour le vendre. itemNotEnough2=\u00a77Si vous voulez vendre l'int\u00e9gralit\u00e9 de vos objets de ce type l\u00e0, utilisez /sell nomObjet itemNotEnough3=\u00a77/sell nomObjet -1 vendra tout sauf un objet, etc. -itemsCsvNotLoaded=N'a pas pu charger items.csv. itemSellAir=Vouliez-vous vraiment vendre de l'air ? Mettez un objet dans votre main. itemSold=\u00a77Vendu pour \u00a7c{0} \u00a77({1} {2} \u00e0 {3} chacun) itemSoldConsole={0} vendu {1} pour \u00a77{2} \u00a77({3} objet(s) \u00e0 {4} chacun) itemSpawn=\u00a77Donne {0} de {1} +itemsCsvNotLoaded=N'a pas pu charger items.csv. jailAlreadyIncarcerated=\u00a7cJoueur d\u00e9j\u00e0 emprisonn\u00e9 : {0} jailMessage=\u00a7cVous avez commis un crime, vous en payez le prix. jailNotExist=Cette prison n'existe pas. @@ -162,8 +163,8 @@ kitError=\u00a7cIl n'y a pas de kits valides. kitErrorHelp=\u00a7cPeut-\u00eatre qu'un objet manque d'une quantit\u00e9 dans la configuration ? kitGive=\u00a77Donner le kit {0}. kitInvFull=\u00a7cVotre inventaire \u00e9tait plein, le kit est parre-terre. -kits=\u00a77Kits :{0} kitTimed=\u00a7cVous ne pouvez pas utiliser ce kit pendant encore {0}. +kits=\u00a77Kits :{0} lightningSmited=\u00a77Vous venez d'\u00eatre foudroy\u00e9. lightningUse=\u00a77{0} a \u00e9t\u00e9 foudroy\u00e9. listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +176,9 @@ localFormat=Locale : <{0}> {1} mailClear=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear mailCleared=\u00a77Courrier supprim\u00e9 ! mailSent=\u00a77Courrier envoy\u00e9 ! +markMailAsRead=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear markedAsAway=\u00a77Vous \u00eates d\u00e9sormais AFK. markedAsNotAway=\u00a77Vous n'\u00eates d\u00e9sormais plus AFK. -markMailAsRead=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear maxHomes=Vous ne pouvez pas cr\u00e9er plus de {0} r\u00e9sidences. mayNotJail=\u00a7cVous ne pouvez pas emprisonner cette personne. me=moi @@ -185,10 +186,10 @@ minute=minute minutes=minutes missingItems=Vous n''avez pas {0} x {1}. missingPrefixSuffix=Pr\u00e9fixe ou Suffixe manquant pour {0} -mobsAvailable=\u00a77cr\u00e9atures : {0} mobSpawnError=Erreur lors du changement du g\u00e9n\u00e9rateur de cr\u00e9atures. mobSpawnLimit=Quantit\u00e9 de cr\u00e9atures limit\u00e9 \u00e0 au maximum du serveur. mobSpawnTarget=Le bloc cible doit \u00eatre un g\u00e9n\u00e9rateur de cr\u00e9atures. +mobsAvailable=\u00a77cr\u00e9atures : {0} moneyRecievedFrom=\u00a7a{0} a \u00e9t\u00e9 re\u00e7u de {1} moneySentTo=\u00a7a{0} a \u00e9t\u00e9 envoy\u00e9 \u00e0 {1} moneyTaken={0} pr\u00e9lev\u00e9(s) de votre compte. @@ -196,10 +197,10 @@ month=mois months=mois moreThanZero=Les quantit\u00e9s doivent \u00eatre sup\u00e9rieures \u00e0 z\u00e9ro. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cVous ne pouvez pas r\u00e9duire ce joueur au silence. mutedPlayer=Le joueur {0} est d\u00e9sormais muet. mutedPlayerFor={0} a \u00e9t\u00e9 muet pour {1}. mutedUserSpeaks={0} a essay\u00e9 de parler mais est muet. -muteExempt=\u00a7cVous ne pouvez pas r\u00e9duire ce joueur au silence. nearbyPlayers=Joueurs dans les environs : {0} needTpohere=Vous avez besoin de l'acc\u00c3\u00a8s \u00e0 /tpohere pour t\u00e9l\u00e9porter d'autres joueurs. negativeBalanceError=L'utilisateur n'est pas autoris\u00e9 \u00e0 avoir un solde n\u00e9gatif. @@ -221,7 +222,6 @@ noKitPermission=\u00a7cVous avez besoin de la permission \u00a7c{0}\u00a7c pour noKits=\u00a77Il n'y a pas encore de kits disponibles. noMail=Vous n'avez pas de courrier noMotd=\u00a7cIl n'y a pas de message su jour. -none=aucun noNewMail=\u00a77Vous n'avez pas de courrier. noPendingRequest=Vous n'avez pas de requ\u00eate non lue. noPerm=\u00a7cVous n''avez pas la permission \u00a7f{0}\u00a7c. @@ -229,21 +229,30 @@ noPermToSpawnMob=\u00a7cVous n'avez pas la permission d'invoquer cette cr\u00e9a noPlacePermission=\u00a7cVous n'avez pas la permission de placer un bloc pr\u00c3\u00a8 de cette pancarte. noPowerTools=Vous n'avez pas d'outil macro associ\u00e9. noRules=\u00a7cIl n'y a pas encore de r\u00e8gles d\u00e9finies. +noWarpsDefined=Aucun point de t\u00e9l\u00e9portation d\u00e9fini. +none=aucun notAllowedToQuestion=\u00a7cVous n'\u00eates pas autoris\u00e9 \u00e0 poser des questions. notAllowedToShout=\u00a7cVous n'\u00eates pas autoris\u00e9 \u00e0 crier. notEnoughExperience=Vous n'avez pas assez d'exp\u00e9rience. notEnoughMoney=Vous n'avez pas les fonds n\u00e9cessaires. -nothingInHand = \u00a7cVous n'avez rien en main. notRecommendedBukkit=* ! * La version de Bukkit n'est pas celle qui est recommand\u00e9 pour cette version de Essentials. notSupportedYet=Pas encore pris en charge. +nothingInHand = \u00a7cVous n'avez rien en main. now=maintenant -noWarpsDefined=Aucun point de t\u00e9l\u00e9portation d\u00e9fini. nuke=Que la mort s'abatte sur eux ! numberRequired=Il faut fournir un nombre ici. onlyDayNight=/time ne supporte que (jour) day/night (nuit). onlyPlayers=Seulement les joueurs en jeu peuvent utiliser {0}. onlySunStorm=/weather ne supporte que (soleil) sun/storm (temp\u00eate). orderBalances=Classement des balance de {0} utilisateurs, patientez ... +pTimeCurrent=Pour \u00a7e{0}\u00a7f l''heure est {1}. +pTimeCurrentFixed=L''heure de \u00a7e{0}\u00a7f est fix\u00e9e \u00e0 {1}. +pTimeNormal=\u00a7fPour \u00a7e{0}\u00a7f l'heure est normale et correspond au server. +pTimeOthersPermission=\u00a7cVous n'etes pas autoris\u00e9 \u00e0 changer l'heure des autres joueurs. +pTimePlayers=Ces joueurs ont leur propre horraire : +pTimeReset=l''heure a \u00e9t\u00e9 r\u00e9initialis\u00e9e \u00e0 : \u00a7e{0} +pTimeSet=l''heure du joueur a \u00e9t\u00e9 r\u00e9egl\u00e9ee \u00e0 \u00a73{0}\u00a7f pour : \u00a7e{1} +pTimeSetFixed=l''heure du joueur a \u00e9t\u00e9 fix\u00e9e \u00e0 : \u00a7e{1} parseError=Erreur de conversion {0} \u00e0 la ligne {1} pendingTeleportCancelled=\u00a7cRequete de t\u00e9l\u00e9portation annul\u00e9e. permissionsError=Permissions/GroupManager manquant, les pr\u00e9fixes et suffixes ne seront pas affich\u00e9s. @@ -271,14 +280,6 @@ powerToolRemoveAll=Toutes les commandes retir\u00e9es de {0}. powerToolsDisabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 retir\u00e9es. powerToolsEnabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 activ\u00e9es. protectionOwner=\u00a76[EssentialsProtect] Propri\u00e9taire de la protection : {0} -pTimeCurrent=Pour \u00a7e{0}\u00a7f l''heure est {1}. -pTimeCurrentFixed=L''heure de \u00a7e{0}\u00a7f est fix\u00e9e \u00e0 {1}. -pTimeNormal=\u00a7fPour \u00a7e{0}\u00a7f l'heure est normale et correspond au server. -pTimeOthersPermission=\u00a7cVous n'etes pas autoris\u00e9 \u00e0 changer l'heure des autres joueurs. -pTimePlayers=Ces joueurs ont leur propre horraire : -pTimeReset=l''heure a \u00e9t\u00e9 r\u00e9initialis\u00e9e \u00e0 : \u00a7e{0} -pTimeSet=l''heure du joueur a \u00e9t\u00e9 r\u00e9egl\u00e9ee \u00e0 \u00a73{0}\u00a7f pour : \u00a7e{1} -pTimeSetFixed=l''heure du joueur a \u00e9t\u00e9 fix\u00e9e \u00e0 : \u00a7e{1} questionFormat=\u00a77[Question]\u00a7f {0} readNextPage=Utilisez /{0} {1} pour lire la page suivante. reloadAllPlugins=\u00a77Toutes les extensions ont \u00e9t\u00e9 recharg\u00e9es. @@ -312,8 +313,8 @@ signProtectInvalidLocation=\u00a74Vous n'avez pas l'autorisation de cr\u00e9er u similarWarpExist=Un point de t\u00e9l\u00e9portation avec un nom similaire existe d\u00e9j\u00e0. slimeMalformedSize=Taille mal form\u00e9e. soloMob=Ce cr\u00e9ature aime \u00eatre seul. -spawned=invoqu\u00e9(s) spawnSet=\u00a77Le point de d\u00e9part a \u00e9t\u00e9 d\u00e9fini pour le groupe {0}. +spawned=invoqu\u00e9(s) suicideMessage=\u00a77Au revoir monde cruel... suicideSuccess=\u00a77{0} s''est suicid\u00e9. survival=survie @@ -321,20 +322,20 @@ takenFromAccount=\u00a7c{0} ont \u00e9t\u00e9 retir\u00e9 de votre compte. 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. -teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation... -teleportationDisabled=\u00a77T\u00e9l\u00e9poration d\u00e9sactiv\u00e9. -teleportationEnabled=\u00a77T\u00e9l\u00e9portation activ\u00e9e. teleportAtoB=\u00a77{0}\u00a77 vous a t\u00e9l\u00e9port\u00e9 \u00e0 {1}\u00a77. teleportDisabled={0} a la t\u00e9l\u00e9portation d\u00e9sactiv\u00e9. teleportHereRequest=\u00a7c{0}\u00a7c Vous a demand\u00e9 de vous t\u00e9l\u00e9porter \u00e0 lui/elle. -teleporting=\u00a77T\u00e9l\u00e9poration en cours... -teleportingPortal=\u00a77T\u00e9l\u00e9portation via portail. teleportNewPlayerError=\u00c9chec de la t\u00e9l\u00e9portation du nouveau joueur. teleportRequest=\u00a7c{0}\u00a7c vous demande s''il peut se t\u00e9l\u00e9porter vers vous. teleportRequestTimeoutInfo=\u00a77Cette demande de t\u00e9l\u00e9portation expirera dans {0} secondes. teleportTop=\u00a77T\u00e9l\u00e9portation vers le haut. -tempbanExempt=\u00a77Vous ne pouvez pas bannir temporairement ce joueur. +teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation... +teleportationDisabled=\u00a77T\u00e9l\u00e9poration d\u00e9sactiv\u00e9. +teleportationEnabled=\u00a77T\u00e9l\u00e9portation activ\u00e9e. +teleporting=\u00a77T\u00e9l\u00e9poration en cours... +teleportingPortal=\u00a77T\u00e9l\u00e9portation via portail. tempBanned=Banni temporairement du serveur pour {0} +tempbanExempt=\u00a77Vous ne pouvez pas bannir temporairement ce joueur. thunder=Vous avez {0} la foudre dans votre monde. thunderDuration=Vous avez {0} la foudre dans le serveur pendant {1} secondes. timeBeforeHeal=Temps avant le prochain soin : {0} @@ -365,25 +366,25 @@ unlimitedItemPermission=\u00a7cPas de permission pour l''objet illimit\u00e9 {0} unlimitedItems=Objets illimit\u00e9s: unmutedPlayer=Le joueur {0} n''est plus muet. upgradingFilesError=Erreur durant la mise \u00e0 jour des fichiers. -userdataMoveBackError=Echec du d\u00e9placement de userdata/{0}.tmp vers userdata/{1} -userdataMoveError=Echec du d\u00e9placement de userdata/{0} vers userdata/{1}.tmp userDoesNotExist=L''utilisateur {0} n''existe pas. userIsAway={0} s'est mis en AFK userIsNotAway={0} n'est plus AFK userJailed=\u00a77Vous avez \u00e9t\u00e9 emprisonn\u00e9. userUsedPortal={0} a utilis\u00e9 un portail existant. +userdataMoveBackError=Echec du d\u00e9placement de userdata/{0}.tmp vers userdata/{1} +userdataMoveError=Echec du d\u00e9placement de userdata/{0} vers userdata/{1}.tmp usingTempFolderForTesting=Utilise un fichier temporaire pour un test. versionMismatch=Versions diff\u00e9rentes ! Mettez s''il vous plait {0} \u00e0 la m\u00eame version. versionMismatchAll=Mauvaise version ! S'il vous plait mettez des jars Essentials de version identique. voiceSilenced=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duit au silence. warpDeleteError=Probl\u00c3\u00a8me concernant la suppression du fichier warp. -warpingTo=\u00a77T\u00e9l\u00e9portation vers {0}. warpListPermission=\u00a7cVous n'avez pas la permission d'afficher la liste des points de t\u00e9l\u00e9portation. warpNotExist=Ce point de t\u00e9l\u00e9portation n'existe pas. -warps=point de t\u00e9l\u00e9portations : {0} -warpsCount=\u00a77Il y a {0} points de t\u00e9l\u00e9portations. Page {1} sur {2}. warpSet=\u00a77Le point de t\u00e9l\u00e9portation {0} a \u00e9t\u00e9 cr\u00e9\u00e9. warpUsePermission=\u00a7cVous n'avez pas la permission d'utiliser ce point de t\u00e9l\u00e9portation. +warpingTo=\u00a77T\u00e9l\u00e9portation vers {0}. +warps=point de t\u00e9l\u00e9portations : {0} +warpsCount=\u00a77Il y a {0} points de t\u00e9l\u00e9portations. Page {1} sur {2}. weatherStorm=\u00a77Vous avez programm\u00e9 l''orage dans {0} weatherStormFor=\u00a77Vous avez programm\u00e9 l''orage dans {0} pour {1} secondes. weatherSun=\u00a77Vous avez programm\u00e9 le beau temps dans {0} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 51bbe2bed..da88603d6 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -11,9 +11,9 @@ alertPlaced=geplaatst: alertUsed=gebruikt: autoAfkKickReason=You have been kicked for idling more than {0} minutes. backAfterDeath=\u00a77Gebruik het /back command om terug te keren naar je sterfplaats. +backUsageMsg=\u00a77Naar de vorige locatie aan het gaan. backupFinished=Backup voltooid backupStarted=Backup gestart -backUsageMsg=\u00a77Naar de vorige locatie aan het gaan. balance=\u00a77Saldo: {0} balanceTop=\u00a77 Top saldi ({0}) banExempt=\u00a77Je kunt deze speler niet verbannen. @@ -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! @@ -64,14 +65,14 @@ depth=\u00a77Je zit op zeeniveau. depthAboveSea=\u00a77Je zit {0} blok(ken) boven zeeniveau. depthBelowSea=\u00a77Je zit {0} blok(ken) onder zeeniveau. destinationNotSet=Bestemming niet ingesteld +disableUnlimited=\u00a77Oneindig plaatsen van {0} uitgeschakeld voor {1}. disabled=uitgeschakeld disabledToSpawnMob=Spawning this mob was disabled in the config file. -disableUnlimited=\u00a77Oneindig plaatsen van {0} uitgeschakeld voor {1}. dontMoveMessage=\u00a77Beginnen met teleporteren in {0}. Niet bewegen. downloadingGeoIp=Bezig met downloaden van GeoIP database ... Dit kan een tijdje duren (country: 0.6 MB, city: 20MB) duplicatedUserdata=Dubbele userdata: {0} en {1}. -enabled=ingeschakeld enableUnlimited=\u00a77Oneindig aantal {0} aan {1} gegeven. +enabled=ingeschakeld enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand. enchantmentNotFound = \u00a7cEnchantment not found enchantmentPerm = \u00a7cYou do not have the permission for {0} @@ -99,9 +100,9 @@ gcentities= entities gcfree=Vrij geheugen: {0} MB gcmax=Maximaal geheugen: {0} MB gctotal=Gealloceerd geheugen: {0} MB -geoipJoinFormat=Speler {0} komt uit {1} geoIpUrlEmpty=GeoIP download url is leeg. geoIpUrlInvalid=GeoIP download url is ongeldig. +geoipJoinFormat=Speler {0} komt uit {1} godDisabledFor=uitgeschakeld voor {0} godEnabledFor=ingeschakeld voor {0} godMode=\u00a77God mode {0}. @@ -112,9 +113,9 @@ helpConsole=type ? om de consolehelp weer te geven. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f: holeInFloor=Gat in de vloer -homes=Homes: {0} homeSet=\u00a77Home ingesteld. homeSetToBed=\u00a77Je home is is nu verplaatst naar dit bed. +homes=Homes: {0} hour=uur hours=uren ignorePlayer=Je negeert {0} vanaf nu. @@ -124,28 +125,28 @@ infoChapterPages=Hoofdstuk {0}, Pagina \u00a7c{1}\u00a7f van de \u00a7c{2}\u00a7 infoFileDoesNotExist=Bestand info.txt bestaat niet. Bezig met aanmaken. infoPages=Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f: infoUnknownChapter=Onbekend hoofdstuk. +invBigger=De inventory van de andere speler is groter dan die van jou. +invRestored=Je inventory is hersteld. +invSee=Je kijkt naar de inventory van {0}. +invSeeHelp=Type /invsee om je inventory te herstellen. invalidCharge=\u00a7cOngeldig te laden. invalidMob=Ongeldig mob type. invalidServer=Ongeldige server! invalidSignLine=Regel {0} op het bordje is ongeldig. invalidWorld=\u00a7cOngeldige wereld. -invBigger=De inventory van de andere speler is groter dan die van jou. inventoryCleared=\u00a77inventory leeggemaakt. inventoryClearedOthers=\u00a77inventory van \u00a7c{0}\u00a77 leeggemaakt. -invRestored=Je inventory is hersteld. -invSee=Je kijkt naar de inventory van {0}. -invSeeHelp=Type /invsee om je inventory te herstellen. is=is itemCannotBeSold=Dat voorwerp kan niet aan de server worden verkocht. itemMustBeStacked=Voorwerp moet geruild worden als stapel. Een hoeveelheid van 2 moet dus geruild worden als twee stapels, etc. itemNotEnough1=\u00a7cJe hebt niet genoeg van dat voorwerp om te verkopen. itemNotEnough2=\u00a77Type /sell itemname Als je alles daarvan wilt verkopen itemNotEnough3=\u00a77/sell itemname -1 zorgt ervoor dat ze allemaal behalve 1 worden verkocht, etc. -itemsCsvNotLoaded=De item kunnen niet geladen worden.csv. itemSellAir=Je wilde serieus lucht verkopen? Plaats een voorwerp in je hand. itemSold=\u00a77Verkocht voor \u00a7c{0} \u00a77({1} {2} voorwerpen voor {3} per stuk) itemSoldConsole={0} verkocht {1} voor \u00a77{2} \u00a77({3} voorwerpen voor {4} per stuk) itemSpawn=\u00a77Geeft {0} {1} +itemsCsvNotLoaded=De item kunnen niet geladen worden.csv. jailAlreadyIncarcerated=\u00a7cPerson is already in jail: {0} jailMessage=\u00a7cYou do the crime, you do the time. jailNotExist=Die gevangenis bestaat niet. @@ -162,8 +163,8 @@ kitError=\u00a7cEr zijn geen geldige kits. kitErrorHelp=\u00a7cMisschien mist er een hoeveelheid van het item in de configuratie? kitGive=\u00a77Kit {0} wordt gegeven. kitInvFull=\u00a7cJe inventory was vol, de kit wordt op de grond geplaatst -kits=\u00a77Kits: {0} kitTimed=\u00a7cJe kan die kit pas weer gebruiken over {0}. +kits=\u00a77Kits: {0} lightningSmited=\u00a77Je bent zojuist verbrand lightningUse=\u00a77Brand {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +176,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cType /mail clear, om ej berichten als gelezen te markeren. mailCleared=\u00a77Bericht geklaard! mailSent=\u00a77Bericht verzonden! +markMailAsRead=\u00a7cType /mail clear, om je berichten als gelezen te markeren markedAsAway=\u00a77Je staat nu als afwezig gemeld. markedAsNotAway=\u00a77Je staat niet meer als afwezig gemeld. -markMailAsRead=\u00a7cType /mail clear, om je berichten als gelezen te markeren maxHomes=You cannot set more than {0} homes. mayNotJail=\u00a7cJe mag die speler niet in de gevangenis zetten. me=me @@ -185,10 +186,10 @@ minute=minuut minutes=minuten missingItems=Je hebt geen {0}x {1}. missingPrefixSuffix=Er mist een prefix of suffix voor {0} -mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Fout bij het veranderen van de mob spawner. mobSpawnLimit=Grootte van de mob hang af van het server limiet mobSpawnTarget=Target blok moet een mob spawner zijn. +mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} is ontvangen van {1} moneySentTo=\u00a7a{0} is verzonden naar {1} moneyTaken={0} van je bankrekening afgehaald. @@ -196,10 +197,10 @@ month=maand months=maanden moreThanZero=Het aantal moet groter zijn dan 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cJe kan deze speler niet muten. mutedPlayer=Speler {0} gemute. mutedPlayerFor=Speler {0} is gemute voor {1}. mutedUserSpeaks={0} probeerde te praten, maar is gemute. -muteExempt=\u00a7cJe kan deze speler niet muten. nearbyPlayers=Players nearby: {0} needTpohere=Je moet toegang krijgen tot /tpohere om naar andere spelers te teleporteren. negativeBalanceError=Speler is niet toegestaan om een negatief saldo te hebben. @@ -221,7 +222,6 @@ noKitPermission=\u00a7cJe hebt de \u00a7c{0}\u00a7c toestemming nodig om die kit noKits=\u00a77Er zijn nog geen kits beschikbaar noMail=Je hebt geen berichten noMotd=\u00a7cEr is geen bericht van de dag. -none=geen noNewMail=\u00a77Je hebt geen nieuwe berichten. noPendingRequest=Je hebt geen aanvragen. noPerm=\u00a7cJe hebt de \u00a7f{0}\u00a7c toestemming niet. @@ -229,21 +229,30 @@ noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob. noPlacePermission=\u00a7cJe hebt geen toestemming om een blok naast die sign te plaatsen. noPowerTools=You have no power tools assigned. noRules=\u00a7cEr zijn nog geen regels gegeven. +noWarpsDefined=Geen warps gedefinieerd +none=geen notAllowedToQuestion=\u00a7cJe bent niet bevoegd om de vraag functie te gebruiken. notAllowedToShout=\u00a7cJe bent niet bevoegd om de roep functie te gebruiken. notEnoughExperience=You do not have enough experience. notEnoughMoney=Je hebt niet voldoende middelen. -nothingInHand = \u00a7cYou have nothing in your hand. notRecommendedBukkit=* ! * De Bukkit versie is niet de aangeraden build voor Essentials. notSupportedYet=Nog niet ondersteund. +nothingInHand = \u00a7cYou have nothing in your hand. now=nu -noWarpsDefined=Geen warps gedefinieerd nuke=May death rain upon them numberRequired=Er moet daar een nummer, grapjas. onlyDayNight=/time ondersteund alleen day/night. onlyPlayers=Alleen in-game spelers kunnen {0} gebruiken. onlySunStorm=/weather only supports sun/storm. orderBalances=Ordering balances of {0} users, please wait ... +pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. +pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. +pTimePlayers=These players have their own time: +pTimeReset=Player time has been reset for: \u00a7e{0} +pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} +pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} parseError=Fout bij ontleding {0} op regel {1} pendingTeleportCancelled=\u00a7cAangevraagde teleportatie afgelast. permissionsError=Permissions/GroupManager ontbreekt; chat prefixes/suffixes worden uitgeschakeld. @@ -271,14 +280,6 @@ powerToolRemoveAll=All commands removed from {0}. powerToolsDisabled=All of your power tools have been disabled. powerToolsEnabled=All of your power tools have been enabled. protectionOwner=\u00a76[EssentialsProtect] Beschermingeigenaar: {0} -pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. -pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. -pTimePlayers=These players have their own time: -pTimeReset=Player time has been reset for: \u00a7e{0} -pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} -pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Vraag]\u00a7f {0} readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Alle plugins zijn herladen. @@ -312,8 +313,8 @@ signProtectInvalidLocation=\u00a74You are not allowed to create sign here. similarWarpExist=Er bestaat al een warp met dezelfde naam. slimeMalformedSize=Misvoormde grootte. soloMob=Die mob is liever in zijn eentje -spawned=gespawned spawnSet=\u00a77Spawn locatie voor de groep {0} ingesteld. +spawned=gespawned suicideMessage=\u00a77Vaarwel vreedzame wereld... suicideSuccess= \u00a77{0} pleegde zelfmoord survival=survival @@ -321,20 +322,20 @@ takenFromAccount=\u00a7c{0} is van je bank rekening afgehaald. 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... -teleportationCommencing=\u00a77Aan het beginnen met teleporteren... -teleportationDisabled=\u00a77Teleportatie uitgeschakeld. -teleportationEnabled=\u00a77Teleportatie ingeschakeld. teleportAtoB=\u00a77{0}\u00a77 is naar {1}\u00a77 geteleporteerd. teleportDisabled={0} heeft teleporteren uit gezet. teleportHereRequest=\u00a7c{0}\u00a7c Heeft gevraagd of hij/zij naar jou mag teleporteren. -teleporting=\u00a77Bezig met teleporteren... -teleportingPortal=\u00a77Bezig met teleporteren via de portal. teleportNewPlayerError=Fout bij het teleporteren van nieuwe speler. teleportRequest=\u00a7c{0}\u00a7c vraagt of hij jou kan teleporteren. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Bezig met teleporteren naar de top. -tempbanExempt=\u00a77Je mag deze speler niet een tempban geven +teleportationCommencing=\u00a77Aan het beginnen met teleporteren... +teleportationDisabled=\u00a77Teleportatie uitgeschakeld. +teleportationEnabled=\u00a77Teleportatie ingeschakeld. +teleporting=\u00a77Bezig met teleporteren... +teleportingPortal=\u00a77Bezig met teleporteren via de portal. tempBanned=Tijdelijk geband voor {0} +tempbanExempt=\u00a77Je mag deze speler niet een tempban geven thunder= Je {0} onweert de wereld thunderDuration=Je {0} onweert de wereld voor {1} seconde. timeBeforeHeal=Afkoeltijd tot de volgende heal: {0} @@ -365,25 +366,25 @@ unlimitedItemPermission=\u00a7cOnbevoegd om oneindig {0} te hebben. unlimitedItems=Oneindige voorwerpen: unmutedPlayer=Speler {0} mag weer spreken. upgradingFilesError=Fout tijdens het upgraden van de bestanden -userdataMoveBackError=Fout bij het verplaasten van userdata/{0}.tmp naar userdata/{1} -userdataMoveError=Fout bij het verplaasten van userdata/{0} naar userdata/{1}.tmp userDoesNotExist=Speler {0} bestaat niet. userIsAway={0} is nu AFK userIsNotAway={0} is niet meer AFK userJailed=\u00a77Je bent in de gevangenis gezet. userUsedPortal={0} gebruikte een bestaande uitgangs portal. +userdataMoveBackError=Fout bij het verplaasten van userdata/{0}.tmp naar userdata/{1} +userdataMoveError=Fout bij het verplaasten van userdata/{0} naar userdata/{1}.tmp usingTempFolderForTesting=Tijdelijke map om te testen: versionMismatch=Verkeerde versie! Update {0} naar dezelfde versie. versionMismatchAll=Verkeerde versie! Update alle Essentials jars naar dezelfde versie. voiceSilenced=\u00a77Je kan niet meer praten warpDeleteError=Fout bij het verwijderen van het warp bestand. -warpingTo=\u00a77Aan het warpen naar {0}. warpListPermission=\u00a7cJe hebt geen toegang om die warp te maken. warpNotExist=Die warp bestaat niet. -warps=Warps: {0} -warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. warpSet=\u00a77Warp {0} ingesteld. warpUsePermission=\u00a7cOnbevoegd om die warp te gebruiken. +warpingTo=\u00a77Aan het warpen naar {0}. +warps=Warps: {0} +warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. weatherStorm=\u00a77Je hebt het weer naar storm gezet in de {0} weatherStormFor=\u00a77Je hebt het weer in de {0} naar storm gezet voor {1} seconde weatherSun=\u00a77Je hebt het weer naar zon gezet in de {0} -- cgit v1.2.3 From 7ba49afa0b3095e678f91412f991db4bf82a84b9 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sun, 4 Mar 2012 10:39:39 +0000 Subject: Better reporting when a users.yml is failing to load. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 9ea8082c0..d28696f5f 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -147,4 +147,5 @@ v 1.9: - 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. - - Minor optimization when checking bukkit permissions. \ No newline at end of file + - Minor optimization when checking bukkit permissions. + - Better reporting when a users.yml is failing to load. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index e766b6c78..a01381fcd 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -602,7 +602,12 @@ public class WorldDataHolder { // Load users if the file is NOT empty if (allUsersNode != null) for (String usersKey : allUsersNode.keySet()) { - Map thisUserNode = (Map) allUsersNode.get(usersKey); + Map thisUserNode = null; + try { + thisUserNode = (Map) allUsersNode.get(usersKey); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in file: " + usersFile.getPath()); + } User thisUser = ph.createUser(usersKey); if (thisUser == null) { throw new IllegalArgumentException("I think this user was declared more than once: " + usersKey + " in file: " + usersFile.getPath()); -- cgit v1.2.3 From 1ce2c60bf4e3a4a38ae8c58cd76849656f37f895 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 16:01:49 +0000 Subject: Updating Craftbukkit #2034 Bukkit #1378 --- lib/bukkit.jar | Bin 4691009 -> 4690989 bytes lib/craftbukkit.jar | Bin 11039568 -> 11039537 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/bukkit.jar b/lib/bukkit.jar index b53ae8d18..0b13c3119 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index c5bdd9c3c..8b32a634a 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From e55aa3cea7f8c12dd843a62f955c83a7b3153ce4 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 16:17:16 +0000 Subject: Extra command alias. --- Essentials/src/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index be2c64b5c..714abde4b 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -58,7 +58,7 @@ commands: clearinventory: description: Clear all items in your inventory. usage: / - aliases: [ci,eci,clearinvent,eclearinvent,eclearinventory] + aliases: [ci,eci,clearinvent,clean,eclean,eclearinvent,eclearinventory] compass: description: Describes your current bearing. usage: / -- cgit v1.2.3 From 6a9027da6d7cd2c2c0c35f0163dc0207720708e6 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 20:06:50 +0000 Subject: Adding starter/newbie kit to EssentialsSpawn Optimization to EssentialsSpawn join event. --- .../src/com/earth2me/essentials/IEssentials.java | 1 + .../src/com/earth2me/essentials/ISettings.java | 6 +++-- Essentials/src/com/earth2me/essentials/Kit.java | 5 ++-- .../src/com/earth2me/essentials/Settings.java | 6 +++++ .../earth2me/essentials/commands/Commandkit.java | 4 +-- Essentials/src/config.yml | 5 ++++ .../spawn/EssentialsSpawnPlayerListener.java | 31 +++++++++++++++++----- 7 files changed, 45 insertions(+), 13 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/IEssentials.java b/Essentials/src/com/earth2me/essentials/IEssentials.java index 20c6c300e..6b820440a 100644 --- a/Essentials/src/com/earth2me/essentials/IEssentials.java +++ b/Essentials/src/com/earth2me/essentials/IEssentials.java @@ -9,6 +9,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.plugin.Plugin; import org.bukkit.scheduler.BukkitScheduler; + /** * @deprecated This will be moved to the api package soon */ diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index 6186736b4..ec3941cd1 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -20,6 +20,8 @@ public interface ISettings extends IConf boolean getAnnounceNewPlayers(); + String getNewPlayerKit(); + String getBackupCommand(); long getBackupInterval(); @@ -115,11 +117,11 @@ public interface ISettings extends IConf boolean warnOnSmite(); double getMaxMoney(); - + double getMinMoney(); boolean isEcoLogEnabled(); - + boolean isEcoLogUpdateEnabled(); boolean removeGodOnDisconnect(); diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index 47e5e6ac2..cf39997ea 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -63,10 +63,11 @@ public class Kit public static List getItems(final User user, final Map kit) throws Exception { - if (kit == null) { + if (kit == null) + { throw new Exception(_("kitError2")); } - + try { return (List)kit.get("items"); diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index e3992e52c..c9232f107 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -351,6 +351,12 @@ public class Settings implements ISettings return new SimpleTextInput(Util.replaceColor(config.getString("newbies.announce-format", "&dWelcome {DISPLAYNAME} to the server!"))); } + @Override + public String getNewPlayerKit() + { + return config.getString("newbies.kit", ""); + } + @Override public String getNewbieSpawn() { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java index aee0af910..67f0fafd0 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java @@ -38,7 +38,7 @@ public class Commandkit extends EssentialsCommand { throw new Exception(_("noKitPermission", "essentials.kit." + kitName)); } - + final List items = Kit.getItems(user, kit); Kit.checkTime(user, kitName, kit); @@ -47,7 +47,7 @@ public class Commandkit extends EssentialsCommand charge.isAffordableFor(user); Kit.expandItems(ess, user, items); - + charge.charge(user); user.sendMessage(_("kitGive", kitName)); diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 81d911c82..11bc38329 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -547,6 +547,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/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index c7a17845a..ba71c176f 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -1,12 +1,13 @@ package com.earth2me.essentials.spawn; +import com.earth2me.essentials.*; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.IEssentials; -import com.earth2me.essentials.OfflinePlayer; -import com.earth2me.essentials.User; import com.earth2me.essentials.textreader.IText; import com.earth2me.essentials.textreader.KeywordReplacer; import com.earth2me.essentials.textreader.SimpleTextPager; +import java.util.List; +import java.util.Locale; +import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Bukkit; @@ -67,13 +68,14 @@ public class EssentialsSpawnPlayerListener implements Listener public void onPlayerJoin(final PlayerJoinEvent event) { - final User user = ess.getUser(event.getPlayer()); - - if (user.hasPlayedBefore()) + if (event.getPlayer().hasPlayedBefore()) { LOGGER.log(Level.FINE, "Old player join"); return; } + + final User user = ess.getUser(event.getPlayer()); + if (!"none".equalsIgnoreCase(ess.getSettings().getNewbieSpawn())) { ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user), 1L); @@ -86,6 +88,21 @@ public class EssentialsSpawnPlayerListener implements Listener ess.broadcastMessage(user, pager.getString(0)); } + final String kitName = ess.getSettings().getNewPlayerKit(); + if (!kitName.isEmpty()) + { + try + { + final Map kit = ess.getSettings().getKit(kitName.toLowerCase(Locale.ENGLISH)); + final List items = Kit.getItems(user, kit); + Kit.expandItems(ess, user, items); + } + catch (Exception ex) + { + LOGGER.log(Level.WARNING, ex.getMessage()); + } + } + LOGGER.log(Level.FINE, "New player join"); } @@ -109,7 +126,7 @@ public class EssentialsSpawnPlayerListener implements Listener try { - Location spawn = spawns.getSpawn(ess.getSettings().getNewbieSpawn()); + final Location spawn = spawns.getSpawn(ess.getSettings().getNewbieSpawn()); if (spawn != null) { user.getTeleport().now(spawn, false, TeleportCause.PLUGIN); -- cgit v1.2.3 From a75eefcdd47f50292fe2ca4d3d8740ebc10b253b Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 21:43:24 +0000 Subject: CME --- Essentials/src/com/earth2me/essentials/Mob.java | 3 ++- Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Mob.java b/Essentials/src/com/earth2me/essentials/Mob.java index 656ed6bc1..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; @@ -73,7 +74,7 @@ public enum Mob } public static Set getMobList() { - return hashMap.keySet(); + return Collections.unmodifiableSet(hashMap.keySet()); } public LivingEntity spawn(final Player player, final Server server, final Location loc) throws MobException diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 5c118eaaa..27a9d3d3a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -27,7 +27,7 @@ public class Commandspawnmob extends EssentialsCommand { if (args.length < 1) { - Set availableList = Mob.getMobList(); + final Set availableList = Mob.getMobList(); for (String mob : availableList) { if (!user.isAuthorized("essentials.spawnmob." + mob.toLowerCase())) -- cgit v1.2.3 From 7cec1564b9e2b5074cae24f36de75b0838309b2a Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 21:54:51 +0000 Subject: Build custom mob list /spawnmob --- .../com/earth2me/essentials/commands/Commandspawnmob.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 27a9d3d3a..7c71c9576 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -5,9 +5,7 @@ import com.earth2me.essentials.Mob; import com.earth2me.essentials.Mob.MobException; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; -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.Server; @@ -27,12 +25,13 @@ public class Commandspawnmob extends EssentialsCommand { if (args.length < 1) { - final Set availableList = Mob.getMobList(); - for (String mob : availableList) + final Set mobList = Mob.getMobList(); + final Set availableList = new HashSet(); + for (String mob : mobList) { - if (!user.isAuthorized("essentials.spawnmob." + mob.toLowerCase())) + if (user.isAuthorized("essentials.spawnmob." + mob.toLowerCase())) { - availableList.remove(mob); + availableList.add(mob); } } if (availableList.isEmpty()) -- cgit v1.2.3 From 1811631b93c5d1d2d731b5aced8b9e780b5b4fc4 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 5 Mar 2012 00:08:37 +0000 Subject: Apply colors to group tags. --- Essentials/src/com/earth2me/essentials/commands/Commandlist.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java index 92833a66c..187e6c7e5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; import java.util.*; import org.bukkit.Server; import org.bukkit.command.CommandSender; @@ -72,7 +73,7 @@ public class Commandlist extends EssentialsCommand for (String group : groups) { final StringBuilder groupString = new StringBuilder(); - groupString.append(group).append(": "); + groupString.append(Util.replaceColor(group)).append(": "); final List users = sort.get(group); Collections.sort(users); boolean first = true; -- cgit v1.2.3 From 8b7c5cf2eda4d501b7022b2cfc18b66cd7314014 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 5 Mar 2012 00:19:40 +0000 Subject: Add listgroups as TL key --- Essentials/src/com/earth2me/essentials/commands/Commandlist.java | 2 +- Essentials/src/messages.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_nl.properties | 1 + 8 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java index 187e6c7e5..77788c7c2 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java @@ -73,7 +73,7 @@ public class Commandlist extends EssentialsCommand for (String group : groups) { final StringBuilder groupString = new StringBuilder(); - groupString.append(Util.replaceColor(group)).append(": "); + groupString.append(_("listGroupTag",Util.replaceColor(group))); final List users = sort.get(group); Collections.sort(users); boolean first = true; diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index d10ec0908..60b09b734 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -170,6 +170,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} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 9bb84edba..0b8671379 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -170,6 +170,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} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 944d5c7ef..fac736f2b 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -170,6 +170,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} diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index c38abd727..66f357022 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -408,3 +408,4 @@ year=year years=years youAreHealed=\u00a77You have been healed. youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail. +listGroupTag={0}\u00a7f: diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 07a788eb5..fbaba1cac 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -170,6 +170,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} diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 8afe6cb0c..0473b3ce4 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -170,6 +170,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} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index da88603d6..05a735949 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -170,6 +170,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} -- cgit v1.2.3 From 68fbc4060541697e209852d3716bad47f41669fe Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 5 Mar 2012 00:22:31 +0000 Subject: Fixing spawnmob count. --- Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 7c71c9576..8d716106f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -175,7 +175,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) { -- cgit v1.2.3 From fabc1c3dd95ce18422f8896d90bc81ce600df965 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 5 Mar 2012 00:39:37 +0000 Subject: Missed one. --- Essentials/src/messages_en.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 66f357022..d1499aad8 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -170,6 +170,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} @@ -408,4 +409,3 @@ year=year years=years youAreHealed=\u00a77You have been healed. youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail. -listGroupTag={0}\u00a7f: -- cgit v1.2.3 From d31e434e4dd8f58ea1da760f931693342631565c Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 5 Mar 2012 18:28:04 +1100 Subject: Allow spamming of this, by reducing explosion damage to 0, same effect, no mess --- Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java b/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java index 3d9846923..9db608235 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java @@ -37,7 +37,7 @@ public class Commandkittycannon extends EssentialsCommand { final Location loc = ocelot.getLocation(); ocelot.remove(); - loc.getWorld().createExplosion(loc, 1f); + loc.getWorld().createExplosion(loc, 0F); } }, 20); } -- cgit v1.2.3 From 0b60d4efe2fed324131e083f6d4168256d943588 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 5 Mar 2012 18:40:18 +1100 Subject: I dont think free noteblocks are a good idea --- Essentials/src/com/earth2me/essentials/commands/Commandessentials.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index 56432a91f..ce2f03af9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -117,7 +117,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() @@ -149,7 +149,6 @@ public class Commandessentials extends EssentialsCommand } } }, 20, 2); - return; } private void stopTune() -- cgit v1.2.3 From cdf5d454839c73e5ff392ba041dbcec259d9b4e3 Mon Sep 17 00:00:00 2001 From: Iaccidentally Date: Thu, 1 Mar 2012 23:10:32 -0500 Subject: update messages.properties for the new bukkit download link (ci.bukkit,org no longer works) --- Essentials/src/messages.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index f7958319d..ad3ff11ac 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -294,7 +294,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 -- cgit v1.2.3 From d27ff9abb6eb33b53f6c3c56d3dbff0346a024ee Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Mar 2012 16:29:06 +0000 Subject: Don't think we need animation event anymore. --- .../src/com/earth2me/essentials/EssentialsPlayerListener.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 9b964364b..ee247f465 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -277,13 +277,6 @@ public class EssentialsPlayerListener implements Listener } } - @EventHandler(priority = EventPriority.NORMAL) - public void onPlayerAnimation(final PlayerAnimationEvent event) - { - final User user = ess.getUser(event.getPlayer()); - user.updateActivity(true); - } - @EventHandler(priority = EventPriority.MONITOR) public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event) { -- cgit v1.2.3 From 016299a1ddf7dd3bd5cf5fe26a96ad9909e8b8e5 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Mar 2012 16:33:20 +0000 Subject: Shouldn't really be canceling events at priority monitor, oops. --- Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index ee247f465..0779c01ab 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -317,9 +317,11 @@ public class EssentialsPlayerListener implements Listener } } - @EventHandler(priority = EventPriority.MONITOR) + @EventHandler(priority = EventPriority.NORMAL) public void onPlayerInteract(final PlayerInteractEvent event) { + final User user = ess.getUser(event.getPlayer()); + user.updateActivity(true); switch (event.getAction()) { case RIGHT_CLICK_BLOCK: @@ -334,7 +336,6 @@ public class EssentialsPlayerListener implements Listener break; case LEFT_CLICK_AIR: case LEFT_CLICK_BLOCK: - final User user = ess.getUser(event.getPlayer()); if (user.hasPowerTools() && user.arePowerToolsEnabled()) { if (usePowertools(user)) -- cgit v1.2.3 From 8450734cf115aa8ee11910705118799424791e40 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Mar 2012 16:54:12 +0000 Subject: Entity event cleanup --- .../essentials/EssentialsEntityListener.java | 89 ++++++++++------------ 1 file changed, 42 insertions(+), 47 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java index e4879186d..45d78ebeb 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java @@ -24,48 +24,47 @@ public class EssentialsEntityListener implements Listener } @EventHandler(priority = EventPriority.LOWEST) - public void onEntityDamage(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) { - EntityDamageByEntityEvent edEvent = (EntityDamageByEntityEvent)event; - Entity eAttack = edEvent.getDamager(); - Entity eDefend = edEvent.getEntity(); - if (eDefend instanceof Player && eAttack instanceof Player) + final User defender = ess.getUser(eDefend); + final User attacker = ess.getUser(eAttack); + attacker.updateActivity(true); + final List commandList = attacker.getPowertool(attacker.getItemInHand()); + if (commandList != null && !commandList.isEmpty()) { - User defender = ess.getUser(eDefend); - User attacker = ess.getUser(eAttack); - attacker.updateActivity(true); - ItemStack is = attacker.getItemInHand(); - List commandList = attacker.getPowertool(is); - if (commandList != null && !commandList.isEmpty()) + for (String command : commandList) { - for (String command : commandList) + if (command != null && !command.isEmpty()) { - - if (command != null && !command.isEmpty()) - { - attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", defender.getName())); - event.setCancelled(true); - return; - } + attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", defender.getName())); + event.setCancelled(true); + return; } } } - if (eDefend instanceof Animals && eAttack instanceof Player) + } + else if (eDefend instanceof Animals && eAttack instanceof Player) + { + final User player = ess.getUser(eAttack); + final ItemStack hand = player.getItemInHand(); + if (hand != null && hand.getType() == Material.MILK_BUCKET) { - User player = ess.getUser(eAttack); - ItemStack hand = player.getItemInHand(); - if (hand != null && hand.getType() == Material.MILK_BUCKET) - { - ((Animals)eDefend).setAge(-24000); - hand.setType(Material.BUCKET); - player.setItemInHand(hand); - player.updateInventory(); - event.setCancelled(true); - } + ((Animals)eDefend).setAge(-24000); + hand.setType(Material.BUCKET); + player.setItemInHand(hand); + player.updateInventory(); + event.setCancelled(true); } } + } + + @EventHandler(priority = EventPriority.LOWEST) + public void onEntityDamage(final EntityDamageEvent event) + { if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled()) { final Player player = (Player)event.getEntity(); @@ -76,7 +75,7 @@ public class EssentialsEntityListener implements Listener } @EventHandler(priority = EventPriority.LOWEST) - public void onEntityCombust(EntityCombustEvent event) + public void onEntityCombust(final EntityCombustEvent event) { if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled()) { @@ -85,26 +84,22 @@ 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 User user = ess.getUser(event.getEntity()); + if (user.isAuthorized("essentials.back.ondeath") && !ess.getSettings().isCommandDisabled("back")) { - final PlayerDeathEvent pdevent = (PlayerDeathEvent)event; - final User user = ess.getUser(pdevent.getEntity()); - if (user.isAuthorized("essentials.back.ondeath") && !ess.getSettings().isCommandDisabled("back")) - { - user.setLastLocation(); - user.sendMessage(_("backAfterDeath")); - } - if (!ess.getSettings().areDeathMessagesEnabled()) - { - pdevent.setDeathMessage(""); - } + user.setLastLocation(); + user.sendMessage(_("backAfterDeath")); + } + if (!ess.getSettings().areDeathMessagesEnabled()) + { + event.setDeathMessage(""); } } @EventHandler(priority = EventPriority.LOWEST) - public void onFoodLevelChange(FoodLevelChangeEvent event) + public void onFoodLevelChange(final FoodLevelChangeEvent event) { if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled()) { @@ -113,7 +108,7 @@ public class EssentialsEntityListener implements Listener } @EventHandler(priority = EventPriority.LOWEST) - public void onEntityRegainHealth(EntityRegainHealthEvent event) + public void onEntityRegainHealth(final EntityRegainHealthEvent event) { if (event.getRegainReason() == RegainReason.SATIATED && event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isAfk() && ess.getSettings().getFreezeAfkPlayers()) -- cgit v1.2.3 From eb74a1de9c1edfca947614759dff6d0e9889c945 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Mar 2012 17:03:34 +0000 Subject: Make the antioch message optional. --- .../src/com/earth2me/essentials/commands/Commandantioch.java | 7 +++++-- Essentials/src/plugin.yml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java b/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java index 54277d466..968d0012c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandantioch.java @@ -17,8 +17,11 @@ public class Commandantioch extends EssentialsCommand @Override public void run(final Server server, final User 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/plugin.yml b/Essentials/src/plugin.yml index 9165febb2..4931191d1 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -13,7 +13,7 @@ commands: aliases: [eafk] antioch: description: 'A little surprise for operators.' - usage: / + usage: / [message] aliases: [eantioch] back: description: Teleports you to your location prior to tp/spawn/warp. -- cgit v1.2.3 From a45c19a08ba657144d536725e3c33b319372d763 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Mar 2012 17:05:55 +0000 Subject: Extra command aliases --- Essentials/src/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 4931191d1..343708b2f 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -14,7 +14,7 @@ commands: antioch: description: 'A little surprise for operators.' usage: / [message] - aliases: [eantioch] + aliases: [eantioch,grenade,tnt,egrenade,etnt] back: description: Teleports you to your location prior to tp/spawn/warp. usage: / -- cgit v1.2.3 From 3e3c7f0d545955912f925b08049adf38372e5472 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 2 Mar 2012 19:05:30 +0000 Subject: Only update displayname on world change, not every teleport. --- .../essentials/EssentialsPlayerListener.java | 15 +++++------ Essentials/src/com/earth2me/essentials/User.java | 29 +++++++++++----------- .../src/com/earth2me/essentials/UserData.java | 19 ++++++++++---- 3 files changed, 37 insertions(+), 26 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 0779c01ab..1b9464da4 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -233,18 +233,13 @@ public class EssentialsPlayerListener implements Listener return; } - final User user = ess.getUser(event.getPlayer()); //There is TeleportCause.COMMMAND but plugins have to actively pass the cause in on their teleports. if ((event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND) && ess.getSettings().registerBackInListener()) { + final User user = ess.getUser(event.getPlayer()); user.setLastLocation(); } - if (ess.getSettings().changeDisplayName()) - { - user.setDisplayNick(); - } - updateCompass(user); } @EventHandler(priority = EventPriority.HIGH) @@ -307,9 +302,15 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.MONITOR) public void onPlayerChangedWorld(final PlayerChangedWorldEvent event) { + final User user = ess.getUser(event.getPlayer()); + if (ess.getSettings().changeDisplayName()) + { + user.setDisplayNick(); + } + updateCompass(user); + if (ess.getSettings().getNoGodWorlds().contains(event.getPlayer().getLocation().getWorld().getName())) { - User user = ess.getUser(event.getPlayer()); if (user.isGodModeEnabledRaw()) { user.sendMessage(_("noGodWorldWarning")); diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index ba34548fe..125962da9 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -249,7 +249,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser return teleportRequestHere; } - public String getNick(boolean addprefixsuffix) + public String getNick(final boolean addprefixsuffix) { final StringBuilder nickname = new StringBuilder(); final String nick = getNickname(); @@ -261,28 +261,28 @@ public class User extends UserData implements Comparable, IReplyTo, IUser { nickname.append(ess.getSettings().getNicknamePrefix()).append(nick); } - if (isOp()) + + if (addprefixsuffix && ess.getSettings().addPrefixSuffix()) { - try - { - nickname.insert(0, ess.getSettings().getOperatorColor().toString()); - nickname.append("§f"); - } - catch (Exception e) + if (isOp()) { + try + { + nickname.insert(0, ess.getSettings().getOperatorColor().toString()); + } + catch (Exception e) + { + } } - } - if (addprefixsuffix && ess.getSettings().addPrefixSuffix()) - { if (!ess.getSettings().disablePrefix()) { - final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName()); + final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§'); nickname.insert(0, prefix); } if (!ess.getSettings().disableSuffix()) { - final String suffix = ess.getPermissionsHandler().getSuffix(base).replace('&', '§').replace("{WORLDNAME}", this.getWorld().getName()); + final String suffix = ess.getPermissionsHandler().getSuffix(base).replace('&', '§'); nickname.append(suffix); if (suffix.length() < 2 || !suffix.substring(suffix.length() - 2, suffix.length() - 1).equals("§")) { @@ -330,6 +330,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser return super.getDisplayName() == null ? super.getName() : super.getDisplayName(); } + @Override public Teleport getTeleport() { return teleport; @@ -385,7 +386,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser catch (Throwable ex) { } - } + } super.setMoney(value); Trade.log("Update", "Set", "API", getName(), new Trade(value, ess), null, null, null, ess); } diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index cda2fa511..1fdc98254 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -44,7 +44,7 @@ public abstract class UserData extends PlayerExtension implements IConf savedInventory = _getSavedInventory(); teleportEnabled = getTeleportEnabled(); ignoredPlayers = getIgnoredPlayers(); - godmode = getGodModeEnabled(); + godmode = _getGodModeEnabled(); muted = getMuted(); muteTimeout = _getMuteTimeout(); jailed = getJailed(); @@ -58,6 +58,7 @@ public abstract class UserData extends PlayerExtension implements IConf isNPC = _isNPC(); arePowerToolsEnabled = _arePowerToolsEnabled(); kitTimestamps = _getKitTimestamps(); + nickname = _getNickname(); } private double money; @@ -189,13 +190,21 @@ public abstract class UserData extends PlayerExtension implements IConf return false; } - public String getNickname() + private String nickname; + + public String _getNickname() { return config.getString("nickname"); } + + public String getNickname() + { + return nickname; + } public void setNickname(String nick) { + nickname = nick; config.setProperty("nickname", nick); config.save(); } @@ -515,7 +524,7 @@ public abstract class UserData extends PlayerExtension implements IConf } private boolean godmode; - private boolean getGodModeEnabled() + private boolean _getGodModeEnabled() { return config.getBoolean("godmode", false); } @@ -817,12 +826,12 @@ public abstract class UserData extends PlayerExtension implements IConf private Map _getKitTimestamps() { - + if (config.isConfigurationSection("timestamps.kits")) { return config.getConfigurationSection("timestamps.kits").getValues(false); } - return new HashMap(); + return new HashMap(); } public Long getKitTimestamp(final String name) -- cgit v1.2.3 From 7cb728b15fcf79d2d39c5f6749f6cb9209c4f635 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 3 Mar 2012 05:09:03 +0000 Subject: I think switches are better. --- .../src/com/earth2me/essentials/EssentialsPlayerListener.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 1b9464da4..76668b615 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -182,10 +182,15 @@ 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) - { - return; + switch (event.getResult()) { + case ALLOWED: + case KICK_FULL: + case KICK_BANNED: + break; + default: + return; } + User user = ess.getUser(event.getPlayer()); user.setNPC(false); -- cgit v1.2.3 From faba1e3604808a46c78bb74d8890351ab49ddb5a Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 3 Mar 2012 05:27:02 +0000 Subject: *make it look like i'm doing something* --- .../com/earth2me/essentials/EssentialsBlockListener.java | 2 +- .../com/earth2me/essentials/EssentialsPlayerListener.java | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java index 648bfcef5..f2e2e8a77 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java @@ -32,7 +32,7 @@ public class EssentialsBlockListener implements Listener { return; } - boolean unlimitedForUser = user.hasUnlimited(is); + final boolean unlimitedForUser = user.hasUnlimited(is); if (unlimitedForUser && user.getGameMode() == GameMode.SURVIVAL) { ess.scheduleSyncDelayedTask( diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 76668b615..7ab1847f1 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -182,15 +182,16 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.HIGH) public void onPlayerLogin(final PlayerLoginEvent event) { - switch (event.getResult()) { + switch (event.getResult()) + { case ALLOWED: case KICK_FULL: - case KICK_BANNED: + case KICK_BANNED: break; default: - return; + return; } - + User user = ess.getUser(event.getPlayer()); user.setNPC(false); @@ -199,7 +200,7 @@ public class EssentialsPlayerListener implements Listener user.checkMuteTimeout(currentTime); user.checkJailTimeout(currentTime); - if (banExpired == false && (user.isBanned() || event.getResult() == Result.KICK_BANNED)) + if (!banExpired && (user.isBanned() || event.getResult() == Result.KICK_BANNED)) { final String banReason = user.getBanReason(); event.disallow(Result.KICK_BANNED, banReason != null && !banReason.isEmpty() && !banReason.equalsIgnoreCase("ban") ? banReason : _("defaultBanReason")); @@ -291,7 +292,7 @@ public class EssentialsPlayerListener implements Listener { for (Player player : ess.getServer().getOnlinePlayers()) { - User spyer = ess.getUser(player); + final User spyer = ess.getUser(player); if (spyer.isSocialSpyEnabled() && !user.equals(spyer)) { player.sendMessage(user.getDisplayName() + " : " + event.getMessage()); @@ -400,7 +401,7 @@ public class EssentialsPlayerListener implements Listener } @EventHandler(priority = EventPriority.LOW) - public void onPlayerPickupItem(PlayerPickupItemEvent event) + public void onPlayerPickupItem(final PlayerPickupItemEvent event) { if (event.isCancelled() || !ess.getSettings().getDisableItemPickupWhileAfk()) { -- cgit v1.2.3 From 619e099a04a8453365121865cb587447be8174a2 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 3 Mar 2012 07:03:54 +0000 Subject: Force all kits to lowercase. --- Essentials/src/com/earth2me/essentials/Kit.java | 8 +++-- .../src/com/earth2me/essentials/Settings.java | 41 +++++++++++++++------- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index 88816368c..138a12979 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -60,11 +60,15 @@ public class Kit } } - public static List getItems(final User user, final Map els) throws Exception + public static List getItems(final User user, final Map kit) throws Exception { + if (kit == null) { + throw new Exception(_("kitError2")); + } + try { - return (List)els.get("items"); + return (List)kit.get("items"); } catch (Exception e) { diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 732b5485c..e3992e52c 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -13,6 +13,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.ChatColor; import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.configuration.MemoryConfiguration; import org.bukkit.event.EventPriority; import org.bukkit.inventory.ItemStack; @@ -208,18 +209,22 @@ public class Settings implements ISettings { return config.getDouble("heal-cooldown", 0); } + private ConfigurationSection kits; - @Override - public Map getKit(String name) + public ConfigurationSection _getKits() { - name = name.replace('.', '_').replace('/', '_'); if (config.isConfigurationSection("kits")) { - final ConfigurationSection kits = getKits(); - if (kits.isConfigurationSection(name)) + final ConfigurationSection section = config.getConfigurationSection("kits"); + final ConfigurationSection newSection = new MemoryConfiguration(); + for (String kitItem : section.getKeys(false)) { - return kits.getConfigurationSection(name).getValues(true); + if (section.isConfigurationSection(kitItem)) + { + newSection.set(kitItem.toLowerCase(Locale.ENGLISH), section.getConfigurationSection(kitItem)); + } } + return newSection; } return null; } @@ -227,9 +232,20 @@ public class Settings implements ISettings @Override public ConfigurationSection getKits() { + return kits; + } + + @Override + public Map getKit(String name) + { + name = name.replace('.', '_').replace('/', '_'); if (config.isConfigurationSection("kits")) { - return config.getConfigurationSection("kits"); + final ConfigurationSection kits = getKits(); + if (kits.isConfigurationSection(name)) + { + return kits.getConfigurationSection(name).getValues(true); + } } return null; } @@ -358,8 +374,9 @@ public class Settings implements ISettings { config.load(); noGodWorlds = new HashSet(config.getStringList("no-god-in-worlds")); - enabledSigns = getEnabledSigns(); - itemSpawnBl = getItemSpawnBlacklist(); + enabledSigns = _getEnabledSigns(); + itemSpawnBl = _getItemSpawnBlacklist(); + kits = _getKits(); chatFormats.clear(); } private List itemSpawnBl = new ArrayList(); @@ -370,7 +387,7 @@ public class Settings implements ISettings return itemSpawnBl; } - private List getItemSpawnBlacklist() + private List _getItemSpawnBlacklist() { final List epItemSpwn = new ArrayList(); if (ess.getItemDb() == null) @@ -405,7 +422,7 @@ public class Settings implements ISettings return enabledSigns; } - private List getEnabledSigns() + private List _getEnabledSigns() { List newSigns = new ArrayList(); @@ -559,7 +576,7 @@ public class Settings implements ISettings { return config.getBoolean("economy-log-enabled", false); } - + @Override public boolean isEcoLogUpdateEnabled() { -- cgit v1.2.3 From caf598f55b271cf1e009c8073cb4d13538559a73 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 3 Mar 2012 07:09:41 +0000 Subject: Capital case for formatting. --- Essentials/src/com/earth2me/essentials/Kit.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index 138a12979..47e5e6ac2 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -1,6 +1,7 @@ package com.earth2me.essentials; import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.capitalCase; import com.earth2me.essentials.commands.NoChargeException; import com.earth2me.essentials.craftbukkit.InventoryWorkaround; import java.util.*; @@ -22,7 +23,7 @@ public class Kit { if (user.isAuthorized("essentials.kit." + kiteItem.toLowerCase(Locale.ENGLISH))) { - list.append(" ").append(kiteItem); + list.append(" ").append(capitalCase(kiteItem)); } } return list.toString().trim(); -- cgit v1.2.3 From e6736e48a5da9a3dd8480fef3640eae85f4b13ce Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Sat, 3 Mar 2012 18:07:43 +1100 Subject: Cleanup Signed-off-by: Chris Ward --- .../src/com/earth2me/essentials/commands/Commandessentials.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index 14bbf5e02..0f390f4e0 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -35,6 +35,10 @@ public class Commandessentials extends EssentialsCommand { run_nya(server, sender, commandLabel, args); } + else if (args[0].equalsIgnoreCase("moo")) + { + run_moo(server, sender, commandLabel, args); + } else { run_reload(server, sender, commandLabel, args); } @@ -159,4 +163,9 @@ public class Commandessentials extends EssentialsCommand } noteBlocks.clear(); } + + private void run_moo(final Server server, final CommandSender sender, final String command, final String args[]) + { + sender.sendMessage(new String[]{" (__)", " (oo)", " /------\\/", " / | ||", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..." } ); + } } -- cgit v1.2.3 From 873c9880dd361e1edae6e0ecca745e1592cafc67 Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Sat, 3 Mar 2012 19:21:27 +1100 Subject: Cleanup Signed-off-by: Chris Ward --- .../src/com/earth2me/essentials/commands/Commandessentials.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index 0f390f4e0..56432a91f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -9,6 +9,7 @@ import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.block.Block; import org.bukkit.command.CommandSender; +import org.bukkit.command.ConsoleCommandSender; import org.bukkit.entity.Player; @@ -166,6 +167,9 @@ public class Commandessentials extends EssentialsCommand private void run_moo(final Server server, final CommandSender sender, final String command, final String args[]) { - sender.sendMessage(new String[]{" (__)", " (oo)", " /------\\/", " / | ||", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..." } ); + if(sender instanceof ConsoleCommandSender) + sender.sendMessage(new String[]{" (__)", " (oo)", " /------\\/", " / | ||", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..." } ); + else + sender.sendMessage(new String[]{" (__)", " (oo)", " /------\\/", " / | | |", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..." } ); } } -- cgit v1.2.3 From b512a243e71034dc56ecdc37281d18e39b21109f Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 4 Mar 2012 15:43:00 +1100 Subject: Fix op colours, which KHobbits broke! --- Essentials/src/com/earth2me/essentials/User.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 125962da9..f89f1a5ad 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -262,19 +262,19 @@ public class User extends UserData implements Comparable, IReplyTo, IUser nickname.append(ess.getSettings().getNicknamePrefix()).append(nick); } - if (addprefixsuffix && ess.getSettings().addPrefixSuffix()) + if (isOp()) { - if (isOp()) + try { - try - { - nickname.insert(0, ess.getSettings().getOperatorColor().toString()); - } - catch (Exception e) - { - } + nickname.insert(0, ess.getSettings().getOperatorColor().toString()); + nickname.append("§f"); } - + catch (Exception e) + { + } + } + if (addprefixsuffix && ess.getSettings().addPrefixSuffix()) + { if (!ess.getSettings().disablePrefix()) { final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§'); -- cgit v1.2.3 From e28f1b1be3bf9a44a0eb4c4116a9a166cec7be20 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 08:18:25 +0000 Subject: Half-revert double backflip. 10 points. (op prefix changes that md-5 broke, thinking I broke op prefixes) --- Essentials/src/com/earth2me/essentials/User.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index f89f1a5ad..092b61880 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -262,12 +262,15 @@ public class User extends UserData implements Comparable, IReplyTo, IUser nickname.append(ess.getSettings().getNicknamePrefix()).append(nick); } - if (isOp()) + if (addprefixsuffix && isOp()) { try { - nickname.insert(0, ess.getSettings().getOperatorColor().toString()); - nickname.append("§f"); + final String opPrefix = ess.getSettings().getOperatorColor().toString(); + if (opPrefix.length() > 0) { + nickname.insert(0, opPrefix); + nickname.append("§f"); + } } catch (Exception e) { -- cgit v1.2.3 From b16a1f7237f58a3c7728bc238923fb90e218659e Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 09:20:03 +0000 Subject: Adding option to modify all users balances (including offline) /eco reset ** --- .../earth2me/essentials/commands/Commandeco.java | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java index b9694ee49..dd6d6ad0d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java @@ -34,7 +34,31 @@ public class Commandeco extends EssentialsCommand throw new NotEnoughArgumentsException(ex); } - if (args[1].contentEquals("*")) + if (args[1].contentEquals("**")) + { + for (String sUser : ess.getUserMap().getAllUniqueUsers()) + { + final User 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: + player.setMoney(amount == 0 ? ess.getSettings().getStartingBalance() : amount); + break; + } + } + } + else if (args[1].contentEquals("*")) { for (Player onlinePlayer : server.getOnlinePlayers()) { -- cgit v1.2.3 From cbfb52419577fffca58c8e334a6c8b8caa1961f6 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 10:11:58 +0000 Subject: Allow more currency customization. Added currency key to messages. --- Essentials/src/com/earth2me/essentials/User.java | 12 ++-- Essentials/src/com/earth2me/essentials/Util.java | 16 ++++- .../src/com/earth2me/essentials/api/Economy.java | 2 +- .../essentials/commands/Commandbalance.java | 4 +- .../essentials/commands/Commandbalancetop.java | 4 +- .../earth2me/essentials/commands/Commandsell.java | 4 +- .../earth2me/essentials/commands/Commandwhois.java | 2 +- .../earth2me/essentials/commands/Commandworth.java | 16 ++--- .../earth2me/essentials/signs/EssentialsSign.java | 2 +- .../com/earth2me/essentials/signs/SignTrade.java | 8 +-- Essentials/src/messages.properties | 75 +++++++++++----------- Essentials/src/messages_da.properties | 75 +++++++++++----------- Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 75 +++++++++++----------- Essentials/src/messages_es.properties | 75 +++++++++++----------- Essentials/src/messages_fr.properties | 75 +++++++++++----------- Essentials/src/messages_nl.properties | 75 +++++++++++----------- 17 files changed, 269 insertions(+), 252 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 092b61880..b02a70a03 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -105,10 +105,10 @@ public class User extends UserData implements Comparable, IReplyTo, IUser return; } 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(), Util.formatCurrency(getMoney(), ess))); + initiator.sendMessage(_("addedToOthersAccount", Util.displayCurrency(value, ess), this.getDisplayName(), Util.displayCurrency(getMoney(), ess))); } } @@ -122,8 +122,8 @@ public class User extends UserData implements Comparable, IReplyTo, 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 { @@ -144,10 +144,10 @@ public class User extends UserData implements Comparable, IReplyTo, 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(), Util.formatCurrency(getMoney(), ess))); + initiator.sendMessage(_("takenFromOthersAccount", Util.displayCurrency(value, ess), this.getDisplayName(), Util.displayCurrency(getMoney(), ess))); } } diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index 3e3a7efd0..51e80fc5b 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -422,11 +422,11 @@ public 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) { - String str = ess.getSettings().getCurrencySymbol() + df.format(value); + String str = dFormat.format(value); if (str.endsWith(".00")) { str = str.substring(0, str.length() - 3); @@ -434,6 +434,16 @@ public class Util return str; } + public static String displayCurrency(final double value, final IEssentials ess) + { + return _("currency", ess.getSettings().getCurrencySymbol(), formatAsCurrency(value)); + } + + public static String shortCurrency(final double value, final IEssentials ess) + { + return ess.getSettings().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/Economy.java b/Essentials/src/com/earth2me/essentials/api/Economy.java index a1d421c38..6ed1829b3 100644 --- a/Essentials/src/com/earth2me/essentials/api/Economy.java +++ b/Essentials/src/com/earth2me/essentials/api/Economy.java @@ -249,7 +249,7 @@ public final class Economy { throw new RuntimeException(noCallBeforeLoad); } - return Util.formatCurrency(amount, ess); + return Util.displayCurrency(amount, ess); } /** diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java index 58f164ad6..15c3c9088 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java @@ -21,7 +21,7 @@ public class Commandbalance extends EssentialsCommand { throw new NotEnoughArgumentsException(); } - sender.sendMessage(_("balance", Util.formatCurrency(getPlayer(server, args, 0, true).getMoney(), ess))); + sender.sendMessage(_("balance", Util.displayCurrency(getPlayer(server, args, 0, true).getMoney(), ess))); } @Override @@ -32,6 +32,6 @@ public class Commandbalance extends EssentialsCommand || user.isAuthorized("essentials.balance.other")) ? user : getPlayer(server, 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 fffb69ea4..6c5e96b9f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java @@ -130,11 +130,11 @@ public class Commandbalancetop extends EssentialsCommand } }); - cache.getLines().add(_("serverTotal", Util.formatCurrency(totalMoney, ess))); + cache.getLines().add(_("serverTotal", Util.displayCurrency(totalMoney, ess))); int pos = 1; for (Map.Entry 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/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java index d59c09b1e..5958a5c0f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java @@ -160,8 +160,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/Commandwhois.java b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java index 7e211455e..d068aac9a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java @@ -60,7 +60,7 @@ public class Commandwhois extends EssentialsCommand sender.sendMessage(_("whoisLocation", user.getLocation().getWorld().getName(), user.getLocation().getBlockX(), user.getLocation().getBlockY(), user.getLocation().getBlockZ())); if (!ess.getSettings().isEcoDisabled()) { - sender.sendMessage(_("whoisMoney", Util.formatCurrency(user.getMoney(), ess))); + sender.sendMessage(_("whoisMoney", Util.displayCurrency(user.getMoney(), ess))); } sender.sendMessage(user.isAfk() ? _("whoisStatusAway") diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java index 586b31873..c8573ba25 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java @@ -51,14 +51,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 @@ -95,14 +95,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/signs/EssentialsSign.java b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java index b0df73a42..21e70516e 100644 --- a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java +++ b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java @@ -266,7 +266,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/Essentials/src/com/earth2me/essentials/signs/SignTrade.java b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java index 6b47ebc76..6ea4f5e80 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java @@ -135,11 +135,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; } } @@ -155,7 +155,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; } } @@ -313,7 +313,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/Essentials/src/messages.properties b/Essentials/src/messages.properties index ad3ff11ac..d10ec0908 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -11,9 +11,9 @@ alertPlaced=placed: alertUsed=used: autoAfkKickReason=You have been kicked for idling more than {0} minutes. backAfterDeath=\u00a77Use the /back command to return to your death point. +backUsageMsg=\u00a77Returning to previous location. backupFinished=Backup finished backupStarted=Backup started -backUsageMsg=\u00a77Returning to previous location. balance=\u00a77Balance: {0} balanceTop=\u00a77Top balances ({0}) banExempt=\u00a7cYou can not ban that player. @@ -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! @@ -64,14 +65,14 @@ depth=\u00a77You are at sea level. depthAboveSea=\u00a77You are {0} block(s) above sea level. depthBelowSea=\u00a77You are {0} block(s) below sea level. destinationNotSet=Destination not set +disableUnlimited=\u00a77Disabled unlimited placing of {0} for {1}. disabled=disabled disabledToSpawnMob=Spawning this mob was disabled in the config file. -disableUnlimited=\u00a77Disabled unlimited placing of {0} for {1}. dontMoveMessage=\u00a77Teleportation will commence in {0}. Don''t move. downloadingGeoIp=Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB) duplicatedUserdata=Duplicated userdata: {0} and {1} -enabled=enabled enableUnlimited=\u00a77Giving unlimited amount of {0} to {1}. +enabled=enabled enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand. enchantmentNotFound = \u00a7cEnchantment not found enchantmentPerm = \u00a7cYou do not have the permission for {0} @@ -99,9 +100,9 @@ gcentities= entities gcfree=Free memory: {0} MB gcmax=Maximum memory: {0} MB gctotal=Allocated memory: {0} MB -geoipJoinFormat=Player {0} comes from {1} geoIpUrlEmpty=GeoIP download url is empty. geoIpUrlInvalid=GeoIP download url is invalid. +geoipJoinFormat=Player {0} comes from {1} godDisabledFor=disabled for {0} godEnabledFor=enabled for {0} godMode=\u00a77God mode {0}. @@ -112,9 +113,9 @@ helpConsole=To view help from the console, type ?. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: holeInFloor=Hole in floor -homes=Homes: {0} homeSet=\u00a77Home set. homeSetToBed=\u00a77Your home is now set to this bed. +homes=Homes: {0} hour=hour hours=hours ignorePlayer=You ignore player {0} from now on. @@ -124,28 +125,28 @@ infoChapterPages=Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f: infoFileDoesNotExist=File info.txt does not exist. Creating one for you. infoPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: infoUnknownChapter=Unknown chapter. +invBigger=The other users inventory is bigger than yours. +invRestored=Your inventory has been restored. +invSee=You see the inventory of {0}. +invSeeHelp=Use /invsee to restore your inventory. invalidCharge=\u00a7cInvalid charge. invalidMob=Invalid mob type. invalidServer=Invalid server! invalidSignLine=Line {0} on sign is invalid. invalidWorld=\u00a7cInvalid world. -invBigger=The other users inventory is bigger than yours. inventoryCleared=\u00a77Inventory Cleared. inventoryClearedOthers=\u00a77Inventory of \u00a7c{0}\u00a77 cleared. -invRestored=Your inventory has been restored. -invSee=You see the inventory of {0}. -invSeeHelp=Use /invsee to restore your inventory. is=is itemCannotBeSold=That item cannot be sold to the server. itemMustBeStacked=Item must be traded in stacks. A quantity of 2s would be two stacks, etc. itemNotEnough1=\u00a7cYou do not have enough of that item to sell. itemNotEnough2=\u00a77If you meant to sell all of your items of that type, use /sell itemname itemNotEnough3=\u00a77/sell itemname -1 will sell all but one item, etc. -itemsCsvNotLoaded=Could not load items.csv. itemSellAir=You really tried to sell Air? Put an item in your hand. itemSold=\u00a77Sold for \u00a7c{0} \u00a77({1} {2} at {3} each) itemSoldConsole={0} sold {1} for \u00a77{2} \u00a77({3} items at {4} each) itemSpawn=\u00a77Giving {0} of {1} +itemsCsvNotLoaded=Could not load items.csv. jailAlreadyIncarcerated=\u00a7cPerson is already in jail: {0} jailMessage=\u00a7cYou do the crime, you do the time. jailNotExist=That jail does not exist. @@ -162,8 +163,8 @@ kitError=\u00a7cThere are no valid kits. kitErrorHelp=\u00a7cPerhaps an item is missing a quantity in the configuration? kitGive=\u00a77Giving kit {0}. kitInvFull=\u00a7cYour inventory was full, placing kit on the floor -kits=\u00a77Kits: {0} kitTimed=\u00a7cYou can''t use that kit again for another {0}. +kits=\u00a77Kits: {0} lightningSmited=\u00a77You have just been smited lightningUse=\u00a77Smiting {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +176,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cTo mark your mail as read, type /mail clear mailCleared=\u00a77Mail Cleared! mailSent=\u00a77Mail sent! +markMailAsRead=\u00a7cTo mark your mail as read, type /mail clear markedAsAway=\u00a77You are now marked as away. markedAsNotAway=\u00a77You are no longer marked as away. -markMailAsRead=\u00a7cTo mark your mail as read, type /mail clear maxHomes=You cannot set more than {0} homes. mayNotJail=\u00a7cYou may not jail that person me=me @@ -185,10 +186,10 @@ minute=minute minutes=minutes missingItems=You do not have {0}x {1}. missingPrefixSuffix=Missing a prefix or suffix for {0} -mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Error while changing mob spawner. mobSpawnLimit=Mob quantity limited to server limit mobSpawnTarget=Target block must be a mob spawner. +mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} has been received from {1} moneySentTo=\u00a7a{0} has been sent to {1} moneyTaken={0} taken from your bank account. @@ -196,10 +197,10 @@ month=month months=months moreThanZero=Quantities must be greater than 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cYou may not mute that player. mutedPlayer=Player {0} muted. mutedPlayerFor=Player {0} muted for {1}. mutedUserSpeaks={0} tried to speak, but is muted. -muteExempt=\u00a7cYou may not mute that player. nearbyPlayers=Players nearby: {0} needTpohere=You need access to /tpohere to teleport other players. negativeBalanceError=User is not allowed to have a negative balance. @@ -221,7 +222,6 @@ noKitPermission=\u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit noKits=\u00a77There are no kits available yet noMail=You do not have any mail noMotd=\u00a7cThere is no message of the day. -none=none noNewMail=\u00a77You have no new mail. noPendingRequest=You do not have a pending request. noPerm=\u00a7cYou do not have the \u00a7f{0}\u00a7c permission. @@ -229,21 +229,30 @@ noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob. noPlacePermission=\u00a7cYou do not have permission to place a block near that sign. noPowerTools=You have no power tools assigned. noRules=\u00a7cThere are no rules specified yet. +noWarpsDefined=No warps defined +none=none notAllowedToQuestion=\u00a7cYou are not authorized to use question. notAllowedToShout=\u00a7cYou are not authorized to shout. notEnoughExperience=You do not have enough experience. notEnoughMoney=You do not have sufficient funds. -nothingInHand = \u00a7cYou have nothing in your hand. notRecommendedBukkit= * ! * Bukkit version is not the recommended build for Essentials. notSupportedYet=Not supported yet. +nothingInHand = \u00a7cYou have nothing in your hand. now=now -noWarpsDefined=No warps defined nuke=May death rain upon them numberRequired=A number goes there, silly. onlyDayNight=/time only supports day/night. onlyPlayers=Only in-game players can use {0}. onlySunStorm=/weather only supports sun/storm. orderBalances=Ordering balances of {0} users, please wait ... +pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. +pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. +pTimePlayers=These players have their own time: +pTimeReset=Player time has been reset for: \u00a7e{0} +pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} +pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} parseError=Error parsing {0} on line {1} pendingTeleportCancelled=\u00a7cPending teleportation request cancelled. permissionsError=Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled. @@ -271,14 +280,6 @@ powerToolRemoveAll=All commands removed from {0}. powerToolsDisabled=All of your power tools have been disabled. powerToolsEnabled=All of your power tools have been enabled. protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0} -pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. -pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. -pTimePlayers=These players have their own time: -pTimeReset=Player time has been reset for: \u00a7e{0} -pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} -pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Question]\u00a7f {0} readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Reloaded all plugins. @@ -312,8 +313,8 @@ signProtectInvalidLocation=\u00a74You are not allowed to create sign here. similarWarpExist=A warp with a similar name already exists. slimeMalformedSize=Malformed size. soloMob=That mob likes to be alone -spawned=spawned spawnSet=\u00a77Spawn location set for group {0}. +spawned=spawned suicideMessage=\u00a77Goodbye Cruel World... suicideSuccess= \u00a77{0} took their own life survival=survival @@ -321,20 +322,20 @@ takenFromAccount=\u00a7c{0} has been taken from your account. takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... -teleportationCommencing=\u00a77Teleportation commencing... -teleportationDisabled=\u00a77Teleportation disabled. -teleportationEnabled=\u00a77Teleportation enabled. teleportAtoB=\u00a77{0}\u00a77 teleported you to {1}\u00a77. teleportDisabled={0} has teleportation disabled. teleportHereRequest=\u00a7c{0}\u00a7c has requested that you teleport to them. -teleporting=\u00a77Teleporting... -teleportingPortal=\u00a77Teleporting via portal. teleportNewPlayerError=Failed to teleport new player teleportRequest=\u00a7c{0}\u00a7c has requested to teleport to you. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teleporting to top. -tempbanExempt=\u00a77You may not tempban that player +teleportationCommencing=\u00a77Teleportation commencing... +teleportationDisabled=\u00a77Teleportation disabled. +teleportationEnabled=\u00a77Teleportation enabled. +teleporting=\u00a77Teleporting... +teleportingPortal=\u00a77Teleporting via portal. tempBanned=Temporarily banned from server for {0} +tempbanExempt=\u00a77You may not tempban that player thunder= You {0} thunder in your world thunderDuration=You {0} thunder in your world for {1} seconds. timeBeforeHeal=Time before next heal: {0} @@ -365,25 +366,25 @@ unlimitedItemPermission=\u00a7cNo permission for unlimited item {0}. unlimitedItems=Unlimited items: unmutedPlayer=Player {0} unmuted. upgradingFilesError=Error while upgrading the files -userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} -userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp userDoesNotExist=The user {0} does not exist. userIsAway={0} is now AFK userIsNotAway={0} is no longer AFK userJailed=\u00a77You have been jailed userUsedPortal={0} used an existing exit portal. +userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} +userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp usingTempFolderForTesting=Using temp folder for testing: versionMismatch=Version mismatch! Please update {0} to the same version. versionMismatchAll=Version mismatch! Please update all Essentials jars to the same version. voiceSilenced=\u00a77Your voice has been silenced warpDeleteError=Problem deleting the warp file. -warpingTo=\u00a77Warping to {0}. warpListPermission=\u00a7cYou do not have Permission to list warps. warpNotExist=That warp does not exist. -warps=Warps: {0} -warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. warpSet=\u00a77Warp {0} set. warpUsePermission=\u00a7cYou do not have Permission to use that warp. +warpingTo=\u00a77Warping to {0}. +warps=Warps: {0} +warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. weatherStorm=\u00a77You set the weather to storm in {0} weatherStormFor=\u00a77You set the weather to storm in {0} for {1} seconds weatherSun=\u00a77You set the weather to sun in {0} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 0d8260947..9bb84edba 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -11,9 +11,9 @@ alertPlaced=placerede: alertUsed=brugte: autoAfkKickReason=Du er blevet kicked for at idle mere end {0} minutter. backAfterDeath=\u00a77Brug /back kommandoen for at teleportere til dit d\u00f8dspunkt. +backUsageMsg=\u00a77Teleporterer til tidligere placering. backupFinished=Backup sluttet backupStarted=Backup startet -backUsageMsg=\u00a77Teleporterer til tidligere placering. balance=\u00a77Saldo: {0} balanceTop=\u00a77Top saldoer ({0}) banExempt=\u00a7cDu kan ikke banne den p\u00e5g\u00e6ldende spiller. @@ -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! @@ -64,14 +65,14 @@ depth=\u00a77Du er ved havoverfladen. depthAboveSea=\u00a77Du er {0} blok(ke) over havets overflade. depthBelowSea=\u00a77Du er {0} blok(ke) under havets overflade. destinationNotSet=Destination ikke sat +disableUnlimited=\u00a77Deaktiverede ubergr\u00e6nset placering af {0} for {1}. disabled=deaktiveret disabledToSpawnMob=Skabelse af denne mob er deaktiveret i configfilen. -disableUnlimited=\u00a77Deaktiverede ubergr\u00e6nset placering af {0} for {1}. dontMoveMessage=\u00a77Teleportering vil begynde om {0}. Bev\u00e6g dig ikke. downloadingGeoIp=Downloader GeoIP database... det her kan tage et stykke tid (land: 0.6 MB, by: 27MB) duplicatedUserdata=Duplikerede userdata: {0} og {1} -enabled=aktiveret enableUnlimited=\u00a77Giver ubegr\u00e6nset m\u00e6ngde af {0} til {1}. +enabled=aktiveret enchantmentApplied = \u00a77Enchantment {0} er blevet tilf\u00c3\u00b8jet til tingen i din h\u00c3\u00a5nd. enchantmentNotFound = \u00a7cEnchantment ikke fundet. enchantmentPerm = \u00a7cDu har ikke tilladelse til at {0} @@ -99,9 +100,9 @@ gcentities= entities gcfree=Free memory: {0} MB gcmax=Maximum memory: {0} MB gctotal=Allocated memory: {0} MB -geoipJoinFormat=Spilleren {0} kommer fra {1} geoIpUrlEmpty=GeoIP download url er tom. geoIpUrlInvalid=GeoIP download url er ugyldig. +geoipJoinFormat=Spilleren {0} kommer fra {1} godDisabledFor=deaktiveret for {0} godEnabledFor=aktiveret for {0} godMode=\u00a77Gud mode {0}. @@ -112,9 +113,9 @@ helpConsole=For at se hj\u00e6lp fra konsolen, skriv ?. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f: holeInFloor=Hul i gulv -homes=Hjem: {0} homeSet=\u00a77Hjem sat. homeSetToBed=\u00a77Dit hjem er nu sat til denne seng. +homes=Hjem: {0} hour=time hours=timer ignorePlayer=Du ignorerer spiller {0} fra nu af. @@ -124,28 +125,28 @@ infoChapterPages=Kapitel {0}, side \u00a7c{1}\u00a7f af \u00a7c{2}\u00a7f: infoFileDoesNotExist=Fil info.txt eksisterer ikke. Fixer liiige en for dig. infoPages=Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f: infoUnknownChapter=Ukendt kapitel. +invBigger=Den anden brugers inventory er st\u00f8rre end din. +invRestored=Din inventory er blevet genoprettet. +invSee=Du ser {0}''s inventory. +invSeeHelp=Brug /invsee for at genoprette din inventory. invalidCharge=\u00a7cUgyldig opladning (korrekt oversat?). invalidMob=Ugyldig mob type. invalidServer=Ugyldig server! invalidSignLine=Linje {0} p\u00e5 skilt er ugyldig. invalidWorld=\u00a7cUgyldig verden. -invBigger=Den anden brugers inventory er st\u00f8rre end din. inventoryCleared=\u00a77Inventory ryddet. inventoryClearedOthers=\u00a7c{0}\u00a77''s inventory ryddet. -invRestored=Din inventory er blevet genoprettet. -invSee=Du ser {0}''s inventory. -invSeeHelp=Brug /invsee for at genoprette din inventory. is=er itemCannotBeSold=Denne ting kan ikke s\u00e6lges til serveren. itemMustBeStacked=Tingen skal handles i stakke. En m\u00e6ngde af 2s ville v\u00e6re to stakke, osv. itemNotEnough1=\u00a7cDu har ikke nok af denne ting til at kunne s\u00e6lge. itemNotEnough2=\u00a77Hvis du mente, at du ville s\u00c3\u00a6lge alle ting af den type, brug da /sell tingens-navn itemNotEnough3=\u00a77/sell ting-navn -1 vil s\u00e6lge alle enheder, undtagen \u00c3\u00a9n, osv. -itemsCsvNotLoaded=Kunne ikke loade items.csv. itemSellAir=Fors\u00f8gte du virkelig at s\u00e6lge luft? Kom en ting i h\u00e5nden, hattemand. itemSold=\u00a77Solgte til \u00a7c{0} \u00a77({1} {2} ting for {3} pr. stk.) itemSoldConsole={0} solgte {1} til \u00a77{2} \u00a77({3} ting for {4} pr. stk.) itemSpawn=\u00a77Giver {0} af {1} +itemsCsvNotLoaded=Kunne ikke loade items.csv. jailAlreadyIncarcerated=\u00a7cSpilleren er allerede i f\u00c3\u00a6ngsel: {0} jailMessage=\u00a7cDu bryder reglerne, du tager straffen. jailNotExist=Det f\u00e6ngsel eksisterer ikke. @@ -162,8 +163,8 @@ kitError=\u00a7cDer er ikke nogen gyldige kits. kitErrorHelp=\u00a7cM\u00e5ske mangler en ting en m\u00e6ngde i konfigurationen? Eller m\u00c3\u00a5ske er der nisser p\u00c3\u00a5 spil? kitGive=\u00a77Giver kit til {0} (oversat korrekt?). kitInvFull=\u00a7cDin inventory er fuld, placerer kit p\u00e5 gulvet. -kits=\u00a77Kits: {0} kitTimed=\u00a7cDu kan ikke benytte dette kit igen i {0}. +kits=\u00a77Kits: {0} lightningSmited=\u00a77Du er blevet ramt af Guds vrede (din admin) lightningUse=\u00a77Kaster lyn efter {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +176,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cFor at markere din flaskepost som l\u00e6st, skriv /mail clear mailCleared=\u00a77Flaskepot ryddet! mailSent=\u00a77Flaskepot sendt! +markMailAsRead=\u00a7cFor at markere din flaskepost som l\u00e6st, skriv /mail clear markedAsAway=\u00a77Du er nu markeret som v\u00c3\u00a6rende ikke tilstede. markedAsNotAway=\u00a77Du er ikke l\u00e6ngere markeret som v\u00c3\u00a6rende ikke tilstede. -markMailAsRead=\u00a7cFor at markere din flaskepost som l\u00e6st, skriv /mail clear maxHomes=Du kan ikke have mere end {0} hjem. mayNotJail=\u00a7cDu kan ikke smide denne person i f\u00c3\u00a6ngsel. me=mig @@ -185,10 +186,10 @@ minute=minut minutes=minutter missingItems=Du har ikke {0}x {1}. missingPrefixSuffix=Mangler et pr\u00e6fiks eller suffiks for {0} -mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Fejl ved \u00e6ndring af mob spawner. mobSpawnLimit=Mob m\u00e6ngde begr\u00e6nset til serverens fastsatte gr\u00e6nse. mobSpawnTarget=M\u00e5l blok skal v\u00e6re en mob spawner. +mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} er modtaget fra {1} moneySentTo=\u00a7a{0} er sendt til {1} moneyTaken={0} blev taget fra din bankkonto. @@ -196,10 +197,10 @@ month=m\u00e5nede months=m\u00e5neder moreThanZero=M\u00e6ngder skal v\u00e6re st\u00f8rre end 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cDu kan ikke mute denne spiller. mutedPlayer=Spiller {0} muted. mutedPlayerFor=Spiller {0} muted i {1}. mutedUserSpeaks={0} pr\u00f8vede at snakke, men er muted. -muteExempt=\u00a7cDu kan ikke mute denne spiller. nearbyPlayers=Spillere i n\u00c3\u00a6rheden: {0} needTpohere=Du skal have adgang til /tpohere for at teleportere andre spillere. negativeBalanceError=Brugeren har ikke tilladelse til at have en negativ saldo. @@ -221,7 +222,6 @@ noKitPermission=\u00a7cDu har brug for \u00a7c{0}\u00a7c permission for at bruge noKits=\u00a77Der er ikke nogen kits tilg\u00e6ngelige endnu noMail=Du har ikke noget flaskepost. noMotd=\u00a7cDer er ingen Message of the day. -none=ingen noNewMail=\u00a77Du har ingen ny flaskepost. noPendingRequest=Du har ikke en ventende anmodning. noPerm=\u00a7cDu har ikke \u00a7f{0}\u00a7c permission. @@ -229,21 +229,30 @@ noPermToSpawnMob=\u00a7cDu har ikke tilladelse til at spawne denne mob. noPlacePermission=\u00a7cDu har ikke tiladelse til at placere en block n\u00c3\u00a6r det skilt. noPowerTools= Du har ingen power tools tilf\u00c3\u00b8jet. noRules=\u00a7cDer er ingen regler endnu. ANARKI! +noWarpsDefined=Ingen warps er defineret +none=ingen notAllowedToQuestion=\u00a7cDu har ikke tilladelse til at bruge sp\u00f8rgsm\u00e5l. notAllowedToShout=\u00a7cDu har ikke tilladelse til at r\u00e5be. notEnoughExperience=You do not have enough experience. notEnoughMoney=Du har ikke tilstr\u00e6kkeligt med penge. -nothingInHand = \u00a7cDu har intet i din h\u00c3\u00a5nd. notRecommendedBukkit=* ! * Bukkit version er ikke den anbefalede build til Essentials. notSupportedYet=Ikke underst\u00f8ttet endnu. +nothingInHand = \u00a7cDu har intet i din h\u00c3\u00a5nd. now=nu -noWarpsDefined=Ingen warps er defineret nuke=May death rain upon them numberRequired=Et nummer skal v\u00e6re, din tardo. onlyDayNight=/time underst\u00f8tter kun day/night. onlyPlayers=Kun in-game spillere kan bruge {0}. onlySunStorm=/weather underst\u00c3\u00b8tter kun sun/storm. orderBalances=Tjekker saldoer af {0} spillere, vent venligst... +pTimeCurrent=\u00a7e{0}''s\u00a7f Tiden er {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f Tiden er fastsat til {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f Tiden er normal og matcher serveren. +pTimeOthersPermission=\u00a7cDu har ikke tilladelse til at \u00c3\u00a6ndre andre spilleres tid. +pTimePlayers=Disse spillere har deres egen tid: +pTimeReset=Spiler-tid er blevet nulstillet for: \u00a7e{0} (oversat korrekt?) +pTimeSet=Spiller-tid er blevet sat til \u00a73{0}\u00a7f for: \u00a7e{1} (oversat korrekt?) +pTimeSetFixed=Spiller-tid er fastsat til \u00a73{0}\u00a7f for: \u00a7e{1} parseError=Fejl ved parsing af {0} p\u00e5 linje {1} pendingTeleportCancelled=\u00a7cAnmodning om teleport er blevet afvist. permissionsError=Mangler Permissions/GroupManager; chat pr\u00e6fikser/suffikser vil v\u00e6re deaktiveret. @@ -271,14 +280,6 @@ powerToolRemoveAll=Alle kommandoer fjernet fra {0}. powerToolsDisabled= Alle dine power tools er blevet deaktiveret. powerToolsEnabled= Alle dine power tools er blevet aktiveret. protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0} -pTimeCurrent=\u00a7e{0}''s\u00a7f Tiden er {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f Tiden er fastsat til {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f Tiden er normal og matcher serveren. -pTimeOthersPermission=\u00a7cDu har ikke tilladelse til at \u00c3\u00a6ndre andre spilleres tid. -pTimePlayers=Disse spillere har deres egen tid: -pTimeReset=Spiler-tid er blevet nulstillet for: \u00a7e{0} (oversat korrekt?) -pTimeSet=Spiller-tid er blevet sat til \u00a73{0}\u00a7f for: \u00a7e{1} (oversat korrekt?) -pTimeSetFixed=Spiller-tid er fastsat til \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Sp\u00f8rgsm\u00e5l]\u00a7f {0} readNextPage=Skriv /{0} {1} for at l\u00c3\u00a6se n\u00c3\u00a6ste side. reloadAllPlugins=\u00a77Reload alle plugins. @@ -312,8 +313,8 @@ signProtectInvalidLocation=\u00a74Du har ikke tilladelse til at lave et skilt he similarWarpExist=En warp med dette navn eksisterer allerede. slimeMalformedSize=Forkert st\u00f8rrelse. (Korrekt oversat?) soloMob=Denne mob kan godt lide at v\u00e6re alene. Den hygger sig. -spawned=spawnet spawnSet=\u00a77Spawnplacering fastsat for gruppe: {0}. +spawned=spawnet suicideMessage=\u00a77Farvel grusomme verden... suicideSuccess= \u00a77{0} tog sit eget liv survival=survival @@ -321,20 +322,20 @@ takenFromAccount=\u00a7c{0} er blevet taget fra din 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... -teleportationCommencing=\u00a77Teleport begynder... -teleportationDisabled=\u00a77Teleport deaktiveret. -teleportationEnabled=\u00a77Teleport aktiveret. teleportAtoB=\u00a77{0}\u00a77 teleporterede dig til {1}\u00a77. teleportDisabled={0} har ikke teleportation aktiveret. teleportHereRequest=\u00a7c{0}\u00a7c har anmodet om, at du teleporterer dig til ham/hende. -teleporting=\u00a77Teleporterer... -teleportingPortal=\u00a77Teleporterede via portal. teleportNewPlayerError=Fejlede ved teleportering af ny spiller teleportRequest=\u00a7c{0}\u00a7c har anmodet om at teleportere til dig. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teleporterer til toppen. -tempbanExempt=\u00a77Du m\u00c3\u00a5 ikke tempbanne denne spiller! Slemme, slemme du! +teleportationCommencing=\u00a77Teleport begynder... +teleportationDisabled=\u00a77Teleport deaktiveret. +teleportationEnabled=\u00a77Teleport aktiveret. +teleporting=\u00a77Teleporterer... +teleportingPortal=\u00a77Teleporterede via portal. tempBanned=Midlertidigt bannet fra serveren for {0} +tempbanExempt=\u00a77Du m\u00c3\u00a5 ikke tempbanne denne spiller! Slemme, slemme du! thunder= Du har nu {0} torden i din verden thunderDuration=Du har nu {0} torden i din verden i {1} sekunder. timeBeforeHeal=Tid f\u00c3\u00b8r du kan heale igen: {0} @@ -365,25 +366,25 @@ unlimitedItemPermission=\u00a7cIngen tilladelse til ubegr\u00e6nset ting {0}. unlimitedItems=Ubegr\u00c3\u00a6nsede ting: unmutedPlayer=Spilleren {0} unmuted. upgradingFilesError=Fejl under opgradering af filerne. -userdataMoveBackError=Kunne ikke flytte userdata/{0}.tmp til userdata/{1} -userdataMoveError=Kunne ikke flytte userdata/{0} til userdata/{1}.tmp userDoesNotExist=Brugeren {0} eksisterer ikke. userIsAway={0} er nu AFK. Skub ham i havet eller bur ham inde! userIsNotAway={0} er ikke l\u00e6ngere AFK. userJailed=\u00a77Du er blevet f\u00e6ngslet. userUsedPortal={0} brugte en eksisterende udgangsportal. +userdataMoveBackError=Kunne ikke flytte userdata/{0}.tmp til userdata/{1} +userdataMoveError=Kunne ikke flytte userdata/{0} til userdata/{1}.tmp usingTempFolderForTesting=Bruger temp-mappe til testing: versionMismatch=Versioner matcher ikke! Opdater venligst {0} til den nyeste version. versionMismatchAll=Versioner matcher ikke! Opdater venligst alle Essentials jar-filer til samme version. voiceSilenced=\u00a77Din stemme er blevet gjort stille. warpDeleteError=Ah, shit; kunne sgu ikke fjerne warp-filen. Jeg giver en \u00c3\u00b8l i lufthavnen. -warpingTo=\u00a77Warper til {0}. warpListPermission=\u00a7cDu har ikke tilladelse til at vise listen over warps. warpNotExist=Den warp eksisterer ikke. -warps=Warps: {0} -warpsCount=\u00a77Der er {0} warps. Viser side {1} af {2}. warpSet=\u00a77Warp {0} sat. warpUsePermission=\u00a7cDu har ikke tilladelse til at benytte den warp. +warpingTo=\u00a77Warper til {0}. +warps=Warps: {0} +warpsCount=\u00a77Der er {0} warps. Viser side {1} af {2}. weatherStorm=\u00a77Du har sat vejret til ''storm'' i {0} weatherStormFor=\u00a77Du har sat vejret til ''storm'' i {0} i {1} sekunder weatherSun=\u00a77Du har sat vejret til ''sol'' i {0} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 815972f03..944d5c7ef 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -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! diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index dfc7600dc..c38abd727 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -11,9 +11,9 @@ alertPlaced=placed: alertUsed=used: autoAfkKickReason=You have been kicked for idling more than {0} minutes. backAfterDeath=\u00a77Use the /back command to return to your death point. +backUsageMsg=\u00a77Returning to previous location. backupFinished=Backup finished backupStarted=Backup started -backUsageMsg=\u00a77Returning to previous location. balance=\u00a77Balance: {0} balanceTop=\u00a77Top balances ({0}) banExempt=\u00a7cYou can not ban that player. @@ -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! @@ -64,14 +65,14 @@ depth=\u00a77You are at sea level. depthAboveSea=\u00a77You are {0} block(s) above sea level. depthBelowSea=\u00a77You are {0} block(s) below sea level. destinationNotSet=Destination not set +disableUnlimited=\u00a77Disabled unlimited placing of {0} for {1}. disabled=disabled disabledToSpawnMob=Spawning this mob was disabled in the config file. -disableUnlimited=\u00a77Disabled unlimited placing of {0} for {1}. dontMoveMessage=\u00a77Teleportation will commence in {0}. Don''t move. downloadingGeoIp=Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB) duplicatedUserdata=Duplicated userdata: {0} and {1} -enabled=enabled enableUnlimited=\u00a77Giving unlimited amount of {0} to {1}. +enabled=enabled enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand. enchantmentNotFound = \u00a7cEnchantment not found enchantmentPerm = \u00a7cYou do not have the permission for {0} @@ -99,9 +100,9 @@ gcentities= entities gcfree=Free memory: {0} MB gcmax=Maximum memory: {0} MB gctotal=Allocated memory: {0} MB -geoipJoinFormat=Player {0} comes from {1} geoIpUrlEmpty=GeoIP download url is empty. geoIpUrlInvalid=GeoIP download url is invalid. +geoipJoinFormat=Player {0} comes from {1} godDisabledFor=disabled for {0} godEnabledFor=enabled for {0} godMode=\u00a77God mode {0}. @@ -112,9 +113,9 @@ helpConsole=To view help from the console, type ?. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: holeInFloor=Hole in floor -homes=Homes: {0} homeSet=\u00a77Home set. homeSetToBed=\u00a77Your home is now set to this bed. +homes=Homes: {0} hour=hour hours=hours ignorePlayer=You ignore player {0} from now on. @@ -124,28 +125,28 @@ infoChapterPages=Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f: infoFileDoesNotExist=File info.txt does not exist. Creating one for you. infoPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: infoUnknownChapter=Unknown chapter. +invBigger=The other users inventory is bigger than yours. +invRestored=Your inventory has been restored. +invSee=You see the inventory of {0}. +invSeeHelp=Use /invsee to restore your inventory. invalidCharge=\u00a7cInvalid charge. invalidMob=Invalid mob type. invalidServer=Invalid server! invalidSignLine=Line {0} on sign is invalid. invalidWorld=\u00a7cInvalid world. -invBigger=The other users inventory is bigger than yours. inventoryCleared=\u00a77Inventory Cleared. inventoryClearedOthers=\u00a77Inventory of \u00a7c{0}\u00a77 cleared. -invRestored=Your inventory has been restored. -invSee=You see the inventory of {0}. -invSeeHelp=Use /invsee to restore your inventory. is=is itemCannotBeSold=That item cannot be sold to the server. itemMustBeStacked=Item must be traded in stacks. A quantity of 2s would be two stacks, etc. itemNotEnough1=\u00a7cYou do not have enough of that item to sell. itemNotEnough2=\u00a77If you meant to sell all of your items of that type, use /sell itemname itemNotEnough3=\u00a77/sell itemname -1 will sell all but one item, etc. -itemsCsvNotLoaded=Could not load items.csv. itemSellAir=You really tried to sell Air? Put an item in your hand. itemSold=\u00a77Sold for \u00a7c{0} \u00a77({1} {2} at {3} each) itemSoldConsole={0} sold {1} for \u00a77{2} \u00a77({3} items at {4} each) itemSpawn=\u00a77Giving {0} of {1} +itemsCsvNotLoaded=Could not load items.csv. jailAlreadyIncarcerated=\u00a7cPerson is already in jail: {0} jailMessage=\u00a7cYou do the crime, you do the time. jailNotExist=That jail does not exist. @@ -162,8 +163,8 @@ kitError=\u00a7cThere are no valid kits. kitErrorHelp=\u00a7cPerhaps an item is missing a quantity in the configuration? kitGive=\u00a77Giving kit {0}. kitInvFull=\u00a7cYour inventory was full, placing kit on the floor -kits=\u00a77Kits: {0} kitTimed=\u00a7cYou can''t use that kit again for another {0}. +kits=\u00a77Kits: {0} lightningSmited=\u00a77You have just been smited lightningUse=\u00a77Smiting {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +176,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cTo mark your mail as read, type /mail clear mailCleared=\u00a77Mail Cleared! mailSent=\u00a77Mail sent! +markMailAsRead=\u00a7cTo mark your mail as read, type /mail clear markedAsAway=\u00a77You are now marked as away. markedAsNotAway=\u00a77You are no longer marked as away. -markMailAsRead=\u00a7cTo mark your mail as read, type /mail clear maxHomes=You cannot set more than {0} homes. mayNotJail=\u00a7cYou may not jail that person me=me @@ -185,10 +186,10 @@ minute=minute minutes=minutes missingItems=You do not have {0}x {1}. missingPrefixSuffix=Missing a prefix or suffix for {0} -mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Error while changing mob spawner. mobSpawnLimit=Mob quantity limited to server limit mobSpawnTarget=Target block must be a mob spawner. +mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} has been received from {1} moneySentTo=\u00a7a{0} has been sent to {1} moneyTaken={0} taken from your bank account. @@ -196,10 +197,10 @@ month=month months=months moreThanZero=Quantities must be greater than 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cYou may not mute that player. mutedPlayer=Player {0} muted. mutedPlayerFor=Player {0} muted for {1}. mutedUserSpeaks={0} tried to speak, but is muted. -muteExempt=\u00a7cYou may not mute that player. nearbyPlayers=Players nearby: {0} needTpohere=You need access to /tpohere to teleport other players. negativeBalanceError=User is not allowed to have a negative balance. @@ -221,7 +222,6 @@ noKitPermission=\u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit noKits=\u00a77There are no kits available yet noMail=You do not have any mail noMotd=\u00a7cThere is no message of the day. -none=none noNewMail=\u00a77You have no new mail. noPendingRequest=You do not have a pending request. noPerm=\u00a7cYou do not have the \u00a7f{0}\u00a7c permission. @@ -229,21 +229,30 @@ noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob. noPlacePermission=\u00a7cYou do not have permission to place a block near that sign. noPowerTools=You have no power tools assigned. noRules=\u00a7cThere are no rules specified yet. +noWarpsDefined=No warps defined +none=none notAllowedToQuestion=\u00a7cYou are not authorized to use question. notAllowedToShout=\u00a7cYou are not authorized to shout. notEnoughExperience=You do not have enough experience. notEnoughMoney=You do not have sufficient funds. -nothingInHand = \u00a7cYou have nothing in your hand. notRecommendedBukkit=* ! * Bukkit version is not the recommended build for Essentials. notSupportedYet=Not supported yet. +nothingInHand = \u00a7cYou have nothing in your hand. now=now -noWarpsDefined=No warps defined nuke=May death rain upon them numberRequired=A number goes there, silly. onlyDayNight=/time only supports day/night. onlyPlayers=Only in-game players can use {0}. onlySunStorm=/weather only supports sun/storm. orderBalances=Ordering balances of {0} users, please wait ... +pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. +pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. +pTimePlayers=These players have their own time: +pTimeReset=Player time has been reset for: \u00a7e{0} +pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} +pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} parseError=Error parsing {0} on line {1} pendingTeleportCancelled=\u00a7cPending teleportation request cancelled. permissionsError=Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled. @@ -271,14 +280,6 @@ powerToolRemoveAll=All commands removed from {0}. powerToolsDisabled=All of your power tools have been enabled. powerToolsEnabled=All of your power tools have been enabled. protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0} -pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. -pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. -pTimePlayers=These players have their own time: -pTimeReset=Player time has been reset for: \u00a7e{0} -pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} -pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Question]\u00a7f {0} readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Reloaded all plugins. @@ -312,8 +313,8 @@ signProtectInvalidLocation=\u00a74You are not allowed to create sign here. similarWarpExist=A warp with a similar name already exists. slimeMalformedSize=Malformed size. soloMob=That mob likes to be alone -spawned=spawned spawnSet=\u00a77Spawn location set for group {0}. +spawned=spawned suicideMessage=\u00a77Goodbye Cruel World... suicideSuccess= \u00a77{0} took their own life survival=survival @@ -321,20 +322,20 @@ takenFromAccount=\u00a7c{0} has been taken from your account. takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} teleportAAll=\u00a77Teleporting request sent to all players... teleportAll=\u00a77Teleporting all players... -teleportationCommencing=\u00a77Teleportation commencing... -teleportationDisabled=\u00a77Teleportation disabled. -teleportationEnabled=\u00a77Teleportation enabled. teleportAtoB=\u00a77{0}\u00a77 teleported you to {1}\u00a77. teleportDisabled={0} has teleportation disabled. teleportHereRequest=\u00a7c{0}\u00a7c has requested that you teleport to them. -teleporting=\u00a77Teleporting... -teleportingPortal=\u00a77Teleporting via portal. teleportNewPlayerError=Failed to teleport new player teleportRequest=\u00a7c{0}\u00a7c has requested to teleport to you. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teleporting to top. -tempbanExempt=\u00a77You may not tempban that player +teleportationCommencing=\u00a77Teleportation commencing... +teleportationDisabled=\u00a77Teleportation disabled. +teleportationEnabled=\u00a77Teleportation enabled. +teleporting=\u00a77Teleporting... +teleportingPortal=\u00a77Teleporting via portal. tempBanned=Temporarily banned from server for {0} +tempbanExempt=\u00a77You may not tempban that player thunder= You {0} thunder in your world thunderDuration=You {0} thunder in your world for {1} seconds. timeBeforeHeal=Time before next heal: {0} @@ -365,25 +366,25 @@ unlimitedItemPermission=\u00a7cNo permission for unlimited item {0}. unlimitedItems=Unlimited items: unmutedPlayer=Player {0} unmuted. upgradingFilesError=Error while upgrading the files -userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} -userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp userDoesNotExist=The user {0} does not exist. userIsAway={0} is now AFK userIsNotAway={0} is no longer AFK userJailed=\u00a77You have been jailed userUsedPortal={0} used an existing exit portal. +userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} +userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp usingTempFolderForTesting=Using temp folder for testing: versionMismatch=Version mismatch! Please update {0} to the same version. versionMismatchAll=Version mismatch! Please update all Essentials jars to the same version. voiceSilenced=\u00a77Your voice has been silenced warpDeleteError=Problem deleting the warp file. -warpingTo=\u00a77Warping to {0}. warpListPermission=\u00a7cYou do not have Permission to list that warps. warpNotExist=That warp does not exist. -warps=Warps: {0} -warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. warpSet=\u00a77Warp {0} set. warpUsePermission=\u00a7cYou do not have Permission to use that warp. +warpingTo=\u00a77Warping to {0}. +warps=Warps: {0} +warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. weatherStorm=\u00a77You set the weather to storm in {0} weatherStormFor=\u00a77You set the weather to storm in {0} for {1} seconds weatherSun=\u00a77You set the weather to sun in {0} diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 909ec7434..07a788eb5 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -11,9 +11,9 @@ alertPlaced=situado: alertUsed=usado: autoAfkKickReason=Has sido echado por ausentarte mas de {0} minutos. backAfterDeath=\u00a77Usa el comando /back para volver al punto en el que moriste. +backUsageMsg=\u00a77Volviendo a la localizacion anterior. backupFinished=Copia de seguridad completada backupStarted=Comenzando copia de seguridad -backUsageMsg=\u00a77Volviendo a la localizacion anterior. balance=\u00a77Cantidad: {0} balanceTop=\u00a77Top cantidades ({0}) banExempt=\u00a7cNo puedes banear a ese jugador @@ -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! @@ -64,14 +65,14 @@ depth=\u00a77Estas al nivel del mar. depthAboveSea=\u00a77Estas {0} bloque(s) por encima del mar. depthBelowSea=\u00a77Estas {0} bloque(s) por debajo del mar. destinationNotSet=Destino no establecido. +disableUnlimited=\u00a77Desactivando colocacion ilimitada de {0} para {1}. disabled=desactivado disabledToSpawnMob=Spawning this mob was disabled in the config file. -disableUnlimited=\u00a77Desactivando colocacion ilimitada de {0} para {1}. dontMoveMessage=\u00a77Teletransporte comenzara en {0}. No te muevas. downloadingGeoIp=Descargando base de datos de GeoIP ... puede llevar un tiempo (pais: 0.6 MB, ciudad: 20MB) duplicatedUserdata=Datos de usuario duplicados: {0} y {1} -enabled=activado enableUnlimited=\u00a77Dando cantidad ilimitada de {0} a {1}. +enabled=activado enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand. enchantmentNotFound = \u00a7cEnchantment not found enchantmentPerm = \u00a7cYou do not have the permission for {0} @@ -99,9 +100,9 @@ gcentities= entidades gcfree=Memoria libre: {0} MB gcmax=Memoria maxima: {0} MB gctotal=Memoria localizada: {0} MB -geoipJoinFormat=El jugador {0} viene de {1} geoIpUrlEmpty=Link para descargar GeoIP esta vacio. geoIpUrlInvalid=Link para descargar GeoIP es invalido. +geoipJoinFormat=El jugador {0} viene de {1} godDisabledFor=Desactivado para {0} godEnabledFor=Activado para {0} godMode=\u00a77Modo Dios {0}. @@ -112,9 +113,9 @@ helpConsole=Para obtener ayuda de la consola, escribe ?. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Pagina \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f: holeInFloor=Agujero en el suelo -homes=Hogares: {0} homeSet=\u00a77Hogar establecido. homeSetToBed=\u00a77Tu hogar esta ahora establecido a esta cama. +homes=Hogares: {0} hour=hora hours=horas ignorePlayer=A partir de ahora ignoras al jugador {0}. @@ -124,28 +125,28 @@ infoChapterPages=Seccion {0}, pagina \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f: infoFileDoesNotExist=El archivo info.txt no existe. Creando uno para ti. infoPages=Pagina \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f: infoUnknownChapter=Seccion desconocida. +invBigger=El inventario del otro usuario es mas grande que el tuyo +invRestored=Tu inventario ha sido recuperado. +invSee=Estas viendo el inventario de {0}. +invSeeHelp=Usa /invsee para recuperar tu inventario. invalidCharge=\u00a7cCargo invalido. invalidMob=Mob invalido. invalidServer=Servidor invalido! invalidSignLine=Linea {0} en el signo es invalida. invalidWorld=\u00a7cMundo invalido. -invBigger=El inventario del otro usuario es mas grande que el tuyo inventoryCleared=\u00a77Inventario limpiado. inventoryClearedOthers=\u00a77Inventario de \u00a7c{0}\u00a77 limpiado. -invRestored=Tu inventario ha sido recuperado. -invSee=Estas viendo el inventario de {0}. -invSeeHelp=Usa /invsee para recuperar tu inventario. is=es itemCannotBeSold=Ese objeto no puede ser vendido al servidor. itemMustBeStacked=El objeto tiene que ser intercambiado en pilas. Una cantidad de 2s seria de dos pilas, etc. itemNotEnough1=\u00a7cNo tienes suficientes ejemplares de ese objeto para venderlo. itemNotEnough2=\u00a77Si pensabas en vender todos tus objetos de ese tipo, usa /sell nombredeobjeto itemNotEnough3=\u00a77/sell nombredeobjeto -1 vendera todos excepto un objeto, etc. -itemsCsvNotLoaded=Error al leer items.csv. itemSellAir=Realmente has intentado vender Aire? Pon un objeto en tu mano! itemSold=\u00a77Vendido para \u00a7c {0} \u00a77 ({1} {2} a {3} cada uno) itemSoldConsole={0} Vendido {1} para\u00a77 {2} \u00a77({3} objetos a {4} cada uno) itemSpawn=\u00a77Dando {0} de {1} +itemsCsvNotLoaded=Error al leer items.csv. jailAlreadyIncarcerated=\u00a7cLa persona ya esta en la carcel: {0} jailMessage=\u00a7cPor hacer el mal, tiempo en la carcel estaras. jailNotExist=Esa carcel no existe. @@ -162,8 +163,8 @@ kitError=\u00a7cNo hay ningun kit valido. kitErrorHelp=\u00a7cPerhaps an item is missing a quantity in the configuration? kitGive=\u00a77Dando kit a {0}. kitInvFull=\u00a7cTu inventario esta lleno, su kit se pondra en el suelo -kits=\u00a77Kits: {0} kitTimed=\u00a7c No puedes usar ese kit de nuevo para otro{0}. +kits=\u00a77Kits: {0} lightningSmited=\u00a77Acabas de ser golpeado lightningUse=\u00a77Golpeando a {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +176,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cPara marcar tu email como leido, escribe /mail clear mailCleared=\u00a77Email limpiado! mailSent=\u00a77Email enviado!! +markMailAsRead=\u00a7cPara marcar tu email como leido, escribe /mail clear markedAsAway=\u00a77Has sido puesto como AFK. markedAsNotAway=\u00a77Ya no estas AFK. -markMailAsRead=\u00a7cPara marcar tu email como leido, escribe /mail clear maxHomes=No puedes establecer mas de {0} hogares. mayNotJail=\u00a7cNo puedes encarcelar a esa persona me=yo @@ -185,10 +186,10 @@ minute=minuto minutes=minutos missingItems=No tienes {0}x de {1}. missingPrefixSuffix=Falta un prefijo o un sufijo para {0} -mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Error al cambiar la localizacion para el nacimiento de los mobs. mobSpawnLimit=Cantidad de Mobs limitados al limite del server mobSpawnTarget=El block seleccionado sera el lugar donde van a nacer los mobs. +mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} ha sido recivido de {1} moneySentTo=\u00a7a{0} ha sido enviado a {1} moneyTaken={0} han sido sacados de tu cuenta bancaria. @@ -196,10 +197,10 @@ month=mes months=meses moreThanZero=Las cantidades han de ser mayores que 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cNo puedes silenciar a ese jugador. mutedPlayer=Player {0} silenciado. mutedPlayerFor=Player {0} silenciado durante {1}. mutedUserSpeaks={0} intento hablar, pero esta silenciado. -muteExempt=\u00a7cNo puedes silenciar a ese jugador. nearbyPlayers=Players nearby: {0} needTpohere=Necesitas acceso a /tpohere para teletransportar a otros jugadores. negativeBalanceError=El usuario no tiene permitido tener un saldo negativo. @@ -221,7 +222,6 @@ noKitPermission=\u00a7cNecesitas los \u00a7c{0}\u00a7c permisos para usar ese ki noKits=\u00a77No hay kits disponibles todavia noMail=No tienes ningun email recivido noMotd=\u00a7cNo hay ningun mensaje del dia. -none=ninguno noNewMail=\u00a77No tienes ningun correo nuevo. noPendingRequest=No tienes ninguna peticion pendiente. noPerm=\u00a7cNo tienes el permiso de \u00a7f{0}\u00a7c. @@ -229,21 +229,30 @@ noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob. noPlacePermission=\u00a7cNo tienes permiso para situar ese bloque en ese lugar. noPowerTools=You have no power tools assigned. noRules=\u00a7cNo hay reglas especificadas todavia. +noWarpsDefined=No hay teletransportes definidos aun +none=ninguno notAllowedToQuestion=\u00a7cYou estas autorizado para usar las preguntas. notAllowedToShout=\u00a7cNo estas autorizado para gritar. notEnoughExperience=You do not have enough experience. notEnoughMoney=No tienes el dinero suficiente. -nothingInHand = \u00a7cYou have nothing in your hand. notRecommendedBukkit=* ! * La version de bukkit no es la recomendada para esta version de Essentials. notSupportedYet=No esta soportado aun. +nothingInHand = \u00a7cYou have nothing in your hand. now=ahora -noWarpsDefined=No hay teletransportes definidos aun nuke=May death rain upon them numberRequired=Un numero es necesario, amigo. onlyDayNight=/time solo soporta day/night. (dia/noche) onlyPlayers=Solo los jugadores conectados pueden usar {0}. onlySunStorm=/weather solo soporta sun/storm. (sol/tormenta) orderBalances=Ordering balances of {0} users, please wait ... +pTimeCurrent=\u00a7e{0}''s\u00a7f la hora es {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f la hora ha sido cambiada a {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f el tiempo es normal y coincide con el servidor. +pTimeOthersPermission=\u00a7cNo estas autorizado para especificar'' la hora de otros usuarios. +pTimePlayers=Estos usuarios tienen su propia hora: +pTimeReset=La hora del usuario ha sido reiniciada a las: \u00a7e{0} +pTimeSet=La hora del jugador ha sido cambiada para las: \u00a73{0}\u00a7f for: \u00a7e{1} +pTimeSetFixed=La hora del jugador ha sido arreglada para las: \u00a73{0}\u00a7f for: \u00a7e{1} parseError=error analizando {0} en la linea {1} pendingTeleportCancelled=\u00a7cPeticion de teletransporte pendiente cancelado. permissionsError=Falta el plugin Permissions/GroupManager; Los prefijos/sufijos de chat seran desactivados. @@ -271,14 +280,6 @@ powerToolRemoveAll=Todos los comandos borrados desde {0}. powerToolsDisabled=All of your power tools have been disabled. powerToolsEnabled=All of your power tools have been enabled. protectionOwner=\u00a76[EssentialsProtect] Dueño de la proteccion: {0} -pTimeCurrent=\u00a7e{0}''s\u00a7f la hora es {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f la hora ha sido cambiada a {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f el tiempo es normal y coincide con el servidor. -pTimeOthersPermission=\u00a7cNo estas autorizado para especificar'' la hora de otros usuarios. -pTimePlayers=Estos usuarios tienen su propia hora: -pTimeReset=La hora del usuario ha sido reiniciada a las: \u00a7e{0} -pTimeSet=La hora del jugador ha sido cambiada para las: \u00a73{0}\u00a7f for: \u00a7e{1} -pTimeSetFixed=La hora del jugador ha sido arreglada para las: \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Pregunta]\u00a7f {0} readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Todos los plugins recargados. @@ -312,8 +313,8 @@ signProtectInvalidLocation=\u00a74No puedes poner carteles en ese sitio. similarWarpExist=Ya existe un teletransporte con ese nombre. slimeMalformedSize=Medidas malformadas. soloMob=A este mob le gusta estar solo -spawned=nacido spawnSet=\u00a77El lugar de nacimiento ha sido puesto para el grupo {0}. +spawned=nacido suicideMessage=\u00a77Adios mundo cruel... suicideSuccess= \u00a77{0} se quito su propia vida survival=survival @@ -321,20 +322,20 @@ takenFromAccount=\u00a7c{0} ha sido sacado de tu cuenta. 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... -teleportationCommencing=\u00a77Comenzando teletransporte... -teleportationDisabled=\u00a77Teletransporte desactivado. -teleportationEnabled=\u00a77Teletransporte activado. teleportAtoB=\u00a77{0}\u00a77 te teletransporto a {1}\u00a77. teleportDisabled={0} tiene desactivado los teletransportes. teleportHereRequest=\u00a7c{0}\u00a7c ha pedido que te teletransportes con el. -teleporting=\u00a77Teletransportando... -teleportingPortal=\u00a77Teletransportando via portal. teleportNewPlayerError=Error al teletransportar al nuevo jugador teleportRequest=\u00a7c{0}\u00a7c te ha pedido teletransportarse contigo. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teletransportandote a la cima. -tempbanExempt=\u00a77No puedes banear temporalmente a ese jugador +teleportationCommencing=\u00a77Comenzando teletransporte... +teleportationDisabled=\u00a77Teletransporte desactivado. +teleportationEnabled=\u00a77Teletransporte activado. +teleporting=\u00a77Teletransportando... +teleportingPortal=\u00a77Teletransportando via portal. tempBanned=Baneado temporalmente del servidor por {0} +tempbanExempt=\u00a77No puedes banear temporalmente a ese jugador thunder= Tu has {0} los truenos en tu mundo. thunderDuration=Tu has {0} los truenos en tu mundo durante {1} seconds. timeBeforeHeal=Tiempo antes de la siguiente curacion: {0} @@ -365,25 +366,25 @@ unlimitedItemPermission=\u00a7cNo tienes permiso para objetos ilimitados {0}. unlimitedItems=Objetos ilimitados. unmutedPlayer=Jugador {0} desmuteado. upgradingFilesError=Error mientras se actualizaban los archivos -userdataMoveBackError=Error al mover userdata/{0}.tmp a userdata/{1} -userdataMoveError=Error al mover userdata/{0} a userdata/{1}.tmp userDoesNotExist=El usuario {0} no existe userIsAway={0} esta ahora ausente! userIsNotAway={0} ya no esta ausente! userJailed=\u00a77Has sido encarcelado! userUsedPortal={0} uso un portal de salida existente. +userdataMoveBackError=Error al mover userdata/{0}.tmp a userdata/{1} +userdataMoveError=Error al mover userdata/{0} a userdata/{1}.tmp usingTempFolderForTesting=Usando carpeta temporal para pruebas: versionMismatch=La version no coincide! Por favor actualiza {0} a la misma version. versionMismatchAll=La version no coincide! Por favor actualiza todos los jars de Essentials a la misma version. voiceSilenced=\u00a77Tu voz ha sido silenciada warpDeleteError=Problema al borrar el archivo de teletransporte. -warpingTo=\u00a77Teletransportandote a {0}. warpListPermission=\u00a7cNo tienes permiso para listar esos teletransportes. warpNotExist=Ese teletransporte no existe. -warps=Warps: {0} -warpsCount=\u00a77Hay {0} teletransportes. Mostrando pagina {1} de {2}. warpSet=\u00a77Teletransporte {0} establecido. warpUsePermission=\u00a7cNo tienes permisos para usar ese teletransporte. +warpingTo=\u00a77Teletransportandote a {0}. +warps=Warps: {0} +warpsCount=\u00a77Hay {0} teletransportes. Mostrando pagina {1} de {2}. weatherStorm=\u00a77Has establecido el tiempo a tormenta en este mundo. weatherStormFor=\u00a77Has establecido el tiempo a tormenta en este {1} durante {0} segundos. weatherSun=\u00a77Has establecido el tiempo a sol en este mundo. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index a74be475b..8afe6cb0c 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -11,9 +11,9 @@ alertPlaced=a plac\u00e9 : alertUsed=a utilis\u00e9 : autoAfkKickReason=Vous avez \u00e9t\u00e9 \u00e9ject\u00e9 pour inactivit\u00e9e sup\u00e9rieure \u00e0 {0} minutes. backAfterDeath=\u00a77Utilisez la commande /back pour retourner \u00e0 l''endroit ou vous \u00eates mort. +backUsageMsg=\u00a77Retour \u00e0 votre emplacement pr\u00e9c\u00c3\u00a8dent. backupFinished=Sauvegarde termin\u00e9 backupStarted=D\u00e9but de la sauvegarde... -backUsageMsg=\u00a77Retour \u00e0 votre emplacement pr\u00e9c\u00c3\u00a8dent. balance=\u00a77Solde : {0} balanceTop=\u00a77Meilleurs soldes au ({0}) banExempt=\u00a77Vous ne pouvez pas bannir ce joueur. @@ -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 ! @@ -64,14 +65,14 @@ depth=\u00a77Vous \u00eates au niveau de la mer. depthAboveSea=\u00a77Vous \u00eates \u00e0 {0} bloc(s) au-dessus du niveau de la mer. depthBelowSea=\u00a77Vous \u00eates \u00e0 {0} bloc(s) en-dessous du niveau de la mer. destinationNotSet=Destination non d\u00e9finie +disableUnlimited=\u00a77D\u00e9sactivation du placement illimit\u00e9 de {0} pour {1}. disabled=d\u00e9sactiv\u00e9 disabledToSpawnMob=Spawning this mob was disabled in the config file. -disableUnlimited=\u00a77D\u00e9sactivation du placement illimit\u00e9 de {0} pour {1}. dontMoveMessage=\u00a77La t\u00e9l\u00e9portation commence dans {0}. Ne bougez pas. downloadingGeoIp=T\u00e9l\u00e9chargement de la base de donn\u00e9es GeoIP ... Cela peut prendre un moment (Pays : 0.6 Mo, villes : 20Mo) duplicatedUserdata=Donn\u00e9e utilisateur dupliqu\u00e9e : {0} et {1} -enabled=activ\u00e9 enableUnlimited=\u00a77Quantit\u00e9 illimit\u00e9e de {0} \u00e0 {1}. +enabled=activ\u00e9 enchantmentApplied = \u00a77L''enchantement {0} a \u00e9t\u00e9 appliqu\u00e9 \u00e0 l''objet dans votre main. enchantmentNotFound = \u00a7cEnchantement non-trouv\u00e9 enchantmentPerm = \u00a7cVous n''avez pas les droits pour {0}. @@ -99,9 +100,9 @@ gcentities=entit\u00e9s gcfree=M\u00e9moire libre : {0} Mo gcmax=M\u00e9moire maximale : {0} Mo gctotal=M\u00e9moire utilis\u00e9e : {0} Mo -geoipJoinFormat=Joueur {0} vient de {1} geoIpUrlEmpty=L''URL de t\u00e9l\u00e9chargement de GeoIP est vide. geoIpUrlInvalid=L''URL de t\u00e9l\u00e9chargement de GeoIP est invalide. +geoipJoinFormat=Joueur {0} vient de {1} godDisabledFor=d\u00e9sactiv\u00e9 pour {0} godEnabledFor=activ\u00e9 pour {0} godMode=\u00a77Mode Dieu {0}. @@ -112,9 +113,9 @@ helpConsole=Pour voir l''aide tapez ? helpOp=\u00a7c[Aide Admin]\u00a7f \u00a77{0} : \u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f sur \u00a7c{1}\u00a7f. holeInFloor=Trou dans le Sol. -homes=R\u00e9sidences : {0} homeSet=\u00a77R\u00e9sidence d\u00e9finie. homeSetToBed=\u00a77Votre r\u00e9sidence est d\u00e9sormais li\u00e9e \u00e0 ce lit. +homes=R\u00e9sidences : {0} hour=heure hours=heures ignorePlayer=Vous ignorez d\u00e9sormais {0}. @@ -124,28 +125,28 @@ infoChapterPages=Chapitre {0}, page \u00a7c{1}\u00a7f sur \u00a7c{2}\u00a7f: infoFileDoesNotExist=Le fichier info.txt n'existe pas. Le fichier est en cours de cr\u00e9ation pour vous. infoPages=Page \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f. infoUnknownChapter=Chapitre inconnu. +invBigger=Les inventaires des autres joueurs sont plus gros que le v\u00f4tre. +invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu. +invSee=Vous voyez l''inventaire de {0}. +invSeeHelp=Utilisez /invsee pour revenir \u00e0 votre inventaire. invalidCharge=\u00a7cCharge invalide. invalidMob=Mauvias type de cr\u00e9ature. invalidServer=Serveur non valide. invalidSignLine=La ligne {0} du panneau est invalide. invalidWorld=\u00a7cMonde invalide. -invBigger=Les inventaires des autres joueurs sont plus gros que le v\u00f4tre. inventoryCleared=\u00a77Inventaire nettoy\u00e9. inventoryClearedOthers=\u00a77L''inventaire de \u00a7c{0}\u00a77 a \u00e9t\u00e9 nettoy\u00e9. -invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu. -invSee=Vous voyez l''inventaire de {0}. -invSeeHelp=Utilisez /invsee pour revenir \u00e0 votre inventaire. is=est itemCannotBeSold=Cet objet ne peut \u00eatre vendu au serveur. itemMustBeStacked=Cet objet doit \u00eatre vendu par 64. Une quantit\u00e9 de 2 serait deux fois 64. itemNotEnough1=\u00a7cVous n'avez pas assez de cet objet pour le vendre. itemNotEnough2=\u00a77Si vous voulez vendre l'int\u00e9gralit\u00e9 de vos objets de ce type l\u00e0, utilisez /sell nomObjet itemNotEnough3=\u00a77/sell nomObjet -1 vendra tout sauf un objet, etc. -itemsCsvNotLoaded=N'a pas pu charger items.csv. itemSellAir=Vouliez-vous vraiment vendre de l'air ? Mettez un objet dans votre main. itemSold=\u00a77Vendu pour \u00a7c{0} \u00a77({1} {2} \u00e0 {3} chacun) itemSoldConsole={0} vendu {1} pour \u00a77{2} \u00a77({3} objet(s) \u00e0 {4} chacun) itemSpawn=\u00a77Donne {0} de {1} +itemsCsvNotLoaded=N'a pas pu charger items.csv. jailAlreadyIncarcerated=\u00a7cJoueur d\u00e9j\u00e0 emprisonn\u00e9 : {0} jailMessage=\u00a7cVous avez commis un crime, vous en payez le prix. jailNotExist=Cette prison n'existe pas. @@ -162,8 +163,8 @@ kitError=\u00a7cIl n'y a pas de kits valides. kitErrorHelp=\u00a7cPeut-\u00eatre qu'un objet manque d'une quantit\u00e9 dans la configuration ? kitGive=\u00a77Donner le kit {0}. kitInvFull=\u00a7cVotre inventaire \u00e9tait plein, le kit est parre-terre. -kits=\u00a77Kits :{0} kitTimed=\u00a7cVous ne pouvez pas utiliser ce kit pendant encore {0}. +kits=\u00a77Kits :{0} lightningSmited=\u00a77Vous venez d'\u00eatre foudroy\u00e9. lightningUse=\u00a77{0} a \u00e9t\u00e9 foudroy\u00e9. listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +176,9 @@ localFormat=Locale : <{0}> {1} mailClear=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear mailCleared=\u00a77Courrier supprim\u00e9 ! mailSent=\u00a77Courrier envoy\u00e9 ! +markMailAsRead=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear markedAsAway=\u00a77Vous \u00eates d\u00e9sormais AFK. markedAsNotAway=\u00a77Vous n'\u00eates d\u00e9sormais plus AFK. -markMailAsRead=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear maxHomes=Vous ne pouvez pas cr\u00e9er plus de {0} r\u00e9sidences. mayNotJail=\u00a7cVous ne pouvez pas emprisonner cette personne. me=moi @@ -185,10 +186,10 @@ minute=minute minutes=minutes missingItems=Vous n''avez pas {0} x {1}. missingPrefixSuffix=Pr\u00e9fixe ou Suffixe manquant pour {0} -mobsAvailable=\u00a77cr\u00e9atures : {0} mobSpawnError=Erreur lors du changement du g\u00e9n\u00e9rateur de cr\u00e9atures. mobSpawnLimit=Quantit\u00e9 de cr\u00e9atures limit\u00e9 \u00e0 au maximum du serveur. mobSpawnTarget=Le bloc cible doit \u00eatre un g\u00e9n\u00e9rateur de cr\u00e9atures. +mobsAvailable=\u00a77cr\u00e9atures : {0} moneyRecievedFrom=\u00a7a{0} a \u00e9t\u00e9 re\u00e7u de {1} moneySentTo=\u00a7a{0} a \u00e9t\u00e9 envoy\u00e9 \u00e0 {1} moneyTaken={0} pr\u00e9lev\u00e9(s) de votre compte. @@ -196,10 +197,10 @@ month=mois months=mois moreThanZero=Les quantit\u00e9s doivent \u00eatre sup\u00e9rieures \u00e0 z\u00e9ro. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cVous ne pouvez pas r\u00e9duire ce joueur au silence. mutedPlayer=Le joueur {0} est d\u00e9sormais muet. mutedPlayerFor={0} a \u00e9t\u00e9 muet pour {1}. mutedUserSpeaks={0} a essay\u00e9 de parler mais est muet. -muteExempt=\u00a7cVous ne pouvez pas r\u00e9duire ce joueur au silence. nearbyPlayers=Joueurs dans les environs : {0} needTpohere=Vous avez besoin de l'acc\u00c3\u00a8s \u00e0 /tpohere pour t\u00e9l\u00e9porter d'autres joueurs. negativeBalanceError=L'utilisateur n'est pas autoris\u00e9 \u00e0 avoir un solde n\u00e9gatif. @@ -221,7 +222,6 @@ noKitPermission=\u00a7cVous avez besoin de la permission \u00a7c{0}\u00a7c pour noKits=\u00a77Il n'y a pas encore de kits disponibles. noMail=Vous n'avez pas de courrier noMotd=\u00a7cIl n'y a pas de message su jour. -none=aucun noNewMail=\u00a77Vous n'avez pas de courrier. noPendingRequest=Vous n'avez pas de requ\u00eate non lue. noPerm=\u00a7cVous n''avez pas la permission \u00a7f{0}\u00a7c. @@ -229,21 +229,30 @@ noPermToSpawnMob=\u00a7cVous n'avez pas la permission d'invoquer cette cr\u00e9a noPlacePermission=\u00a7cVous n'avez pas la permission de placer un bloc pr\u00c3\u00a8 de cette pancarte. noPowerTools=Vous n'avez pas d'outil macro associ\u00e9. noRules=\u00a7cIl n'y a pas encore de r\u00e8gles d\u00e9finies. +noWarpsDefined=Aucun point de t\u00e9l\u00e9portation d\u00e9fini. +none=aucun notAllowedToQuestion=\u00a7cVous n'\u00eates pas autoris\u00e9 \u00e0 poser des questions. notAllowedToShout=\u00a7cVous n'\u00eates pas autoris\u00e9 \u00e0 crier. notEnoughExperience=Vous n'avez pas assez d'exp\u00e9rience. notEnoughMoney=Vous n'avez pas les fonds n\u00e9cessaires. -nothingInHand = \u00a7cVous n'avez rien en main. notRecommendedBukkit=* ! * La version de Bukkit n'est pas celle qui est recommand\u00e9 pour cette version de Essentials. notSupportedYet=Pas encore pris en charge. +nothingInHand = \u00a7cVous n'avez rien en main. now=maintenant -noWarpsDefined=Aucun point de t\u00e9l\u00e9portation d\u00e9fini. nuke=Que la mort s'abatte sur eux ! numberRequired=Il faut fournir un nombre ici. onlyDayNight=/time ne supporte que (jour) day/night (nuit). onlyPlayers=Seulement les joueurs en jeu peuvent utiliser {0}. onlySunStorm=/weather ne supporte que (soleil) sun/storm (temp\u00eate). orderBalances=Classement des balance de {0} utilisateurs, patientez ... +pTimeCurrent=Pour \u00a7e{0}\u00a7f l''heure est {1}. +pTimeCurrentFixed=L''heure de \u00a7e{0}\u00a7f est fix\u00e9e \u00e0 {1}. +pTimeNormal=\u00a7fPour \u00a7e{0}\u00a7f l'heure est normale et correspond au server. +pTimeOthersPermission=\u00a7cVous n'etes pas autoris\u00e9 \u00e0 changer l'heure des autres joueurs. +pTimePlayers=Ces joueurs ont leur propre horraire : +pTimeReset=l''heure a \u00e9t\u00e9 r\u00e9initialis\u00e9e \u00e0 : \u00a7e{0} +pTimeSet=l''heure du joueur a \u00e9t\u00e9 r\u00e9egl\u00e9ee \u00e0 \u00a73{0}\u00a7f pour : \u00a7e{1} +pTimeSetFixed=l''heure du joueur a \u00e9t\u00e9 fix\u00e9e \u00e0 : \u00a7e{1} parseError=Erreur de conversion {0} \u00e0 la ligne {1} pendingTeleportCancelled=\u00a7cRequete de t\u00e9l\u00e9portation annul\u00e9e. permissionsError=Permissions/GroupManager manquant, les pr\u00e9fixes et suffixes ne seront pas affich\u00e9s. @@ -271,14 +280,6 @@ powerToolRemoveAll=Toutes les commandes retir\u00e9es de {0}. powerToolsDisabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 retir\u00e9es. powerToolsEnabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 activ\u00e9es. protectionOwner=\u00a76[EssentialsProtect] Propri\u00e9taire de la protection : {0} -pTimeCurrent=Pour \u00a7e{0}\u00a7f l''heure est {1}. -pTimeCurrentFixed=L''heure de \u00a7e{0}\u00a7f est fix\u00e9e \u00e0 {1}. -pTimeNormal=\u00a7fPour \u00a7e{0}\u00a7f l'heure est normale et correspond au server. -pTimeOthersPermission=\u00a7cVous n'etes pas autoris\u00e9 \u00e0 changer l'heure des autres joueurs. -pTimePlayers=Ces joueurs ont leur propre horraire : -pTimeReset=l''heure a \u00e9t\u00e9 r\u00e9initialis\u00e9e \u00e0 : \u00a7e{0} -pTimeSet=l''heure du joueur a \u00e9t\u00e9 r\u00e9egl\u00e9ee \u00e0 \u00a73{0}\u00a7f pour : \u00a7e{1} -pTimeSetFixed=l''heure du joueur a \u00e9t\u00e9 fix\u00e9e \u00e0 : \u00a7e{1} questionFormat=\u00a77[Question]\u00a7f {0} readNextPage=Utilisez /{0} {1} pour lire la page suivante. reloadAllPlugins=\u00a77Toutes les extensions ont \u00e9t\u00e9 recharg\u00e9es. @@ -312,8 +313,8 @@ signProtectInvalidLocation=\u00a74Vous n'avez pas l'autorisation de cr\u00e9er u similarWarpExist=Un point de t\u00e9l\u00e9portation avec un nom similaire existe d\u00e9j\u00e0. slimeMalformedSize=Taille mal form\u00e9e. soloMob=Ce cr\u00e9ature aime \u00eatre seul. -spawned=invoqu\u00e9(s) spawnSet=\u00a77Le point de d\u00e9part a \u00e9t\u00e9 d\u00e9fini pour le groupe {0}. +spawned=invoqu\u00e9(s) suicideMessage=\u00a77Au revoir monde cruel... suicideSuccess=\u00a77{0} s''est suicid\u00e9. survival=survie @@ -321,20 +322,20 @@ takenFromAccount=\u00a7c{0} ont \u00e9t\u00e9 retir\u00e9 de votre compte. 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. -teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation... -teleportationDisabled=\u00a77T\u00e9l\u00e9poration d\u00e9sactiv\u00e9. -teleportationEnabled=\u00a77T\u00e9l\u00e9portation activ\u00e9e. teleportAtoB=\u00a77{0}\u00a77 vous a t\u00e9l\u00e9port\u00e9 \u00e0 {1}\u00a77. teleportDisabled={0} a la t\u00e9l\u00e9portation d\u00e9sactiv\u00e9. teleportHereRequest=\u00a7c{0}\u00a7c Vous a demand\u00e9 de vous t\u00e9l\u00e9porter \u00e0 lui/elle. -teleporting=\u00a77T\u00e9l\u00e9poration en cours... -teleportingPortal=\u00a77T\u00e9l\u00e9portation via portail. teleportNewPlayerError=\u00c9chec de la t\u00e9l\u00e9portation du nouveau joueur. teleportRequest=\u00a7c{0}\u00a7c vous demande s''il peut se t\u00e9l\u00e9porter vers vous. teleportRequestTimeoutInfo=\u00a77Cette demande de t\u00e9l\u00e9portation expirera dans {0} secondes. teleportTop=\u00a77T\u00e9l\u00e9portation vers le haut. -tempbanExempt=\u00a77Vous ne pouvez pas bannir temporairement ce joueur. +teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation... +teleportationDisabled=\u00a77T\u00e9l\u00e9poration d\u00e9sactiv\u00e9. +teleportationEnabled=\u00a77T\u00e9l\u00e9portation activ\u00e9e. +teleporting=\u00a77T\u00e9l\u00e9poration en cours... +teleportingPortal=\u00a77T\u00e9l\u00e9portation via portail. tempBanned=Banni temporairement du serveur pour {0} +tempbanExempt=\u00a77Vous ne pouvez pas bannir temporairement ce joueur. thunder=Vous avez {0} la foudre dans votre monde. thunderDuration=Vous avez {0} la foudre dans le serveur pendant {1} secondes. timeBeforeHeal=Temps avant le prochain soin : {0} @@ -365,25 +366,25 @@ unlimitedItemPermission=\u00a7cPas de permission pour l''objet illimit\u00e9 {0} unlimitedItems=Objets illimit\u00e9s: unmutedPlayer=Le joueur {0} n''est plus muet. upgradingFilesError=Erreur durant la mise \u00e0 jour des fichiers. -userdataMoveBackError=Echec du d\u00e9placement de userdata/{0}.tmp vers userdata/{1} -userdataMoveError=Echec du d\u00e9placement de userdata/{0} vers userdata/{1}.tmp userDoesNotExist=L''utilisateur {0} n''existe pas. userIsAway={0} s'est mis en AFK userIsNotAway={0} n'est plus AFK userJailed=\u00a77Vous avez \u00e9t\u00e9 emprisonn\u00e9. userUsedPortal={0} a utilis\u00e9 un portail existant. +userdataMoveBackError=Echec du d\u00e9placement de userdata/{0}.tmp vers userdata/{1} +userdataMoveError=Echec du d\u00e9placement de userdata/{0} vers userdata/{1}.tmp usingTempFolderForTesting=Utilise un fichier temporaire pour un test. versionMismatch=Versions diff\u00e9rentes ! Mettez s''il vous plait {0} \u00e0 la m\u00eame version. versionMismatchAll=Mauvaise version ! S'il vous plait mettez des jars Essentials de version identique. voiceSilenced=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duit au silence. warpDeleteError=Probl\u00c3\u00a8me concernant la suppression du fichier warp. -warpingTo=\u00a77T\u00e9l\u00e9portation vers {0}. warpListPermission=\u00a7cVous n'avez pas la permission d'afficher la liste des points de t\u00e9l\u00e9portation. warpNotExist=Ce point de t\u00e9l\u00e9portation n'existe pas. -warps=point de t\u00e9l\u00e9portations : {0} -warpsCount=\u00a77Il y a {0} points de t\u00e9l\u00e9portations. Page {1} sur {2}. warpSet=\u00a77Le point de t\u00e9l\u00e9portation {0} a \u00e9t\u00e9 cr\u00e9\u00e9. warpUsePermission=\u00a7cVous n'avez pas la permission d'utiliser ce point de t\u00e9l\u00e9portation. +warpingTo=\u00a77T\u00e9l\u00e9portation vers {0}. +warps=point de t\u00e9l\u00e9portations : {0} +warpsCount=\u00a77Il y a {0} points de t\u00e9l\u00e9portations. Page {1} sur {2}. weatherStorm=\u00a77Vous avez programm\u00e9 l''orage dans {0} weatherStormFor=\u00a77Vous avez programm\u00e9 l''orage dans {0} pour {1} secondes. weatherSun=\u00a77Vous avez programm\u00e9 le beau temps dans {0} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 51bbe2bed..da88603d6 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -11,9 +11,9 @@ alertPlaced=geplaatst: alertUsed=gebruikt: autoAfkKickReason=You have been kicked for idling more than {0} minutes. backAfterDeath=\u00a77Gebruik het /back command om terug te keren naar je sterfplaats. +backUsageMsg=\u00a77Naar de vorige locatie aan het gaan. backupFinished=Backup voltooid backupStarted=Backup gestart -backUsageMsg=\u00a77Naar de vorige locatie aan het gaan. balance=\u00a77Saldo: {0} balanceTop=\u00a77 Top saldi ({0}) banExempt=\u00a77Je kunt deze speler niet verbannen. @@ -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! @@ -64,14 +65,14 @@ depth=\u00a77Je zit op zeeniveau. depthAboveSea=\u00a77Je zit {0} blok(ken) boven zeeniveau. depthBelowSea=\u00a77Je zit {0} blok(ken) onder zeeniveau. destinationNotSet=Bestemming niet ingesteld +disableUnlimited=\u00a77Oneindig plaatsen van {0} uitgeschakeld voor {1}. disabled=uitgeschakeld disabledToSpawnMob=Spawning this mob was disabled in the config file. -disableUnlimited=\u00a77Oneindig plaatsen van {0} uitgeschakeld voor {1}. dontMoveMessage=\u00a77Beginnen met teleporteren in {0}. Niet bewegen. downloadingGeoIp=Bezig met downloaden van GeoIP database ... Dit kan een tijdje duren (country: 0.6 MB, city: 20MB) duplicatedUserdata=Dubbele userdata: {0} en {1}. -enabled=ingeschakeld enableUnlimited=\u00a77Oneindig aantal {0} aan {1} gegeven. +enabled=ingeschakeld enchantmentApplied = \u00a77The enchantment {0} has been applied to your item in hand. enchantmentNotFound = \u00a7cEnchantment not found enchantmentPerm = \u00a7cYou do not have the permission for {0} @@ -99,9 +100,9 @@ gcentities= entities gcfree=Vrij geheugen: {0} MB gcmax=Maximaal geheugen: {0} MB gctotal=Gealloceerd geheugen: {0} MB -geoipJoinFormat=Speler {0} komt uit {1} geoIpUrlEmpty=GeoIP download url is leeg. geoIpUrlInvalid=GeoIP download url is ongeldig. +geoipJoinFormat=Speler {0} komt uit {1} godDisabledFor=uitgeschakeld voor {0} godEnabledFor=ingeschakeld voor {0} godMode=\u00a77God mode {0}. @@ -112,9 +113,9 @@ helpConsole=type ? om de consolehelp weer te geven. helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f: holeInFloor=Gat in de vloer -homes=Homes: {0} homeSet=\u00a77Home ingesteld. homeSetToBed=\u00a77Je home is is nu verplaatst naar dit bed. +homes=Homes: {0} hour=uur hours=uren ignorePlayer=Je negeert {0} vanaf nu. @@ -124,28 +125,28 @@ infoChapterPages=Hoofdstuk {0}, Pagina \u00a7c{1}\u00a7f van de \u00a7c{2}\u00a7 infoFileDoesNotExist=Bestand info.txt bestaat niet. Bezig met aanmaken. infoPages=Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f: infoUnknownChapter=Onbekend hoofdstuk. +invBigger=De inventory van de andere speler is groter dan die van jou. +invRestored=Je inventory is hersteld. +invSee=Je kijkt naar de inventory van {0}. +invSeeHelp=Type /invsee om je inventory te herstellen. invalidCharge=\u00a7cOngeldig te laden. invalidMob=Ongeldig mob type. invalidServer=Ongeldige server! invalidSignLine=Regel {0} op het bordje is ongeldig. invalidWorld=\u00a7cOngeldige wereld. -invBigger=De inventory van de andere speler is groter dan die van jou. inventoryCleared=\u00a77inventory leeggemaakt. inventoryClearedOthers=\u00a77inventory van \u00a7c{0}\u00a77 leeggemaakt. -invRestored=Je inventory is hersteld. -invSee=Je kijkt naar de inventory van {0}. -invSeeHelp=Type /invsee om je inventory te herstellen. is=is itemCannotBeSold=Dat voorwerp kan niet aan de server worden verkocht. itemMustBeStacked=Voorwerp moet geruild worden als stapel. Een hoeveelheid van 2 moet dus geruild worden als twee stapels, etc. itemNotEnough1=\u00a7cJe hebt niet genoeg van dat voorwerp om te verkopen. itemNotEnough2=\u00a77Type /sell itemname Als je alles daarvan wilt verkopen itemNotEnough3=\u00a77/sell itemname -1 zorgt ervoor dat ze allemaal behalve 1 worden verkocht, etc. -itemsCsvNotLoaded=De item kunnen niet geladen worden.csv. itemSellAir=Je wilde serieus lucht verkopen? Plaats een voorwerp in je hand. itemSold=\u00a77Verkocht voor \u00a7c{0} \u00a77({1} {2} voorwerpen voor {3} per stuk) itemSoldConsole={0} verkocht {1} voor \u00a77{2} \u00a77({3} voorwerpen voor {4} per stuk) itemSpawn=\u00a77Geeft {0} {1} +itemsCsvNotLoaded=De item kunnen niet geladen worden.csv. jailAlreadyIncarcerated=\u00a7cPerson is already in jail: {0} jailMessage=\u00a7cYou do the crime, you do the time. jailNotExist=Die gevangenis bestaat niet. @@ -162,8 +163,8 @@ kitError=\u00a7cEr zijn geen geldige kits. kitErrorHelp=\u00a7cMisschien mist er een hoeveelheid van het item in de configuratie? kitGive=\u00a77Kit {0} wordt gegeven. kitInvFull=\u00a7cJe inventory was vol, de kit wordt op de grond geplaatst -kits=\u00a77Kits: {0} kitTimed=\u00a7cJe kan die kit pas weer gebruiken over {0}. +kits=\u00a77Kits: {0} lightningSmited=\u00a77Je bent zojuist verbrand lightningUse=\u00a77Brand {0} listAfkTag = \u00a77[AFK]\u00a7f @@ -175,9 +176,9 @@ localFormat=Local: <{0}> {1} mailClear=\u00a7cType /mail clear, om ej berichten als gelezen te markeren. mailCleared=\u00a77Bericht geklaard! mailSent=\u00a77Bericht verzonden! +markMailAsRead=\u00a7cType /mail clear, om je berichten als gelezen te markeren markedAsAway=\u00a77Je staat nu als afwezig gemeld. markedAsNotAway=\u00a77Je staat niet meer als afwezig gemeld. -markMailAsRead=\u00a7cType /mail clear, om je berichten als gelezen te markeren maxHomes=You cannot set more than {0} homes. mayNotJail=\u00a7cJe mag die speler niet in de gevangenis zetten. me=me @@ -185,10 +186,10 @@ minute=minuut minutes=minuten missingItems=Je hebt geen {0}x {1}. missingPrefixSuffix=Er mist een prefix of suffix voor {0} -mobsAvailable=\u00a77Mobs: {0} mobSpawnError=Fout bij het veranderen van de mob spawner. mobSpawnLimit=Grootte van de mob hang af van het server limiet mobSpawnTarget=Target blok moet een mob spawner zijn. +mobsAvailable=\u00a77Mobs: {0} moneyRecievedFrom=\u00a7a{0} is ontvangen van {1} moneySentTo=\u00a7a{0} is verzonden naar {1} moneyTaken={0} van je bankrekening afgehaald. @@ -196,10 +197,10 @@ month=maand months=maanden moreThanZero=Het aantal moet groter zijn dan 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cJe kan deze speler niet muten. mutedPlayer=Speler {0} gemute. mutedPlayerFor=Speler {0} is gemute voor {1}. mutedUserSpeaks={0} probeerde te praten, maar is gemute. -muteExempt=\u00a7cJe kan deze speler niet muten. nearbyPlayers=Players nearby: {0} needTpohere=Je moet toegang krijgen tot /tpohere om naar andere spelers te teleporteren. negativeBalanceError=Speler is niet toegestaan om een negatief saldo te hebben. @@ -221,7 +222,6 @@ noKitPermission=\u00a7cJe hebt de \u00a7c{0}\u00a7c toestemming nodig om die kit noKits=\u00a77Er zijn nog geen kits beschikbaar noMail=Je hebt geen berichten noMotd=\u00a7cEr is geen bericht van de dag. -none=geen noNewMail=\u00a77Je hebt geen nieuwe berichten. noPendingRequest=Je hebt geen aanvragen. noPerm=\u00a7cJe hebt de \u00a7f{0}\u00a7c toestemming niet. @@ -229,21 +229,30 @@ noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob. noPlacePermission=\u00a7cJe hebt geen toestemming om een blok naast die sign te plaatsen. noPowerTools=You have no power tools assigned. noRules=\u00a7cEr zijn nog geen regels gegeven. +noWarpsDefined=Geen warps gedefinieerd +none=geen notAllowedToQuestion=\u00a7cJe bent niet bevoegd om de vraag functie te gebruiken. notAllowedToShout=\u00a7cJe bent niet bevoegd om de roep functie te gebruiken. notEnoughExperience=You do not have enough experience. notEnoughMoney=Je hebt niet voldoende middelen. -nothingInHand = \u00a7cYou have nothing in your hand. notRecommendedBukkit=* ! * De Bukkit versie is niet de aangeraden build voor Essentials. notSupportedYet=Nog niet ondersteund. +nothingInHand = \u00a7cYou have nothing in your hand. now=nu -noWarpsDefined=Geen warps gedefinieerd nuke=May death rain upon them numberRequired=Er moet daar een nummer, grapjas. onlyDayNight=/time ondersteund alleen day/night. onlyPlayers=Alleen in-game spelers kunnen {0} gebruiken. onlySunStorm=/weather only supports sun/storm. orderBalances=Ordering balances of {0} users, please wait ... +pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. +pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. +pTimePlayers=These players have their own time: +pTimeReset=Player time has been reset for: \u00a7e{0} +pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} +pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} parseError=Fout bij ontleding {0} op regel {1} pendingTeleportCancelled=\u00a7cAangevraagde teleportatie afgelast. permissionsError=Permissions/GroupManager ontbreekt; chat prefixes/suffixes worden uitgeschakeld. @@ -271,14 +280,6 @@ powerToolRemoveAll=All commands removed from {0}. powerToolsDisabled=All of your power tools have been disabled. powerToolsEnabled=All of your power tools have been enabled. protectionOwner=\u00a76[EssentialsProtect] Beschermingeigenaar: {0} -pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. -pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. -pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. -pTimePlayers=These players have their own time: -pTimeReset=Player time has been reset for: \u00a7e{0} -pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} -pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} questionFormat=\u00a77[Vraag]\u00a7f {0} readNextPage=Type /{0} {1} to read the next page reloadAllPlugins=\u00a77Alle plugins zijn herladen. @@ -312,8 +313,8 @@ signProtectInvalidLocation=\u00a74You are not allowed to create sign here. similarWarpExist=Er bestaat al een warp met dezelfde naam. slimeMalformedSize=Misvoormde grootte. soloMob=Die mob is liever in zijn eentje -spawned=gespawned spawnSet=\u00a77Spawn locatie voor de groep {0} ingesteld. +spawned=gespawned suicideMessage=\u00a77Vaarwel vreedzame wereld... suicideSuccess= \u00a77{0} pleegde zelfmoord survival=survival @@ -321,20 +322,20 @@ takenFromAccount=\u00a7c{0} is van je bank rekening afgehaald. 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... -teleportationCommencing=\u00a77Aan het beginnen met teleporteren... -teleportationDisabled=\u00a77Teleportatie uitgeschakeld. -teleportationEnabled=\u00a77Teleportatie ingeschakeld. teleportAtoB=\u00a77{0}\u00a77 is naar {1}\u00a77 geteleporteerd. teleportDisabled={0} heeft teleporteren uit gezet. teleportHereRequest=\u00a7c{0}\u00a7c Heeft gevraagd of hij/zij naar jou mag teleporteren. -teleporting=\u00a77Bezig met teleporteren... -teleportingPortal=\u00a77Bezig met teleporteren via de portal. teleportNewPlayerError=Fout bij het teleporteren van nieuwe speler. teleportRequest=\u00a7c{0}\u00a7c vraagt of hij jou kan teleporteren. teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Bezig met teleporteren naar de top. -tempbanExempt=\u00a77Je mag deze speler niet een tempban geven +teleportationCommencing=\u00a77Aan het beginnen met teleporteren... +teleportationDisabled=\u00a77Teleportatie uitgeschakeld. +teleportationEnabled=\u00a77Teleportatie ingeschakeld. +teleporting=\u00a77Bezig met teleporteren... +teleportingPortal=\u00a77Bezig met teleporteren via de portal. tempBanned=Tijdelijk geband voor {0} +tempbanExempt=\u00a77Je mag deze speler niet een tempban geven thunder= Je {0} onweert de wereld thunderDuration=Je {0} onweert de wereld voor {1} seconde. timeBeforeHeal=Afkoeltijd tot de volgende heal: {0} @@ -365,25 +366,25 @@ unlimitedItemPermission=\u00a7cOnbevoegd om oneindig {0} te hebben. unlimitedItems=Oneindige voorwerpen: unmutedPlayer=Speler {0} mag weer spreken. upgradingFilesError=Fout tijdens het upgraden van de bestanden -userdataMoveBackError=Fout bij het verplaasten van userdata/{0}.tmp naar userdata/{1} -userdataMoveError=Fout bij het verplaasten van userdata/{0} naar userdata/{1}.tmp userDoesNotExist=Speler {0} bestaat niet. userIsAway={0} is nu AFK userIsNotAway={0} is niet meer AFK userJailed=\u00a77Je bent in de gevangenis gezet. userUsedPortal={0} gebruikte een bestaande uitgangs portal. +userdataMoveBackError=Fout bij het verplaasten van userdata/{0}.tmp naar userdata/{1} +userdataMoveError=Fout bij het verplaasten van userdata/{0} naar userdata/{1}.tmp usingTempFolderForTesting=Tijdelijke map om te testen: versionMismatch=Verkeerde versie! Update {0} naar dezelfde versie. versionMismatchAll=Verkeerde versie! Update alle Essentials jars naar dezelfde versie. voiceSilenced=\u00a77Je kan niet meer praten warpDeleteError=Fout bij het verwijderen van het warp bestand. -warpingTo=\u00a77Aan het warpen naar {0}. warpListPermission=\u00a7cJe hebt geen toegang om die warp te maken. warpNotExist=Die warp bestaat niet. -warps=Warps: {0} -warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. warpSet=\u00a77Warp {0} ingesteld. warpUsePermission=\u00a7cOnbevoegd om die warp te gebruiken. +warpingTo=\u00a77Aan het warpen naar {0}. +warps=Warps: {0} +warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. weatherStorm=\u00a77Je hebt het weer naar storm gezet in de {0} weatherStormFor=\u00a77Je hebt het weer in de {0} naar storm gezet voor {1} seconde weatherSun=\u00a77Je hebt het weer naar zon gezet in de {0} -- cgit v1.2.3 From c3d5b32986bcd5c34df8d534bc9045b9a5ff70da Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 16:17:16 +0000 Subject: Extra command alias. --- Essentials/src/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 343708b2f..dcc8743b2 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -58,7 +58,7 @@ commands: clearinventory: description: Clear all items in your inventory. usage: / - aliases: [ci,eci,clearinvent,eclearinvent,eclearinventory] + aliases: [ci,eci,clearinvent,clean,eclean,eclearinvent,eclearinventory] compass: description: Describes your current bearing. usage: / -- cgit v1.2.3 From c7a6677d528a92e4820e297cb08bcbe642c5c6ae Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 20:06:50 +0000 Subject: Adding starter/newbie kit to EssentialsSpawn Optimization to EssentialsSpawn join event. --- .../src/com/earth2me/essentials/IEssentials.java | 1 + .../src/com/earth2me/essentials/ISettings.java | 6 +++-- Essentials/src/com/earth2me/essentials/Kit.java | 5 ++-- .../src/com/earth2me/essentials/Settings.java | 6 +++++ .../earth2me/essentials/commands/Commandkit.java | 4 +-- Essentials/src/config.yml | 5 ++++ .../spawn/EssentialsSpawnPlayerListener.java | 31 +++++++++++++++++----- 7 files changed, 45 insertions(+), 13 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/IEssentials.java b/Essentials/src/com/earth2me/essentials/IEssentials.java index 20c6c300e..6b820440a 100644 --- a/Essentials/src/com/earth2me/essentials/IEssentials.java +++ b/Essentials/src/com/earth2me/essentials/IEssentials.java @@ -9,6 +9,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.plugin.Plugin; import org.bukkit.scheduler.BukkitScheduler; + /** * @deprecated This will be moved to the api package soon */ diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index 6186736b4..ec3941cd1 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -20,6 +20,8 @@ public interface ISettings extends IConf boolean getAnnounceNewPlayers(); + String getNewPlayerKit(); + String getBackupCommand(); long getBackupInterval(); @@ -115,11 +117,11 @@ public interface ISettings extends IConf boolean warnOnSmite(); double getMaxMoney(); - + double getMinMoney(); boolean isEcoLogEnabled(); - + boolean isEcoLogUpdateEnabled(); boolean removeGodOnDisconnect(); diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index 47e5e6ac2..cf39997ea 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -63,10 +63,11 @@ public class Kit public static List getItems(final User user, final Map kit) throws Exception { - if (kit == null) { + if (kit == null) + { throw new Exception(_("kitError2")); } - + try { return (List)kit.get("items"); diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index e3992e52c..c9232f107 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -351,6 +351,12 @@ public class Settings implements ISettings return new SimpleTextInput(Util.replaceColor(config.getString("newbies.announce-format", "&dWelcome {DISPLAYNAME} to the server!"))); } + @Override + public String getNewPlayerKit() + { + return config.getString("newbies.kit", ""); + } + @Override public String getNewbieSpawn() { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java index aee0af910..67f0fafd0 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java @@ -38,7 +38,7 @@ public class Commandkit extends EssentialsCommand { throw new Exception(_("noKitPermission", "essentials.kit." + kitName)); } - + final List items = Kit.getItems(user, kit); Kit.checkTime(user, kitName, kit); @@ -47,7 +47,7 @@ public class Commandkit extends EssentialsCommand charge.isAffordableFor(user); Kit.expandItems(ess, user, items); - + charge.charge(user); user.sendMessage(_("kitGive", kitName)); diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 81d911c82..11bc38329 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -547,6 +547,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/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index c7a17845a..ba71c176f 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -1,12 +1,13 @@ package com.earth2me.essentials.spawn; +import com.earth2me.essentials.*; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.IEssentials; -import com.earth2me.essentials.OfflinePlayer; -import com.earth2me.essentials.User; import com.earth2me.essentials.textreader.IText; import com.earth2me.essentials.textreader.KeywordReplacer; import com.earth2me.essentials.textreader.SimpleTextPager; +import java.util.List; +import java.util.Locale; +import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Bukkit; @@ -67,13 +68,14 @@ public class EssentialsSpawnPlayerListener implements Listener public void onPlayerJoin(final PlayerJoinEvent event) { - final User user = ess.getUser(event.getPlayer()); - - if (user.hasPlayedBefore()) + if (event.getPlayer().hasPlayedBefore()) { LOGGER.log(Level.FINE, "Old player join"); return; } + + final User user = ess.getUser(event.getPlayer()); + if (!"none".equalsIgnoreCase(ess.getSettings().getNewbieSpawn())) { ess.scheduleSyncDelayedTask(new NewPlayerTeleport(user), 1L); @@ -86,6 +88,21 @@ public class EssentialsSpawnPlayerListener implements Listener ess.broadcastMessage(user, pager.getString(0)); } + final String kitName = ess.getSettings().getNewPlayerKit(); + if (!kitName.isEmpty()) + { + try + { + final Map kit = ess.getSettings().getKit(kitName.toLowerCase(Locale.ENGLISH)); + final List items = Kit.getItems(user, kit); + Kit.expandItems(ess, user, items); + } + catch (Exception ex) + { + LOGGER.log(Level.WARNING, ex.getMessage()); + } + } + LOGGER.log(Level.FINE, "New player join"); } @@ -109,7 +126,7 @@ public class EssentialsSpawnPlayerListener implements Listener try { - Location spawn = spawns.getSpawn(ess.getSettings().getNewbieSpawn()); + final Location spawn = spawns.getSpawn(ess.getSettings().getNewbieSpawn()); if (spawn != null) { user.getTeleport().now(spawn, false, TeleportCause.PLUGIN); -- cgit v1.2.3 From 2b25ca2932d9a0d72f4651cf77a8895045f97a98 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 21:43:24 +0000 Subject: CME --- Essentials/src/com/earth2me/essentials/Mob.java | 3 ++- Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Mob.java b/Essentials/src/com/earth2me/essentials/Mob.java index 7be698950..8523a1a87 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; @@ -71,7 +72,7 @@ public enum Mob } public static Set getMobList() { - return hashMap.keySet(); + return Collections.unmodifiableSet(hashMap.keySet()); } public LivingEntity spawn(final Player player, final Server server, final Location loc) throws MobException diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 4971c7922..5c0dc84fe 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -27,7 +27,7 @@ public class Commandspawnmob extends EssentialsCommand { if (args.length < 1) { - Set availableList = Mob.getMobList(); + final Set availableList = Mob.getMobList(); for (String mob : availableList) { if (!user.isAuthorized("essentials.spawnmob." + mob.toLowerCase())) -- cgit v1.2.3 From 15c0565923cf521daa8af3dac10aed6b38133c98 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 4 Mar 2012 21:54:51 +0000 Subject: Build custom mob list /spawnmob --- .../com/earth2me/essentials/commands/Commandspawnmob.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 5c0dc84fe..97141e585 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -5,9 +5,7 @@ import com.earth2me.essentials.Mob; import com.earth2me.essentials.Mob.MobException; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; -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.Server; @@ -27,12 +25,13 @@ public class Commandspawnmob extends EssentialsCommand { if (args.length < 1) { - final Set availableList = Mob.getMobList(); - for (String mob : availableList) + final Set mobList = Mob.getMobList(); + final Set availableList = new HashSet(); + for (String mob : mobList) { - if (!user.isAuthorized("essentials.spawnmob." + mob.toLowerCase())) + if (user.isAuthorized("essentials.spawnmob." + mob.toLowerCase())) { - availableList.remove(mob); + availableList.add(mob); } } if (availableList.isEmpty()) -- cgit v1.2.3 From 7819b9d2f027cd0fc4c6a11e325e2f2dbc839946 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 5 Mar 2012 00:08:37 +0000 Subject: Apply colors to group tags. --- Essentials/src/com/earth2me/essentials/commands/Commandlist.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java index 92833a66c..187e6c7e5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; import java.util.*; import org.bukkit.Server; import org.bukkit.command.CommandSender; @@ -72,7 +73,7 @@ public class Commandlist extends EssentialsCommand for (String group : groups) { final StringBuilder groupString = new StringBuilder(); - groupString.append(group).append(": "); + groupString.append(Util.replaceColor(group)).append(": "); final List users = sort.get(group); Collections.sort(users); boolean first = true; -- cgit v1.2.3 From 8577202f4882a588f458423bd3026b4ec3cefbed Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 5 Mar 2012 00:19:40 +0000 Subject: Add listgroups as TL key --- Essentials/src/com/earth2me/essentials/commands/Commandlist.java | 2 +- Essentials/src/messages.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_nl.properties | 1 + 8 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java index 187e6c7e5..77788c7c2 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java @@ -73,7 +73,7 @@ public class Commandlist extends EssentialsCommand for (String group : groups) { final StringBuilder groupString = new StringBuilder(); - groupString.append(Util.replaceColor(group)).append(": "); + groupString.append(_("listGroupTag",Util.replaceColor(group))); final List users = sort.get(group); Collections.sort(users); boolean first = true; diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index d10ec0908..60b09b734 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -170,6 +170,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} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 9bb84edba..0b8671379 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -170,6 +170,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} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 944d5c7ef..fac736f2b 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -170,6 +170,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} diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index c38abd727..66f357022 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -408,3 +408,4 @@ year=year years=years youAreHealed=\u00a77You have been healed. youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail. +listGroupTag={0}\u00a7f: diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 07a788eb5..fbaba1cac 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -170,6 +170,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} diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 8afe6cb0c..0473b3ce4 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -170,6 +170,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} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index da88603d6..05a735949 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -170,6 +170,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} -- cgit v1.2.3 From e91ed6044141a60d70d65dba464d5e3d189b056a Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 5 Mar 2012 00:22:31 +0000 Subject: Fixing spawnmob count. --- Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 97141e585..c8478f923 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -175,7 +175,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) { -- cgit v1.2.3 From bdf32cde9e3ca43c0fcf35dac57160e8cd1db4ac Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 5 Mar 2012 00:39:37 +0000 Subject: Missed one. --- Essentials/src/messages_en.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 66f357022..d1499aad8 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -170,6 +170,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} @@ -408,4 +409,3 @@ year=year years=years youAreHealed=\u00a77You have been healed. youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail. -listGroupTag={0}\u00a7f: -- cgit v1.2.3 From 0dd5c0370ee0cd01ec07cf3b6acef67985e5999e Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 5 Mar 2012 18:40:18 +1100 Subject: I dont think free noteblocks are a good idea --- Essentials/src/com/earth2me/essentials/commands/Commandessentials.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index 56432a91f..ce2f03af9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -117,7 +117,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() @@ -149,7 +149,6 @@ public class Commandessentials extends EssentialsCommand } } }, 20, 2); - return; } private void stopTune() -- cgit v1.2.3 From 96b217cbe8336810dcb760dfc1845b0472057682 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 5 Mar 2012 08:41:19 +0000 Subject: Craftbukkit/Bukkit R7 --- lib/bukkit.jar | Bin 4686754 -> 4686877 bytes lib/craftbukkit.jar | Bin 10919232 -> 10921072 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/bukkit.jar b/lib/bukkit.jar index 28e143709..8d0f64e0e 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index ce2ecfeb8..7c14fe740 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From ba96117f55384275c655e9be3bae891d284e7631 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 5 Mar 2012 14:17:09 +0000 Subject: Temp fix to disable version check on R7 --- Essentials/src/com/earth2me/essentials/Essentials.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 24ac0ad6e..d7f749eb7 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -133,7 +133,7 @@ public class Essentials extends JavaPlugin implements IEssentials if (versionMatch.matches()) { final int versionNumber = Integer.parseInt(versionMatch.group(1)); - if (versionNumber < BUKKIT_VERSION) + if (versionNumber < BUKKIT_VERSION && versionNumber > 100) { LOGGER.log(Level.SEVERE, _("notRecommendedBukkit")); LOGGER.log(Level.SEVERE, _("requiredBukkit", Integer.toString(BUKKIT_VERSION))); -- cgit v1.2.3 From 1e34a396cd1ab01c1b5cae038deac09bbf776615 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 5 Mar 2012 15:51:15 +0000 Subject: Change starter kit to default to stone tools --- Essentials/src/config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 11bc38329..4c9b31dc0 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -158,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. -- cgit v1.2.3 From 1f761ee1cbd1b4be8583cf4b310e825a1247471e Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 6 Mar 2012 11:02:48 +0000 Subject: Expanded '/manuadd'to accept an optional variable for the world (eg '/manuadd '). --- EssentialsGroupManager/src/Changelog.txt | 3 +- .../org/anjocaido/groupmanager/GroupManager.java | 86 ++++++++++++++-------- EssentialsGroupManager/src/plugin.yml | 2 +- 3 files changed, 57 insertions(+), 34 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index d28696f5f..b8b05c1b4 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -148,4 +148,5 @@ v 1.9: - Prevent promoting players to, and demoting to GlobalGroups. - Make 'manload' reload the config correctly. - Minor optimization when checking bukkit permissions. - - Better reporting when a users.yml is failing to load. \ No newline at end of file + - Better reporting when a users.yml is failing to load. + - Expanded '/manuadd'to accept an optional variable for the world (eg '/manuadd '). \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 00c71a41e..739e5db6b 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -374,16 +374,16 @@ public class GroupManager extends JavaPlugin { if (isConsole || playerCanDo) { switch (execCmd) { case manuadd: - // VALIDANDO ESTADO DO SENDER - if (dataHolder == null || permissionHandler == null) { - if (!setDefaultWorldHandler(sender)) - return true; - } + // VALIDANDO ARGUMENTOS - if (args.length != 2) { - sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); + if ((args.length != 2) && (args.length != 3)) { + sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ | optional )"); return false; } + // Select the relevant world + dataHolder = worldsHolder.getWorldData((args.length == 3)? args[2]:Bukkit.getWorlds().get(0).getName()); + permissionHandler = dataHolder.getPermissionsHandler(); + if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { return false; } @@ -420,14 +420,10 @@ public class GroupManager extends JavaPlugin { // PARECE OK auxUser.setGroup(auxGroup); if (!sender.hasPermission("groupmanager.notify.other") || (isConsole)) - sender.sendMessage(ChatColor.YELLOW + "You changed player '" + auxUser.getName() + "' group to '" + auxGroup.getName() + "'."); - - //targetPlayer = this.getServer().getPlayer(auxUser.getName()); - //if (targetPlayer != null) - // BukkitPermissions.updatePermissions(targetPlayer); + sender.sendMessage(ChatColor.YELLOW + "You changed player '" + auxUser.getName() + "' group to '" + auxGroup.getName() + "' in world '" + dataHolder.getName() + "'."); return true; - // break; + case manudel: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -463,6 +459,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updatePermissions(targetPlayer); return true; + case manuaddsub: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -502,11 +499,8 @@ public class GroupManager extends JavaPlugin { else sender.sendMessage(ChatColor.RED + "The subgroup '" + auxGroup.getName() + "' is already available to '" + auxUser.getName() + "'."); - //targetPlayer = this.getServer().getPlayer(auxUser.getName()); - //if (targetPlayer != null) - // BukkitPermissions.updatePermissions(targetPlayer); - return true; + case manudelsub: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -547,6 +541,7 @@ public class GroupManager extends JavaPlugin { // BukkitPermissions.updatePermissions(targetPlayer); return true; + case mangadd: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -568,6 +563,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "You created a group named: " + auxGroup.getName()); return true; + case mangdel: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -591,6 +587,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updateAllPlayers(); return true; + case manuaddp: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -655,7 +652,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updatePermissions(targetPlayer); return true; - // break; + case manudelp: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -706,7 +703,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updatePermissions(targetPlayer); return true; - // break; + case manulistp: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -771,6 +768,7 @@ public class GroupManager extends JavaPlugin { } return true; + case manucheckp: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -825,6 +823,7 @@ public class GroupManager extends JavaPlugin { } return true; + case mangaddp: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -879,6 +878,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updateAllPlayers(); return true; + case mangdelp: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -919,6 +919,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updateAllPlayers(); return true; + case manglistp: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -967,6 +968,7 @@ public class GroupManager extends JavaPlugin { } return true; + case mangcheckp: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1002,6 +1004,7 @@ public class GroupManager extends JavaPlugin { } return true; + case mangaddi: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1040,6 +1043,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updateAllPlayers(); return true; + case mangdeli: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1082,6 +1086,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updateAllPlayers(); return true; + case manuaddv: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1113,7 +1118,9 @@ public class GroupManager extends JavaPlugin { } auxUser.getVariables().addVar(args[1], Variables.parseVariableValue(auxString)); sender.sendMessage(ChatColor.YELLOW + "Variable " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + ":'" + ChatColor.GREEN + auxString + ChatColor.YELLOW + "' added to the user " + auxUser.getName()); + return true; + case manudelv: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1141,7 +1148,9 @@ public class GroupManager extends JavaPlugin { // PARECE OK auxUser.getVariables().removeVar(args[1]); sender.sendMessage(ChatColor.YELLOW + "Variable " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + " removed from the user " + ChatColor.GREEN + auxUser.getName()); + return true; + case manulistv: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1174,7 +1183,9 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "Variables of user " + auxUser.getName() + ": "); sender.sendMessage(auxString + "."); sender.sendMessage(ChatColor.YELLOW + "Plus all variables from group: " + auxUser.getGroupName()); + return true; + case manucheckv: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1219,7 +1230,9 @@ public class GroupManager extends JavaPlugin { if (!auxGroup.equals(auxGroup2)) { sender.sendMessage(ChatColor.YELLOW + "And the value was inherited from group: " + ChatColor.GREEN + auxGroup2.getName()); } + return true; + case mangaddv: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1253,6 +1266,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "Variable " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + ":'" + ChatColor.GREEN + auxString + ChatColor.YELLOW + "' added to the group " + auxGroup.getName()); return true; + case mangdelv: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1282,6 +1296,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "Variable " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + " removed from the group " + ChatColor.GREEN + auxGroup.getName()); return true; + case manglistv: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1322,7 +1337,9 @@ public class GroupManager extends JavaPlugin { auxString = auxString.substring(0, auxString.lastIndexOf(",")); sender.sendMessage(ChatColor.YELLOW + "Plus all variables from groups: " + auxString); } + return true; + case mangcheckv: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1353,7 +1370,9 @@ public class GroupManager extends JavaPlugin { if (!auxGroup.equals(auxGroup2)) { sender.sendMessage(ChatColor.YELLOW + "And the value was inherited from group: " + ChatColor.GREEN + auxGroup2.getName()); } + return true; + case manwhois: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1383,7 +1402,7 @@ public class GroupManager extends JavaPlugin { } // victim.permissions.add(args[1]); return true; - // break; + case tempadd: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1417,7 +1436,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "Player overloaded!"); return true; - // break; + case tempdel: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1453,7 +1472,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "You removed that player overload. He's back to normal!"); return true; - // break; + case templist: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1482,7 +1501,9 @@ public class GroupManager extends JavaPlugin { } overloadedUsers.get(dataHolder.getName().toLowerCase()).removeAll(removeList); sender.sendMessage(ChatColor.YELLOW + " " + count + " Users in overload mode: " + ChatColor.WHITE + auxString); + return true; + case tempdelall: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1509,6 +1530,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + " " + count + " Users in overload mode. Now they are normal again."); return true; + case mansave: boolean forced = false; @@ -1583,7 +1605,9 @@ public class GroupManager extends JavaPlugin { auxString = auxString.substring(0, auxString.lastIndexOf(",")); } sender.sendMessage(ChatColor.YELLOW + " Groups Available: " + ChatColor.WHITE + auxString); + return true; + case manpromote: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1638,12 +1662,8 @@ public class GroupManager extends JavaPlugin { if (!sender.hasPermission("groupmanager.notify.other") || (isConsole)) sender.sendMessage(ChatColor.YELLOW + "You changed " + auxUser.getName() + " group to " + auxGroup.getName() + "."); - //targetPlayer = this.getServer().getPlayer(auxUser.getName()); - //if (targetPlayer != null) - // BukkitPermissions.updatePermissions(targetPlayer); - return true; - // break; + case mandemote: // VALIDANDO ESTADO DO SENDER if (dataHolder == null || permissionHandler == null) { @@ -1698,12 +1718,8 @@ public class GroupManager extends JavaPlugin { if (!sender.hasPermission("groupmanager.notify.other") || (isConsole)) sender.sendMessage(ChatColor.YELLOW + "You changed " + auxUser.getName() + " group to " + auxGroup.getName() + "."); - //targetPlayer = this.getServer().getPlayer(auxUser.getName()); - //if (targetPlayer != null) - // BukkitPermissions.updatePermissions(targetPlayer); - return true; - // break; + case mantogglevalidate: validateOnlinePlayer = !validateOnlinePlayer; sender.sendMessage(ChatColor.YELLOW + "Validade if player is online, now set to: " + Boolean.toString(validateOnlinePlayer)); @@ -1734,7 +1750,9 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "Your world now uses permissions of world name: '" + dataHolder.getName() + "' "); } } + return true; + case manselect: if (args.length < 1) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); @@ -1765,7 +1783,9 @@ public class GroupManager extends JavaPlugin { permissionHandler = dataHolder.getPermissionsHandler(); selectedWorlds.put(sender, dataHolder.getName()); sender.sendMessage(ChatColor.YELLOW + "You have selected world '" + dataHolder.getName() + "'."); + return true; + case manclear: if (args.length != 0) { sender.sendMessage(ChatColor.RED + "Review your arguments count!"); @@ -1773,7 +1793,9 @@ public class GroupManager extends JavaPlugin { } selectedWorlds.remove(sender); sender.sendMessage(ChatColor.YELLOW + "You have removed your world selection. Working with current world(if possible)."); + return true; + default: break; } diff --git a/EssentialsGroupManager/src/plugin.yml b/EssentialsGroupManager/src/plugin.yml index 65a5d4e95..6648ad7e8 100644 --- a/EssentialsGroupManager/src/plugin.yml +++ b/EssentialsGroupManager/src/plugin.yml @@ -10,7 +10,7 @@ authors: commands: manuadd: description: Move a player to desired group.(Adds to the file if not exists) - usage: / + usage: / | optional permissions: groupmanager.manuadd manudel: description: Remove any user specific configuration. Make him default group. -- cgit v1.2.3 From 19d233454ee7590e1f5221e23a77eb821b14548b Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 6 Mar 2012 16:23:57 +0000 Subject: change []<> for optional command components --- EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java | 2 +- EssentialsGroupManager/src/plugin.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 739e5db6b..eaa945f5d 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -377,7 +377,7 @@ public class GroupManager extends JavaPlugin { // VALIDANDO ARGUMENTOS if ((args.length != 2) && (args.length != 3)) { - sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ | optional )"); + sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ | optional [world])"); return false; } // Select the relevant world diff --git a/EssentialsGroupManager/src/plugin.yml b/EssentialsGroupManager/src/plugin.yml index 6648ad7e8..bf42a08c3 100644 --- a/EssentialsGroupManager/src/plugin.yml +++ b/EssentialsGroupManager/src/plugin.yml @@ -10,7 +10,7 @@ authors: commands: manuadd: description: Move a player to desired group.(Adds to the file if not exists) - usage: / | optional + usage: / | optional [world] permissions: groupmanager.manuadd manudel: description: Remove any user specific configuration. Make him default group. -- cgit v1.2.3 From 5c55e18d33c64d1dd4f82b7c4ddeda8061a96cd7 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 6 Mar 2012 23:17:10 +0000 Subject: Fixing typo in config.yml --- Essentials/src/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 4c9b31dc0..6a0f6e996 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -83,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 @@ -326,9 +326,9 @@ 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 -# Setting this to 0, will disable overdrafts/loans compeltely. Users need 'essentials.eco.loan' perm to go below 0. -min-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 -- cgit v1.2.3 From 9ac5ce8a752bbd546dfba6e75b73d873be2265e5 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 7 Mar 2012 12:14:32 +0000 Subject: Update info.txt to hint at /einfo. --- Essentials/src/info.txt | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3 From c7046b696ab7f6136acf4c22fb0e7b0d88d91629 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 10 Mar 2012 21:42:46 +0000 Subject: Use ignoreCancelled on event registration. --- .../essentials/EssentialsBlockListener.java | 6 +---- .../essentials/EssentialsEntityListener.java | 8 +++---- .../essentials/EssentialsPlayerListener.java | 26 ++++++---------------- Essentials/src/com/earth2me/essentials/Jails.java | 8 +++---- 4 files changed, 16 insertions(+), 32 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java index f2e2e8a77..17f0f1778 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java @@ -17,13 +17,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; - } final User user = ess.getUser(event.getPlayer()); // Do not rely on getItemInHand(); // http://leaky.bukkit.org/issues/663 diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java index 45d78ebeb..524edc16f 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java @@ -62,7 +62,7 @@ public class EssentialsEntityListener implements Listener } } - @EventHandler(priority = EventPriority.LOWEST) + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onEntityDamage(final EntityDamageEvent event) { if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled()) @@ -74,7 +74,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(event.getEntity()).isGodModeEnabled()) @@ -98,7 +98,7 @@ public class EssentialsEntityListener implements Listener } } - @EventHandler(priority = EventPriority.LOWEST) + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onFoodLevelChange(final FoodLevelChangeEvent event) { if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled()) @@ -107,7 +107,7 @@ public class EssentialsEntityListener implements Listener } } - @EventHandler(priority = EventPriority.LOWEST) + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onEntityRegainHealth(final EntityRegainHealthEvent event) { if (event.getRegainReason() == RegainReason.SATIATED && event.getEntity() instanceof Player diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 7ab1847f1..c1bd9bbe0 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -75,13 +75,9 @@ public class EssentialsPlayerListener implements Listener } } - @EventHandler(priority = EventPriority.HIGH) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerMove(final PlayerMoveEvent event) { - if (event.isCancelled()) - { - return; - } final User user = ess.getUser(event.getPlayer()); if (user.isAfk() && ess.getSettings().getFreezeAfkPlayers()) @@ -231,13 +227,9 @@ public class EssentialsPlayerListener implements Listener } } - @EventHandler(priority = EventPriority.HIGH) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerTeleport(final PlayerTeleportEvent event) { - if (event.isCancelled()) - { - return; - } //There is TeleportCause.COMMMAND but plugins have to actively pass the cause in on their teleports. if ((event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND) && ess.getSettings().registerBackInListener()) @@ -248,7 +240,7 @@ public class EssentialsPlayerListener implements Listener } - @EventHandler(priority = EventPriority.HIGH) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerEggThrow(final PlayerEggThrowEvent event) { final User user = ess.getUser(event.getPlayer()); @@ -260,7 +252,7 @@ public class EssentialsPlayerListener implements Listener } } - @EventHandler(priority = EventPriority.HIGH) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerBucketEmpty(final PlayerBucketEmptyEvent event) { final User user = ess.getUser(event.getPlayer()); @@ -278,13 +270,9 @@ public class EssentialsPlayerListener implements Listener } } - @EventHandler(priority = EventPriority.MONITOR) + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event) { - if (event.isCancelled()) - { - return; - } final User user = ess.getUser(event.getPlayer()); final String cmd = event.getMessage().toLowerCase(Locale.ENGLISH).split(" ")[0].replace("/", "").toLowerCase(Locale.ENGLISH); final List commands = Arrays.asList("msg", "r", "mail", "m", "t", "emsg", "tell", "er", "reply", "ereply", "email"); @@ -400,10 +388,10 @@ public class EssentialsPlayerListener implements Listener return used; } - @EventHandler(priority = EventPriority.LOW) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onPlayerPickupItem(final PlayerPickupItemEvent event) { - if (event.isCancelled() || !ess.getSettings().getDisableItemPickupWhileAfk()) + if (!ess.getSettings().getDisableItemPickupWhileAfk()) { return; } diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java index 7217992ad..67c46a310 100644 --- a/Essentials/src/com/earth2me/essentials/Jails.java +++ b/Essentials/src/com/earth2me/essentials/Jails.java @@ -149,7 +149,7 @@ public class Jails extends AsyncStorageObjectHolder Date: Sun, 11 Mar 2012 01:46:01 +0000 Subject: Add Enderman check to EntityChangeEvent (Should fix sheep eating grass). --- .../earth2me/essentials/protect/EssentialsProtectEntityListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index 57302517f..d19f48abb 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -334,7 +334,7 @@ public class EssentialsProtectEntityListener implements Listener { return; } - if (prot.getSettingBool(ProtectConfig.prevent_enderman_pickup)) + if (event.getEntityType() == EntityType.ENDERMAN && prot.getSettingBool(ProtectConfig.prevent_enderman_pickup)) { event.setCancelled(true); return; -- cgit v1.2.3 From a40c936bcff0a05887d3acc9ab096aaab4b9df2d Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 11 Mar 2012 20:58:54 +0000 Subject: New Permission: essentials.lightning.others With this permission you can use /lightning , without only strike based on direction. --- Essentials/src/com/earth2me/essentials/commands/Commandlightning.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java index be9ac61f5..810ef0b33 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java @@ -24,7 +24,7 @@ public class Commandlightning extends EssentialsCommand { user = ess.getUser(((Player)sender)); } - if (args.length < 1 & user != null) + if ((args.length < 1 || !user.isAuthorized("essentials.lightning.others")) & user != null) { user.getWorld().strikeLightning(user.getTargetBlock(null, 600).getLocation()); return; -- cgit v1.2.3 From 8dcd591beb12bd0bc03f2a3d6092ce1a7654495b Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 11 Mar 2012 23:59:59 +0000 Subject: Update setworth to allow /setworth ingame Allow /setworth to be used from console. --- .../essentials/commands/Commandsetworth.java | 29 +++++++++++++++++++++- Essentials/src/plugin.yml | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java index 1d236b70a..734d9244d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import org.bukkit.Server; +import org.bukkit.command.CommandSender; import org.bukkit.inventory.ItemStack; @@ -21,8 +22,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 Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception + { + if (args.length < 2) + { + throw new NotEnoughArgumentsException(); + } + ItemStack stack = ess.getItemDb().get(args[0]); ess.getWorth().setPrice(stack, Double.parseDouble(args[1])); - user.sendMessage(_("worthSet")); + sender.sendMessage(_("worthSet")); } } diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 714abde4b..27541d782 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -295,7 +295,7 @@ commands: aliases: [createwarp,esetwarp] setworth: description: Set the sell value of an item. - usage: / + usage: / [itemname|id] aliases: [esetworth] socialspy: description: Toggles if you can see msg/mail commands in chat. -- cgit v1.2.3 From e11525ab64fb1044a4e7d2c5e2aa4654699b3c34 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 12 Mar 2012 01:00:57 +0000 Subject: Update offline user check. Add ban reason to /seen --- Essentials/src/com/earth2me/essentials/Jails.java | 2 +- Essentials/src/com/earth2me/essentials/User.java | 5 +++-- .../src/com/earth2me/essentials/commands/Commandban.java | 3 +-- .../src/com/earth2me/essentials/commands/Commandseen.java | 14 +++++++------- .../com/earth2me/essentials/commands/Commandtempban.java | 3 +-- .../earth2me/essentials/commands/Commandtogglejail.java | 7 +++---- .../com/earth2me/essentials/commands/Commandtpaccept.java | 3 +-- .../src/com/earth2me/essentials/commands/Commandtpo.java | 3 +-- .../com/earth2me/essentials/commands/Commandtpohere.java | 3 +-- .../earth2me/essentials/commands/EssentialsCommand.java | 5 ++--- 10 files changed, 21 insertions(+), 27 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java index 67c46a310..7ca4d3bcd 100644 --- a/Essentials/src/com/earth2me/essentials/Jails.java +++ b/Essentials/src/com/earth2me/essentials/Jails.java @@ -115,7 +115,7 @@ public class Jails extends AsyncStorageObjectHolder, IReplyTo, IUser try { final String opPrefix = ess.getSettings().getOperatorColor().toString(); - if (opPrefix.length() > 0) { + if (opPrefix.length() > 0) + { nickname.insert(0, opPrefix); nickname.append("§f"); } @@ -326,7 +327,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser @Override public String getDisplayName() { - if (!(base instanceof OfflinePlayer) && ess.getSettings().changeDisplayName()) + if (base.isOnline() && ess.getSettings().changeDisplayName()) { setDisplayNick(); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java index d39419686..bc09cbba8 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java @@ -2,7 +2,6 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.Console; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.OfflinePlayer; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.command.CommandSender; @@ -24,7 +23,7 @@ public class Commandban extends EssentialsCommand throw new NotEnoughArgumentsException(); } final User user = getPlayer(server, args, 0, true); - if (user.getBase() instanceof OfflinePlayer) + if (!user.isOnline()) { if (sender instanceof Player && !ess.getUser(sender).isAuthorized("essentials.ban.offline")) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index cf500e094..131d38f81 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -23,20 +23,20 @@ public class Commandseen extends EssentialsCommand } try { - User u = getPlayer(server, args, 0); - sender.sendMessage(_("seenOnline", u.getDisplayName(), Util.formatDateDiff(u.getLastLogin()))); + User user = getPlayer(server, args, 0); + sender.sendMessage(_("seenOnline", user.getDisplayName(), Util.formatDateDiff(user.getLastLogin()))); } catch (NoSuchFieldException e) { - User u = ess.getOfflineUser(args[0]); - if (u == null) + User user = ess.getOfflineUser(args[0]); + if (user == null) { throw new Exception(_("playerNotFound")); } - sender.sendMessage(_("seenOffline", u.getDisplayName(), Util.formatDateDiff(u.getLastLogout()))); - if (u.isBanned()) + sender.sendMessage(_("seenOffline", user.getDisplayName(), Util.formatDateDiff(user.getLastLogout()))); + if (user.isBanned()) { - sender.sendMessage(_("whoisBanned", _("true"))); + sender.sendMessage(_("whoisBanned", user.getBanReason())); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java index 144d19d15..25c457a20 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java @@ -2,7 +2,6 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.Console; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.OfflinePlayer; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; import org.bukkit.Server; @@ -25,7 +24,7 @@ public class Commandtempban extends EssentialsCommand throw new NotEnoughArgumentsException(); } final User user = getPlayer(server, args, 0, true); - if (user.getBase() instanceof OfflinePlayer) + if (!user.isOnline()) { if (sender instanceof Player && !ess.getUser(sender).isAuthorized("essentials.tempban.offline")) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java index f98343311..3240b73a9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java @@ -1,7 +1,6 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.OfflinePlayer; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; import org.bukkit.Server; @@ -28,7 +27,7 @@ public class Commandtogglejail extends EssentialsCommand if (args.length >= 2 && !player.isJailed()) { - if (player.getBase() instanceof OfflinePlayer) + if (!player.isOnline()) { if (sender instanceof Player && !ess.getUser(sender).isAuthorized("essentials.togglejail.offline")) @@ -45,7 +44,7 @@ public class Commandtogglejail extends EssentialsCommand return; } } - if (!(player.getBase() instanceof OfflinePlayer)) + if (player.isOnline()) { ess.getJails().sendToJail(player, args[1]); } @@ -96,7 +95,7 @@ public class Commandtogglejail extends EssentialsCommand player.setJailTimeout(0); player.sendMessage(_("jailReleasedPlayerNotify")); player.setJail(null); - if (!(player.getBase() instanceof OfflinePlayer)) + if (player.isOnline()) { player.getTeleport().back(); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java index 891742043..449ae7489 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java @@ -1,7 +1,6 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.OfflinePlayer; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -21,7 +20,7 @@ public class Commandtpaccept extends EssentialsCommand final User target = user.getTeleportRequest(); if (target == null - || target.getBase() instanceof OfflinePlayer + || !target.isOnline() || (user.isTeleportRequestHere() && !target.isAuthorized("essentials.tpahere")) || (!user.isTeleportRequestHere() && !target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall")) ) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java index 7c13b80d4..b10f0a301 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java @@ -1,7 +1,6 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.OfflinePlayer; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -25,7 +24,7 @@ public class Commandtpo extends EssentialsCommand //Just basically the old tp command final User player = getPlayer(server, 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 e226f0702..6183bcf74 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java @@ -1,7 +1,6 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.OfflinePlayer; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -26,7 +25,7 @@ public class Commandtpohere extends EssentialsCommand final User player = getPlayer(server, 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/EssentialsCommand.java b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java index 13328e1b5..6bc0649e9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java +++ b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java @@ -3,7 +3,6 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.IEssentialsModule; -import com.earth2me.essentials.OfflinePlayer; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import java.util.List; @@ -31,7 +30,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand { this.ess = ess; } - + @Override public void setEssentialsModule(final IEssentialsModule module) { @@ -62,7 +61,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand final User user = ess.getUser(args[pos]); if (user != null) { - if (!getOffline && (user.getBase() instanceof OfflinePlayer || user.isHidden())) + if (!getOffline && (!user.isOnline() || user.isHidden())) { throw new NoSuchFieldException(_("playerNotFound")); } -- cgit v1.2.3 From adffbab6783aa016a7402ae20c922232389f18e1 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 12 Mar 2012 01:15:10 +0000 Subject: Adding jail time to /whois. --- Essentials/src/com/earth2me/essentials/commands/Commandwhois.java | 5 +++++ Essentials/src/messages.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_nl.properties | 1 + 8 files changed, 12 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java index d068aac9a..f9955cfb4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java @@ -62,6 +62,11 @@ public class Commandwhois extends EssentialsCommand { sender.sendMessage(_("whoisMoney", Util.displayCurrency(user.getMoney(), ess))); } + sender.sendMessage(_("whoisJail", (user.isJailed() + ? user.getJailTimeout() > 0 + ? Util.formatDateDiff(user.getJailTimeout()) + : _("true") + : _("false")))); sender.sendMessage(user.isAfk() ? _("whoisStatusAway") : _("whoisStatusAvailable")); diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 60b09b734..390cd3564 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -397,6 +397,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 0b8671379..23a8cd46f 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -397,6 +397,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 fac736f2b..3365afd38 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -397,6 +397,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 d1499aad8..171e022a0 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -397,6 +397,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 fbaba1cac..f33ca8b07 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -397,6 +397,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 0473b3ce4..420f40f46 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -397,6 +397,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 05a735949..60d1caaea 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -397,6 +397,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} -- cgit v1.2.3 From 2da802d4b7b73ecdacfe6a02ce9197a468c75cbc Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 12 Mar 2012 15:00:44 +0000 Subject: New permission: essentials.seen.banreason With this permission players can see why a user was banned, in /seen. --- .../earth2me/essentials/commands/Commandseen.java | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index 131d38f81..2783fb68e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -16,6 +16,17 @@ public class Commandseen extends EssentialsCommand @Override protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception + { + seen(server,sender,args,true); + } + + @Override + protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception + { + seen(server,user,args,user.isAuthorized("essentials.seen.banreason")); + } + + protected void seen (final Server server, final CommandSender sender, final String[] args, final boolean show) throws Exception { if (args.length < 1) { @@ -23,20 +34,20 @@ public class Commandseen extends EssentialsCommand } try { - User user = getPlayer(server, args, 0); - sender.sendMessage(_("seenOnline", user.getDisplayName(), Util.formatDateDiff(user.getLastLogin()))); + User player = getPlayer(server, args, 0); + sender.sendMessage(_("seenOnline", player.getDisplayName(), Util.formatDateDiff(player.getLastLogin()))); } catch (NoSuchFieldException e) { - User user = ess.getOfflineUser(args[0]); - if (user == null) + User player = ess.getOfflineUser(args[0]); + if (player == null) { throw new Exception(_("playerNotFound")); } - sender.sendMessage(_("seenOffline", user.getDisplayName(), Util.formatDateDiff(user.getLastLogout()))); - if (user.isBanned()) + sender.sendMessage(_("seenOffline", player.getDisplayName(), Util.formatDateDiff(player.getLastLogout()))); + if (player.isBanned()) { - sender.sendMessage(_("whoisBanned", user.getBanReason())); + sender.sendMessage(_("whoisBanned", show ? player.getBanReason() : _("true"))); } } } -- cgit v1.2.3 From c0490c08902dafe6db021f8ac5c08610f3a58d9e Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 12 Mar 2012 15:21:37 +0000 Subject: New TL Key, allow formatting/colouring of help output. --- .../src/com/earth2me/essentials/textreader/HelpInput.java | 10 +++++----- Essentials/src/messages.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_nl.properties | 1 + 8 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java index efe66d585..6d4efd811 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java @@ -50,7 +50,7 @@ public class HelpInput implements IText final String node = "essentials." + k.getKey(); if (!ess.getSettings().isCommandDisabled(k.getKey()) && user.isAuthorized(node)) { - lines.add("§c" + k.getKey() + "§7: " + k.getValue().get(DESCRIPTION)); + lines.add(_("helpLine", k.getKey(), k.getValue().get(DESCRIPTION))); } } else @@ -69,7 +69,7 @@ public class HelpInput implements IText } if (user.isAuthorized("essentials.help." + pluginName)) { - lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION)); + lines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } else if (permissions instanceof List && !((List)permissions).isEmpty()) { @@ -84,21 +84,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.isAuthorized(permissions.toString())) { - lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION)); + lines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } } else { if (!ess.getSettings().hidePermissionlessHelp()) { - lines.add("§c" + k.getKey() + "§7: " + value.get(DESCRIPTION)); + lines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } } } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 390cd3564..b41c3be0a 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -410,3 +410,4 @@ year=year years=years youAreHealed=\u00a77You have been healed. youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail. +helpLine=\u00a76/{0}\u00a7f: {1} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 23a8cd46f..7973ce9f0 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -410,3 +410,4 @@ year=\u00e5r years=\u00e5r youAreHealed=\u00a77Du er blevet healed. Halleluja! youHaveNewMail=\u00a7cDu har {0} flaskeposter!\u00a7f Type \u00a77/mail read for at se din flaskepost. +helpLine=\u00a76/{0}\u00a7f: {1} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 3365afd38..ed3bc4285 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -410,3 +410,4 @@ year=Jahr years=Jahre youAreHealed=\u00a77Du wurdest geheilt. youHaveNewMail=\u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen. +helpLine=\u00a76/{0}\u00a7f: {1} diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 171e022a0..e2582525f 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -410,3 +410,4 @@ year=year years=years youAreHealed=\u00a77You have been healed. youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail. +helpLine=\u00a76/{0}\u00a7f: {1} diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index f33ca8b07..bbbd5e787 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -410,3 +410,4 @@ year=año years=años youAreHealed=\u00a77Has sido curado. youHaveNewMail=\u00a7cTienes {0} mensajes!\u00a7f Pon \u00a77/mail read\u00a7f para ver tus emails no leidos!. +helpLine=\u00a76/{0}\u00a7f: {1} diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 420f40f46..c012a6242 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -410,3 +410,4 @@ year=ann\u00e9e years=ann\u00e9es youAreHealed=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9. youHaveNewMail=\u00a7cVous avez {0} messages ! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier. +helpLine=\u00a76/{0}\u00a7f: {1} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 60d1caaea..66f9a74c0 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -410,3 +410,4 @@ year=jaar years=jaren youAreHealed=\u00a77Je bent genezen. youHaveNewMail=\u00a7cJe hebt {0} berichten!\u00a7f Type \u00a77/mail read\u00a7f om je berichten te bekijken. +helpLine=\u00a76/{0}\u00a7f: {1} -- cgit v1.2.3 From dfbc1956c981c18b8331fbf52786982063657c97 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 12 Mar 2012 15:35:20 +0000 Subject: Fixing a few TL Keys --- Essentials/src/com/earth2me/essentials/UserData.java | 4 ++-- Essentials/src/com/earth2me/essentials/commands/Commandbreak.java | 3 ++- Essentials/src/com/earth2me/essentials/commands/Commandgive.java | 6 +++--- Essentials/src/com/earth2me/essentials/commands/Commandsudo.java | 7 +++---- Essentials/src/com/earth2me/essentials/commands/Commandtp.java | 3 +-- Essentials/src/messages.properties | 5 ++++- Essentials/src/messages_da.properties | 5 ++++- Essentials/src/messages_de.properties | 5 ++++- Essentials/src/messages_en.properties | 5 ++++- Essentials/src/messages_es.properties | 5 ++++- Essentials/src/messages_fr.properties | 5 ++++- Essentials/src/messages_nl.properties | 5 ++++- 12 files changed, 39 insertions(+), 19 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 1fdc98254..3b6516277 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -1,5 +1,6 @@ package com.earth2me.essentials; +import static com.earth2me.essentials.I18n._; import java.io.File; import java.util.*; import java.util.logging.Logger; @@ -176,8 +177,7 @@ public abstract class UserData extends PlayerExtension implements IConf } else { - //TODO: move this message to messages file - throw new Exception("Home " + name + " doesn't exist"); + throw new Exception(_("invalidHome", name)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java index 2691ad4f2..a03c24264 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.commands; +import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import org.bukkit.Material; import org.bukkit.Server; @@ -29,7 +30,7 @@ public class Commandbreak extends EssentialsCommand } if (block.getType() == Material.BEDROCK && !user.isAuthorized("essentials.break.bedrock")) { - 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/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java index d6e3d8f98..9db7d4da3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.commands; +import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.craftbukkit.InventoryWorkaround; import com.earth2me.essentials.User; import java.util.Locale; @@ -19,7 +20,6 @@ public class Commandgive extends EssentialsCommand super("give"); } - //TODO: move these messages to message file @Override public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { @@ -39,7 +39,7 @@ public class Commandgive extends EssentialsCommand : (!ess.getUser(sender).isAuthorized("essentials.itemspawn.exempt") && !ess.getUser(sender).canSpawnItem(stack.getTypeId())))) { - throw new Exception(ChatColor.RED + "You are not allowed to spawn the item " + itemname); + throw new Exception(_("cantSpawnItem", itemname)); } final User giveTo = getPlayer(server, args, 0); @@ -82,7 +82,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")); } final String itemName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' '); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java index d43d486b9..23083fa3d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.commands; +import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; import org.bukkit.Server; @@ -30,14 +31,12 @@ public class Commandsudo extends EssentialsCommand System.arraycopy(args, 2, arguments, 0, args.length - 2); } - //TODO: Translate this. if (user.isAuthorized("essentials.sudo.exempt")) { - throw new Exception("You cannot sudo this user"); + throw new Exception(_("sudoExempt")); } - //TODO: Translate this. - sender.sendMessage("Forcing " + user.getDisplayName() + " to run: /" + command + " " + getFinalArg(arguments, 0)); + 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/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java index 7ea3f0541..f65dc75f8 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java @@ -39,8 +39,7 @@ public class Commandtp extends EssentialsCommand default: if (!user.isAuthorized("essentials.tpohere")) { - //TODO: Translate this - throw new Exception("You need access to /tpohere to teleport other players."); + throw new Exception(_("needTpohere")); } user.sendMessage(_("teleporting")); final User target = getPlayer(server, args, 0); diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index b41c3be0a..b6bbae274 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -110,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 @@ -130,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. @@ -214,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. @@ -316,6 +319,7 @@ 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 suicideMessage=\u00a77Goodbye Cruel World... suicideSuccess= \u00a77{0} took their own life survival=survival @@ -410,4 +414,3 @@ year=year years=years youAreHealed=\u00a77You have been healed. youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail. -helpLine=\u00a76/{0}\u00a7f: {1} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 7973ce9f0..8f75f3a7b 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -110,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 @@ -130,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. @@ -214,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. @@ -316,6 +319,7 @@ 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 suicideMessage=\u00a77Farvel grusomme verden... suicideSuccess= \u00a77{0} tog sit eget liv survival=survival @@ -410,4 +414,3 @@ year=\u00e5r years=\u00e5r youAreHealed=\u00a77Du er blevet healed. Halleluja! youHaveNewMail=\u00a7cDu har {0} flaskeposter!\u00a7f Type \u00a77/mail read for at se din flaskepost. -helpLine=\u00a76/{0}\u00a7f: {1} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index ed3bc4285..b2e298442 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -110,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 +131,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. @@ -214,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. @@ -316,6 +319,7 @@ 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 suicideMessage=\u00a77Lebewohl grausame Welt... suicideSuccess= \u00a77{0} hat sich das Leben genommen. survival=survival @@ -410,4 +414,3 @@ year=Jahr years=Jahre youAreHealed=\u00a77Du wurdest geheilt. youHaveNewMail=\u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen. -helpLine=\u00a76/{0}\u00a7f: {1} diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index e2582525f..2afb11651 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -110,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 @@ -130,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. @@ -214,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. @@ -316,6 +319,7 @@ 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 suicideMessage=\u00a77Goodbye Cruel World... suicideSuccess= \u00a77{0} took their own life survival=survival @@ -410,4 +414,3 @@ year=year years=years youAreHealed=\u00a77You have been healed. youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail. -helpLine=\u00a76/{0}\u00a7f: {1} diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index bbbd5e787..9d5954263 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -110,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 @@ -130,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. @@ -214,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. @@ -316,6 +319,7 @@ 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 suicideMessage=\u00a77Adios mundo cruel... suicideSuccess= \u00a77{0} se quito su propia vida survival=survival @@ -410,4 +414,3 @@ year=año years=años youAreHealed=\u00a77Has sido curado. youHaveNewMail=\u00a7cTienes {0} mensajes!\u00a7f Pon \u00a77/mail read\u00a7f para ver tus emails no leidos!. -helpLine=\u00a76/{0}\u00a7f: {1} diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index c012a6242..b1dd7bc0c 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -110,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. @@ -130,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. @@ -214,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. @@ -316,6 +319,7 @@ 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 suicideMessage=\u00a77Au revoir monde cruel... suicideSuccess=\u00a77{0} s''est suicid\u00e9. survival=survie @@ -410,4 +414,3 @@ year=ann\u00e9e years=ann\u00e9es youAreHealed=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9. youHaveNewMail=\u00a7cVous avez {0} messages ! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier. -helpLine=\u00a76/{0}\u00a7f: {1} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 66f9a74c0..9d4af2810 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -110,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 @@ -130,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. @@ -214,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. @@ -316,6 +319,7 @@ 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 suicideMessage=\u00a77Vaarwel vreedzame wereld... suicideSuccess= \u00a77{0} pleegde zelfmoord survival=survival @@ -410,4 +414,3 @@ year=jaar years=jaren youAreHealed=\u00a77Je bent genezen. youHaveNewMail=\u00a7cJe hebt {0} berichten!\u00a7f Type \u00a77/mail read\u00a7f om je berichten te bekijken. -helpLine=\u00a76/{0}\u00a7f: {1} -- cgit v1.2.3 From dfd63a81acdae71b23bb40523bc40dbd58a4d75b Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 12 Mar 2012 16:50:32 +0000 Subject: Missed a TL key. --- Essentials/src/messages.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_nl.properties | 1 + 7 files changed, 7 insertions(+) diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index b6bbae274..146ab7736 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -320,6 +320,7 @@ 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 diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 8f75f3a7b..4a46b1302 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -320,6 +320,7 @@ 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 diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index b2e298442..aaeec37a4 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -320,6 +320,7 @@ 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 diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 2afb11651..ef3855714 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -320,6 +320,7 @@ 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 diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 9d5954263..ecee52869 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -320,6 +320,7 @@ 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 diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index b1dd7bc0c..c7898356d 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -320,6 +320,7 @@ 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 diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 9d4af2810..7a56a4e8d 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -320,6 +320,7 @@ 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 -- cgit v1.2.3 From a8937f7bf0a97276443473d6bd83d8045e0a112f Mon Sep 17 00:00:00 2001 From: ElgarL Date: Mon, 12 Mar 2012 22:18:25 +0000 Subject: Fix a globalgroup inheritance in groups.yml --- EssentialsGroupManager/src/groups.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EssentialsGroupManager/src/groups.yml b/EssentialsGroupManager/src/groups.yml index e50054c9f..ec8b0422f 100644 --- a/EssentialsGroupManager/src/groups.yml +++ b/EssentialsGroupManager/src/groups.yml @@ -24,7 +24,7 @@ groups: inheritance: - default - g:essentials_builder - - g:towny_moderator + - g:towny_builder info: prefix: '&2' build: true -- cgit v1.2.3 From 267495a4063ed57582e01fea8d5671c5a14f9681 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 13 Mar 2012 16:15:01 +0000 Subject: Fixing warp command costs. --- Essentials/src/com/earth2me/essentials/Trade.java | 18 ++++++++++++++---- .../com/earth2me/essentials/commands/Commandwarp.java | 5 ++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java index 3594c3137..fbdc471bd 100644 --- a/Essentials/src/com/earth2me/essentials/Trade.java +++ b/Essentials/src/com/earth2me/essentials/Trade.java @@ -158,11 +158,9 @@ public class Trade InventoryWorkaround.removeItem(user.getInventory(), true, true, getItemStack()); user.updateInventory(); } - if (command != null && !command.isEmpty() - && !user.isAuthorized("essentials.nocommandcost.all") - && !user.isAuthorized("essentials.nocommandcost." + command)) + if (command != null) { - final double cost = ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command); + final double cost = getCommandCost(user); if (!user.canAfford(cost) && cost > 0) { throw new ChargeException(_("notEnoughMoney")); @@ -194,6 +192,18 @@ public class Trade { return exp; } + + public Double getCommandCost(final IUser user) + { + double cost = 0d; + if (command != null && !command.isEmpty() + && !user.isAuthorized("essentials.nocommandcost.all") + && !user.isAuthorized("essentials.nocommandcost." + command)) + { + cost = ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command); + } + return cost; + } private static FileWriter fw = null; public static void log(String type, String subtype, String event, String sender, Trade charge, String receiver, Trade pay, Location loc, IEssentials ess) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java index 62641172b..84df12900 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java @@ -115,7 +115,10 @@ public class Commandwarp extends EssentialsCommand private void warpUser(final User owner, final User user, final String name) throws Exception { - final Trade charge = new Trade("warp-" + name.toLowerCase(Locale.ENGLISH).replace('_', '-'), ess); + final Trade chargeWarp = new Trade("warp-" + name.toLowerCase(Locale.ENGLISH).replace('_', '-'), ess); + final Trade chargeCmd = new Trade(this.getName(), ess); + final double fullCharge = chargeWarp.getCommandCost(user) + chargeCmd.getCommandCost(user); + final Trade charge = new Trade(fullCharge, ess); charge.isAffordableFor(owner); if (ess.getSettings().getPerWarpPermission() && !owner.isAuthorized("essentials.warp." + name)) { -- cgit v1.2.3 From 6cf2bb5cd9875a3f07fc9d66d771985489651bae Mon Sep 17 00:00:00 2001 From: ementalo Date: Wed, 14 Mar 2012 21:16:22 +0000 Subject: Adding permissions for overwriting exisitng warps essentials.warp.overwrite.[warpname] will allow overwrting of exsiting warps essentials.warp.overwrite.* for all warps Adding WarpNotFoundException class --- .../essentials/commands/Commandsetwarp.java | 21 ++++++++++++++++++++- .../essentials/commands/WarpNotFoundException.java | 15 +++++++++++++++ Essentials/src/messages.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_nl.properties | 1 + 9 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java index 1a7d27b4b..b39a7efcf 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; +import com.earth2me.essentials.Warps; import org.bukkit.Location; import org.bukkit.Server; @@ -26,7 +27,25 @@ public class Commandsetwarp extends EssentialsCommand } final Location loc = user.getLocation(); - ess.getWarps().setWarp(args[0], loc); + final Warps warps = ess.getWarps(); + Location warpLoc = null; + + try + { + warpLoc = warps.getWarp(args[0]); + } + catch (WarpNotFoundException ex) + { + } + + if (warpLoc == null || user.hasPermission("essentials.warp.overwrite." + args[0])) + { + warps.setWarp(args[0], loc); + } + else + { + throw new Exception(_("warpOverwrite")); + } user.sendMessage(_("warpSet", args[0])); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java b/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java new file mode 100644 index 000000000..9258bf926 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java @@ -0,0 +1,15 @@ +package com.earth2me.essentials.commands; + + +public class WarpNotFoundException extends Exception +{ + public WarpNotFoundException() + { + super("Warp not found"); + } + + public WarpNotFoundException(String message) + { + super(message); + } +} diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 146ab7736..0db1ab1b3 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -386,6 +386,7 @@ voiceSilenced=\u00a77Your voice has been silenced warpDeleteError=Problem deleting the warp file. warpListPermission=\u00a7cYou do not have Permission to list warps. warpNotExist=That warp does not exist. +warpOverwrite=\u00a7cYou cannot overwrite that warp. warpSet=\u00a77Warp {0} set. warpUsePermission=\u00a7cYou do not have Permission to use that warp. warpingTo=\u00a77Warping to {0}. diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 4a46b1302..6168b7bdb 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -386,6 +386,7 @@ voiceSilenced=\u00a77Din stemme er blevet gjort stille. warpDeleteError=Ah, shit; kunne sgu ikke fjerne warp-filen. Jeg giver en \u00c3\u00b8l i lufthavnen. warpListPermission=\u00a7cDu har ikke tilladelse til at vise listen over warps. warpNotExist=Den warp eksisterer ikke. +warpOverwrite=\u00a7cYou cannot overwrite that warp. warpSet=\u00a77Warp {0} sat. warpUsePermission=\u00a7cDu har ikke tilladelse til at benytte den warp. warpingTo=\u00a77Warper til {0}. diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index aaeec37a4..1ebac92ae 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -386,6 +386,7 @@ voiceSilenced=\u00a77Du bist stumm warpDeleteError=Fehler beim L\u00f6schen der Warp-Datei. warpListPermission=\u00a7cDu hast keine Berechtigung, die Warp-Punkte anzuzeigen. warpNotExist=Warp-Punkt existiert nicht. +warpOverwrite=\u00a7cYou cannot overwrite that warp. warpSet=\u00a77Warp-Punkt {0} wurde erstellt. warpUsePermission=\u00a7cDu hast keinen Zugriff f\u00fcr diesen Warp-Punkt. warpingTo=\u00a77Teleportiere zu Warp-Punkt {0}. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index ef3855714..e7433b943 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -386,6 +386,7 @@ voiceSilenced=\u00a77Your voice has been silenced warpDeleteError=Problem deleting the warp file. warpListPermission=\u00a7cYou do not have Permission to list that warps. warpNotExist=That warp does not exist. +warpOverwrite=\u00a7cYou cannot overwrite that warp. warpSet=\u00a77Warp {0} set. warpUsePermission=\u00a7cYou do not have Permission to use that warp. warpingTo=\u00a77Warping to {0}. diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index ecee52869..9ffe1fa6c 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -386,6 +386,7 @@ voiceSilenced=\u00a77Tu voz ha sido silenciada warpDeleteError=Problema al borrar el archivo de teletransporte. warpListPermission=\u00a7cNo tienes permiso para listar esos teletransportes. warpNotExist=Ese teletransporte no existe. +warpOverwrite=\u00a7cYou cannot overwrite that warp. warpSet=\u00a77Teletransporte {0} establecido. warpUsePermission=\u00a7cNo tienes permisos para usar ese teletransporte. warpingTo=\u00a77Teletransportandote a {0}. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index c7898356d..a65e79c52 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -386,6 +386,7 @@ voiceSilenced=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duit au silence. warpDeleteError=Probl\u00c3\u00a8me concernant la suppression du fichier warp. warpListPermission=\u00a7cVous n'avez pas la permission d'afficher la liste des points de t\u00e9l\u00e9portation. warpNotExist=Ce point de t\u00e9l\u00e9portation n'existe pas. +warpOverwrite=\u00a7cYou cannot overwrite that warp. warpSet=\u00a77Le point de t\u00e9l\u00e9portation {0} a \u00e9t\u00e9 cr\u00e9\u00e9. warpUsePermission=\u00a7cVous n'avez pas la permission d'utiliser ce point de t\u00e9l\u00e9portation. warpingTo=\u00a77T\u00e9l\u00e9portation vers {0}. diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 7a56a4e8d..b21185784 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -386,6 +386,7 @@ voiceSilenced=\u00a77Je kan niet meer praten warpDeleteError=Fout bij het verwijderen van het warp bestand. warpListPermission=\u00a7cJe hebt geen toegang om die warp te maken. warpNotExist=Die warp bestaat niet. +warpOverwrite=\u00a7cYou cannot overwrite that warp. warpSet=\u00a77Warp {0} ingesteld. warpUsePermission=\u00a7cOnbevoegd om die warp te gebruiken. warpingTo=\u00a77Aan het warpen naar {0}. -- cgit v1.2.3 From d3033716ca532fb2d327493a5af19a2bd30d57a1 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 15 Mar 2012 00:49:22 +0000 Subject: Add Griefcraft metrics to Essentials Warns on first start, and first staff join, and 5 minute warning before logging starts. --- .../src/com/earth2me/essentials/Essentials.java | 29 +- .../com/earth2me/essentials/EssentialsUpgrade.java | 11 + .../src/com/earth2me/essentials/ISettings.java | 4 + .../src/com/earth2me/essentials/Settings.java | 13 + .../com/earth2me/essentials/metrics/Metrics.java | 529 +++++++++++++++++++++ .../essentials/metrics/MetricsListener.java | 40 ++ .../essentials/metrics/MetricsStarter.java | 62 +++ 7 files changed, 682 insertions(+), 6 deletions(-) create mode 100644 Essentials/src/com/earth2me/essentials/metrics/Metrics.java create mode 100644 Essentials/src/com/earth2me/essentials/metrics/MetricsListener.java create mode 100644 Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index ccc90cb01..22ac04c6d 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -24,6 +24,8 @@ import com.earth2me.essentials.commands.EssentialsCommand; import com.earth2me.essentials.commands.IEssentialsCommand; import com.earth2me.essentials.commands.NoChargeException; import com.earth2me.essentials.commands.NotEnoughArgumentsException; +import com.earth2me.essentials.metrics.MetricsListener; +import com.earth2me.essentials.metrics.MetricsStarter; import com.earth2me.essentials.perm.PermissionsHandler; import com.earth2me.essentials.register.payment.Methods; import com.earth2me.essentials.signs.SignBlockListener; @@ -223,7 +225,7 @@ public class Essentials extends JavaPlugin implements IEssentials final EssentialsEntityListener entityListener = new EssentialsEntityListener(this); pm.registerEvents(entityListener, this); - + final EssentialsWorldListener worldListener = new EssentialsWorldListener(this); pm.registerEvents(worldListener, this); @@ -237,6 +239,18 @@ public class Essentials extends JavaPlugin implements IEssentials getScheduler().scheduleSyncRepeatingTask(this, timer, 1, 100); Economy.setEss(this); execTimer.mark("RegListeners"); + + final MetricsStarter metricsStarter = new MetricsStarter(this); + if (metricsStarter.getStart()) + { + getScheduler().scheduleAsyncDelayedTask(this, metricsStarter, 1); + } + else if (metricsStarter.getStart() == false) + { + final MetricsListener metricsListener = new MetricsListener(this, metricsStarter); + pm.registerEvents(metricsListener, this); + } + final String timeroutput = execTimer.end(); if (getSettings().isDebug()) { @@ -599,15 +613,16 @@ public class Essentials extends JavaPlugin implements IEssentials { return i18n; } - - private static class EssentialsWorldListener implements Listener, Runnable { + + + private static class EssentialsWorldListener implements Listener, Runnable + { private transient final IEssentials ess; public EssentialsWorldListener(final IEssentials ess) { this.ess = ess; } - @EventHandler(priority = EventPriority.LOW) public void onWorldLoad(final WorldLoadEvent event) @@ -616,7 +631,8 @@ public class Essentials extends JavaPlugin implements IEssentials ess.getWarps().reloadConfig(); for (IConf iConf : ((Essentials)ess).confList) { - if (iConf instanceof IEssentialsModule) { + if (iConf instanceof IEssentialsModule) + { iConf.reloadConfig(); } } @@ -629,7 +645,8 @@ public class Essentials extends JavaPlugin implements IEssentials ess.getWarps().reloadConfig(); for (IConf iConf : ((Essentials)ess).confList) { - if (iConf instanceof IEssentialsModule) { + if (iConf instanceof IEssentialsModule) + { iConf.reloadConfig(); } } diff --git a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java index f70f0c091..8bfec57d1 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java @@ -777,6 +777,16 @@ public class EssentialsUpgrade doneFile.setProperty("updateJailsToNewJailsConfig", true); doneFile.save(); } + + private void warnMetrics() { + if (doneFile.getBoolean("warnMetrics", false)) + { + return; + } + ess.getSettings().setMetricsEnabled(false); + doneFile.setProperty("warnMetrics", true); + doneFile.save(); + } public void beforeSettings() { @@ -800,5 +810,6 @@ public class EssentialsUpgrade deleteOldItemsCsv(); updateSpawnsToNewSpawnsConfig(); updateJailsToNewJailsConfig(); + warnMetrics(); } } diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index ec3941cd1..c5773404e 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -163,4 +163,8 @@ public interface ISettings extends IConf EventPriority getRespawnPriority(); long getTpaAcceptCancellation(); + + boolean isMetricsEnabled(); + + void setMetricsEnabled(boolean metricsEnabled); } diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index c9232f107..e0e2dd63b 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -23,6 +23,7 @@ public class Settings implements ISettings private final transient EssentialsConf config; private final static Logger logger = Logger.getLogger("Minecraft"); private final transient IEssentials ess; + private boolean metricsEnabled = true; public Settings(IEssentials ess) { @@ -718,4 +719,16 @@ public class Settings implements ISettings { return config.getLong("tpa-accept-cancellation", 0); } + + @Override + public boolean isMetricsEnabled() + { + return metricsEnabled; + } + + @Override + public void setMetricsEnabled(boolean metricsEnabled) + { + this.metricsEnabled = metricsEnabled; + } } diff --git a/Essentials/src/com/earth2me/essentials/metrics/Metrics.java b/Essentials/src/com/earth2me/essentials/metrics/Metrics.java new file mode 100644 index 000000000..3a43af70f --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/metrics/Metrics.java @@ -0,0 +1,529 @@ +package com.earth2me.essentials.metrics; + +/* + * Copyright 2011 Tyler Blair. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + * following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the authors and contributors and + * should not be interpreted as representing official policies, either expressed or implied, of anybody else. + */ +import org.bukkit.Bukkit; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.PluginDescriptionFile; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.net.Proxy; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.UUID; + + +/** + *

The metrics class obtains data about a plugin and submits statistics about it to the metrics backend.

+ * Public methods provided by this class:

+ * + * Graph createGraph(String name);
+ * void addCustomData(Metrics.Plotter plotter);
+ * void start();
+ *
+ */ +public class Metrics +{ + /** + * The current revision number + */ + private final static int REVISION = 5; + /** + * The base url of the metrics domain + */ + private static final String BASE_URL = "http://metrics.essentials3.net"; + /** + * The url used to report a server's status + */ + private static final String REPORT_URL = "/report/%s"; + /** + * The file where guid and opt out is stored in + */ + private static final String CONFIG_FILE = "plugins/PluginMetrics/config.yml"; + /** + * The separator to use for custom data. This MUST NOT change unless you are hosting your own version of metrics and + * want to change it. + */ + private static final String CUSTOM_DATA_SEPARATOR = "~~"; + /** + * Interval of time to ping (in minutes) + */ + private final static int PING_INTERVAL = 10; + /** + * The plugin this metrics submits for + */ + private final Plugin plugin; + /** + * All of the custom graphs to submit to metrics + */ + private final Set graphs = Collections.synchronizedSet(new HashSet()); + /** + * The default graph, used for addCustomData when you don't want a specific graph + */ + private final Graph defaultGraph = new Graph("Default"); + /** + * The plugin configuration file + */ + private final YamlConfiguration configuration; + /** + * Unique server id + */ + private final String guid; + + public Metrics(Plugin plugin) throws IOException + { + if (plugin == null) + { + throw new IllegalArgumentException("Plugin cannot be null"); + } + + this.plugin = plugin; + + // load the config + File file = new File(CONFIG_FILE); + configuration = YamlConfiguration.loadConfiguration(file); + + // add some defaults + configuration.addDefault("opt-out", false); + configuration.addDefault("guid", UUID.randomUUID().toString()); + + // Do we need to create the file? + if (configuration.get("guid", null) == null) + { + configuration.options().header("http://metrics.griefcraft.com").copyDefaults(true); + configuration.save(file); + } + + // Load the guid then + guid = configuration.getString("guid"); + } + + /** + * Construct and create a Graph that can be used to separate specific plotters to their own graphs on the metrics + * website. Plotters can be added to the graph object returned. + * + * @param name + * @return Graph object created. Will never return NULL under normal circumstances unless bad parameters are given + */ + public Graph createGraph(String name) + { + if (name == null) + { + throw new IllegalArgumentException("Graph name cannot be null"); + } + + // Construct the graph object + Graph graph = new Graph(name); + + // Now we can add our graph + graphs.add(graph); + + // and return back + return graph; + } + + /** + * Adds a custom data plotter to the default graph + * + * @param plotter + */ + public void addCustomData(Plotter plotter) + { + if (plotter == null) + { + throw new IllegalArgumentException("Plotter cannot be null"); + } + + // Add the plotter to the graph o/ + defaultGraph.addPlotter(plotter); + + // Ensure the default graph is included in the submitted graphs + graphs.add(defaultGraph); + } + + public boolean isOptOut() + { + return configuration.getBoolean("opt-out", false); + } + + /** + * Start measuring statistics. This will immediately create an async repeating task as the plugin and send the + * initial data to the metrics backend, and then after that it will post in increments of PING_INTERVAL * 1200 + * ticks. + */ + public void start() + { + // Did we opt out? + if (configuration.getBoolean("opt-out", false)) + { + return; + } + + // Begin hitting the server with glorious data + plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable() + { + private boolean firstPost = true; + + public void run() + { + try + { + // We use the inverse of firstPost because if it is the first time we are posting, + // it is not a interval ping, so it evaluates to FALSE + // Each time thereafter it will evaluate to TRUE, i.e PING! + postPlugin(!firstPost); + + // After the first post we set firstPost to false + // Each post thereafter will be a ping + firstPost = false; + } + catch (IOException e) + { + System.err.println("[Metrics] " + e.getMessage()); + } + } + }, 0, PING_INTERVAL * 1200); + } + + /** + * Generic method that posts a plugin to the metrics website + */ + private void postPlugin(boolean isPing) throws IOException + { + // The plugin's description file containg all of the plugin data such as name, version, author, etc + PluginDescriptionFile description = plugin.getDescription(); + + // Construct the post data + String data = encode("guid") + '=' + encode(guid) + + encodeDataPair("version", description.getVersion()) + + encodeDataPair("server", Bukkit.getVersion()) + + encodeDataPair("players", Integer.toString(Bukkit.getServer().getOnlinePlayers().length)) + + encodeDataPair("revision", String.valueOf(REVISION)); + + // If we're pinging, append it + if (isPing) + { + data += encodeDataPair("ping", "true"); + } + + // Acquire a lock on the graphs, which lets us make the assumption we also lock everything + // inside of the graph (e.g plotters) + synchronized (graphs) + { + Iterator iter = graphs.iterator(); + + while (iter.hasNext()) + { + Graph graph = iter.next(); + + // Because we have a lock on the graphs set already, it is reasonable to assume + // that our lock transcends down to the individual plotters in the graphs also. + // Because our methods are private, no one but us can reasonably access this list + // without reflection so this is a safe assumption without adding more code. + for (Plotter plotter : graph.getPlotters()) + { + // The key name to send to the metrics server + // The format is C-GRAPHNAME-PLOTTERNAME where separator - is defined at the top + // Legacy (R4) submitters use the format Custom%s, or CustomPLOTTERNAME + String key = String.format("C%s%s%s%s", CUSTOM_DATA_SEPARATOR, graph.getName(), CUSTOM_DATA_SEPARATOR, plotter.getColumnName()); + + // The value to send, which for the foreseeable future is just the string + // value of plotter.getValue() + String value = Integer.toString(plotter.getValue()); + + // Add it to the http post data :) + data += encodeDataPair(key, value); + } + } + } + + // Create the url + URL url = new URL(BASE_URL + String.format(REPORT_URL, description.getName())); + + // Connect to the website + URLConnection connection; + + // Mineshafter creates a socks proxy, so we can safely bypass it + // It does not reroute POST requests so we need to go around it + if (isMineshafterPresent()) + { + connection = url.openConnection(Proxy.NO_PROXY); + } + else + { + connection = url.openConnection(); + } + + connection.setDoOutput(true); + + // Write the data + OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream()); + writer.write(data); + writer.flush(); + + // Now read the response + BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + String response = reader.readLine(); + + // close resources + writer.close(); + reader.close(); + + if (response.startsWith("ERR")) + { + throw new IOException(response); //Throw the exception + } + else + { + // Is this the first update this hour? + if (response.contains("OK This is your first update this hour")) + { + synchronized (graphs) + { + Iterator iter = graphs.iterator(); + + while (iter.hasNext()) + { + Graph graph = iter.next(); + + for (Plotter plotter : graph.getPlotters()) + { + plotter.reset(); + } + } + } + } + } + //if (response.startsWith("OK")) - We should get "OK" followed by an optional description if everything goes right + } + + /** + * Check if mineshafter is present. If it is, we need to bypass it to send POST requests + * + * @return + */ + private boolean isMineshafterPresent() + { + try + { + Class.forName("mineshafter.MineServer"); + return true; + } + catch (Exception e) + { + return false; + } + } + + /** + *

Encode a key/value data pair to be used in a HTTP post request. This INCLUDES a & so the first key/value pair + * MUST be included manually, e.g:

+ * + * String httpData = encode("guid") + '=' + encode("1234") + encodeDataPair("authors") + ".."; + * + * + * @param key + * @param value + * @return + */ + private static String encodeDataPair(String key, String value) throws UnsupportedEncodingException + { + return '&' + encode(key) + '=' + encode(value); + } + + /** + * Encode text as UTF-8 + * + * @param text + * @return + */ + private static String encode(String text) throws UnsupportedEncodingException + { + return URLEncoder.encode(text, "UTF-8"); + } + + + /** + * Represents a custom graph on the website + */ + public static class Graph + { + /** + * The graph's name, alphanumeric and spaces only :) If it does not comply to the above when submitted, it is + * rejected + */ + private final String name; + /** + * The set of plotters that are contained within this graph + */ + private final Set plotters = new LinkedHashSet(); + + private Graph(String name) + { + this.name = name; + } + + /** + * Gets the graph's name + * + * @return + */ + public String getName() + { + return name; + } + + /** + * Add a plotter to the graph, which will be used to plot entries + * + * @param plotter + */ + public void addPlotter(Plotter plotter) + { + plotters.add(plotter); + } + + /** + * Remove a plotter from the graph + * + * @param plotter + */ + public void removePlotter(Plotter plotter) + { + plotters.remove(plotter); + } + + /** + * Gets an unmodifiable set of the plotter objects in the graph + * + * @return + */ + public Set getPlotters() + { + return Collections.unmodifiableSet(plotters); + } + + @Override + public int hashCode() + { + return name.hashCode(); + } + + @Override + public boolean equals(Object object) + { + if (!(object instanceof Graph)) + { + return false; + } + + Graph graph = (Graph)object; + return graph.name.equals(name); + } + } + + + /** + * Interface used to collect custom data for a plugin + */ + public static abstract class Plotter + { + /** + * The plot's name + */ + private final String name; + + /** + * Construct a plotter with the default plot name + */ + public Plotter() + { + this("Default"); + } + + /** + * Construct a plotter with a specific plot name + * + * @param name + */ + public Plotter(String name) + { + this.name = name; + } + + /** + * Get the current value for the plotted point + * + * @return + */ + public abstract int getValue(); + + /** + * Get the column name for the plotted point + * + * @return the plotted point's column name + */ + public String getColumnName() + { + return name; + } + + /** + * Called after the website graphs have been updated + */ + public void reset() + { + } + + @Override + public int hashCode() + { + return getColumnName().hashCode() + getValue(); + } + + @Override + public boolean equals(Object object) + { + if (!(object instanceof Plotter)) + { + return false; + } + + Plotter plotter = (Plotter)object; + return plotter.name.equals(name) && plotter.getValue() == getValue(); + } + } +} diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsListener.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsListener.java new file mode 100644 index 000000000..fb2db2e15 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsListener.java @@ -0,0 +1,40 @@ +package com.earth2me.essentials.metrics; + +import com.earth2me.essentials.IEssentials; +import com.earth2me.essentials.User; +import java.util.logging.Level; +import org.bukkit.Server; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerJoinEvent; + + +public class MetricsListener implements Listener +{ + private final transient Server server; + private final transient IEssentials ess; + private final transient MetricsStarter starter; + + public MetricsListener(final IEssentials parent, final MetricsStarter starter) + { + this.ess = parent; + this.server = parent.getServer(); + this.starter = starter; + } + + @EventHandler(priority = EventPriority.MONITOR) + public void onPlayerJoin(final PlayerJoinEvent event) + { + final User player = ess.getUser(event.getPlayer()); + if (ess.getSettings().isMetricsEnabled() == false && (player.isAuthorized("essentials.essentials") || player.isAuthorized("bukkit.broadcast.admin"))) + { + player.sendMessage("PluginMetrics collects minimal statistic data, starting in about 5 minutes."); + player.sendMessage("To opt out, edit plugins/PluginMetrics/config.yml."); + ess.getLogger().log(Level.INFO, "[Metrics] Admin join - Starting 5 minute opt-out period."); + ess.getSettings().setMetricsEnabled(true); + ess.getScheduler().scheduleAsyncDelayedTask(ess, starter, 5 * 1200); + } + } +} diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java new file mode 100644 index 000000000..a775f68f1 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -0,0 +1,62 @@ +package com.earth2me.essentials.metrics; + + +import com.earth2me.essentials.IEssentials; +import java.io.IOException; +import java.util.logging.Level; + + +public class MetricsStarter implements Runnable +{ + private final IEssentials ess; + private transient Boolean start; + + public MetricsStarter(final IEssentials plugin) + { + ess = plugin; + try + { + final Metrics metrics = new Metrics(ess); + + if (!metrics.isOptOut()) + { + if (ess.getSettings().isMetricsEnabled()) + { + start = true; + } + else + { + ess.getLogger().info("This plugin collects minimal statistic data and sends it to http://metrics.essentials3.net."); + ess.getLogger().info("You can opt out by changing plugins/PluginMetrics/config.yml, set opt-out to true."); + ess.getLogger().info("This will start 5 minutes after the first admin/op joins."); + start = false; + } + return; + } + } + catch (IOException e) + { + ess.getLogger().log(Level.WARNING, "[Metrics] " + e.getMessage(), e); + } + } + + @Override + public void run() + { + try + { + final Metrics metrics = new Metrics(ess); + metrics.start(); + + } + catch (IOException e) + { + ess.getLogger().log(Level.WARNING, "[Metrics] " + e.getMessage(), e); + } + } + + public Boolean getStart() + { + return start; + } +} \ No newline at end of file -- cgit v1.2.3 From 5e8fd3993da989d0905e5c5e29cf3f5dd889bf49 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 15 Mar 2012 01:17:12 +0000 Subject: Basic module graph. --- .../com/earth2me/essentials/EssentialsUpgrade.java | 9 +++--- .../essentials/metrics/MetricsStarter.java | 33 ++++++++++++++++++++-- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java index 8bfec57d1..bc0de9fa4 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java @@ -730,7 +730,7 @@ public class EssentialsUpgrade doneFile.setProperty("updateSpawnsToNewSpawnsConfig", true); doneFile.save(); } - + private void updateJailsToNewJailsConfig() { if (doneFile.getBoolean("updateJailsToNewJailsConfig", false)) @@ -777,13 +777,14 @@ public class EssentialsUpgrade doneFile.setProperty("updateJailsToNewJailsConfig", true); doneFile.save(); } - - private void warnMetrics() { + + private void warnMetrics() + { if (doneFile.getBoolean("warnMetrics", false)) { return; } - ess.getSettings().setMetricsEnabled(false); + ess.getSettings().setMetricsEnabled(false); doneFile.setProperty("warnMetrics", true); doneFile.save(); } diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index a775f68f1..347d74bf6 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.metrics; - import com.earth2me.essentials.IEssentials; +import com.earth2me.essentials.metrics.Metrics.Graph; import java.io.IOException; import java.util.logging.Level; @@ -11,6 +11,17 @@ public class MetricsStarter implements Runnable private final IEssentials ess; private transient Boolean start; + + private enum Modules + { + Essentials, + EssentialsChat, + EssentialsSpawn, + EssentialsProtect, + EssentialsGeoIP, + EssentialsXMPP + }; + public MetricsStarter(final IEssentials plugin) { ess = plugin; @@ -45,7 +56,25 @@ public class MetricsStarter implements Runnable { try { - final Metrics metrics = new Metrics(ess); + final Metrics metrics = new Metrics(ess); + + Graph moduleGraph = metrics.createGraph("Modules Used"); + for (Modules module : Modules.values()) + { + final String moduleName = module.toString(); + if (ess.getServer().getPluginManager().isPluginEnabled(moduleName)) + { + moduleGraph.addPlotter(new Metrics.Plotter(moduleName) + { + @Override + public int getValue() + { + return 1; + } + }); + } + } + metrics.start(); } -- cgit v1.2.3 From 8776f4c1c040d8636a180939d7b076c3a1045ffd Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 15 Mar 2012 01:32:08 +0000 Subject: Metrics errors aren't important. --- .../earth2me/essentials/metrics/MetricsStarter.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index 347d74bf6..120b22742 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -45,9 +45,9 @@ public class MetricsStarter implements Runnable return; } } - catch (IOException e) + catch (IOException ex) { - ess.getLogger().log(Level.WARNING, "[Metrics] " + e.getMessage(), e); + metricsError(ex); } } @@ -78,9 +78,21 @@ public class MetricsStarter implements Runnable metrics.start(); } - catch (IOException e) + catch (IOException ex) { - ess.getLogger().log(Level.WARNING, "[Metrics] " + e.getMessage(), e); + metricsError(ex); + } + } + + public void metricsError(IOException ex) + { + if (ess.getSettings().isDebug()) + { + ess.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage(), ex); + } + else + { + ess.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage()); } } -- cgit v1.2.3 From b85756f8b1d0b3a2d8b144b0cb7552b8d08d2092 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 15 Mar 2012 02:12:27 +0000 Subject: Adding some simple feature metrics. --- .../essentials/metrics/MetricsStarter.java | 55 ++++++++++++++++++---- 1 file changed, 47 insertions(+), 8 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index 120b22742..7c79b6406 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -2,7 +2,9 @@ package com.earth2me.essentials.metrics; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.metrics.Metrics.Graph; +import com.earth2me.essentials.metrics.Metrics.Plotter; import java.io.IOException; +import java.util.Locale; import java.util.logging.Level; @@ -64,17 +66,39 @@ public class MetricsStarter implements Runnable final String moduleName = module.toString(); if (ess.getServer().getPluginManager().isPluginEnabled(moduleName)) { - moduleGraph.addPlotter(new Metrics.Plotter(moduleName) - { - @Override - public int getValue() - { - return 1; - } - }); + moduleGraph.addPlotter(new SimplePlotter(moduleName)); } } + Graph localeGraph = metrics.createGraph("Locale"); + localeGraph.addPlotter(new SimplePlotter(ess.getI18n().getCurrentLocale().getDisplayLanguage(Locale.ENGLISH))); + + Graph featureGraph = metrics.createGraph("Features"); + featureGraph.addPlotter(new Plotter("Unique Accounts") + { + @Override + public int getValue() + { + return ess.getUserMap().getUniqueUsers(); + } + }); + featureGraph.addPlotter(new Plotter("Kits") + { + @Override + public int getValue() + { + return ess.getSettings().getKits().getKeys(false).size(); + } + }); + featureGraph.addPlotter(new Plotter("Warps") + { + @Override + public int getValue() + { + return ess.getWarps().getWarpNames().size(); + } + }); + metrics.start(); } @@ -100,4 +124,19 @@ public class MetricsStarter implements Runnable { return start; } + + + private class SimplePlotter extends Plotter + { + public SimplePlotter(final String name) + { + super(name); + } + + @Override + public int getValue() + { + return 1; + } + } } \ No newline at end of file -- cgit v1.2.3 From 5d79863cfc5cb72aa387a381cf8069cbd20a1c49 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 15 Mar 2012 02:12:43 +0000 Subject: Fixing setwarp command. --- Essentials/src/com/earth2me/essentials/Warps.java | 3 ++- Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java | 5 +++-- .../src/com/earth2me/essentials/commands/WarpNotFoundException.java | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Warps.java b/Essentials/src/com/earth2me/essentials/Warps.java index 57326b54a..ece987aba 100644 --- a/Essentials/src/com/earth2me/essentials/Warps.java +++ b/Essentials/src/com/earth2me/essentials/Warps.java @@ -1,6 +1,7 @@ package com.earth2me.essentials; import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.commands.WarpNotFoundException; import java.io.File; import java.util.*; import java.util.logging.Level; @@ -48,7 +49,7 @@ public class Warps implements IConf EssentialsConf conf = warpPoints.get(new StringIgnoreCase(warp)); if (conf == null) { - throw new Exception(_("warpNotExist")); + throw new WarpNotFoundException(); } return conf.getLocation(null, server); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java index b39a7efcf..42da62b85 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; import com.earth2me.essentials.Warps; import org.bukkit.Location; import org.bukkit.Server; @@ -34,11 +35,11 @@ public class Commandsetwarp extends EssentialsCommand { warpLoc = warps.getWarp(args[0]); } - catch (WarpNotFoundException ex) + catch (Exception ex) { } - if (warpLoc == null || user.hasPermission("essentials.warp.overwrite." + args[0])) + if (warpLoc == null || user.isAuthorized("essentials.warp.overwrite." + Util.sanitizeFileName(args[0]))) { warps.setWarp(args[0], loc); } diff --git a/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java b/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java index 9258bf926..bfba73818 100644 --- a/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java +++ b/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java @@ -1,11 +1,12 @@ package com.earth2me.essentials.commands; +import static com.earth2me.essentials.I18n._; public class WarpNotFoundException extends Exception { public WarpNotFoundException() { - super("Warp not found"); + super(_("warpNotExist")); } public WarpNotFoundException(String message) -- cgit v1.2.3 From d0d0117411c95bb188eff6af4779686382ce9472 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 15 Mar 2012 03:49:17 +0000 Subject: Add metric opt out toggle ingame. --- .../src/com/earth2me/essentials/Essentials.java | 18 ++++++++++++++--- .../src/com/earth2me/essentials/IEssentials.java | 6 ++++++ .../essentials/commands/Commandessentials.java | 23 ++++++++++++++++++++++ .../com/earth2me/essentials/metrics/Metrics.java | 18 +++++++++++++---- .../essentials/metrics/MetricsListener.java | 2 +- .../essentials/metrics/MetricsStarter.java | 18 +++++++++-------- 6 files changed, 69 insertions(+), 16 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 22ac04c6d..352c25b41 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -24,6 +24,7 @@ import com.earth2me.essentials.commands.EssentialsCommand; import com.earth2me.essentials.commands.IEssentialsCommand; import com.earth2me.essentials.commands.NoChargeException; import com.earth2me.essentials.commands.NotEnoughArgumentsException; +import com.earth2me.essentials.metrics.Metrics; import com.earth2me.essentials.metrics.MetricsListener; import com.earth2me.essentials.metrics.MetricsStarter; import com.earth2me.essentials.perm.PermissionsHandler; @@ -84,6 +85,7 @@ public class Essentials extends JavaPlugin implements IEssentials private transient UserMap userMap; private transient ExecuteTimer execTimer; private transient I18n i18n; + private transient Metrics metrics; @Override public ISettings getSettings() @@ -239,13 +241,13 @@ public class Essentials extends JavaPlugin implements IEssentials getScheduler().scheduleSyncRepeatingTask(this, timer, 1, 100); Economy.setEss(this); execTimer.mark("RegListeners"); - + final MetricsStarter metricsStarter = new MetricsStarter(this); - if (metricsStarter.getStart()) + if (metricsStarter.getStart() != null && metricsStarter.getStart() == true) { getScheduler().scheduleAsyncDelayedTask(this, metricsStarter, 1); } - else if (metricsStarter.getStart() == false) + else if (metricsStarter.getStart() != null && metricsStarter.getStart() == false) { final MetricsListener metricsListener = new MetricsListener(this, metricsStarter); pm.registerEvents(metricsListener, this); @@ -449,6 +451,16 @@ public class Essentials extends JavaPlugin implements IEssentials return backup; } + public Metrics getMetrics() + { + return metrics; + } + + public void setMetrics(Metrics metrics) + { + this.metrics = metrics; + } + @Override public User getUser(final Object base) { diff --git a/Essentials/src/com/earth2me/essentials/IEssentials.java b/Essentials/src/com/earth2me/essentials/IEssentials.java index 6b820440a..83c2e7325 100644 --- a/Essentials/src/com/earth2me/essentials/IEssentials.java +++ b/Essentials/src/com/earth2me/essentials/IEssentials.java @@ -1,6 +1,7 @@ package com.earth2me.essentials; import com.earth2me.essentials.api.IJails; +import com.earth2me.essentials.metrics.Metrics; import com.earth2me.essentials.perm.PermissionsHandler; import com.earth2me.essentials.register.payment.Methods; import org.bukkit.World; @@ -65,4 +66,9 @@ public interface IEssentials extends Plugin ItemDb getItemDb(); UserMap getUserMap(); + + Metrics getMetrics(); + + void setMetrics(Metrics metrics); + } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index ce2f03af9..bf1077c30 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -2,8 +2,12 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.Util; +import com.earth2me.essentials.metrics.Metrics; +import java.io.IOException; import java.util.HashMap; import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Server; @@ -40,6 +44,10 @@ public class Commandessentials extends EssentialsCommand { run_moo(server, sender, commandLabel, args); } + else if (args[0].equalsIgnoreCase("opt-out")) + { + run_optout(server, sender, commandLabel, args); + } else { run_reload(server, sender, commandLabel, args); } @@ -171,4 +179,19 @@ public class Commandessentials extends EssentialsCommand else sender.sendMessage(new String[]{" (__)", " (oo)", " /------\\/", " / | | |", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..." } ); } + + private void run_optout(final Server server, final CommandSender sender, final String command, final String args[]) + { + final Metrics metrics = ess.getMetrics(); + try + { + sender.sendMessage("Essentials collects simple metrics to highlight which features to concentrate work on in the future."); + metrics.setOptOut(!metrics.isOptOut()); + sender.sendMessage("Annonmous Metrics are now: " + (metrics.isOptOut() ? "disabled" : "enabled")); + } + catch (IOException ex) + { + sender.sendMessage("Unable to modify 'plugins/PluginMetrics/config.yml': " + ex.getMessage()); + } + } } diff --git a/Essentials/src/com/earth2me/essentials/metrics/Metrics.java b/Essentials/src/com/earth2me/essentials/metrics/Metrics.java index 3a43af70f..a5de7816c 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/Metrics.java +++ b/Essentials/src/com/earth2me/essentials/metrics/Metrics.java @@ -97,7 +97,11 @@ public class Metrics /** * The plugin configuration file */ - private final YamlConfiguration configuration; + private final YamlConfiguration configuration; + /** + * The plugin configuration file + */ + private final File configurationFile; /** * Unique server id */ @@ -113,8 +117,8 @@ public class Metrics this.plugin = plugin; // load the config - File file = new File(CONFIG_FILE); - configuration = YamlConfiguration.loadConfiguration(file); + configurationFile = new File(CONFIG_FILE); + configuration = YamlConfiguration.loadConfiguration(configurationFile); // add some defaults configuration.addDefault("opt-out", false); @@ -124,7 +128,7 @@ public class Metrics if (configuration.get("guid", null) == null) { configuration.options().header("http://metrics.griefcraft.com").copyDefaults(true); - configuration.save(file); + configuration.save(configurationFile); } // Load the guid then @@ -178,6 +182,12 @@ public class Metrics { return configuration.getBoolean("opt-out", false); } + + public void setOptOut(final boolean toggle) throws IOException + { + configuration.set("opt-out", toggle); + configuration.save(configurationFile); + } /** * Start measuring statistics. This will immediately create an async repeating task as the plugin and send the diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsListener.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsListener.java index fb2db2e15..4af8f9173 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsListener.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsListener.java @@ -31,7 +31,7 @@ public class MetricsListener implements Listener if (ess.getSettings().isMetricsEnabled() == false && (player.isAuthorized("essentials.essentials") || player.isAuthorized("bukkit.broadcast.admin"))) { player.sendMessage("PluginMetrics collects minimal statistic data, starting in about 5 minutes."); - player.sendMessage("To opt out, edit plugins/PluginMetrics/config.yml."); + player.sendMessage("To opt out, run /essentials opt-out"); ess.getLogger().log(Level.INFO, "[Metrics] Admin join - Starting 5 minute opt-out period."); ess.getSettings().setMetricsEnabled(true); ess.getScheduler().scheduleAsyncDelayedTask(ess, starter, 5 * 1200); diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index 7c79b6406..ddd4c197c 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -29,7 +29,9 @@ public class MetricsStarter implements Runnable ess = plugin; try { + final Metrics metrics = new Metrics(ess); + ess.setMetrics(metrics); if (!metrics.isOptOut()) { @@ -40,14 +42,14 @@ public class MetricsStarter implements Runnable else { ess.getLogger().info("This plugin collects minimal statistic data and sends it to http://metrics.essentials3.net."); - ess.getLogger().info("You can opt out by changing plugins/PluginMetrics/config.yml, set opt-out to true."); + ess.getLogger().info("You can opt out by running /essentials opt-out"); ess.getLogger().info("This will start 5 minutes after the first admin/op joins."); start = false; } return; } } - catch (IOException ex) + catch (Exception ex) { metricsError(ex); } @@ -58,9 +60,9 @@ public class MetricsStarter implements Runnable { try { - final Metrics metrics = new Metrics(ess); + final Metrics metrics = ess.getMetrics(); - Graph moduleGraph = metrics.createGraph("Modules Used"); + final Graph moduleGraph = metrics.createGraph("Modules Used"); for (Modules module : Modules.values()) { final String moduleName = module.toString(); @@ -70,10 +72,10 @@ public class MetricsStarter implements Runnable } } - Graph localeGraph = metrics.createGraph("Locale"); + final Graph localeGraph = metrics.createGraph("Locale"); localeGraph.addPlotter(new SimplePlotter(ess.getI18n().getCurrentLocale().getDisplayLanguage(Locale.ENGLISH))); - Graph featureGraph = metrics.createGraph("Features"); + final Graph featureGraph = metrics.createGraph("Features"); featureGraph.addPlotter(new Plotter("Unique Accounts") { @Override @@ -102,13 +104,13 @@ public class MetricsStarter implements Runnable metrics.start(); } - catch (IOException ex) + catch (Exception ex) { metricsError(ex); } } - public void metricsError(IOException ex) + public void metricsError(final Exception ex) { if (ess.getSettings().isDebug()) { -- cgit v1.2.3 From 45cf2ae9605732dc3d6da3195b8fcc83f8972e8a Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 15 Mar 2012 04:41:56 +0000 Subject: Make /spawner errors more descriptive. --- .../essentials/commands/Commandspawner.java | 47 ++++++++++------------ 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java index 1cd65a743..d2b50137d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java @@ -1,10 +1,7 @@ package com.earth2me.essentials.commands; +import com.earth2me.essentials.*; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.Mob; -import com.earth2me.essentials.Trade; -import com.earth2me.essentials.User; -import com.earth2me.essentials.Util; import java.util.Locale; import org.bukkit.Location; import org.bukkit.Material; @@ -34,34 +31,34 @@ public class Commandspawner extends EssentialsCommand throw new Exception(_("mobSpawnTarget")); } + String name = args[0]; + + Mob mob = null; + mob = Mob.fromName(name); + if (mob == null) + { + throw new Exception(_("invalidMob")); + } + if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH))) + { + throw new Exception(_("disabledToSpawnMob")); + } + if (!user.isAuthorized("essentials.spawner." + mob.name.toLowerCase(Locale.ENGLISH))) + { + throw new Exception(_("noPermToSpawnMob")); + } + final Trade charge = new Trade("spawner-" + mob.name.toLowerCase(Locale.ENGLISH), ess); + charge.isAffordableFor(user); try { - String name = args[0]; - - Mob mob = null; - mob = Mob.fromName(name); - if (mob == null) - { - user.sendMessage(_("invalidMob")); - return; - } - if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH))) - { - throw new Exception(_("unableToSpawnMob")); - } - if (!user.isAuthorized("essentials.spawner." + mob.name.toLowerCase(Locale.ENGLISH))) - { - throw new Exception(_("unableToSpawnMob")); - } - final Trade charge = new Trade("spawner-" + mob.name.toLowerCase(Locale.ENGLISH), ess); - charge.isAffordableFor(user); ((CreatureSpawner)target.getBlock().getState()).setSpawnedType(mob.getType()); - charge.charge(user); - user.sendMessage(_("setSpawner", mob.name)); } catch (Throwable ex) { throw new Exception(_("mobSpawnError"), ex); } + charge.charge(user); + user.sendMessage(_("setSpawner", mob.name)); + } } -- cgit v1.2.3 From e5e81eda72af4d8af5564b6aec43ee0a72067f26 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 15 Mar 2012 05:09:34 +0000 Subject: Make /nuke drop tnt from a more reasonable height. --- Essentials/src/com/earth2me/essentials/commands/Commandnuke.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java index 19695233e..60b1e3111 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java @@ -51,7 +51,7 @@ public class Commandnuke extends EssentialsCommand { for (int z = -10; z <= 10; z += 5) { - final Location tntloc = new Location(world, loc.getBlockX() + x, world.getMaxHeight(), loc.getBlockZ() + z); + final Location tntloc = new Location(world, loc.getBlockX() + x, world.getHighestBlockYAt(loc) + 64, loc.getBlockZ() + z); final TNTPrimed tnt = world.spawn(tntloc, TNTPrimed.class); } } -- cgit v1.2.3 From bada36be686ebe8ceac0edc461a6cd5f970d5a44 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 15 Mar 2012 06:42:58 +0000 Subject: Fix fake explosions. --- .../earth2me/essentials/TNTExplodeListener.java | 7 ++- .../essentials/craftbukkit/FakeExplosion.java | 51 ---------------------- .../protect/EssentialsProtectEntityListener.java | 7 ++- 3 files changed, 8 insertions(+), 57 deletions(-) delete mode 100644 Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java diff --git a/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java b/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java index 54e49ad5f..4187f835d 100644 --- a/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java +++ b/Essentials/src/com/earth2me/essentials/TNTExplodeListener.java @@ -1,6 +1,5 @@ package com.earth2me.essentials; -import com.earth2me.essentials.craftbukkit.FakeExplosion; import org.bukkit.entity.LivingEntity; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -46,8 +45,12 @@ public class TNTExplodeListener implements Listener, Runnable { return; } - FakeExplosion.createExplosion(event, ess.getServer(), ess.getServer().getOnlinePlayers()); + if (event.blockList().size() < 1) + { + return; + } event.setCancelled(true); + event.getLocation().getWorld().createExplosion(event.getLocation(), 0F); } @Override diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java deleted file mode 100644 index 934d94fa2..000000000 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.earth2me.essentials.craftbukkit; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -import net.minecraft.server.ChunkPosition; -import net.minecraft.server.Packet60Explosion; -import org.bukkit.Location; -import org.bukkit.Server; -import org.bukkit.block.Block; -import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.craftbukkit.CraftWorld; -import org.bukkit.entity.Player; -import org.bukkit.event.entity.EntityExplodeEvent; - - -public class FakeExplosion -{ - public static void createExplosion(final EntityExplodeEvent event, final Server server, final Player[] players) - { - try - { - final Set set = new HashSet(event.blockList().size()); - final List blocksUnderPlayers = new ArrayList(players.length); - final Location loc = event.getLocation(); - for (Player player : players) - { - if (player.getWorld().equals(loc.getWorld())) - { - blocksUnderPlayers.add(new ChunkPosition(player.getLocation().getBlockX(), player.getLocation().getBlockY() - 1, player.getLocation().getBlockZ())); - } - } - for (Block block : event.blockList()) - { - final ChunkPosition cp = new ChunkPosition(block.getX(), block.getY(), block.getZ()); - if (!blocksUnderPlayers.contains(cp)) - { - set.add(cp); - } - } - ((CraftServer)server).getHandle().sendPacketNearby(loc.getX(), loc.getY(), loc.getZ(), 64.0, ((CraftWorld)loc.getWorld()).getHandle().worldProvider.dimension, new Packet60Explosion(loc.getX(), loc.getY(), loc.getZ(), 3.0F, set)); - } - catch (Throwable ex) - { - Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex); - } - } -} diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index d19f48abb..fe3cadbbe 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -2,7 +2,6 @@ package com.earth2me.essentials.protect; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.User; -import com.earth2me.essentials.craftbukkit.FakeExplosion; import java.util.Locale; import org.bukkit.Material; import org.bukkit.block.Block; @@ -204,11 +203,11 @@ public class EssentialsProtectEntityListener implements Listener if (event.getEntity() instanceof EnderDragon && prot.getSettingBool(ProtectConfig.prevent_enderdragon_blockdmg)) { + event.setCancelled(true); if (prot.getSettingBool(ProtectConfig.enderdragon_fakeexplosions)) { - FakeExplosion.createExplosion(event, ess.getServer(), ess.getServer().getOnlinePlayers()); + event.getLocation().getWorld().createExplosion(event.getLocation(), 0F); } - event.setCancelled(true); return; } else if (event.getEntity() instanceof Creeper @@ -217,8 +216,8 @@ public class EssentialsProtectEntityListener implements Listener || (maxHeight >= 0 && event.getLocation().getBlockY() > maxHeight))) { //Nicccccccccce plaaacccccccccce.. - FakeExplosion.createExplosion(event, ess.getServer(), ess.getServer().getOnlinePlayers()); event.setCancelled(true); + event.getLocation().getWorld().createExplosion(event.getLocation(), 0F); return; } else if (event.getEntity() instanceof TNTPrimed -- cgit v1.2.3 From c513014732cc94473c746d3db5be33f773c417ca Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 15 Mar 2012 08:08:25 +0000 Subject: Graph a little bit extra information. --- Essentials/src/com/earth2me/essentials/Jails.java | 13 ++++++ .../src/com/earth2me/essentials/api/IJails.java | 2 + .../essentials/metrics/MetricsStarter.java | 54 +++++++++++++++++++++- .../essentials/perm/PermissionsHandler.java | 5 ++ 4 files changed, 73 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java index 7ca4d3bcd..65f486f42 100644 --- a/Essentials/src/com/earth2me/essentials/Jails.java +++ b/Essentials/src/com/earth2me/essentials/Jails.java @@ -146,6 +146,19 @@ public class Jails extends AsyncStorageObjectHolder getList() throws Exception; + int getCount(); + void removeJail(String jail) throws Exception; void sendToJail(com.earth2me.essentials.IUser user, String jail) throws Exception; diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index ddd4c197c..83ad84337 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.metrics; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.metrics.Metrics.Graph; import com.earth2me.essentials.metrics.Metrics.Plotter; -import java.io.IOException; +import com.earth2me.essentials.register.payment.Method; import java.util.Locale; import java.util.logging.Level; @@ -84,6 +84,14 @@ public class MetricsStarter implements Runnable return ess.getUserMap().getUniqueUsers(); } }); + featureGraph.addPlotter(new Plotter("Jails") + { + @Override + public int getValue() + { + return ess.getJails().getCount(); + } + }); featureGraph.addPlotter(new Plotter("Kits") { @Override @@ -101,6 +109,50 @@ public class MetricsStarter implements Runnable } }); + final Graph enabledGraph = metrics.createGraph("EnabledFeatures"); + enabledGraph.addPlotter(new SimplePlotter("Total")); + final String BKcommand = ess.getSettings().getBackupCommand(); + if (BKcommand != null && !"".equals(BKcommand)) + { + enabledGraph.addPlotter(new SimplePlotter("Backup")); + } + if (ess.getJails().getCount() > 0) + { + enabledGraph.addPlotter(new SimplePlotter("Jails")); + } + if (ess.getSettings().getKits().getKeys(false).size() > 0) + { + enabledGraph.addPlotter(new SimplePlotter("Kits")); + } + if (ess.getWarps().getWarpNames().size() > 0) + { + enabledGraph.addPlotter(new SimplePlotter("Warps")); + } + if (!ess.getSettings().areSignsDisabled()) + { + enabledGraph.addPlotter(new SimplePlotter("Signs")); + } + if (ess.getSettings().getAutoAfk() > 0) + { + enabledGraph.addPlotter(new SimplePlotter("AutoAFK")); + } + if (ess.getSettings().changeDisplayName()) + { + enabledGraph.addPlotter(new SimplePlotter("DisplayName")); + } + if (ess.getSettings().getChatRadius() >= 1) + { + enabledGraph.addPlotter(new SimplePlotter("LocalChat")); + } + + final Graph depGraph = metrics.createGraph("Dependancies"); + Method method = ess.getPaymentMethod().getMethod(); + if (method != null) + { + depGraph.addPlotter(new SimplePlotter(method.getName() + " " + method.getVersion())); + } + depGraph.addPlotter(new SimplePlotter(ess.getPermissionsHandler().getName())); + metrics.start(); } diff --git a/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java b/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java index a344968c2..e1bf13d10 100644 --- a/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java +++ b/Essentials/src/com/earth2me/essentials/perm/PermissionsHandler.java @@ -210,4 +210,9 @@ public class PermissionsHandler implements IPermissionsHandler { this.useSuperperms = useSuperperms; } + + public String getName() + { + return handler.getClass().getSimpleName().replace("Handler", ""); + } } -- cgit v1.2.3 From c09329e5be9e2b923abad716d2f94031dc8f1594 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 15 Mar 2012 09:15:28 +0100 Subject: :P --- Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index 83ad84337..d5f7d634a 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -145,7 +145,7 @@ public class MetricsStarter implements Runnable enabledGraph.addPlotter(new SimplePlotter("LocalChat")); } - final Graph depGraph = metrics.createGraph("Dependancies"); + final Graph depGraph = metrics.createGraph("Dependencies"); Method method = ess.getPaymentMethod().getMethod(); if (method != null) { -- cgit v1.2.3 From 5b930cdc3b99fdc1fa6a4d05334f674374767eef Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 15 Mar 2012 20:48:41 +1100 Subject: Restore [free] and [disposal] signs back to their intended behaviour --- .../src/com/earth2me/essentials/signs/SignDisposal.java | 5 +---- Essentials/src/com/earth2me/essentials/signs/SignFree.java | 11 +++-------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java index aa6376fa0..f44c6177a 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignDisposal.java @@ -14,10 +14,7 @@ public class SignDisposal extends EssentialsSign @Override protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) { - 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)); + player.getBase().openInventory(ess.getServer().createInventory(player, 36)); return true; } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java index f5f32c38c..c7adec307 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java @@ -35,14 +35,9 @@ public class SignFree extends EssentialsSign } 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); + 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; } -- cgit v1.2.3 From 79cd8d60659f7bb8e9ed8c851b7815c1b99dcacf Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 15 Mar 2012 20:51:51 +1100 Subject: Update minimum CraftBukkit version --- Essentials/src/com/earth2me/essentials/Essentials.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 352c25b41..2ba5a3909 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -69,7 +69,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 2015; + public static final int BUKKIT_VERSION = 2070; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); -- cgit v1.2.3 From cf000b04e40f9cd9d55cf425c9b50daa3b0e473f Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 15 Mar 2012 20:55:56 +1100 Subject: Fill the entire sign with free goodness --- Essentials/src/com/earth2me/essentials/signs/SignFree.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java index c7adec307..52e2b9540 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java @@ -34,8 +34,8 @@ public class SignFree extends EssentialsSign throw new SignException(_("cantSpawnItem", "Air")); } - item.setAmount(item.getType().getMaxStackSize()); - Inventory i = ess.getServer().createInventory(player, InventoryType.CHEST); + item.setAmount(item.getType().getMaxStackSize() * 36); + Inventory i = ess.getServer().createInventory(player, 36); i.addItem(item); player.openInventory(i); Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), sign.getBlock().getLocation(), ess); -- cgit v1.2.3 From 4a149855ab3eae05393299fbcfe99693842de532 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 15 Mar 2012 22:15:17 +0000 Subject: Updating Bukkit/CraftBukkit to match minimum ver. --- lib/bukkit.jar | Bin 4690989 -> 4706072 bytes lib/craftbukkit.jar | Bin 11039537 -> 11069383 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/bukkit.jar b/lib/bukkit.jar index 0b13c3119..5cc58ca1d 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index 8b32a634a..009194ab9 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From 5c280e7cb7a2eb7fd2cacf373db698c3b31f7c28 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 15 Mar 2012 22:23:26 +0000 Subject: Add missing methods. --- Essentials/src/com/earth2me/essentials/OfflinePlayer.java | 13 +++++++++++++ .../src/com/earth2me/essentials/craftbukkit/FakeWorld.java | 6 ++++++ Essentials/test/com/earth2me/essentials/FakeServer.java | 12 ++++++++++++ 3 files changed, 31 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index a1c46c3ea..6a88eb533 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -7,6 +7,7 @@ import lombok.Delegate; import org.bukkit.*; import org.bukkit.block.Block; import org.bukkit.conversations.Conversation; +import org.bukkit.conversations.ConversationAbandonedEvent; import org.bukkit.entity.*; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -1027,4 +1028,16 @@ public class OfflinePlayer implements Player { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public boolean isBlocking() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void abandonConversation(Conversation arg0, ConversationAbandonedEvent arg1) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java index 91e5d5239..fee9d41e3 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java @@ -627,4 +627,10 @@ public class FakeWorld implements World { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public void setBiome(int arg0, int arg1, Biome arg2) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials/test/com/earth2me/essentials/FakeServer.java b/Essentials/test/com/earth2me/essentials/FakeServer.java index 58fdfc5fe..1d025abe7 100644 --- a/Essentials/test/com/earth2me/essentials/FakeServer.java +++ b/Essentials/test/com/earth2me/essentials/FakeServer.java @@ -705,4 +705,16 @@ public class FakeServer implements Server { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public String getWorldType() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getGenerateStructures() + { + throw new UnsupportedOperationException("Not supported yet."); + } } -- cgit v1.2.3 From adf3755abb29b635977a2eb3ca4688dbd917d471 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 15 Mar 2012 23:15:19 +0000 Subject: Handle permission check failures better. --- .../src/com/earth2me/essentials/Essentials.java | 2 ++ Essentials/src/com/earth2me/essentials/User.java | 8 ++++++- .../essentials/perm/GroupManagerHandler.java | 25 ++++++++++++++++------ 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 2ba5a3909..684080f63 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -139,8 +139,10 @@ public class Essentials extends JavaPlugin implements IEssentials final int versionNumber = Integer.parseInt(versionMatch.group(1)); if (versionNumber < BUKKIT_VERSION && versionNumber > 100) { + LOGGER.log(Level.SEVERE, "* ! * ! * ! * ! * ! * ! * ! * ! * ! *"); LOGGER.log(Level.SEVERE, _("notRecommendedBukkit")); LOGGER.log(Level.SEVERE, _("requiredBukkit", Integer.toString(BUKKIT_VERSION))); + LOGGER.log(Level.SEVERE, "* ! * ! * ! * ! * ! * ! * ! * ! * ! *"); this.setEnabled(false); return; } diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 6a7feff07..8f6196e31 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -71,7 +71,13 @@ public class User extends UserData implements Comparable, IReplyTo, IUser return false; } - return ess.getPermissionsHandler().hasPermission(base, node); + try { + return ess.getPermissionsHandler().hasPermission(base, node); + } + catch (Exception ex) { + ess.getLogger().log(Level.SEVERE, "Permission System Error: " + ess.getPermissionsHandler().getName() + " returned: " + ex.getMessage()); + return false; + } } public void healCooldown() throws Exception diff --git a/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java b/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java index 8c3cdf1e2..23fe142b2 100644 --- a/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java +++ b/Essentials/src/com/earth2me/essentials/perm/GroupManagerHandler.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.perm; import java.util.Arrays; import java.util.List; import org.anjocaido.groupmanager.GroupManager; +import org.anjocaido.groupmanager.dataholder.worlds.WorldsHolder; import org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; @@ -20,7 +21,7 @@ public class GroupManagerHandler implements IPermissionsHandler @Override public String getGroup(final Player base) { - final AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base); + final AnjoPermissionsHandler handler = getHandler(base); if (handler == null) { return null; @@ -31,7 +32,7 @@ public class GroupManagerHandler implements IPermissionsHandler @Override public List getGroups(final Player base) { - final AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base); + final AnjoPermissionsHandler handler = getHandler(base); if (handler == null) { return null; @@ -42,7 +43,7 @@ public class GroupManagerHandler implements IPermissionsHandler @Override public boolean canBuild(final Player base, final String group) { - final AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base); + final AnjoPermissionsHandler handler = getHandler(base); if (handler == null) { return false; @@ -53,7 +54,7 @@ public class GroupManagerHandler implements IPermissionsHandler @Override public boolean inGroup(final Player base, final String group) { - AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base); + AnjoPermissionsHandler handler = getHandler(base); if (handler == null) { return false; @@ -64,7 +65,7 @@ public class GroupManagerHandler implements IPermissionsHandler @Override public boolean hasPermission(final Player base, final String node) { - AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base); + AnjoPermissionsHandler handler = getHandler(base); if (handler == null) { return false; @@ -75,7 +76,7 @@ public class GroupManagerHandler implements IPermissionsHandler @Override public String getPrefix(final Player base) { - AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base); + AnjoPermissionsHandler handler = getHandler(base); if (handler == null) { return null; @@ -86,11 +87,21 @@ public class GroupManagerHandler implements IPermissionsHandler @Override public String getSuffix(final Player base) { - AnjoPermissionsHandler handler = groupManager.getWorldsHolder().getWorldPermissions(base); + AnjoPermissionsHandler handler = getHandler(base); if (handler == null) { return null; } return handler.getUserSuffix(base.getName()); } + + private AnjoPermissionsHandler getHandler(final Player base) + { + final WorldsHolder holder = groupManager.getWorldsHolder(); + if (holder == null) + { + return null; + } + return holder.getWorldPermissions(base); + } } -- cgit v1.2.3 From baadd4b1cbe132c822d5f36da52225d843c0d584 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 16 Mar 2012 23:03:22 +0000 Subject: Adding reference to &k in MOTD. --- Essentials/src/com/earth2me/essentials/textreader/TextInput.java | 2 +- Essentials/src/info.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/textreader/TextInput.java b/Essentials/src/com/earth2me/essentials/textreader/TextInput.java index 316a0b576..6e9256b4c 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/TextInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/TextInput.java @@ -74,7 +74,7 @@ public class TextInput implements IText } if (line.length() > 0 && line.charAt(0) == '#') { - bookmarks.put(line.substring(1).toLowerCase(Locale.ENGLISH).replaceAll("&[0-9a-f]", ""), lineNumber); + bookmarks.put(line.substring(1).toLowerCase(Locale.ENGLISH).replaceAll("&[0-9a-fk]", ""), lineNumber); chapters.add(line.substring(1).replace('&', '§').replace("§§", "&")); } lines.add(line.replace('&', '§').replace("§§", "&")); diff --git a/Essentials/src/info.txt b/Essentials/src/info.txt index 0b4fb3c42..cfc037040 100644 --- a/Essentials/src/info.txt +++ b/Essentials/src/info.txt @@ -8,7 +8,7 @@ Name it info_username.txt or info_groupname.txt This also works with motd and rules. Extra pages: -Type /info Colours +Type /info Colors Type /info Tags If you have problem viewing this file ingame, try using /einfo. @@ -29,6 +29,7 @@ Minecraft colors: &4 &&4 &5 &&5 &6 &&6 &7 &&7 &8 &&8 &9 &&9 &a &&a &b &&b &c &&c &d &&d &e &&e &f &&f +&&k &k Magic! #Tags PLAYER: {PLAYER} -- cgit v1.2.3 From 87cd6930208560b206a32ec047c75342423c940a Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 17 Mar 2012 01:43:49 +0000 Subject: Adding Exp to /whois, shows total exp and ingame level. Due to the way minecraft calculates levels (flawed formula), its possible to not match calculated level. --- Essentials/src/com/earth2me/essentials/commands/Commandwhois.java | 2 ++ Essentials/src/messages.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_nl.properties | 1 + 8 files changed, 9 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java index f9955cfb4..8adc4c95c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; +import com.earth2me.essentials.craftbukkit.SetExpFix; import java.util.Locale; import org.bukkit.Server; import org.bukkit.command.CommandSender; @@ -54,6 +55,7 @@ public class Commandwhois extends EssentialsCommand sender.sendMessage(""); sender.sendMessage(_("whoisIs", user.getDisplayName(), user.getName())); sender.sendMessage(_("whoisHealth", user.getHealth())); + sender.sendMessage(_("whoisExp", SetExpFix.getTotalExperience(user), user.getLevel())); sender.sendMessage(_("whoisOP", (user.isOp() ? _("true") : _("false")))); sender.sendMessage(_("whoisGod", (user.isGodModeEnabled() ? _("true") : _("false")))); sender.sendMessage(_("whoisGamemode", _(user.getGameMode().toString().toLowerCase(Locale.ENGLISH)))); diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 0db1ab1b3..71922e49c 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -397,6 +397,7 @@ weatherStormFor=\u00a77You set the weather to storm in {0} for {1} seconds weatherSun=\u00a77You set the weather to sun in {0} weatherSunFor=\u00a77You set the weather to sun in {0} for {1} seconds whoisBanned=\u00a79 - Banned: {0} +whoisExp=\u00a79 - Exp: {0} (Level {1}) whoisGamemode=\u00a79 - Gamemode: {0} whoisGeoLocation=\u00a79 - Location: {0} whoisGod=\u00a79 - God mode: {0} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 6168b7bdb..f5ce209cb 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -397,6 +397,7 @@ weatherStormFor=\u00a77Du har sat vejret til ''storm'' i {0} i {1} sekunder weatherSun=\u00a77Du har sat vejret til ''sol'' i {0} weatherSunFor=\u00a77Du har sat vejret til ''sol'' i {0} i {1} sekunder whoisBanned=\u00a79 - Banned: {0} +whoisExp=\u00a79 - Exp: {0} (Level {1}) whoisGamemode=\u00a79 - Gamemode: {0} whoisGeoLocation=\u00a79 - Placering: {0} whoisGod=\u00a79 - God mode: {0} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 1ebac92ae..fbc93504e 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -416,3 +416,4 @@ year=Jahr years=Jahre youAreHealed=\u00a77Du wurdest geheilt. youHaveNewMail=\u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen. +whoisExp=\u00a79 - Exp: {0} (Level {1}) diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index e7433b943..09ee97a55 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -397,6 +397,7 @@ weatherStormFor=\u00a77You set the weather to storm in {0} for {1} seconds weatherSun=\u00a77You set the weather to sun in {0} weatherSunFor=\u00a77You set the weather to sun in {0} for {1} seconds whoisBanned=\u00a79 - Banned: {0} +whoisExp=\u00a79 - Exp: {0} (Level {1}) whoisGamemode=\u00a79 - Gamemode: {0} whoisGeoLocation=\u00a79 - Location: {0} whoisGod=\u00a79 - God mode: {0} diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 9ffe1fa6c..d9add11c0 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -397,6 +397,7 @@ weatherStormFor=\u00a77Has establecido el tiempo a tormenta en este {1} durante weatherSun=\u00a77Has establecido el tiempo a sol en este mundo. weatherSunFor=\u00a77Has establecido el tiempo a sol en este {1} durante {0} segundos. whoisBanned=\u00a79 - Banned: {0} +whoisExp=\u00a79 - Exp: {0} (Level {1}) whoisGamemode=\u00a79 - Gamemode: {0} whoisGeoLocation=\u00a79 - Localizacion: {0} whoisGod=\u00a79 - God mode: {0} diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index a65e79c52..78b1b894e 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -397,6 +397,7 @@ weatherStormFor=\u00a77Vous avez programm\u00e9 l''orage dans {0} pour {1} secon weatherSun=\u00a77Vous avez programm\u00e9 le beau temps dans {0} weatherSunFor=\u00a77Vous avez programm\u00e9 le beau temps dans {0} pour {1} secondes. whoisBanned=\u00a79 - Banni : {0} +whoisExp=\u00a79 - Exp: {0} (Level {1}) whoisGamemode=\u00a79 - Mode de jeu : {0} whoisGeoLocation=\u00a79 - Emplacement : {0} whoisGod=\u00a79 - Mode Dieu : {0} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index b21185784..9b855643a 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -397,6 +397,7 @@ weatherStormFor=\u00a77Je hebt het weer in de {0} naar storm gezet voor {1} seco weatherSun=\u00a77Je hebt het weer naar zon gezet in de {0} weatherSunFor=\u00a77Je hebt het weer in de {0} naar zon gezet voor {1} seconde whoisBanned=\u00a79 - Banned: {0} +whoisExp=\u00a79 - Exp: {0} (Level {1}) whoisGamemode=\u00a79 - Gamemode: {0} whoisGeoLocation=\u00a79 - Locatie: {0} whoisGod=\u00a79 - God mode: {0} -- cgit v1.2.3 From e4ce814c2f3ff919ad77d2b3845f996a09bfc327 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 17 Mar 2012 03:38:32 +0000 Subject: Comments to SetExpFix. --- Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java b/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java index 5b1161851..70d15b856 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java @@ -5,6 +5,8 @@ import org.bukkit.entity.Player; public class SetExpFix { + //This method is used to update both the recorded total experience and displayed total experience. + //We reset both types to prevent issues. public static void setTotalExperience(final Player player, final int exp) { if (exp < 0) @@ -14,6 +16,9 @@ public class SetExpFix player.setExp(0); player.setLevel(0); player.setTotalExperience(0); + + //This following code is technically redundant now, as bukkit now calulcates levels more or less correctly + //At larger numbers however... player.getExp(3000), only seems to give 2999, putting the below calculations off. int amount = exp; while (amount > 0) { @@ -44,6 +49,8 @@ public class SetExpFix return 7 + (level * 7 >> 1); } + //This method is required because the bukkit player.getTotalExperience() method, shows exp that has been 'spent'. + //Without this people would be able to use exp and then still sell it. public static int getTotalExperience(final Player player) { int exp = (int) (getExpToLevel(player) * player.getExp()); -- cgit v1.2.3 From 762105d69214eb0cd0db2c595b5e156455676cc5 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 17 Mar 2012 06:08:06 +0000 Subject: New permission: essentials.tp.others - Allows players to /tp replaces old reused permission. New permission usage: if world-teleport-permissions is true in the config, TP commands will now check for essentials.world. when a tp would switch worlds. --- Essentials/src/com/earth2me/essentials/commands/Commandtp.java | 9 +++++++-- Essentials/src/com/earth2me/essentials/commands/Commandtpa.java | 5 +++++ Essentials/src/com/earth2me/essentials/commands/Commandtpo.java | 5 +++++ .../src/com/earth2me/essentials/commands/Commandworld.java | 8 ++------ Essentials/src/config.yml | 2 +- Essentials/src/messages.properties | 1 - Essentials/src/messages_da.properties | 1 - Essentials/src/messages_de.properties | 1 - Essentials/src/messages_en.properties | 1 - Essentials/src/messages_es.properties | 1 - Essentials/src/messages_fr.properties | 1 - Essentials/src/messages_nl.properties | 1 - 12 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java index f65dc75f8..72739966b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java @@ -30,6 +30,11 @@ public class Commandtp extends EssentialsCommand { throw new Exception(_("teleportDisabled", player.getDisplayName())); } + if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + player.getWorld().getName())) + { + throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName())); + } user.sendMessage(_("teleporting")); final Trade charge = new Trade(this.getName(), ess); charge.isAffordableFor(user); @@ -37,9 +42,9 @@ public class Commandtp extends EssentialsCommand throw new NoChargeException(); default: - if (!user.isAuthorized("essentials.tpohere")) + if (!user.isAuthorized("essentials.tp.others")) { - throw new Exception(_("needTpohere")); + throw new Exception(_("noPerm", "essentials.tp.others")); } user.sendMessage(_("teleporting")); final User target = getPlayer(server, args, 0); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java index 34195d51a..97fa15d5c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java @@ -36,6 +36,11 @@ public class Commandtpa extends EssentialsCommand player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation())); } } + if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + player.getWorld().getName())) + { + throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName())); + } user.sendMessage(_("requestSent", player.getDisplayName())); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java index b10f0a301..5edbe274d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java @@ -32,6 +32,11 @@ public class Commandtpo extends EssentialsCommand // Verify permission if (!player.isHidden() || user.isAuthorized("essentials.teleport.hidden")) { + if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + player.getWorld().getName())) + { + throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName())); + } user.getTeleport().now(player, false, TeleportCause.COMMAND); user.sendMessage(_("teleporting")); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java index 41554c8ce..c160e0a7a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java @@ -54,13 +54,9 @@ public class Commandworld extends EssentialsCommand } } - if (ess.getSettings().getIsWorldTeleportPermissions()) + if (ess.getSettings().getIsWorldTeleportPermissions() && !user.isAuthorized("essentials.world." + world.getName())) { - if (!user.isAuthorized("essentials.world." + world.getName())) - { - user.sendMessage(_("invalidWorld")); //TODO: Make a "world teleport denied" translation - throw new NoChargeException(); - } + throw new Exception(_("noPerm", "essentials.world." + world.getName())); } double factor; diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 6a0f6e996..2bbb87afc 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -250,7 +250,7 @@ death-messages: true no-god-in-worlds: # - world_nether -# Set to true to enable per-world permissions for teleporting with /world +# Set to true to enable per-world permissions for teleporting with /world, /tp ,/tpa and /tpo. # Give someone permission to teleport to a world with essentials.world. world-teleport-permissions: false diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 71922e49c..02598c9cb 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -205,7 +205,6 @@ mutedPlayer=Player {0} muted. mutedPlayerFor=Player {0} muted for {1}. mutedUserSpeaks={0} tried to speak, but is muted. nearbyPlayers=Players nearby: {0} -needTpohere=You need access to /tpohere to teleport other players. negativeBalanceError=User is not allowed to have a negative balance. nickChanged=Nickname changed. nickDisplayName=\u00a77You have to enable change-displayname in Essentials config. diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index f5ce209cb..37bae113c 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -205,7 +205,6 @@ mutedPlayer=Spiller {0} muted. mutedPlayerFor=Spiller {0} muted i {1}. mutedUserSpeaks={0} pr\u00f8vede at snakke, men er muted. nearbyPlayers=Spillere i n\u00c3\u00a6rheden: {0} -needTpohere=Du skal have adgang til /tpohere for at teleportere andre spillere. negativeBalanceError=Brugeren har ikke tilladelse til at have en negativ saldo. nickChanged=Nickname \u00e6ndret. nickDisplayName=\u00a77Du bliver n\u00c3\u00b8dt til at aktivere change-displayname i Essentials config. diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index fbc93504e..99501d2e5 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -205,7 +205,6 @@ mutedPlayer=Player {0} ist nun stumm. mutedPlayerFor=Player {0} ist nun stumm f\u00fcr {1}. mutedUserSpeaks={0} versuchte zu sprechen, aber ist stumm geschaltet. nearbyPlayers=Players nearby: {0} -needTpohere=Du brauchst Zugriff auf /tpohere um andere Spieler teleportieren zu k\u00f6nnen. negativeBalanceError=Spieler darf keine Schulden machen. nickChanged=Nickname ge\u00e4ndert. nickDisplayName=\u00a77Du musst \u00a7fchange-displayname\u00a7c in der Essentials-Config aktivieren. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 09ee97a55..6f4d29020 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -205,7 +205,6 @@ mutedPlayer=Player {0} muted. mutedPlayerFor=Player {0} muted for {1}. mutedUserSpeaks={0} tried to speak, but is muted. nearbyPlayers=Players nearby: {0} -needTpohere=You need access to /tpohere to teleport other players. negativeBalanceError=User is not allowed to have a negative balance. nickChanged=Nickname changed. nickDisplayName=\u00a77You have to enable change-displayname in Essentials config. diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index d9add11c0..f1609f7f9 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -205,7 +205,6 @@ mutedPlayer=Player {0} silenciado. mutedPlayerFor=Player {0} silenciado durante {1}. mutedUserSpeaks={0} intento hablar, pero esta silenciado. nearbyPlayers=Players nearby: {0} -needTpohere=Necesitas acceso a /tpohere para teletransportar a otros jugadores. negativeBalanceError=El usuario no tiene permitido tener un saldo negativo. nickChanged=Nombre de jugador cambiado. nickDisplayName=\u00a77Tienes que habilitar cambio de nombre de usuario en la configuracion de Essentials. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 78b1b894e..4e33fa061 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -205,7 +205,6 @@ mutedPlayer=Le joueur {0} est d\u00e9sormais muet. mutedPlayerFor={0} a \u00e9t\u00e9 muet pour {1}. mutedUserSpeaks={0} a essay\u00e9 de parler mais est muet. nearbyPlayers=Joueurs dans les environs : {0} -needTpohere=Vous avez besoin de l'acc\u00c3\u00a8s \u00e0 /tpohere pour t\u00e9l\u00e9porter d'autres joueurs. negativeBalanceError=L'utilisateur n'est pas autoris\u00e9 \u00e0 avoir un solde n\u00e9gatif. nickChanged=surnom modifi\u00e9. nickDisplayName=\u00a77Vous devez activer change-displayname dans la configuration Essentials. diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 9b855643a..c08111085 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -205,7 +205,6 @@ mutedPlayer=Speler {0} gemute. mutedPlayerFor=Speler {0} is gemute voor {1}. mutedUserSpeaks={0} probeerde te praten, maar is gemute. nearbyPlayers=Players nearby: {0} -needTpohere=Je moet toegang krijgen tot /tpohere om naar andere spelers te teleporteren. negativeBalanceError=Speler is niet toegestaan om een negatief saldo te hebben. nickChanged=Nickname veranderd. nickDisplayName=\u00a77You have to enable change-displayname in Essentials config. -- cgit v1.2.3 From 12cb4fd5f8f92fd05a375ee1c81d92c7eca44ff7 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sat, 17 Mar 2012 11:12:32 +0100 Subject: Fix bukkit download url --- Essentials/src/messages_en.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 6f4d29020..0a64b2308 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -298,7 +298,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 -- cgit v1.2.3 From ca11d4d98b2467cb400dea039cd6ec25261a6cf9 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sat, 17 Mar 2012 11:15:28 +0100 Subject: Fix bukkit download url --- Essentials/src/messages_da.properties | 2 +- Essentials/src/messages_de.properties | 2 +- Essentials/src/messages_es.properties | 2 +- Essentials/src/messages_fr.properties | 2 +- Essentials/src/messages_nl.properties | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 37bae113c..fd4803d3f 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -298,7 +298,7 @@ requestDenied=\u00a77Anmodning om teleport afvist. requestDeniedFrom=\u00a77{0} afviste din anmodning om teleport. requestSent=\u00a77Anmodning sendt til {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=sekund seconds=sekunder diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 99501d2e5..767f028fd 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -298,7 +298,7 @@ requestDenied=\u00a77Teleportierungsanfrage verweigert. requestDeniedFrom=\u00a77{0} hat deine Teleportierungsanfrage abgelehnt. requestSent=\u00a77Anfrage gesendet an {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=Sekunde seconds=Sekunden diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index f1609f7f9..6356bfbff 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -298,7 +298,7 @@ requestDenied=\u00a77Peticion de teletransporte denegada. requestDeniedFrom=\u00a77{0} ha denegado tu peticion de teletransporte. requestSent=\u00a77Peticion enviada a {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=segundo seconds=segundos diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 4e33fa061..e92efb181 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -298,7 +298,7 @@ requestDenied=\u00a77Demande de t\u00e9l\u00e9portation refus\u00e9e. requestDeniedFrom=\u00a77{0} a refus\u00e9 votre demande de t\u00e9l\u00e9portation. requestSent=\u00a77Requ\u00eate envoy\u00e9e \u00e0 {0}\u00a77. requestTimedOut=\u00a7cLa de mande de t\u00e9l\u00e9portation a expir\u00e9. -requiredBukkit=* ! * Vous avez besoin au moins de la version {0} de CraftBukkit. T\u00e9l\u00e9chargez-la ici http://ci.bukkit.org. +requiredBukkit=* ! * Vous avez besoin au moins de la version {0} de CraftBukkit. T\u00e9l\u00e9chargez-la ici http://dl.bukkit.org/downloads/craftbukkit/ returnPlayerToJailError=Error occurred when trying to return player {0} to jail: {1} second=seconde seconds=secondes diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index c08111085..5ab703d99 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -298,7 +298,7 @@ requestDenied=\u00a77Teleporteer aanvraag geweigerd. requestDeniedFrom=\u00a77{0} denied your teleport request. requestSent=\u00a77Aanvraag verstuurd naar {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=seconde seconds=seconde -- cgit v1.2.3 From b72083fb186504b88aad84c9b4df4b5349602c77 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 17 Mar 2012 12:37:23 +0000 Subject: Removed some debug spam. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index b8b05c1b4..13cbf98c6 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -149,4 +149,5 @@ v 1.9: - Make 'manload' reload the config correctly. - Minor optimization when checking bukkit permissions. - Better reporting when a users.yml is failing to load. - - Expanded '/manuadd'to accept an optional variable for the world (eg '/manuadd '). \ No newline at end of file + - Expanded '/manuadd'to accept an optional variable for the world (eg '/manuadd '). + - Removed some debug spam. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java index 30fe3f709..217ab904e 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java @@ -243,7 +243,6 @@ public class User extends DataUnit implements Cloneable { //UserVariables temp = new UserVariables(this, varList); variables.clearVars(); for (String key : varList.keySet()) { - System.out.print("Adding variable - " + key); variables.addVar(key, varList.get(key)); } flagAsChanged(); -- cgit v1.2.3 From 6476158462650c9dea305c2e3892e976a258a529 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 17 Mar 2012 15:56:40 +0000 Subject: Don't remove an attachment on a player leaving as Bukkit never forgets it. This fixes non mirrored permissions being messed up if a player relogs. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../dataholder/worlds/WorldsHolder.java | 26 +--------------------- .../permissions/BukkitPermissions.java | 12 ++-------- 3 files changed, 5 insertions(+), 36 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 13cbf98c6..6bedf7e90 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -150,4 +150,5 @@ v 1.9: - Minor optimization when checking bukkit permissions. - Better reporting when a users.yml is failing to load. - Expanded '/manuadd'to accept an optional variable for the world (eg '/manuadd '). - - Removed some debug spam. \ No newline at end of file + - Removed some debug spam. + - Don't remove an attachment on a player leaving as Bukkit never forgets it. This fixes non mirrored permissions being messed up if a player relogs. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java index e72118468..290a58388 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java @@ -347,32 +347,8 @@ public class WorldsHolder { String worldNameLowered = worldName.toLowerCase(); // Find this worlds data - if (worldsData.containsKey(worldNameLowered)) { - - String usersMirror = mirrorsUser.get(worldNameLowered); - String groupsMirror = mirrorsGroup.get(worldNameLowered); - - if (usersMirror != null) { - - // If both are mirrored - if (groupsMirror != null) { - - // if the data sources are the same, return the parent - if (usersMirror == groupsMirror) - return getUpdatedWorldData(usersMirror.toLowerCase()); - - // Both data sources are mirrors, but they are from different parents - // so we return the actual data object. - return getUpdatedWorldData(worldNameLowered); - } - - // Groups isn't a mirror so return this this worlds data source - return getUpdatedWorldData(worldNameLowered); - } - - // users isn't mirrored so we need to return this worlds data source + if (worldsData.containsKey(worldNameLowered)) return getUpdatedWorldData(worldNameLowered); - } // Oddly no data source was found for this world so return the default. GroupManager.logger.finest("Requested world " + worldName + " not found or badly mirrored. Returning default world..."); diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index 0b6148900..dc08168dc 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -26,6 +26,7 @@ import java.util.List; import java.util.ListIterator; import java.util.Map; import java.util.Set; +import java.util.WeakHashMap; import org.anjocaido.groupmanager.GroupManager; @@ -37,7 +38,6 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerChangedWorldEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerKickEvent; -import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.server.PluginDisableEvent; import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.permissions.Permission; @@ -54,7 +54,7 @@ import org.bukkit.plugin.PluginManager; */ public class BukkitPermissions { - protected Map attachments = new HashMap(); + protected WeakHashMap attachments = new WeakHashMap(); protected LinkedHashMap registeredPermissions = new LinkedHashMap(); protected GroupManager plugin; protected boolean dumpAllPermissions = true; @@ -368,14 +368,6 @@ public class BukkitPermissions { updatePermissions(event.getPlayer(), event.getPlayer().getWorld().getName()); } - @EventHandler(priority = EventPriority.LOWEST) - public void onPlayerQuit(PlayerQuitEvent event) { - if (!GroupManager.isLoaded()) - return; - - attachments.remove(event.getPlayer()); - } - @EventHandler(priority = EventPriority.LOWEST) public void onPlayerKick(PlayerKickEvent event) { attachments.remove(event.getPlayer()); -- cgit v1.2.3 From 17be04cd99521565448e606d21c123f3c498c153 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 17 Mar 2012 20:23:46 +0000 Subject: Error and info cleanup. --- Essentials/src/com/earth2me/essentials/Essentials.java | 7 ++----- .../earth2me/essentials/storage/AbstractDelayedYamlFileReader.java | 7 +++++-- .../earth2me/essentials/storage/AbstractDelayedYamlFileWriter.java | 1 - Essentials/src/config.yml | 1 + 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 684080f63..05e5df1aa 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -35,10 +35,8 @@ import com.earth2me.essentials.signs.SignPlayerListener; import java.io.File; import java.io.FileReader; import java.io.IOException; -import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; @@ -48,7 +46,6 @@ import org.bukkit.ChatColor; import org.bukkit.Server; import org.bukkit.World; import org.bukkit.command.Command; -import org.bukkit.command.CommandException; import org.bukkit.command.CommandSender; import org.bukkit.command.PluginCommand; import org.bukkit.entity.Player; @@ -139,10 +136,10 @@ public class Essentials extends JavaPlugin implements IEssentials final int versionNumber = Integer.parseInt(versionMatch.group(1)); if (versionNumber < BUKKIT_VERSION && versionNumber > 100) { - LOGGER.log(Level.SEVERE, "* ! * ! * ! * ! * ! * ! * ! * ! * ! *"); + LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *"); LOGGER.log(Level.SEVERE, _("notRecommendedBukkit")); LOGGER.log(Level.SEVERE, _("requiredBukkit", Integer.toString(BUKKIT_VERSION))); - LOGGER.log(Level.SEVERE, "* ! * ! * ! * ! * ! * ! * ! * ! * ! *"); + LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *"); this.setEnabled(false); return; } diff --git a/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java b/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java index d48b4a060..83452884b 100644 --- a/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java +++ b/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java @@ -14,7 +14,7 @@ public abstract class AbstractDelayedYamlFileReader imp { private final transient File file; private final transient Class clazz; - private final transient Plugin plugin; + protected final transient IEssentials plugin; public AbstractDelayedYamlFileReader(final IEssentials ess, final File file, final Class clazz) { @@ -54,7 +54,10 @@ public abstract class AbstractDelayedYamlFileReader imp catch (FileNotFoundException ex) { onException(); - Bukkit.getLogger().log(Level.INFO, "File not found: " + file.toString()); + if (plugin.getSettings() == null || plugin.getSettings().isDebug()) + { + Bukkit.getLogger().log(Level.INFO, "File not found: " + file.toString()); + } } catch (ObjectLoadException ex) { diff --git a/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileWriter.java b/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileWriter.java index 697ef7730..e8b3992ae 100644 --- a/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileWriter.java +++ b/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileWriter.java @@ -5,7 +5,6 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.logging.Level; -import java.util.logging.Logger; import org.bukkit.Bukkit; diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 2bbb87afc..3aea83772 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -175,6 +175,7 @@ kits: # Essentials Sign Control # See http://ess.khhq.net/wiki/Sign_Tutorial for instructions on how to use these. # To enable signs, remove # symbol. To disable all signs, comment/remove each sign. +# If there are no signs enabled, all sign features will be disabled including sign colours. # We recommend not enabling chest protection signs if you don't intend to use them, (or are using LWC/Lockette). enabledSigns: -- cgit v1.2.3 From 14bce8fd82b5b814b51d13fa1a48446d7805d305 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 18 Mar 2012 03:01:44 +0000 Subject: Shorten help messages. --- Essentials/src/plugin.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 27541d782..5f2091605 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -242,8 +242,8 @@ commands: usage: / 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: / [l:|a:|r:|c:|d:][command] [arguments] + description: Assigns a command to the item in hand. + usage: / [l:|a:|r:|c:|d:][command] [arguments] - {player} can be replaced by name of a clicked player. aliases: [pt,epowertool,ept] powertooltoggle: description: Enables or disables all current powertools @@ -258,7 +258,7 @@ commands: usage: / aliases: [er,reply,ereply] realname: - description: Displays the username of a user based on nickname. + description: Displays the username of a user based on nick. usage: / aliases: [erealname] remove: @@ -330,7 +330,7 @@ commands: usage: / [day|night|dawn|17:30|4pm|4000ticks] [worldname|all] aliases: [etime, day, night] togglejail: - description: Prevents a player from interacting with the world and teleports him/her to the jail specified + description: Jails/Unjails a player and tp them to the jail specified. usage: / [datediff] aliases: [tjail,jail,ejail,unjail,eunjail,etogglejail] top: -- cgit v1.2.3 From c80605995858aa26a72d2e38d1ce3dec3889046a Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 18 Mar 2012 03:29:49 +0000 Subject: Only show nickname update message in debug mode. --- Essentials/src/com/earth2me/essentials/User.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 8f6196e31..b9f5198dc 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -326,7 +326,9 @@ public class User extends UserData implements Comparable, IReplyTo, IUser } catch (IllegalArgumentException e) { - logger.log(Level.INFO, "Playerlist for " + name + " was not updated. Use a shorter displayname prefix."); + if (ess.getSettings().isDebug()) { + logger.log(Level.INFO, "Playerlist for " + name + " was not updated. Name clashed with another online player."); + } } } -- cgit v1.2.3 From 07f859e38bf524ed2360826e0c8c3a450420237c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 18 Mar 2012 17:15:46 +0000 Subject: Missing kit time check from [kit] signs. --- Essentials/src/com/earth2me/essentials/signs/SignKit.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Essentials/src/com/earth2me/essentials/signs/SignKit.java b/Essentials/src/com/earth2me/essentials/signs/SignKit.java index 102bd01b9..c1a4cd0fd 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignKit.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignKit.java @@ -57,6 +57,7 @@ public class SignKit extends EssentialsSign try { final Map kit = ess.getSettings().getKit(kitName); + Kit.checkTime(player, kitName, kit); final List items = Kit.getItems(player, kit); Kit.expandItems(ess, player, items); charge.charge(player); -- cgit v1.2.3 From 970364886c4bf2400460c4903381ba295f89dfac Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 19 Mar 2012 08:21:39 +0000 Subject: Add 'color' sign type to config file. Enforce colour permission on signs when essentials signs are enabled. --- Essentials/src/com/earth2me/essentials/Settings.java | 10 +++++++++- .../src/com/earth2me/essentials/signs/SignBlockListener.java | 11 ++++++++++- Essentials/src/com/earth2me/essentials/signs/Signs.java | 1 + Essentials/src/config.yml | 3 ++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index e0e2dd63b..6db8dcafc 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -303,7 +303,7 @@ public class Settings implements ISettings @Override public boolean areSignsDisabled() { - return enabledSigns.isEmpty(); + return !signsEnabled; } @Override @@ -422,6 +422,7 @@ public class Settings implements ISettings return epItemSpwn; } private List enabledSigns = new ArrayList(); + private boolean signsEnabled = false; @Override public List enabledSigns() @@ -440,6 +441,11 @@ public class Settings implements ISettings { continue; } + if (signName.equals("COLOR") || signName.equals("COLOUR")) + { + signsEnabled = true; + continue; + } try { newSigns.add(Signs.valueOf(signName).getSign()); @@ -447,7 +453,9 @@ public class Settings implements ISettings catch (Exception ex) { logger.log(Level.SEVERE, _("unknownItemInList", signName, "enabledSigns")); + continue; } + signsEnabled = true; } return newSigns; } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java index e57919ab1..bd90d6c47 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Material; @@ -87,9 +88,17 @@ public class SignBlockListener implements Listener { for (int i = 0; i < 4; i++) { - event.setLine(i, event.getLine(i).replaceAll("&([0-9a-f])", "§$1")); + event.setLine(i, Util.replaceColor(event.getLine(i))); } } + else + { + for (int i = 0; i < 4; i++) + { + event.setLine(i, Util.stripColor(event.getLine(i))); + } + } + for (Signs signs : Signs.values()) { final EssentialsSign sign = signs.getSign(); diff --git a/Essentials/src/com/earth2me/essentials/signs/Signs.java b/Essentials/src/com/earth2me/essentials/signs/Signs.java index e29d45ad4..2cf05ee77 100644 --- a/Essentials/src/com/earth2me/essentials/signs/Signs.java +++ b/Essentials/src/com/earth2me/essentials/signs/Signs.java @@ -19,6 +19,7 @@ public enum Signs TRADE(new SignTrade()), WARP(new SignWarp()), WEATHER(new SignWeather()); + private final EssentialsSign sign; private Signs(final EssentialsSign sign) diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 3aea83772..7b72ee1c0 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -175,10 +175,11 @@ kits: # Essentials Sign Control # See http://ess.khhq.net/wiki/Sign_Tutorial for instructions on how to use these. # To enable signs, remove # symbol. To disable all signs, comment/remove each sign. -# If there are no signs enabled, all sign features will be disabled including sign colours. +# Essentials Colored sign support will be enabled when any sign types are enabled. # We recommend not enabling chest protection signs if you don't intend to use them, (or are using LWC/Lockette). enabledSigns: + #- color #- balance #- buy #- sell -- cgit v1.2.3 From e752538568a7547f68800df003bd96b46ecedf27 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 20 Mar 2012 11:53:05 +0000 Subject: Fix per world teleport permission checking. --- Essentials/src/com/earth2me/essentials/commands/Commandtp.java | 5 +++++ .../src/com/earth2me/essentials/commands/Commandtpa.java | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java index 72739966b..05451fdcf 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java @@ -49,6 +49,11 @@ public class Commandtp extends EssentialsCommand user.sendMessage(_("teleporting")); final User target = getPlayer(server, args, 0); final User toPlayer = getPlayer(server, args, 1); + if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().getIsWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + toPlayer.getWorld().getName())) + { + throw new Exception(_("noPerm", "essentials.world." + toPlayer.getWorld().getName())); + } target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND); target.sendMessage(_("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName())); break; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java index 97fa15d5c..90e8e69d9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java @@ -25,6 +25,11 @@ public class Commandtpa extends EssentialsCommand { throw new Exception(_("teleportDisabled", player.getDisplayName())); } + if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + player.getWorld().getName())) + { + throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName())); + } if (!player.isIgnoredPlayer(user.getName())) { player.requestTeleport(user, false); @@ -36,11 +41,6 @@ public class Commandtpa extends EssentialsCommand player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation())); } } - if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + player.getWorld().getName())) - { - throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName())); - } user.sendMessage(_("requestSent", player.getDisplayName())); } } -- cgit v1.2.3 From 518b013a63a23f9bdb587355aa34442cf2327a25 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 20 Mar 2012 13:26:49 +0000 Subject: Teleport check cleanup --- .../src/com/earth2me/essentials/ISettings.java | 2 +- .../src/com/earth2me/essentials/Settings.java | 2 +- Essentials/src/com/earth2me/essentials/User.java | 2 +- .../earth2me/essentials/commands/Commandtp.java | 4 ++-- .../earth2me/essentials/commands/Commandtpa.java | 2 +- .../essentials/commands/Commandtpaccept.java | 22 ++++++++++------------ .../earth2me/essentials/commands/Commandtpo.java | 2 +- .../earth2me/essentials/commands/Commandworld.java | 2 +- 8 files changed, 18 insertions(+), 20 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index c5773404e..fe12720ea 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -154,7 +154,7 @@ public interface ISettings extends IConf boolean getRepairEnchanted(); - boolean getIsWorldTeleportPermissions(); + boolean isWorldTeleportPermissions(); boolean registerBackInListener(); diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 6db8dcafc..f094dda6e 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -678,7 +678,7 @@ public class Settings implements ISettings } @Override - public boolean getIsWorldTeleportPermissions() + public boolean isWorldTeleportPermissions() { return config.getBoolean("world-teleport-permissions", false); } diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index b9f5198dc..3d5cbb398 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -250,7 +250,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser return teleportRequester; } - public boolean isTeleportRequestHere() + public boolean isTpRequestHere() { return teleportRequestHere; } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java index 05451fdcf..22d4778d3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java @@ -30,7 +30,7 @@ public class Commandtp extends EssentialsCommand { throw new Exception(_("teleportDisabled", player.getDisplayName())); } - if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions() + if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.world." + player.getWorld().getName())) { throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName())); @@ -49,7 +49,7 @@ public class Commandtp extends EssentialsCommand user.sendMessage(_("teleporting")); final User target = getPlayer(server, args, 0); final User toPlayer = getPlayer(server, args, 1); - if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().getIsWorldTeleportPermissions() + if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.world." + toPlayer.getWorld().getName())) { throw new Exception(_("noPerm", "essentials.world." + toPlayer.getWorld().getName())); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java index 90e8e69d9..95cbc58cd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java @@ -25,7 +25,7 @@ public class Commandtpa extends EssentialsCommand { throw new Exception(_("teleportDisabled", player.getDisplayName())); } - if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions() + if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.world." + player.getWorld().getName())) { throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName())); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java index 449ae7489..ffc8f2fdd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java @@ -19,16 +19,14 @@ public class Commandtpaccept extends EssentialsCommand { final User target = user.getTeleportRequest(); - if (target == null - || !target.isOnline() - || (user.isTeleportRequestHere() && !target.isAuthorized("essentials.tpahere")) - || (!user.isTeleportRequestHere() && !target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall")) - ) - { - throw new Exception(_("noPendingRequest")); - } - - if (args.length > 0 && !target.getName().contains(args[0])) + + if (target == null || !target.isOnline() + || (args.length > 0 && !target.getName().contains(args[0])) + || (user.isTpRequestHere() && !target.isAuthorized("essentials.tpahere")) + || (!user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall")) + || (user.getWorld() != target.getWorld() + && ess.getSettings().isWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + target.getWorld().getName()))))) { throw new Exception(_("noPendingRequest")); } @@ -41,7 +39,7 @@ public class Commandtpaccept extends EssentialsCommand } final Trade charge = new Trade(this.getName(), ess); - if (user.isTeleportRequestHere()) + if (user.isTpRequestHere()) { charge.isAffordableFor(user); } @@ -52,7 +50,7 @@ public class Commandtpaccept extends EssentialsCommand user.sendMessage(_("requestAccepted")); target.sendMessage(_("requestAcceptedFrom", user.getDisplayName())); - if (user.isTeleportRequestHere()) + if (user.isTpRequestHere()) { user.getTeleport().teleport(target, charge, TeleportCause.COMMAND); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java index 5edbe274d..e30aee127 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java @@ -32,7 +32,7 @@ public class Commandtpo extends EssentialsCommand // Verify permission if (!player.isHidden() || user.isAuthorized("essentials.teleport.hidden")) { - if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions() + if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.world." + player.getWorld().getName())) { throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName())); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java index c160e0a7a..647115d66 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java @@ -54,7 +54,7 @@ public class Commandworld extends EssentialsCommand } } - if (ess.getSettings().getIsWorldTeleportPermissions() && !user.isAuthorized("essentials.world." + world.getName())) + if (ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.world." + world.getName())) { throw new Exception(_("noPerm", "essentials.world." + world.getName())); } -- cgit v1.2.3 From 3e88fb44f47f8f17a0f496164255fbbff07bafc9 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 20 Mar 2012 14:32:11 +0000 Subject: Split if tree for readability. --- .../essentials/commands/Commandtpaccept.java | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java index ffc8f2fdd..7f06602ae 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java @@ -20,13 +20,24 @@ public class Commandtpaccept extends EssentialsCommand final User target = user.getTeleportRequest(); - if (target == null || !target.isOnline() - || (args.length > 0 && !target.getName().contains(args[0])) - || (user.isTpRequestHere() && !target.isAuthorized("essentials.tpahere")) - || (!user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall")) - || (user.getWorld() != target.getWorld() - && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + target.getWorld().getName()))))) + if (target == null || !target.isOnline()) + { + throw new Exception(_("noPendingRequest")); + } + + if (user.isTpRequestHere() && !target.isAuthorized("essentials.tpahere")) + { + throw new Exception(_("noPendingRequest")); + } + + if (!user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall")) + || (user.getWorld() != target.getWorld() && ess.getSettings().isWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + target.getWorld().getName())))) + { + throw new Exception(_("noPendingRequest")); + } + + if (args.length > 0 && !target.getName().contains(args[0])) { throw new Exception(_("noPendingRequest")); } -- cgit v1.2.3 From bcd4fd9bff3b6fcb3eda05e5cb79f2aeba5477f0 Mon Sep 17 00:00:00 2001 From: Michael Bonney Date: Wed, 21 Mar 2012 16:13:34 +0000 Subject: Removed Portuguese text, and added English replacements. Made more sense of the sentences, and also changed an incorrect message to it's proper form. --- .../org/anjocaido/groupmanager/GroupManager.java | 306 ++++++++++----------- 1 file changed, 153 insertions(+), 153 deletions(-) diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index eaa945f5d..baa45a275 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -108,7 +108,7 @@ public class GroupManager extends JavaPlugin { WorldEvents = null; BukkitPermissions = null; - // EXAMPLE: Custom code, here we just output some info so we can check + // EXAMPLE: Custom code, here we just output some info so we can check that // all is well PluginDescriptionFile pdfFile = this.getDescription(); System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is disabled!"); @@ -349,7 +349,7 @@ public class GroupManager extends JavaPlugin { GroupManager.logger.severe("==================================================="); GroupManager.logger.severe("= ERROR REPORT START ="); GroupManager.logger.severe("==================================================="); - GroupManager.logger.severe("= COPY AND PASTE THIS TO GROUPMANAGER DEVELOPER ="); + GroupManager.logger.severe("= COPY AND PASTE THIS TO A GROUPMANAGER DEVELOPER ="); GroupManager.logger.severe("==================================================="); GroupManager.logger.severe(this.getDescription().getName()); GroupManager.logger.severe(this.getDescription().getVersion()); @@ -375,7 +375,7 @@ public class GroupManager extends JavaPlugin { switch (execCmd) { case manuadd: - // VALIDANDO ARGUMENTOS + // Validating arguments if ((args.length != 2) && (args.length != 3)) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ | optional [world])"); return false; @@ -403,9 +403,9 @@ public class GroupManager extends JavaPlugin { return false; } - // VALIDANDO PERMISSAO + // Validating permissions 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."); + sender.sendMessage(ChatColor.RED + "Can't modify a player with the same permissions as you, or higher."); return false; } if (!isConsole && !isOpOverride && (permissionHandler.hasGroupInInheritance(auxGroup, senderGroup.getName()))) { @@ -413,11 +413,11 @@ public class GroupManager extends JavaPlugin { return false; } if (!isConsole && !isOpOverride && (!permissionHandler.inGroup(senderUser.getName(), auxUser.getGroupName()) || !permissionHandler.inGroup(senderUser.getName(), auxGroup.getName()))) { - sender.sendMessage(ChatColor.RED + "Can't modify player involving a group that you don't inherit."); + sender.sendMessage(ChatColor.RED + "You can't modify a player involving a group that you don't inherit."); return false; } - // PARECE OK + // Seems OK auxUser.setGroup(auxGroup); if (!sender.hasPermission("groupmanager.notify.other") || (isConsole)) sender.sendMessage(ChatColor.YELLOW + "You changed player '" + auxUser.getName() + "' group to '" + auxGroup.getName() + "' in world '" + dataHolder.getName() + "'."); @@ -425,12 +425,12 @@ public class GroupManager extends JavaPlugin { return true; case manudel: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 1) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -444,12 +444,12 @@ public class GroupManager extends JavaPlugin { } else { auxUser = dataHolder.getUser(args[0]); } - // VALIDANDO PERMISSAO + // Validating permission 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."); + sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher."); return false; } - // PARECE OK + // Seems OK dataHolder.removeUser(auxUser.getName()); sender.sendMessage(ChatColor.YELLOW + "You changed player '" + auxUser.getName() + "' to default settings."); @@ -461,7 +461,7 @@ public class GroupManager extends JavaPlugin { return true; case manuaddsub: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) { sender.sendMessage(ChatColor.RED + "Couldn't retrieve your world. World selection is needed."); @@ -469,7 +469,7 @@ public class GroupManager extends JavaPlugin { return true; } } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -488,12 +488,12 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Group not found!"); return false; } - // VALIDANDO PERMISSAO + // Validating permission 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."); + sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher."); return false; } - // PARECE OK + // Seems OK if (auxUser.addSubGroup(auxGroup)) sender.sendMessage(ChatColor.YELLOW + "You added subgroup '" + auxGroup.getName() + "' to player '" + auxUser.getName() + "'."); else @@ -502,12 +502,12 @@ public class GroupManager extends JavaPlugin { return true; case manudelsub: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manudelsub )"); return false; @@ -527,12 +527,12 @@ public class GroupManager extends JavaPlugin { return false; } - // VALIDANDO PERMISSAO + // Validating permission 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."); + sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher."); return false; } - // PARECE OK + // Seems OK auxUser.removeSubGroup(auxGroup); sender.sendMessage(ChatColor.YELLOW + "You removed subgroup '" + auxGroup.getName() + "' from player '" + auxUser.getName() + "' list."); @@ -543,12 +543,12 @@ public class GroupManager extends JavaPlugin { return true; case mangadd: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 1) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -558,19 +558,19 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Group already exists!"); return false; } - // PARECE OK + // Seems OK auxGroup = dataHolder.createGroup(args[0]); sender.sendMessage(ChatColor.YELLOW + "You created a group named: " + auxGroup.getName()); return true; case mangdel: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 1) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -580,7 +580,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Group not exists!"); return false; } - // PARECE OK + // Seems OK dataHolder.removeGroup(auxGroup.getName()); sender.sendMessage(ChatColor.YELLOW + "You deleted a group named " + auxGroup.getName() + ", it's users are default group now."); @@ -589,12 +589,12 @@ public class GroupManager extends JavaPlugin { return true; case manuaddp: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -608,17 +608,17 @@ public class GroupManager extends JavaPlugin { } else { auxUser = dataHolder.getUser(args[0]); } - // VALIDANDO SUA PERMISSAO + // Validating your permissions if (!isConsole && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { sender.sendMessage(ChatColor.RED + "Can't modify player with same group than you, or higher."); return false; } permissionResult = permissionHandler.checkFullUserPermission(senderUser, args[1]); if (!isConsole && !isOpOverride && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) { - sender.sendMessage(ChatColor.RED + "Can't add a permission you don't have."); + sender.sendMessage(ChatColor.RED + "You can't add a permission you don't have."); return false; } - // VALIDANDO PERMISSAO DO DESTINO + // Validating permissions of user permissionResult = permissionHandler.checkUserOnlyPermission(auxUser, args[1]); if (args[1].startsWith("+")) { if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) { @@ -643,7 +643,7 @@ public class GroupManager extends JavaPlugin { return false; } } - // PARECE OK + // Seems OK auxUser.addPermission(args[1]); sender.sendMessage(ChatColor.YELLOW + "You added '" + args[1] + "' to player '" + auxUser.getName() + "' permissions."); @@ -654,12 +654,12 @@ public class GroupManager extends JavaPlugin { return true; case manudelp: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -673,17 +673,17 @@ public class GroupManager extends JavaPlugin { } else { auxUser = dataHolder.getUser(args[0]); } - // VALIDANDO SUA PERMISSAO + // Validating your permissions if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { - sender.sendMessage(ChatColor.RED + "Can't modify player with same group than you, or higher."); + sender.sendMessage(ChatColor.RED + "You can't modify a player with same group as you, or higher."); return false; } permissionResult = permissionHandler.checkFullUserPermission(senderUser, args[1]); if (!isConsole && !isOpOverride && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) { - sender.sendMessage(ChatColor.RED + "Can't remove a permission you don't have."); + sender.sendMessage(ChatColor.RED + "You can't remove a permission you don't have."); return false; } - // VALIDANDO PERMISSAO DO DESTINO + // Validating permissions of user permissionResult = permissionHandler.checkUserOnlyPermission(auxUser, args[1]); if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) { sender.sendMessage(ChatColor.RED + "The user doesn't have direct access to that permission."); @@ -694,7 +694,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "But might match node: " + permissionResult.accessLevel); return false; } - // PARECE OK + // Seems OK auxUser.removePermission(args[1]); sender.sendMessage(ChatColor.YELLOW + "You removed '" + args[1] + "' from player '" + auxUser.getName() + "' permissions."); @@ -705,12 +705,12 @@ public class GroupManager extends JavaPlugin { return true; case manulistp: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if ((args.length == 0) || (args.length > 2)) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ (+))"); return false; @@ -725,8 +725,8 @@ public class GroupManager extends JavaPlugin { } else { auxUser = dataHolder.getUser(args[0]); } - // VALIDANDO PERMISSAO - // PARECE OK + // Validating permission + // Seems OK auxString = ""; for (String perm : auxUser.getPermissionList()) { auxString += perm + ", "; @@ -770,12 +770,12 @@ public class GroupManager extends JavaPlugin { return true; case manucheckp: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -791,7 +791,7 @@ public class GroupManager extends JavaPlugin { auxUser = dataHolder.getUser(args[0]); } targetPlayer = this.getServer().getPlayer(auxUser.getName()); - // VALIDANDO PERMISSAO + // Validating permission permissionResult = permissionHandler.checkFullGMPermission(auxUser, args[1], false); if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) { @@ -825,28 +825,28 @@ public class GroupManager extends JavaPlugin { return true; case mangaddp: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; } auxGroup = dataHolder.getGroup(args[0]); if (auxGroup == null) { - sender.sendMessage(ChatColor.RED + "Group does not exists!"); + sender.sendMessage(ChatColor.RED + "The specified group does not exist!"); return false; } - // VALIDANDO SUA PERMISSAO + // Validating your permissions permissionResult = permissionHandler.checkFullUserPermission(senderUser, args[1]); if (!isConsole && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) { - sender.sendMessage(ChatColor.RED + "Can't add a permission you don't have."); + sender.sendMessage(ChatColor.RED + "You can't add a permission you don't have."); return false; } - // VALIDANDO PERMISSAO DO DESTINO + // Validating permissions of user permissionResult = permissionHandler.checkGroupOnlyPermission(auxGroup, args[1]); if (args[1].startsWith("+")) { if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) { @@ -866,12 +866,12 @@ public class GroupManager extends JavaPlugin { } } else { if (permissionResult.resultType.equals(PermissionCheckResult.Type.FOUND)) { - sender.sendMessage(ChatColor.RED + "The user already has direct access to that permission."); + sender.sendMessage(ChatColor.RED + "The group already has direct access to that permission."); sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel); return false; } } - // PARECE OK + // Seems OK auxGroup.addPermission(args[1]); sender.sendMessage(ChatColor.YELLOW + "You added '" + args[1] + "' to group '" + auxGroup.getName() + "' permissions."); @@ -880,28 +880,28 @@ public class GroupManager extends JavaPlugin { return true; case mangdelp: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; } auxGroup = dataHolder.getGroup(args[0]); if (auxGroup == null) { - sender.sendMessage(ChatColor.RED + "Group does not exists!"); + sender.sendMessage(ChatColor.RED + "The specified group does not exist!"); return false; } - // VALIDANDO SUA PERMISSAO + // Validating your permissions permissionResult = permissionHandler.checkFullUserPermission(senderUser, args[1]); if (!isConsole && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) { sender.sendMessage(ChatColor.RED + "Can't remove a permission you don't have."); return false; } - // VALIDANDO PERMISSAO DO DESTINO + // Validating permissions of user permissionResult = permissionHandler.checkGroupOnlyPermission(auxGroup, args[1]); if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) { sender.sendMessage(ChatColor.RED + "The group doesn't have direct access to that permission."); @@ -912,7 +912,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "But might match node: " + permissionResult.accessLevel); return false; } - // PARECE OK + // Seems OK auxGroup.removePermission(args[1]); sender.sendMessage(ChatColor.YELLOW + "You removed '" + args[1] + "' from group '" + auxGroup.getName() + "' permissions."); @@ -921,24 +921,24 @@ public class GroupManager extends JavaPlugin { return true; case manglistp: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 1) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; } auxGroup = dataHolder.getGroup(args[0]); if (auxGroup == null) { - sender.sendMessage(ChatColor.RED + "Group does not exists!"); + sender.sendMessage(ChatColor.RED + "The specified group does not exist!"); return false; } - // VALIDANDO PERMISSAO + // Validating permission - // PARECE OK + // Seems OK auxString = ""; for (String perm : auxGroup.getPermissionList()) { auxString += perm + ", "; @@ -970,28 +970,28 @@ public class GroupManager extends JavaPlugin { return true; case mangcheckp: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; } auxGroup = dataHolder.getGroup(args[0]); if (auxGroup == null) { - sender.sendMessage(ChatColor.RED + "Group does not exists!"); + sender.sendMessage(ChatColor.RED + "The specified group does not exist!"); return false; } - // VALIDANDO PERMISSAO + // Validating permission permissionResult = permissionHandler.checkGroupPermissionWithInheritance(auxGroup, args[1]); if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) { sender.sendMessage(ChatColor.RED + "The group doesn't have access to that permission"); return false; } - // PARECE OK + // Seems OK // auxString = // permissionHandler.checkUserOnlyPermission(auxUser, args[1]); if (permissionResult.owner instanceof Group) { @@ -1006,24 +1006,24 @@ public class GroupManager extends JavaPlugin { return true; case mangaddi: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; } auxGroup = dataHolder.getGroup(args[0]); if (auxGroup == null) { - sender.sendMessage(ChatColor.RED + "Group 1 does not exists!"); + sender.sendMessage(ChatColor.RED + "Group 1 does not exist!"); return false; } auxGroup2 = dataHolder.getGroup(args[1]); if (auxGroup2 == null) { - sender.sendMessage(ChatColor.RED + "Group 2 does not exists!"); + sender.sendMessage(ChatColor.RED + "Group 2 does not exist!"); return false; } if (auxGroup.isGlobal()) { @@ -1031,12 +1031,12 @@ public class GroupManager extends JavaPlugin { return false; } - // VALIDANDO PERMISSAO + // Validating permission if (permissionHandler.searchGroupInInheritance(auxGroup, auxGroup2.getName(), null)) { sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " already inherits " + auxGroup2.getName() + " (might not be directly)"); return false; } - // PARECE OK + // Seems OK auxGroup.addInherits(auxGroup2); sender.sendMessage(ChatColor.RED + "Group " + auxGroup2.getName() + " is now in " + auxGroup.getName() + " inheritance list."); @@ -1045,24 +1045,24 @@ public class GroupManager extends JavaPlugin { return true; case mangdeli: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; } auxGroup = dataHolder.getGroup(args[0]); if (auxGroup == null) { - sender.sendMessage(ChatColor.RED + "Group 1 does not exists!"); + sender.sendMessage(ChatColor.RED + "Group 1 does not exist!"); return false; } auxGroup2 = dataHolder.getGroup(args[1]); if (auxGroup2 == null) { - sender.sendMessage(ChatColor.RED + "Group 2 does not exists!"); + sender.sendMessage(ChatColor.RED + "Group 2 does not exist!"); return false; } if (auxGroup.isGlobal()) { @@ -1070,7 +1070,7 @@ public class GroupManager extends JavaPlugin { return false; } - // VALIDANDO PERMISSAO + // Validating permission if (!permissionHandler.searchGroupInInheritance(auxGroup, auxGroup2.getName(), null)) { sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " does not inherits " + auxGroup2.getName() + "."); return false; @@ -1079,7 +1079,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " does not inherits " + auxGroup2.getName() + " directly."); return false; } - // PARECE OK + // Seems OK auxGroup.removeInherits(auxGroup2.getName()); sender.sendMessage(ChatColor.RED + "Group " + auxGroup2.getName() + " was removed from " + auxGroup.getName() + " inheritance list."); @@ -1088,12 +1088,12 @@ public class GroupManager extends JavaPlugin { return true; case manuaddv: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length < 3) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -1107,8 +1107,8 @@ public class GroupManager extends JavaPlugin { } else { auxUser = dataHolder.getUser(args[0]); } - // VALIDANDO PERMISSAO - // PARECE OK + // Validating permission + // Seems OK auxString = ""; for (int i = 2; i < args.length; i++) { auxString += args[i]; @@ -1122,12 +1122,12 @@ public class GroupManager extends JavaPlugin { return true; case manudelv: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -1141,23 +1141,23 @@ public class GroupManager extends JavaPlugin { } else { auxUser = dataHolder.getUser(args[0]); } - // VALIDANDO PERMISSAO + // Validating permission if (!auxUser.getVariables().hasVar(args[1])) { sender.sendMessage(ChatColor.RED + "The user doesn't have directly that variable!"); } - // PARECE OK + // Seems OK auxUser.getVariables().removeVar(args[1]); sender.sendMessage(ChatColor.YELLOW + "Variable " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + " removed from the user " + ChatColor.GREEN + auxUser.getName()); return true; case manulistv: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 1) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -1170,8 +1170,8 @@ public class GroupManager extends JavaPlugin { } else { auxUser = dataHolder.getUser(args[0]); } - // VALIDANDO PERMISSAO - // PARECE OK + // Validating permission + // Seems OK auxString = ""; for (String varKey : auxUser.getVariables().getVarKeyList()) { Object o = auxUser.getVariables().getVarObject(varKey); @@ -1187,12 +1187,12 @@ public class GroupManager extends JavaPlugin { return true; case manucheckv: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -1205,7 +1205,7 @@ public class GroupManager extends JavaPlugin { } else { auxUser = dataHolder.getUser(args[0]); } - // VALIDANDO PERMISSAO + // Validating permission auxGroup = auxUser.getGroup(); auxGroup2 = permissionHandler.nextGroupWithVariable(auxGroup, args[1]); @@ -1221,7 +1221,7 @@ public class GroupManager extends JavaPlugin { return false; } } - // PARECE OK + // Seems OK if (auxUser.getVariables().hasVar(auxString)) { sender.sendMessage(ChatColor.YELLOW + "The value of variable '" + ChatColor.GOLD + args[1] + ChatColor.YELLOW + "' is: '" + ChatColor.GREEN + auxUser.getVariables().getVarObject(args[1]).toString() + ChatColor.WHITE + "'"); sender.sendMessage(ChatColor.YELLOW + "This user own directly the variable"); @@ -1234,27 +1234,27 @@ public class GroupManager extends JavaPlugin { return true; case mangaddv: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length < 3) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; } auxGroup = dataHolder.getGroup(args[0]); if (auxGroup == null) { - sender.sendMessage(ChatColor.RED + "Group does not exists!"); + sender.sendMessage(ChatColor.RED + "The specified group does not exist!"); return false; } if (auxGroup.isGlobal()) { sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes."); return false; } - // VALIDANDO PERMISSAO - // PARECE OK + // Validating permission + // Seems OK auxString = ""; for (int i = 2; i < args.length; i++) { auxString += args[i]; @@ -1268,57 +1268,57 @@ public class GroupManager extends JavaPlugin { return true; case mangdelv: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; } auxGroup = dataHolder.getGroup(args[0]); if (auxGroup == null) { - sender.sendMessage(ChatColor.RED + "Group does not exists!"); + sender.sendMessage(ChatColor.RED + "The specified group does not exist!"); return false; } if (auxGroup.isGlobal()) { sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes."); return false; } - // VALIDANDO PERMISSAO + // Validating permission if (!auxGroup.getVariables().hasVar(args[1])) { sender.sendMessage(ChatColor.RED + "The group doesn't have directly that variable!"); } - // PARECE OK + // Seems OK auxGroup.getVariables().removeVar(args[1]); sender.sendMessage(ChatColor.YELLOW + "Variable " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + " removed from the group " + ChatColor.GREEN + auxGroup.getName()); return true; case manglistv: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 1) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; } auxGroup = dataHolder.getGroup(args[0]); if (auxGroup == null) { - sender.sendMessage(ChatColor.RED + "Group does not exists!"); + sender.sendMessage(ChatColor.RED + "The specified group does not exist!"); return false; } if (auxGroup.isGlobal()) { sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes."); return false; } - // VALIDANDO PERMISSAO - // PARECE OK + // Validating permission + // Seems OK auxString = ""; for (String varKey : auxGroup.getVariables().getVarKeyList()) { Object o = auxGroup.getVariables().getVarObject(varKey); @@ -1341,31 +1341,31 @@ public class GroupManager extends JavaPlugin { return true; case mangcheckv: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; } auxGroup = dataHolder.getGroup(args[0]); if (auxGroup == null) { - sender.sendMessage(ChatColor.RED + "Group does not exists!"); + sender.sendMessage(ChatColor.RED + "The specified group does not exist!"); return false; } if (auxGroup.isGlobal()) { sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes."); return false; } - // VALIDANDO PERMISSAO + // Validating permission auxGroup2 = permissionHandler.nextGroupWithVariable(auxGroup, args[1], null); if (auxGroup2 == null) { sender.sendMessage(ChatColor.RED + "The group doesn't have access to that variable!"); } - // PARECE OK + // Seems OK sender.sendMessage(ChatColor.YELLOW + "The value of variable '" + ChatColor.GOLD + args[1] + ChatColor.YELLOW + "' is: '" + ChatColor.GREEN + auxGroup2.getVariables().getVarObject(args[1]).toString() + ChatColor.WHITE + "'"); if (!auxGroup.equals(auxGroup2)) { sender.sendMessage(ChatColor.YELLOW + "And the value was inherited from group: " + ChatColor.GREEN + auxGroup2.getName()); @@ -1374,12 +1374,12 @@ public class GroupManager extends JavaPlugin { return true; case manwhois: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 1) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -1392,7 +1392,7 @@ public class GroupManager extends JavaPlugin { } else { auxUser = dataHolder.getUser(args[0]); } - // PARECE OK + // Seems OK sender.sendMessage(ChatColor.YELLOW + "Name: " + ChatColor.GREEN + auxUser.getName()); sender.sendMessage(ChatColor.YELLOW + "Group: " + ChatColor.GREEN + auxUser.getGroup().getName()); sender.sendMessage(ChatColor.YELLOW + "Overloaded: " + ChatColor.GREEN + dataHolder.isOverloaded(auxUser.getName())); @@ -1404,12 +1404,12 @@ public class GroupManager extends JavaPlugin { return true; case tempadd: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 1) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -1422,12 +1422,12 @@ public class GroupManager extends JavaPlugin { } else { auxUser = dataHolder.getUser(args[0]); } - // VALIDANDO PERMISSAO + // Validating permission if (!isConsole && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher."); return false; } - // PARECE OK + // Seems OK if (overloadedUsers.get(dataHolder.getName().toLowerCase()) == null) { overloadedUsers.put(dataHolder.getName().toLowerCase(), new ArrayList()); } @@ -1438,12 +1438,12 @@ public class GroupManager extends JavaPlugin { return true; case tempdel: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 1) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -1456,12 +1456,12 @@ public class GroupManager extends JavaPlugin { } else { auxUser = dataHolder.getUser(args[0]); } - // VALIDANDO PERMISSAO + // Validating permission if (!isConsole && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { - sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher."); + sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher."); return false; } - // PARECE OK + // Seems OK if (overloadedUsers.get(dataHolder.getName().toLowerCase()) == null) { overloadedUsers.put(dataHolder.getName().toLowerCase(), new ArrayList()); } @@ -1469,12 +1469,12 @@ public class GroupManager extends JavaPlugin { if (overloadedUsers.get(dataHolder.getName().toLowerCase()).contains(auxUser)) { overloadedUsers.get(dataHolder.getName().toLowerCase()).remove(auxUser); } - sender.sendMessage(ChatColor.YELLOW + "You removed that player overload. He's back to normal!"); + sender.sendMessage(ChatColor.YELLOW + "You removed that player's overload. He's back to normal!"); return true; case templist: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; @@ -1492,7 +1492,7 @@ public class GroupManager extends JavaPlugin { } } if (count == 0) { - sender.sendMessage(ChatColor.YELLOW + "There is no users in overload mode"); + sender.sendMessage(ChatColor.YELLOW + "There are no users in overload mode."); return true; } auxString = auxString.substring(0, auxString.lastIndexOf(",")); @@ -1505,7 +1505,7 @@ public class GroupManager extends JavaPlugin { return true; case tempdelall: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; @@ -1520,14 +1520,14 @@ public class GroupManager extends JavaPlugin { } } if (count == 0) { - sender.sendMessage(ChatColor.YELLOW + "There is no users in overload mode"); + sender.sendMessage(ChatColor.YELLOW + "There are no users in overload mode."); return true; } if (overloadedUsers.get(dataHolder.getName().toLowerCase()) == null) { overloadedUsers.put(dataHolder.getName().toLowerCase(), new ArrayList()); } overloadedUsers.get(dataHolder.getName().toLowerCase()).clear(); - sender.sendMessage(ChatColor.YELLOW + " " + count + " Users in overload mode. Now they are normal again."); + sender.sendMessage(ChatColor.YELLOW + " " + count + "All users in overload mode are now are normal again."); return true; @@ -1588,7 +1588,7 @@ public class GroupManager extends JavaPlugin { return true; case listgroups: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; @@ -1609,12 +1609,12 @@ public class GroupManager extends JavaPlugin { return true; case manpromote: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -1636,9 +1636,9 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly."); return false; } - // VALIDANDO PERMISSAO + // Validating permission 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."); + sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher."); return false; } if (!isConsole && !isOpOverride && (permissionHandler.hasGroupInInheritance(auxGroup, senderGroup.getName()))) { @@ -1646,18 +1646,18 @@ public class GroupManager extends JavaPlugin { return false; } if (!isConsole && !isOpOverride && (!permissionHandler.inGroup(senderUser.getName(), auxUser.getGroupName()) || !permissionHandler.inGroup(senderUser.getName(), auxGroup.getName()))) { - sender.sendMessage(ChatColor.RED + "Can't modify player involving a group that you don't inherit."); + sender.sendMessage(ChatColor.RED + "You can't modify a player involving a group that you don't inherit."); return false; } if (!isConsole && !isOpOverride && (!permissionHandler.hasGroupInInheritance(auxUser.getGroup(), auxGroup.getName()) && !permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) { - sender.sendMessage(ChatColor.RED + "Can't modify player using groups with different heritage line."); + sender.sendMessage(ChatColor.RED + "You can't modify a player using groups with different heritage line."); return false; } if (!isConsole && !isOpOverride && (!permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) { sender.sendMessage(ChatColor.RED + "The new group must be a higher rank."); return false; } - // PARECE OK + // Seems OK auxUser.setGroup(auxGroup); if (!sender.hasPermission("groupmanager.notify.other") || (isConsole)) sender.sendMessage(ChatColor.YELLOW + "You changed " + auxUser.getName() + " group to " + auxGroup.getName() + "."); @@ -1665,12 +1665,12 @@ public class GroupManager extends JavaPlugin { return true; case mandemote: - // VALIDANDO ESTADO DO SENDER + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - // VALIDANDO ARGUMENTOS + // Validating arguments if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); return false; @@ -1692,9 +1692,9 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly."); return false; } - // VALIDANDO PERMISSAO + // Validating permission 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."); + sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher."); return false; } if (!isConsole && !isOpOverride && (permissionHandler.hasGroupInInheritance(auxGroup, senderGroup.getName()))) { @@ -1702,18 +1702,18 @@ public class GroupManager extends JavaPlugin { return false; } if (!isConsole && !isOpOverride && (!permissionHandler.inGroup(senderUser.getName(), auxUser.getGroupName()) || !permissionHandler.inGroup(senderUser.getName(), auxGroup.getName()))) { - sender.sendMessage(ChatColor.RED + "Can't modify player involving a group that you don' inherit."); + sender.sendMessage(ChatColor.RED + "You can't modify a player involving a group that you don't inherit."); return false; } if (!isConsole && !isOpOverride && (!permissionHandler.hasGroupInInheritance(auxUser.getGroup(), auxGroup.getName()) && !permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) { - sender.sendMessage(ChatColor.RED + "Can't modify player using groups with different heritage line."); + sender.sendMessage(ChatColor.RED + "You can't modify a player using groups with different heritage line."); return false; } if (!isConsole && !isOpOverride && (permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) { sender.sendMessage(ChatColor.RED + "The new group must be a lower rank."); return false; } - // PARECE OK + // Seems OK auxUser.setGroup(auxGroup); if (!sender.hasPermission("groupmanager.notify.other") || (isConsole)) sender.sendMessage(ChatColor.YELLOW + "You changed " + auxUser.getName() + " group to " + auxGroup.getName() + "."); -- cgit v1.2.3 From 264e175d6ccf8fdd246ba7d990caf2abaa61c346 Mon Sep 17 00:00:00 2001 From: Iaccidentally Date: Wed, 21 Mar 2012 13:23:36 -0300 Subject: update default player-commands to support new and missed commands --- Essentials/src/config.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 7b72ee1c0..ef2485ae8 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -97,9 +97,14 @@ player-commands: - back - back.ondeath - balance + - balance.others + - balancetop + - chat.shout + - chat.question - clearinventory - compass - depth + - delhome - getpos - geoip.show - help @@ -108,20 +113,26 @@ player-commands: - home.others - ignore - info + - itemdb - kit + - kit.tools - list - mail - mail.send - me - motd - msg + - msg.color - nick + - near - pay - ping - powertool + - powertooltoggle - protect - r - rules + - realname - seen - sell - sethome @@ -144,6 +155,7 @@ player-commands: - signs.use.weather - spawn - suicide + - time - tpa - tpaccept - tpahere -- cgit v1.2.3 From 7bcec32134b5bf62d60b235471f6350979b65e76 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 21 Mar 2012 23:54:57 +0000 Subject: Cleaning up displaynames --- .../essentials/EssentialsPlayerListener.java | 21 ++------- Essentials/src/com/earth2me/essentials/User.java | 54 +++++++++++++--------- .../earth2me/essentials/commands/Commandafk.java | 1 + .../essentials/commands/Commandhelpop.java | 2 +- .../earth2me/essentials/commands/Commandlist.java | 10 ++-- .../earth2me/essentials/commands/Commandme.java | 5 +- .../essentials/commands/Commandrealname.java | 1 + .../earth2me/essentials/commands/Commandseen.java | 12 +++-- .../essentials/commands/Commandsuicide.java | 1 + .../earth2me/essentials/commands/Commandwhois.java | 1 + .../essentials/textreader/KeywordReplacer.java | 1 + 11 files changed, 58 insertions(+), 51 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index c1bd9bbe0..43adf0a6f 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -43,10 +43,7 @@ public class EssentialsPlayerListener implements Listener { final User user = ess.getUser(event.getPlayer()); updateCompass(user); - if (ess.getSettings().changeDisplayName()) - { - user.setDisplayNick(); - } + user.setDisplayNick(); } @EventHandler(priority = EventPriority.LOWEST) @@ -69,10 +66,7 @@ public class EssentialsPlayerListener implements Listener } } user.updateActivity(true); - if (ess.getSettings().changeDisplayName()) - { - user.setDisplayNick(); - } + user.setDisplayNick(); } @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) @@ -127,11 +121,7 @@ public class EssentialsPlayerListener implements Listener { ess.getBackup().onPlayerJoin(); final User user = ess.getUser(event.getPlayer()); - - if (ess.getSettings().changeDisplayName()) - { - user.setDisplayNick(); - } + user.setDisplayNick(); user.setLastLoginAddress(user.getAddress().getAddress().getHostAddress()); user.updateActivity(false); if (user.isAuthorized("essentials.sleepingignored")) @@ -297,10 +287,7 @@ public class EssentialsPlayerListener implements Listener public void onPlayerChangedWorld(final PlayerChangedWorldEvent event) { final User user = ess.getUser(event.getPlayer()); - if (ess.getSettings().changeDisplayName()) - { - user.setDisplayNick(); - } + user.setDisplayNick(); updateCompass(user); if (ess.getSettings().getNoGodWorlds().contains(event.getPlayer().getLocation().getWorld().getName())) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 3d5cbb398..a41fd1b5f 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -71,10 +71,12 @@ public class User extends UserData implements Comparable, IReplyTo, IUser return false; } - try { + try + { return ess.getPermissionsHandler().hasPermission(base, node); } - catch (Exception ex) { + catch (Exception ex) + { ess.getLogger().log(Level.SEVERE, "Permission System Error: " + ess.getPermissionsHandler().getName() + " returned: " + ex.getMessage()); return false; } @@ -289,6 +291,10 @@ public class User extends UserData implements Comparable, IReplyTo, IUser { final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§'); nickname.insert(0, prefix); + if (prefix.length() < 2 || prefix.charAt(0) != '&') + { + nickname.insert(0, "&f"); + } } if (!ess.getSettings().disableSuffix()) { @@ -310,24 +316,28 @@ public class User extends UserData implements Comparable, IReplyTo, IUser public void setDisplayNick() { - String name = getNick(true); - setDisplayName(name); - if (name.length() > 16) - { - name = getNick(false); - } - if (name.length() > 16) - { - name = name.substring(0, name.charAt(15) == '§' ? 15 : 16); - } - try - { - setPlayerListName(name); - } - catch (IllegalArgumentException e) + if (base.isOnline() && ess.getSettings().changeDisplayName()) { - if (ess.getSettings().isDebug()) { - logger.log(Level.INFO, "Playerlist for " + name + " was not updated. Name clashed with another online player."); + String name = getNick(true); + setDisplayName(name); + if (name.length() > 16) + { + name = getNick(false); + } + if (name.length() > 16) + { + name = Util.stripColor(name); + } + try + { + setPlayerListName(name); + } + catch (IllegalArgumentException e) + { + if (ess.getSettings().isDebug()) + { + logger.log(Level.INFO, "Playerlist for " + name + " was not updated. Name clashed with another online player."); + } } } } @@ -335,10 +345,6 @@ public class User extends UserData implements Comparable, IReplyTo, IUser @Override public String getDisplayName() { - if (base.isOnline() && ess.getSettings().changeDisplayName()) - { - setDisplayNick(); - } return super.getDisplayName() == null ? super.getName() : super.getDisplayName(); } @@ -498,6 +504,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser setAfk(false); if (broadcast && !isHidden()) { + setDisplayNick(); ess.broadcastMessage(this, _("userIsNotAway", getDisplayName())); } } @@ -530,6 +537,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser setAfk(true); if (!isHidden()) { + setDisplayNick(); ess.broadcastMessage(this, _("userIsAway", getDisplayName())); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java index a1c83606c..c71883571 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java @@ -31,6 +31,7 @@ public class Commandafk extends EssentialsCommand private void toggleAfk(User user) { + user.setDisplayNick(); if (!user.toggleAfk()) { //user.sendMessage(_("markedAsNotAway")); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java b/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java index 20cd5cdd3..f26154f71 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java @@ -22,7 +22,7 @@ public class Commandhelpop extends EssentialsCommand { throw new NotEnoughArgumentsException(); } - + user.setDisplayNick(); final String message = _("helpOp", user.getDisplayName(), Util.stripColor(getFinalArg(args, 0))); logger.log(Level.INFO, message); for (Player onlinePlayer : server.getOnlinePlayers()) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java index 77788c7c2..7e699328b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java @@ -44,8 +44,10 @@ public class Commandlist extends EssentialsCommand if (showhidden && playerHidden > 0) { online = _("listAmountHidden", server.getOnlinePlayers().length - playerHidden, playerHidden, server.getMaxPlayers()); - } else { - online = _("listAmount",server.getOnlinePlayers().length - playerHidden, server.getMaxPlayers()); + } + else + { + online = _("listAmount", server.getOnlinePlayers().length - playerHidden, server.getMaxPlayers()); } sender.sendMessage(online); @@ -73,7 +75,7 @@ public class Commandlist extends EssentialsCommand for (String group : groups) { final StringBuilder groupString = new StringBuilder(); - groupString.append(_("listGroupTag",Util.replaceColor(group))); + groupString.append(_("listGroupTag", Util.replaceColor(group))); final List users = sort.get(group); Collections.sort(users); boolean first = true; @@ -95,6 +97,7 @@ public class Commandlist extends EssentialsCommand { groupString.append(_("listHiddenTag")); } + user.setDisplayNick(); groupString.append(user.getDisplayName()); groupString.append("§f"); } @@ -136,6 +139,7 @@ public class Commandlist extends EssentialsCommand { onlineUsers.append(_("listHiddenTag")); } + user.setDisplayNick(); onlineUsers.append(user.getDisplayName()); onlineUsers.append("§f"); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandme.java b/Essentials/src/com/earth2me/essentials/commands/Commandme.java index 1530f3ad7..0bf2a536d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandme.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandme.java @@ -31,11 +31,12 @@ public class Commandme extends EssentialsCommand { message = Util.replaceColor(message); } - else { + else + { message = Util.stripColor(message); } - + user.setDisplayNick(); ess.broadcastMessage(user, _("action", user.getDisplayName(), message)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java index b48ac5bcb..6f9049756 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java @@ -31,6 +31,7 @@ public class Commandrealname extends EssentialsCommand { continue; } + u.setDisplayNick(); final String displayName = Util.stripColor(u.getDisplayName()).toLowerCase(Locale.ENGLISH); if (!whois.equals(displayName) && !displayName.equals(Util.stripColor(ess.getSettings().getNicknamePrefix()) + whois) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index 2783fb68e..38abb2dab 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -17,16 +17,16 @@ public class Commandseen extends EssentialsCommand @Override protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { - seen(server,sender,args,true); + seen(server, sender, args, true); } - + @Override protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - seen(server,user,args,user.isAuthorized("essentials.seen.banreason")); + seen(server, user, args, user.isAuthorized("essentials.seen.banreason")); } - - protected void seen (final Server server, final CommandSender sender, final String[] args, final boolean show) throws Exception + + protected void seen(final Server server, final CommandSender sender, final String[] args, final boolean show) throws Exception { if (args.length < 1) { @@ -35,6 +35,7 @@ public class Commandseen extends EssentialsCommand try { User player = getPlayer(server, args, 0); + player.setDisplayNick(); sender.sendMessage(_("seenOnline", player.getDisplayName(), Util.formatDateDiff(player.getLastLogin()))); } catch (NoSuchFieldException e) @@ -44,6 +45,7 @@ public class Commandseen extends EssentialsCommand { throw new Exception(_("playerNotFound")); } + player.setDisplayNick(); sender.sendMessage(_("seenOffline", player.getDisplayName(), Util.formatDateDiff(player.getLastLogout()))); if (player.isBanned()) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java b/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java index d6afe707a..50933c8f5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java @@ -21,6 +21,7 @@ public class Commandsuicide extends EssentialsCommand user.damage(1000); user.setHealth(0); user.sendMessage(_("suicideMessage")); + user.setDisplayNick(); ess.broadcastMessage(user,_("suicideSuccess", user.getDisplayName())); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java index 8adc4c95c..4f1c2267a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java @@ -53,6 +53,7 @@ public class Commandwhois extends EssentialsCommand continue; } sender.sendMessage(""); + user.setDisplayNick(); sender.sendMessage(_("whoisIs", user.getDisplayName(), user.getName())); sender.sendMessage(_("whoisHealth", user.getHealth())); sender.sendMessage(_("whoisExp", SetExpFix.getTotalExperience(user), user.getLevel())); diff --git a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java index 4c4e3364b..d79483699 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java +++ b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java @@ -37,6 +37,7 @@ public class KeywordReplacer implements IText if (sender instanceof Player) { final User user = ess.getUser(sender); + user.setDisplayNick(); displayName = user.getDisplayName(); userName = user.getName(); ipAddress = user.getAddress().getAddress().toString(); -- cgit v1.2.3 From 7d7c1d34cf69ef9f3d9eb8e8bd76f1bd9de1841f Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 11:57:30 +0000 Subject: Fix typo. --- Essentials/src/com/earth2me/essentials/User.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index a41fd1b5f..9403fc368 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -293,7 +293,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser nickname.insert(0, prefix); if (prefix.length() < 2 || prefix.charAt(0) != '&') { - nickname.insert(0, "&f"); + nickname.insert(0, "§f"); } } if (!ess.getSettings().disableSuffix()) -- cgit v1.2.3 From 209c91d3de0aed2c96384c17be3643f34a6f9f10 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 12:02:19 +0000 Subject: Fixed again. --- Essentials/src/com/earth2me/essentials/User.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 9403fc368..51e10dbf5 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -291,7 +291,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser { final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§'); nickname.insert(0, prefix); - if (prefix.length() < 2 || prefix.charAt(0) != '&') + if (prefix.length() < 2 || prefix.charAt(0) != '§') { nickname.insert(0, "§f"); } -- cgit v1.2.3 From 1746569e1a82d940728fe13e663f368971a96646 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 17:25:13 +0000 Subject: Extra Trees --- .../src/com/earth2me/essentials/commands/Commandbigtree.java | 4 ++++ .../src/com/earth2me/essentials/commands/Commandtree.java | 12 ++++++++++++ Essentials/src/plugin.yml | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java b/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java index 78d557934..5dd22503a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java @@ -27,6 +27,10 @@ public class Commandbigtree extends EssentialsCommand { tree = TreeType.BIG_TREE; } + else if (args.length > 0 && args[0].equalsIgnoreCase("jungle")) + { + tree = TreeType.JUNGLE; + } else { throw new NotEnoughArgumentsException(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtree.java b/Essentials/src/com/earth2me/essentials/commands/Commandtree.java index 20cc9d46f..6c2c15983 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtree.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtree.java @@ -43,6 +43,18 @@ public class Commandtree extends EssentialsCommand { tree = TreeType.BROWN_MUSHROOM; } + else if (args[0].equalsIgnoreCase("jungle")) + { + tree = TreeType.SMALL_JUNGLE; + } + else if (args[0].equalsIgnoreCase("junglebush")) + { + tree = TreeType.JUNGLE_BUSH; + } + else if (args[0].equalsIgnoreCase("swamp")) + { + tree = TreeType.SWAMP; + } else { throw new NotEnoughArgumentsException(); diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 5f2091605..c54e79c12 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -49,7 +49,7 @@ commands: aliases: [ebroadcast,bcast,ebcast] bigtree: description: Spawn a big tree where you are looking. - usage: / + usage: / aliases: [ebigtree] burn: description: Set a player on fire. @@ -387,7 +387,7 @@ commands: aliases: [etptoggle] tree: description: Spawn a tree where you are looking. - usage: / + usage: / aliases: [etree] unban: description: Unbans the specified player. -- cgit v1.2.3 From 968c849b139a14743a1bf81fbfce27b45c612b76 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 17:25:42 +0000 Subject: Update missing 1.2.3 items in items.csv --- Essentials/src/items.csv | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index acec277cc..70c23faa9 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -232,6 +232,10 @@ wtreesap,6,2 wlogsap,6,2 wtrunksap,6,2 wwoodsap,6,2 +junglesapling,6,3 +jsapling,6,3 +junglesap,6,3 +jsap,6,3 bedrock,7,0 oprock,7,0 opblock,7,0 @@ -360,6 +364,12 @@ wtree,17,2 wlog,17,2 wtrunk,17,2 wwood,17,2 +junglewood,17,3 +jwood,17,3 +junglelog,17,3 +jlog,17,3 +monkeytree,17,3 +monkeylog,17,3 leaves,18,4 leaf,18,4 treeleaves,18,4 @@ -454,6 +464,12 @@ bitreeleaf,18,6 bilogleaf,18,6 bitrunkleaf,18,6 biwoodleaf,18,6 +jungleleaves,18,7 +jleaves,18,7 +jleaf,18,7 +jungleleaf,18,7 +monkeyleaf,18,7 +monkeyleaves,18,7 sponge,19,0 glass,20,0 lapislazuliore,21,0 @@ -1295,6 +1311,10 @@ crackedstonebrick,98,2 crackedstonebricks,98,2 crackedstonebrickblock,98,2 crackedstonebb,98,2 +circlestonebrick,98,3 +circlestonebb,98,3 +circlestone,98,3 +circlesbb,98,3 hugeredmushroom,99,0 bigredmushroom,99,0 brmushroom,99,0 @@ -1462,8 +1482,14 @@ degg,122,0 bossegg,122,0 begg,122,0 redstonelamp,123,0 +redstonelampoff,123,0 redlamp,123,0 +redlampoff,123,0 rslamp,123,0 +rslampoff,123,0 +redstonelampon,124,0 +redlampon,124,0 +rslampon,124,0 ironshovel,256,0 ironspade,256,0 ishovel,256,0 @@ -2322,6 +2348,10 @@ chickenraw,365,0 cookedchicken,366,0 grilledchicken,366,0 toastedchicken,366,0 +gchicken,366,0 +bbqchicken,366,0 +friedchicken,366,0 +cchicken,366,0 rottenflesh,367,0 zombieflesh,367,0 rottenmeat,367,0 @@ -2463,6 +2493,9 @@ bottleofenchanting,384,0 enchantingbottle,384,0 expbottle,384,0 xpbottle,384,0 +firecharge,385,0 +fireball,385,0 +grenade,385,0 goldmusicrecord,2256,0 goldmusicdisk,2256,0 goldmusiccd,2256,0 -- cgit v1.2.3 From 3d7d4a47d95a7332699397c8d1e93439612195c9 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 17:26:05 +0000 Subject: Bukkit R0.3 api updates. --- .../com/earth2me/essentials/commands/Commandbreak.java | 6 +++++- .../earth2me/essentials/craftbukkit/FakeInventory.java | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java index a03c24264..406230401 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java @@ -2,10 +2,13 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; +import java.util.ArrayList; +import java.util.List; import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.block.Block; import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.inventory.ItemStack; public class Commandbreak extends EssentialsCommand @@ -32,7 +35,8 @@ public class Commandbreak extends EssentialsCommand { throw new Exception(_("noBreakBedrock")); } - final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase()); + final List list = (List)block.getDrops(); + final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase(), list); server.getPluginManager().callEvent(event); if (event.isCancelled()) { diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java index 01e7bd5b2..8456c956e 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeInventory.java @@ -222,4 +222,22 @@ public class FakeInventory implements Inventory { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public int getMaxStackSize() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaxStackSize(int size) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ListIterator iterator(int index) + { + throw new UnsupportedOperationException("Not supported yet."); + } } -- cgit v1.2.3 From 9570e5cfd9731e19420f33048c55d3fb7d58bc7d Mon Sep 17 00:00:00 2001 From: ElgarL Date: Thu, 22 Mar 2012 17:54:59 +0000 Subject: Correct Grammar --- EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index baa45a275..09ea3b247 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -1527,7 +1527,7 @@ public class GroupManager extends JavaPlugin { overloadedUsers.put(dataHolder.getName().toLowerCase(), new ArrayList()); } overloadedUsers.get(dataHolder.getName().toLowerCase()).clear(); - sender.sendMessage(ChatColor.YELLOW + " " + count + "All users in overload mode are now are normal again."); + sender.sendMessage(ChatColor.YELLOW + " " + count + "All users in overload mode are now normal again."); return true; -- cgit v1.2.3 From 165a76d492f63c825e5e7b6490a8bb3fe7043a86 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 18:00:13 +0000 Subject: Add villager professions to /spawnmob --- .../src/com/earth2me/essentials/Essentials.java | 2 +- .../essentials/commands/Commandspawnmob.java | 43 ++++++++++++---------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 05e5df1aa..68f976113 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 2070; + public static final int BUKKIT_VERSION = 2098; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 8d716106f..fdaa0eb9e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -11,6 +11,8 @@ import org.bukkit.Location; import org.bukkit.Server; import org.bukkit.block.Block; import org.bukkit.entity.*; +import org.bukkit.entity.Villager.Profession; +import org.bukkit.material.Colorable; public class Commandspawnmob extends EssentialsCommand @@ -199,7 +201,8 @@ public class Commandspawnmob extends EssentialsCommand private void changeMobData(final EntityType type, final Entity spawned, String data, final User user) throws Exception { data = data.toLowerCase(Locale.ENGLISH); - if (type == EntityType.SLIME || type == EntityType.MAGMA_CUBE) + + if (spawned instanceof Slime) { try { @@ -210,32 +213,24 @@ public class Commandspawnmob extends EssentialsCommand throw new Exception(_("slimeMalformedSize"), e); } } - 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")) + if (spawned instanceof Ageable && data.contains("baby")) { - ((Animals)spawned).setBaby(); + ((Ageable)spawned).setBaby(); return; } - if (type == EntityType.SHEEP) + if (spawned instanceof Colorable) { final String color = data.toUpperCase(Locale.ENGLISH).replace("BABY", ""); try { if (color.equals("RANDOM")) { - Random rand = new Random(); - ((Sheep)spawned).setColor(DyeColor.values()[rand.nextInt(DyeColor.values().length)]); + final Random rand = new Random(); + ((Colorable)spawned).setColor(DyeColor.values()[rand.nextInt(DyeColor.values().length)]); } else { - ((Sheep)spawned).setColor(DyeColor.valueOf(color)); + ((Colorable)spawned).setColor(DyeColor.valueOf(color)); } } catch (Exception e) @@ -243,9 +238,7 @@ public class Commandspawnmob extends EssentialsCommand throw new Exception(_("sheepMalformedColor"), e); } } - if ((type == EntityType.WOLF - || type == EntityType.OCELOT) - && data.contains("tamed")) + if (spawned instanceof Tameable && data.contains("tamed")) { final Tameable tameable = ((Tameable)spawned); tameable.setTamed(true); @@ -266,14 +259,24 @@ public class Commandspawnmob extends EssentialsCommand { ((Ocelot)spawned).setCatType(Ocelot.Type.SIAMESE_CAT); } - if (data.contains("red")) + else if (data.contains("red")) { ((Ocelot)spawned).setCatType(Ocelot.Type.RED_CAT); } - if (data.contains("black")) + else if (data.contains("black")) { ((Ocelot)spawned).setCatType(Ocelot.Type.BLACK_CAT); } } + if (type == EntityType.VILLAGER) + { + for (Profession prof : Villager.Profession.values()) + { + if (data.contains(prof.toString().toLowerCase(Locale.ENGLISH))) + { + ((Villager)spawned).setProfession(prof); + } + } + } } } -- cgit v1.2.3 From 56fce34539390ba0c78f30126f8524b46894df61 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 20:48:27 +0000 Subject: Extra items in 1.2.4 --- Essentials/src/items.csv | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index 70c23faa9..703772685 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -17,6 +17,76 @@ wplank,5,0 plankwooden,5,0 plankwood,5,0 plankw,5,0 +darkplank,5,1 +darkwoodenplank,5,1 +darkwoodplank,5,1 +darkwplank,5,1 +darkplankwooden,5,1 +darkplankwood,5,1 +darkplankw,5,1 +dplank,5,1 +dwoodenplank,5,1 +dwoodplank,5,1 +dwplank,5,1 +dplankwooden,5,1 +dplankwood,5,1 +dplankw,5,1 +pineplank,5,1 +pinewoodenplank,5,1 +pinewoodplank,5,1 +pinewplank,5,1 +pineplankwooden,5,1 +pineplankwood,5,1 +pineplankw,5,1 +pplank,5,1 +pwoodenplank,5,1 +pwoodplank,5,1 +pwplank,5,1 +pplankwooden,5,1 +pplankwood,5,1 +pplankw,5,1 +lightplank,5,2 +lightwoodenplank,5,2 +lightwoodplank,5,2 +lightwplank,5,2 +lightplankwooden,5,2 +lightplankwood,5,2 +lightplankw,5,2 +liteplank,5,2 +litewoodenplank,5,2 +litewoodplank,5,2 +litewplank,5,2 +liteplankwooden,5,2 +liteplankwood,5,2 +liteplankw,5,2 +birchplank,5,2 +birchwoodenplank,5,2 +birchwoodplank,5,2 +birchwplank,5,2 +birchplankwooden,5,2 +birchplankwood,5,2 +birchplankw,5,2 +bplank,5,2 +bwoodenplank,5,2 +bwoodplank,5,2 +bwplank,5,2 +bplankwooden,5,2 +bplankwood,5,2 +bplankw,5,2 +jungleplank,5,3 +junglewoodenplank,5,3 +junglewoodplank,5,3 +junglewplank,5,3 +jungleplankwooden,5,3 +jungleplankwood,5,3 +jungleplankw,5,3 +jplank,5,3 +jwoodenplank,5,3 +jwoodplank,5,3 +jwplank,5,3 +jplankwooden,5,3 +jplankwood,5,3 +jplankw,5,3 sapling,6,0 treesapling,6,0 logsapling,6,0 @@ -492,6 +562,25 @@ dispenser,23,0 dispense,23,0 sandstone,24,0 sastone,24,0 +csandstone,24,1 +csastone,24,1 +creepersandstone,24,1 +creepersastone,24,1 +hieroglyphicsandstone,24,1 +hieroglyphicsastone,24,1 +hieroglyphsandstone,24,1 +hieroglyphsastone,24,1 +hsandstone,24,1 +hsastone,24,1 +pyramidsandstone,24,1 +pyramidsastone,24,1 +psandstone,24,1 +psastone,24,1 +smoothsandstone,24,2 +smoothsastone,24,2 +ssandstone,24,2 +smsastone,24,2 +ssastone,24,2 noteblock,25,0 musicblock,25,0 nblock,25,0 -- cgit v1.2.3 From cd0d37f73c5d8f2e9990d96ff95eb04ab4322bd5 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 20:53:58 +0000 Subject: Update to 1.2.4 (R0.1) New Minimum CB version: 2100 --- .../src/com/earth2me/essentials/Essentials.java | 2 +- lib/bukkit.jar | Bin 4706072 -> 4715475 bytes lib/craftbukkit.jar | Bin 11069383 -> 11102949 bytes 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 68f976113..4111d3ca7 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 2098; + public static final int BUKKIT_VERSION = 2100; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); diff --git a/lib/bukkit.jar b/lib/bukkit.jar index 5cc58ca1d..95ac7392f 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index 009194ab9..67b691c8e 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From 0dc1270aedb932d19d5c1c2e313c4f2fb099bbc0 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 22:07:13 +0000 Subject: Split colour permissions into 3: color/magic/format --- .../src/com/earth2me/essentials/Settings.java | 4 +- Essentials/src/com/earth2me/essentials/User.java | 4 +- Essentials/src/com/earth2me/essentials/Util.java | 69 ++++++++++++++++++++-- .../earth2me/essentials/commands/Commandgive.java | 1 + .../essentials/commands/Commandhelpop.java | 2 +- .../earth2me/essentials/commands/Commandlist.java | 2 +- .../earth2me/essentials/commands/Commandmail.java | 4 +- .../earth2me/essentials/commands/Commandme.java | 9 +-- .../earth2me/essentials/commands/Commandmsg.java | 11 +--- .../earth2me/essentials/commands/Commandnick.java | 10 ++-- .../earth2me/essentials/commands/Commandping.java | 2 +- .../com/earth2me/essentials/commands/Commandr.java | 11 +--- .../essentials/commands/Commandrealname.java | 4 +- .../earth2me/essentials/commands/Commandwhois.java | 4 +- .../essentials/signs/SignBlockListener.java | 4 +- .../earth2me/essentials/signs/SignProtection.java | 2 +- .../chat/EssentialsChatPlayerListenerLowest.java | 9 +-- 17 files changed, 92 insertions(+), 60 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index f094dda6e..2aa1d93c1 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -327,7 +327,7 @@ public class Settings implements ISettings { String format = config.getString("chat.group-formats." + (group == null ? "Default" : group), config.getString("chat.format", "&7[{GROUP}]&f {DISPLAYNAME}&7:&f {MESSAGE}")); - format = Util.replaceColor(format); + format = Util.replaceFormat(format); format = format.replace("{DISPLAYNAME}", "%1$s"); format = format.replace("{GROUP}", "{0}"); format = format.replace("{MESSAGE}", "%2$s"); @@ -349,7 +349,7 @@ public class Settings implements ISettings @Override public IText getAnnounceNewPlayerFormat() { - return new SimpleTextInput(Util.replaceColor(config.getString("newbies.announce-format", "&dWelcome {DISPLAYNAME} to the server!"))); + return new SimpleTextInput(Util.replaceFormat(config.getString("newbies.announce-format", "&dWelcome {DISPLAYNAME} to the server!"))); } @Override diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 51e10dbf5..c4293cc63 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -194,7 +194,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser @Override public int compareTo(final User other) { - return Util.stripColor(this.getDisplayName()).compareToIgnoreCase(Util.stripColor(other.getDisplayName())); + return Util.stripFormat(this.getDisplayName()).compareToIgnoreCase(Util.stripFormat(other.getDisplayName())); } @Override @@ -326,7 +326,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser } if (name.length() > 16) { - name = Util.stripColor(name); + name = Util.stripFormat(name); } try { diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index fbb8deb08..7a6de8730 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -495,26 +495,83 @@ public class Util } return buf.toString(); } - private static transient final Pattern VANILLA_COLOR_PATTERN = Pattern.compile("\u00A7+[0-9A-FKa-fk]"); - private static transient final Pattern EASY_COLOR_PATTERN = Pattern.compile("&([0-9a-fk])"); + private static transient final Pattern VANILLA_PATTERN = Pattern.compile("\u00A7+[0-9A-FK-ORa-fk-or]"); + private static transient final Pattern REPLACE_PATTERN = Pattern.compile("&([0-9a-fk-or])"); + private static transient final Pattern VANILLA_COLOR_PATTERN = Pattern.compile("\u00A7+[0-9A-Fa-f]"); + private static transient final Pattern VANILLA_MAGIC_PATTERN = Pattern.compile("\u00A7+[Kk]"); + private static transient final Pattern VANILLA_FORMAT_PATTERN = Pattern.compile("\u00A7+[L-ORl-or]"); + private static transient final Pattern REPLACE_COLOR_PATTERN = Pattern.compile("&([0-9a-f])"); + private static transient final Pattern REPLACE_MAGIC_PATTERN = Pattern.compile("&(k)"); + private static transient final Pattern REPLACE_FORMAT_PATTERN = Pattern.compile("&([l-or])"); + + public static String stripFormat(final String input) + { + if (input == null) + { + return null; + } + return VANILLA_PATTERN.matcher(input).replaceAll(""); + } - public static String stripColor(final String input) + public static String replaceFormat(final String input) { if (input == null) { return null; } + return REPLACE_PATTERN.matcher(input).replaceAll(""); + } - return VANILLA_COLOR_PATTERN.matcher(input).replaceAll(""); + public static String blockURL(final String input) + { + if (input == null) + { + return null; + } + return input.replace(".", ". ").replace(". ", ". "); } - public static String replaceColor(final String input) + public static String formatString(final IUser user, final String permBase, final String input) { if (input == null) { return null; } + String message; + if (user.isAuthorized(permBase + ".color")) + { + message = Util.replaceColor(input, REPLACE_COLOR_PATTERN); + } + else + { + message = Util.stripColor(input, VANILLA_COLOR_PATTERN); + } + if (user.isAuthorized(permBase + ".magic")) + { + message = Util.replaceColor(message, REPLACE_MAGIC_PATTERN); + } + else + { + message = Util.stripColor(message, VANILLA_MAGIC_PATTERN); + } + if (user.isAuthorized(permBase + ".format")) + { + message = Util.replaceColor(message, REPLACE_FORMAT_PATTERN); + } + else + { + message = Util.stripColor(message, VANILLA_FORMAT_PATTERN); + } + return message; + } - return EASY_COLOR_PATTERN.matcher(input).replaceAll("\u00a7$1"); + private static String stripColor(final String input, final Pattern pattern) + { + return pattern.matcher(input).replaceAll(""); + } + + private static String replaceColor(final String input, final Pattern pattern) + { + return pattern.matcher(input).replaceAll("\u00a7$1"); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java index 9db7d4da3..701fa6577 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java @@ -85,6 +85,7 @@ public class Commandgive extends EssentialsCommand throw new Exception(_("cantSpawnItem", "Air")); } + //TODO: TL this. final String itemName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' '); sender.sendMessage(ChatColor.BLUE + "Giving " + stack.getAmount() + " of " + itemName + " to " + giveTo.getDisplayName() + "."); if (giveTo.isAuthorized("essentials.oversizedstacks")) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java b/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java index f26154f71..948cfa769 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java @@ -23,7 +23,7 @@ public class Commandhelpop extends EssentialsCommand throw new NotEnoughArgumentsException(); } user.setDisplayNick(); - final String message = _("helpOp", user.getDisplayName(), Util.stripColor(getFinalArg(args, 0))); + final String message = _("helpOp", user.getDisplayName(), Util.stripFormat(getFinalArg(args, 0))); logger.log(Level.INFO, message); for (Player onlinePlayer : server.getOnlinePlayers()) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java index 7e699328b..c981f45c1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java @@ -75,7 +75,7 @@ public class Commandlist extends EssentialsCommand for (String group : groups) { final StringBuilder groupString = new StringBuilder(); - groupString.append(_("listGroupTag", Util.replaceColor(group))); + groupString.append(_("listGroupTag", Util.replaceFormat(group))); final List users = sort.get(group); Collections.sort(users); boolean first = true; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java index abc551f58..fa4643875 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java @@ -59,7 +59,7 @@ public class Commandmail extends EssentialsCommand } if (!u.isIgnoredPlayer(user.getName())) { - final String mail = Util.sanitizeString(Util.stripColor(getFinalArg(args, 2))); + final String mail = Util.sanitizeString(Util.stripFormat(getFinalArg(args, 2))); u.addMail(user.getName() + ": " + mail); } user.sendMessage(_("mailSent")); @@ -71,7 +71,7 @@ public class Commandmail extends EssentialsCommand { throw new Exception(_("noPerm", "essentials.mail.sendall")); } - ess.scheduleAsyncDelayedTask(new SendAll(user.getName() + ": " + Util.stripColor(getFinalArg(args, 1)))); + ess.scheduleAsyncDelayedTask(new SendAll(user.getName() + ": " + Util.stripFormat(getFinalArg(args, 1)))); user.sendMessage(_("mailSent")); return; } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandme.java b/Essentials/src/com/earth2me/essentials/commands/Commandme.java index 0bf2a536d..ec2857841 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandme.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandme.java @@ -27,14 +27,7 @@ public class Commandme extends EssentialsCommand } String message = getFinalArg(args, 0); - if (user.isAuthorized("essentials.chat.color")) - { - message = Util.replaceColor(message); - } - else - { - message = Util.stripColor(message); - } + message = Util.formatString(user, "essentials.chat", message); user.setDisplayNick(); ess.broadcastMessage(user, _("action", user.getDisplayName(), message)); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java index 128d8eeb5..8a6cdad32 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java @@ -34,18 +34,11 @@ public class Commandmsg extends EssentialsCommand { throw new Exception(_("voiceSilenced")); } - if (user.isAuthorized("essentials.msg.color")) - { - message = Util.replaceColor(message); - } - else - { - message = Util.stripColor(message); - } + message = Util.formatString(user, "essentials.msg", message); } else { - message = Util.replaceColor(message); + message = Util.replaceFormat(message); } final String translatedMe = _("me"); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java index b9fbccb37..808e0be70 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java @@ -64,11 +64,13 @@ public class Commandnick extends EssentialsCommand private String formatNickname(final User user, final String nick) { - if (user == null || user.isAuthorized("essentials.nick.color")) + if (user == null) { - return nick.replace('&', '\u00a7').replaceAll("\u00a7+k", ""); - } else { - return Util.stripColor(nick); + return Util.replaceFormat(nick); + } + else + { + return Util.formatString(user, "essentials.nick", nick); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandping.java b/Essentials/src/com/earth2me/essentials/commands/Commandping.java index 0956f4082..43aa18d5f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandping.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandping.java @@ -23,7 +23,7 @@ public class Commandping extends EssentialsCommand } else { - sender.sendMessage(Util.replaceColor(getFinalArg(args, 0))); + sender.sendMessage(Util.replaceFormat(getFinalArg(args, 0))); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandr.java b/Essentials/src/com/earth2me/essentials/commands/Commandr.java index fe2a4e5b1..00072fded 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandr.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandr.java @@ -32,20 +32,13 @@ public class Commandr extends EssentialsCommand if (sender instanceof Player) { User user = ess.getUser(sender); - if (user.isAuthorized("essentials.msg.color")) - { - message = Util.replaceColor(message); - } - else - { - message = Util.stripColor(message); - } + message = Util.formatString(user, "essentials.msg", message); replyTo = user; senderName = user.getDisplayName(); } else { - message = Util.replaceColor(message); + message = Util.replaceFormat(message); replyTo = Console.getConsoleReplyTo(); senderName = Console.NAME; } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java index 6f9049756..c99018211 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java @@ -32,9 +32,9 @@ public class Commandrealname extends EssentialsCommand continue; } u.setDisplayNick(); - final String displayName = Util.stripColor(u.getDisplayName()).toLowerCase(Locale.ENGLISH); + final String displayName = Util.stripFormat(u.getDisplayName()).toLowerCase(Locale.ENGLISH); if (!whois.equals(displayName) - && !displayName.equals(Util.stripColor(ess.getSettings().getNicknamePrefix()) + whois) + && !displayName.equals(Util.stripFormat(ess.getSettings().getNicknamePrefix()) + whois) && !whois.equalsIgnoreCase(u.getName())) { continue; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java index 4f1c2267a..6c7919163 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java @@ -37,7 +37,7 @@ public class Commandwhois extends EssentialsCommand showhidden = true; } final String whois = args[0].toLowerCase(Locale.ENGLISH); - final int prefixLength = Util.stripColor(ess.getSettings().getNicknamePrefix()).length(); + final int prefixLength = Util.stripFormat(ess.getSettings().getNicknamePrefix()).length(); for (Player onlinePlayer : server.getOnlinePlayers()) { final User user = ess.getUser(onlinePlayer); @@ -45,7 +45,7 @@ public class Commandwhois extends EssentialsCommand { continue; } - final String nickName = Util.stripColor(user.getNickname()); + final String nickName = Util.stripFormat(user.getNickname()); if (!whois.equalsIgnoreCase(nickName) && !whois.substring(prefixLength).equalsIgnoreCase(nickName) && !whois.equalsIgnoreCase(user.getName())) diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java index bd90d6c47..fc020aa88 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java @@ -88,14 +88,14 @@ public class SignBlockListener implements Listener { for (int i = 0; i < 4; i++) { - event.setLine(i, Util.replaceColor(event.getLine(i))); + event.setLine(i, Util.replaceFormat(event.getLine(i))); } } else { for (int i = 0; i < 4; i++) { - event.setLine(i, Util.stripColor(event.getLine(i))); + event.setLine(i, Util.stripFormat(event.getLine(i))); } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignProtection.java b/Essentials/src/com/earth2me/essentials/signs/SignProtection.java index 088e74f01..2f2d25c46 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignProtection.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignProtection.java @@ -147,7 +147,7 @@ public class SignProtection extends EssentialsSign { return SignProtectionState.OWNER; } - if (Util.stripColor(sign.getLine(3)).equalsIgnoreCase(username)) + if (Util.stripFormat(sign.getLine(3)).equalsIgnoreCase(username)) { return SignProtectionState.OWNER; } diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java index 5a8cde62d..2c0906cbf 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java @@ -37,14 +37,7 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer /** * This listener should apply the general chat formatting only...then return control back the event handler */ - if (user.isAuthorized("essentials.chat.color")) - { - event.setMessage(Util.replaceColor(event.getMessage())); - } - else - { - event.setMessage(Util.stripColor(event.getMessage())); - } + event.setMessage(Util.formatString(user, "essentials.chat", event.getMessage())); String group = user.getGroup(); String world = user.getWorld().getName(); event.setFormat(ess.getSettings().getChatFormat(group).format(new Object[] {group, world, world.substring(0, 1).toUpperCase(Locale.ENGLISH)})); -- cgit v1.2.3 From d20519ef8bf4141cb99ffc7dd2f43783e2c23253 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 22:15:18 +0000 Subject: New Permission: essentials.chat.url Without this perm, URLs will be modified not to be links. --- Essentials/src/com/earth2me/essentials/Util.java | 29 ++++++++++++++++------ .../earth2me/essentials/commands/Commandme.java | 2 +- .../earth2me/essentials/commands/Commandmsg.java | 2 +- .../com/earth2me/essentials/commands/Commandr.java | 2 +- .../chat/EssentialsChatPlayerListenerLowest.java | 7 ++++-- 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index 7a6de8730..d387cad56 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -495,6 +495,7 @@ public class Util } return buf.toString(); } + private static transient final Pattern URL_PATTERN = Pattern.compile("^((?:(?:https?)://)?[\\w-_\\.]{2,})\\.([a-z]{2,3}(?:/\\S+)?)$"); private static transient final Pattern VANILLA_PATTERN = Pattern.compile("\u00A7+[0-9A-FK-ORa-fk-or]"); private static transient final Pattern REPLACE_PATTERN = Pattern.compile("&([0-9a-fk-or])"); private static transient final Pattern VANILLA_COLOR_PATTERN = Pattern.compile("\u00A7+[0-9A-Fa-f]"); @@ -528,7 +529,7 @@ public class Util { return null; } - return input.replace(".", ". ").replace(". ", ". "); + return URL_PATTERN.matcher(input).replaceAll("$1 $2"); } public static String formatString(final IUser user, final String permBase, final String input) @@ -546,21 +547,35 @@ public class Util { message = Util.stripColor(input, VANILLA_COLOR_PATTERN); } - if (user.isAuthorized(permBase + ".magic")) + if (user.isAuthorized(permBase + ".format")) { - message = Util.replaceColor(message, REPLACE_MAGIC_PATTERN); + message = Util.replaceColor(message, REPLACE_FORMAT_PATTERN); } else { - message = Util.stripColor(message, VANILLA_MAGIC_PATTERN); + message = Util.stripColor(message, VANILLA_FORMAT_PATTERN); } - if (user.isAuthorized(permBase + ".format")) + return message; + } + + public static String formatMessage(final IUser user, final String permBase, final String input) + { + if (input == null) { - message = Util.replaceColor(message, REPLACE_FORMAT_PATTERN); + return null; + } + String message = formatString(user, permBase, input); + if (user.isAuthorized(permBase + ".magic")) + { + message = Util.replaceColor(message, REPLACE_MAGIC_PATTERN); } else { - message = Util.stripColor(message, VANILLA_FORMAT_PATTERN); + message = Util.stripColor(message, VANILLA_MAGIC_PATTERN); + } + if (!user.isAuthorized(permBase + ".url")) + { + message = Util.blockURL(message); } return message; } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandme.java b/Essentials/src/com/earth2me/essentials/commands/Commandme.java index ec2857841..4322592d4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandme.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandme.java @@ -27,7 +27,7 @@ public class Commandme extends EssentialsCommand } String message = getFinalArg(args, 0); - message = Util.formatString(user, "essentials.chat", message); + message = Util.formatMessage(user, "essentials.chat", message); user.setDisplayNick(); ess.broadcastMessage(user, _("action", user.getDisplayName(), message)); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java index 8a6cdad32..2e1011e3b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java @@ -34,7 +34,7 @@ public class Commandmsg extends EssentialsCommand { throw new Exception(_("voiceSilenced")); } - message = Util.formatString(user, "essentials.msg", message); + message = Util.formatMessage(user, "essentials.msg", message); } else { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandr.java b/Essentials/src/com/earth2me/essentials/commands/Commandr.java index 00072fded..9b585509d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandr.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandr.java @@ -32,7 +32,7 @@ public class Commandr extends EssentialsCommand if (sender instanceof Player) { User user = ess.getUser(sender); - message = Util.formatString(user, "essentials.msg", message); + message = Util.formatMessage(user, "essentials.msg", message); replyTo = user; senderName = user.getDisplayName(); } diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java index 2c0906cbf..599c39dda 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java @@ -37,9 +37,12 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer /** * This listener should apply the general chat formatting only...then return control back the event handler */ - event.setMessage(Util.formatString(user, "essentials.chat", event.getMessage())); + event.setMessage(Util.formatMessage(user, "essentials.chat", event.getMessage())); String group = user.getGroup(); String world = user.getWorld().getName(); - event.setFormat(ess.getSettings().getChatFormat(group).format(new Object[] {group, world, world.substring(0, 1).toUpperCase(Locale.ENGLISH)})); + event.setFormat(ess.getSettings().getChatFormat(group).format(new Object[] + { + group, world, world.substring(0, 1).toUpperCase(Locale.ENGLISH) + })); } } -- cgit v1.2.3 From 284fef00e70479dc9bce7a6a2a0baef122753f6c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 22:26:04 +0000 Subject: Split formatting perms for signs as well. --- Essentials/src/com/earth2me/essentials/Util.java | 16 ++++++++-------- .../com/earth2me/essentials/signs/SignBlockListener.java | 15 +++------------ 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index d387cad56..53ee4b8f3 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -547,6 +547,14 @@ public class Util { message = Util.stripColor(input, VANILLA_COLOR_PATTERN); } + if (user.isAuthorized(permBase + ".magic")) + { + message = Util.replaceColor(message, REPLACE_MAGIC_PATTERN); + } + else + { + message = Util.stripColor(message, VANILLA_MAGIC_PATTERN); + } if (user.isAuthorized(permBase + ".format")) { message = Util.replaceColor(message, REPLACE_FORMAT_PATTERN); @@ -565,14 +573,6 @@ public class Util return null; } String message = formatString(user, permBase, input); - if (user.isAuthorized(permBase + ".magic")) - { - message = Util.replaceColor(message, REPLACE_MAGIC_PATTERN); - } - else - { - message = Util.stripColor(message, VANILLA_MAGIC_PATTERN); - } if (!user.isAuthorized(permBase + ".url")) { message = Util.blockURL(message); diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java index fc020aa88..8acca9804 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java @@ -84,19 +84,10 @@ public class SignBlockListener implements Listener return; } User user = ess.getUser(event.getPlayer()); - if (user.isAuthorized("essentials.signs.color")) - { - for (int i = 0; i < 4; i++) - { - event.setLine(i, Util.replaceFormat(event.getLine(i))); - } - } - else + + for (int i = 0; i < 4; i++) { - for (int i = 0; i < 4; i++) - { - event.setLine(i, Util.stripFormat(event.getLine(i))); - } + event.setLine(i, Util.formatString(user, "essentials.signs", event.getLine(i))); } for (Signs signs : Signs.values()) -- cgit v1.2.3 From 71358629f4347c570d2e267b7102f3af812e71d7 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 22:59:52 +0000 Subject: New command: /fly New perm: essentials.fly.others --- .../src/com/earth2me/essentials/Essentials.java | 2 +- .../src/com/earth2me/essentials/OfflinePlayer.java | 13 ++++- .../earth2me/essentials/commands/Commandfly.java | 63 ++++++++++++++++++++++ Essentials/src/messages.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 3 +- Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_nl.properties | 1 + Essentials/src/plugin.yml | 4 ++ 11 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 Essentials/src/com/earth2me/essentials/commands/Commandfly.java diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 4111d3ca7..660d4887b 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 2100; + public static final int BUKKIT_VERSION = 2105; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index 6a88eb533..c6230f5e0 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -26,7 +26,6 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.util.Vector; - public class OfflinePlayer implements Player { private final transient IEssentials ess; @@ -1040,4 +1039,16 @@ public class OfflinePlayer implements Player { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public boolean isFlying() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFlying(boolean arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java new file mode 100644 index 000000000..ea6192589 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java @@ -0,0 +1,63 @@ +package com.earth2me.essentials.commands; + +import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.User; +import java.util.Locale; +import org.bukkit.GameMode; +import org.bukkit.Server; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + + +public class Commandfly extends EssentialsCommand +{ + public Commandfly() + { + super("fly"); + } + + @Override + protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception + { + if (args.length < 1) + { + throw new NotEnoughArgumentsException(); + } + + flyOtherPlayers(server, sender, args[0]); + } + + @Override + protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception + { + if (args.length > 0 && !args[0].trim().isEmpty() && user.isAuthorized("essentials.fly.others")) + { + flyOtherPlayers(server, user, args[0]); + return; + } + user.setAllowFlight(!user.getAllowFlight()); + if (!user.getAllowFlight()) + { + user.setFlying(false); + } + user.sendMessage(_("flyMode", _(user.getAllowFlight() ? "true" : "false"), user.getDisplayName())); + } + + private void flyOtherPlayers(final Server server, final CommandSender sender, final String name) + { + for (Player matchPlayer : server.matchPlayer(name)) + { + final User player = ess.getUser(matchPlayer); + if (player.isHidden()) + { + continue; + } + player.setAllowFlight(!player.getAllowFlight()); + if (!player.getAllowFlight()) + { + player.setFlying(false); + } + sender.sendMessage(_("flyMode", _(player.getAllowFlight() ? "true" : "false"), player.getDisplayName())); + } + } +} diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 02598c9cb..aa32ad340 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -92,6 +92,7 @@ false=false feed=\u00a77Your appetite was sated. feedOther=\u00a77Satisfied {0}. fileRenameError=Renaming file {0} failed +flyMode=\u00a77Set fly mode {0} for {1}. foreverAlone=\u00a7cYou have nobody to whom you can reply. freedMemory=Freed {0} MB. gameMode=\u00a77Set game mode {0} for {1}. diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index fd4803d3f..9304c52df 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -92,6 +92,7 @@ false=false feed=\u00a77Your appetite was sated. feedOther=\u00a77Satisfied {0}. fileRenameError=Omd\u00c3\u00b8bning af fil {0} fejlede. +flyMode=\u00a77Set fly mode {0} for {1}. foreverAlone=\u00a7cDu har ingen til hvem du kan svare. freedMemory=Frigjorde {0} MB. gameMode=\u00a77Satte game mode {0} for {1}. diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 767f028fd..9c7846008 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -92,6 +92,7 @@ false=false feed=\u00a77Your appetite was sated. feedOther=\u00a77Satisfied {0}. fileRenameError=Umbenennen von {0} gescheitert. +flyMode=\u00a77Set fly mode {0} for {1}. foreverAlone=\u00a7cDu hast niemanden, dem du antworten kannst. freedMemory={0} MB frei gemacht. gameMode=\u00a77Set game mode {0} for {1}. @@ -396,6 +397,7 @@ weatherStormFor=\u00a77In {0} st\u00fcrmt es nun f\u00fcr {1} Sekunden. weatherSun=\u00a77In {0} scheint nun die Sonne. weatherSunFor=\u00a77In {0} scheint nun f\u00fcr {1} Sekunden die Sonne. whoisBanned=\u00a79 - Banned: {0} +whoisExp=\u00a79 - Exp: {0} (Level {1}) whoisGamemode=\u00a79 - Gamemode: {0} whoisGeoLocation=\u00a79 - Herkunft: {0} whoisGod=\u00a79 - God mode: {0} @@ -415,4 +417,3 @@ year=Jahr years=Jahre youAreHealed=\u00a77Du wurdest geheilt. youHaveNewMail=\u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen. -whoisExp=\u00a79 - Exp: {0} (Level {1}) diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 0a64b2308..5cb5b8792 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -92,6 +92,7 @@ false=false feed=\u00a77Your appetite was sated. feedOther=\u00a77Satisfied {0}. fileRenameError=Renaming file {0} failed +flyMode=\u00a77Set fly mode {0} for {1}. foreverAlone=\u00a7cYou have nobody to whom you can reply. freedMemory=Freed {0} MB. gameMode=\u00a77Set game mode {0} for {1}. diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 6356bfbff..e1a256b40 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -92,6 +92,7 @@ false=false feed=\u00a77Your appetite was sated. feedOther=\u00a77Satisfied {0}. fileRenameError=Error al renombrar el archivo {0} +flyMode=\u00a77Set fly mode {0} for {1}. foreverAlone=\u00a7cNo tienes nadie a quien puedas responder. freedMemory= {0} MB libres. gameMode=\u00a77Set game mode {0} for {1}. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index e92efb181..1766f4df3 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -92,6 +92,7 @@ false=non feed=\u00a77Vous avez \u00e9t\u00e9 rassasi\u00e9. feedOther=\u00a77 est rassasi\u00e9 {0}. fileRenameError=Echec du changement de nom de {0} +flyMode=\u00a77Set fly mode {0} for {1}. foreverAlone=\u00a7cVous n''avez personne \u00e0 qui r\u00e9pondre freedMemory=A lib\u00e9r\u00e9 {0} Mo. gameMode=\u00a77Mode de jeu {0} pour {1}. diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 5ab703d99..c7f715e72 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -92,6 +92,7 @@ false=false feed=\u00a77Your appetite was sated. feedOther=\u00a77Satisfied {0}. fileRenameError=Hernoemen van {0} mislukt +flyMode=\u00a77Set fly mode {0} for {1}. foreverAlone=\u00a7cJe hebt niemand waarnaar je kan reageren. freedMemory={0} MB gelost. gameMode=\u00a77Set game mode {0} for {1}. diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index c54e79c12..7eaca70f4 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -98,6 +98,10 @@ commands: description: Satisfy the hunger. usage: / [player] aliases: [efeed,eat,eeat] + fly: + description: Take off, and soar! + usage: / [player] + aliases: [efly] itemdb: description: Searches for an item. usage: / -- cgit v1.2.3 From 96f0dd5824d2f2a5a406b103bddf60ba45b3e0dc Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 23:07:23 +0000 Subject: Update CB to 2105 --- lib/bukkit.jar | Bin 4715475 -> 4715585 bytes lib/craftbukkit.jar | Bin 11102949 -> 11095968 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/lib/bukkit.jar b/lib/bukkit.jar index 95ac7392f..60ba2177d 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index 67b691c8e..44b22101d 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From 3c9057f68e679792686510b3bfb1b26c7a8b05be Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 23:10:59 +0000 Subject: Fix jar building. --- Essentials/test/com/earth2me/essentials/FakeServer.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Essentials/test/com/earth2me/essentials/FakeServer.java b/Essentials/test/com/earth2me/essentials/FakeServer.java index 1d025abe7..63d03a5f9 100644 --- a/Essentials/test/com/earth2me/essentials/FakeServer.java +++ b/Essentials/test/com/earth2me/essentials/FakeServer.java @@ -717,4 +717,10 @@ public class FakeServer implements Server { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public long getConnectionThrottle() + { + throw new UnsupportedOperationException("Not supported yet."); + } } -- cgit v1.2.3 From c5eb1bb1058dd5d7189b88781980d03b0cd1ff82 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 22 Mar 2012 23:47:35 +0000 Subject: Improve kit matching, and add enchantments. Enchanted kit example in config.yml --- Essentials/src/com/earth2me/essentials/Kit.java | 38 +++++++++++++++++++++---- Essentials/src/config.yml | 7 +++-- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index cf39997ea..9f7bb5a5d 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -2,11 +2,13 @@ package com.earth2me.essentials; import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.capitalCase; +import com.earth2me.essentials.commands.Commandenchant; import com.earth2me.essentials.commands.NoChargeException; import com.earth2me.essentials.craftbukkit.InventoryWorkaround; import java.util.*; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; @@ -86,14 +88,40 @@ public class Kit boolean spew = false; for (String d : items) { - final String[] parts = d.split("[^0-9]+", 3); - final int id = Material.getMaterial(Integer.parseInt(parts[0])).getId(); - final int amount = parts.length > 1 ? Integer.parseInt(parts[parts.length > 2 ? 2 : 1]) : 1; - final short data = parts.length > 2 ? Short.parseShort(parts[1]) : 0; + final String[] parts = d.split(" "); + final String[] item = parts[0].split("[:+',;.]", 2); + final int id = Material.getMaterial(Integer.parseInt(item[0])).getId(); + final short data = item.length > 1 ? Short.parseShort(item[1]) : 0; + final int amount = parts.length > 1 ? Integer.parseInt(parts[1]) : 1; + + final ItemStack stack = new ItemStack(id, amount, data); + if (parts.length > 2) + { + for (int i = 2; i < parts.length; i++) + { + final String[] split = parts[i].split("[:+',;.]", 2); + if (split.length < 1) + { + continue; + } + final Enchantment enchantment = Commandenchant.getEnchantment(split[0], user); + int level; + if (split.length > 1) + { + level = Integer.parseInt(split[1]); + } + else + { + level = enchantment.getMaxLevel(); + } + stack.addEnchantment(enchantment, level); + } + } + final Map overfilled; if (user.isAuthorized("essentials.oversizedstacks")) { - overfilled = InventoryWorkaround.addItem(user.getInventory(), true, ess.getSettings().getOversizedStackSize(), new ItemStack(id, amount, data)); + overfilled = InventoryWorkaround.addItem(user.getInventory(), true, ess.getSettings().getOversizedStackSize(), stack); } else { diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index ef2485ae8..5462b6c12 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -168,19 +168,20 @@ player-commands: # Note: All items MUST be followed by a quantity! # All kit names should be lower case, and will be treated as lower in permissions/costs. +# Syntax: - itemID[:DataValue] Amount [Enchantment:Level].. # Times are measured in seconds. kits: dtools: delay: 10 items: - - 277 1 + - 277 1 efficiency:1 - 278 1 - - 279 1 + - 279:780 1 tools: delay: 10 items: - 272 1 - - 273 1 + - 273 1 - 274 1 - 275 1 -- cgit v1.2.3 From 42d01471d3c271ee69c6a610c827cd5da1a49602 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 23 Mar 2012 00:15:22 +0000 Subject: Disabling player list updates by default (can mess with tab completion) Hopefully this will be reverted if/when patch is found. --- Essentials/src/com/earth2me/essentials/ISettings.java | 2 ++ Essentials/src/com/earth2me/essentials/Settings.java | 6 ++++++ Essentials/src/com/earth2me/essentials/User.java | 17 ++++++++++------- Essentials/src/config.yml | 3 +++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index fe12720ea..1ef8feaa9 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -127,6 +127,8 @@ public interface ISettings extends IConf boolean removeGodOnDisconnect(); boolean changeDisplayName(); + + boolean changePlayerListName(); boolean isPlayerCommand(String string); diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 2aa1d93c1..e194cf21b 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -609,6 +609,12 @@ public class Settings implements ISettings { return config.getBoolean("change-displayname", true); } + + @Override + public boolean changePlayerListName() + { + return config.getBoolean("change-playerlist", false); + } @Override public boolean useBukkitPermissions() diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index c4293cc63..d84ab84aa 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -328,15 +328,18 @@ public class User extends UserData implements Comparable, IReplyTo, IUser { name = Util.stripFormat(name); } - try - { - setPlayerListName(name); - } - catch (IllegalArgumentException e) + if (ess.getSettings().changePlayerListName()) { - if (ess.getSettings().isDebug()) + try + { + setPlayerListName(name); + } + catch (IllegalArgumentException e) { - logger.log(Level.INFO, "Playerlist for " + name + " was not updated. Name clashed with another online player."); + if (ess.getSettings().isDebug()) + { + logger.log(Level.INFO, "Playerlist for " + name + " was not updated. Name clashed with another online player."); + } } } } diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 5462b6c12..657030626 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -33,6 +33,9 @@ nickname-prefix: '~' # Disable this if you have any other plugin, that modifies the displayname of a user. change-displayname: true +# When this option is enabled, the (tab) player list will be updated with nicknames and colours. +#change-playerlist: true + # Adds the prefix and suffix to the displayname of the player, so it will be displayed in messages and lists. # The prefix/suffix can be set using Permissions, Group Manager or PermissionsEx. # The value of change-displayname (above) has to be true. -- cgit v1.2.3 From 2f434291cbe3888c1e146648f9d8459423f7ca55 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 23 Mar 2012 00:19:27 +0000 Subject: Fixing chat color formatting. --- Essentials/src/com/earth2me/essentials/Util.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index 53ee4b8f3..48eb770b2 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -520,7 +520,7 @@ public class Util { return null; } - return REPLACE_PATTERN.matcher(input).replaceAll(""); + return REPLACE_PATTERN.matcher(input).replaceAll("\u00a7$1"); } public static String blockURL(final String input) -- cgit v1.2.3 From 033c2e22cd99147036488875e7c6c08d431aa8e4 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 23 Mar 2012 07:56:44 +0000 Subject: Remove white user prefix, if prefix is blank. Messes with EssentialsChat colouring. --- Essentials/src/com/earth2me/essentials/User.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index d84ab84aa..dde0c20e2 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -291,16 +291,12 @@ public class User extends UserData implements Comparable, IReplyTo, IUser { final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§'); nickname.insert(0, prefix); - if (prefix.length() < 2 || prefix.charAt(0) != '§') - { - nickname.insert(0, "§f"); - } } if (!ess.getSettings().disableSuffix()) { final String suffix = ess.getPermissionsHandler().getSuffix(base).replace('&', '§'); nickname.append(suffix); - if (suffix.length() < 2 || !suffix.substring(suffix.length() - 2, suffix.length() - 1).equals("§")) + if (suffix.length() < 2 || suffix.charAt(suffix.length() - 2) != '§') { nickname.append("§f"); } -- cgit v1.2.3 From 49cb482ca52f8138fc98a49db11d201f3e1e179e Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 23 Mar 2012 10:03:15 +0000 Subject: Update Essentials/src/config.yml --- Essentials/src/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 657030626..dc9f41656 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -33,7 +33,8 @@ nickname-prefix: '~' # Disable this if you have any other plugin, that modifies the displayname of a user. change-displayname: true -# When this option is enabled, the (tab) player list will be updated with nicknames and colours. +# When this option is enabled, the (tab) player list will be updated with the displayname. +# The value of change-displayname (above) has to be true. #change-playerlist: true # Adds the prefix and suffix to the displayname of the player, so it will be displayed in messages and lists. -- cgit v1.2.3 From 20c973dab2793ef71065bc44f259d3467cd7b2df Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 23 Mar 2012 11:13:03 +0100 Subject: Fix UTF8 handling in Configuration class --- .../com/earth2me/essentials/EssentialsConf.java | 97 ++++++++++++++++++---- 1 file changed, 82 insertions(+), 15 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsConf.java b/Essentials/src/com/earth2me/essentials/EssentialsConf.java index 9ffe7e5b6..846a7b4b0 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsConf.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsConf.java @@ -1,7 +1,14 @@ package com.earth2me.essentials; import static com.earth2me.essentials.I18n._; +import com.google.common.io.Files; import java.io.*; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.channels.FileChannel; +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CoderResult; import java.util.HashMap; import java.util.Locale; import java.util.Map; @@ -24,6 +31,7 @@ public class EssentialsConf extends YamlConfiguration private transient File configFile; private transient String templateName = null; private transient Class resourceClass = EssentialsConf.class; + private static final Charset UTF8 = Charset.forName("UTF-8"); public EssentialsConf(final File configFile) { @@ -104,15 +112,46 @@ public class EssentialsConf extends YamlConfiguration try { - super.load(configFile); - } - catch (FileNotFoundException ex) - { - LOGGER.log(Level.SEVERE, null, ex); + final FileInputStream inputStream = new FileInputStream(configFile); + try + { + final FileChannel channel = inputStream.getChannel(); + final ByteBuffer buffer = ByteBuffer.allocate((int)configFile.length()); + channel.read(buffer); + buffer.rewind(); + final CharBuffer data = CharBuffer.allocate((int)configFile.length()); + CharsetDecoder decoder = UTF8.newDecoder(); + CoderResult result = decoder.decode(buffer, data, true); + if (result.isError()) + { + buffer.rewind(); + data.clear(); + LOGGER.log(Level.INFO, "File {0} is not utf-8 encoded, trying {1}", new Object[] + { + configFile.getAbsolutePath().toString(), Charset.defaultCharset().displayName() + }); + decoder = Charset.defaultCharset().newDecoder(); + result = decoder.decode(buffer, data, true); + if (result.isError()) + { + throw new InvalidConfigurationException("Invalid Characters in file " + configFile.getAbsolutePath().toString()); + } else { + decoder.flush(data); + } + } else { + decoder.flush(data); + } + data.rewind(); + super.loadFromString(data.toString()); + } + finally + { + inputStream.close(); + } } catch (IOException ex) { - LOGGER.log(Level.SEVERE, null, ex); + LOGGER.log(Level.SEVERE, ex.getMessage(), ex); } catch (InvalidConfigurationException ex) { @@ -301,27 +340,55 @@ public class EssentialsConf extends YamlConfiguration return def; } } - - public void save() { + + public void save() + { try { save(configFile); } catch (IOException ex) { - LOGGER.log(Level.SEVERE, null, ex); + LOGGER.log(Level.SEVERE, ex.getMessage(), ex); } } - - public Object getProperty(String path) { + + @Override + public void save(final File file) throws IOException + { + if (file == null) + { + throw new IllegalArgumentException("File cannot be null"); + } + + Files.createParentDirs(file); + + final String data = saveToString(); + + final OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(file), UTF8); + + try + { + writer.write(data); + } + finally + { + writer.close(); + } + } + + public Object getProperty(String path) + { return get(path); } - - public void setProperty(String path, Object object) { + + public void setProperty(String path, Object object) + { set(path, object); } - - public void removeProperty(String path) { + + public void removeProperty(String path) + { set(path, null); } } -- cgit v1.2.3 From c46f14665c0eeea0ebf64251e4cc773d7d2c8a55 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 23 Mar 2012 10:16:38 +0000 Subject: Adding missing entities to Protect Spawn Blacklist --- Essentials/src/config.yml | 31 +++++++++++----------- .../protect/EssentialsProtectEntityListener.java | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index dc9f41656..2399b9be9 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -462,30 +462,31 @@ protect: entitytarget: false # Prevent the spawning of creatures spawn: - chicken: false - cow: false creeper: false - ghast: false - giant: false - monster: false - pig: false - pig_zombie: false - sheep: false skeleton: false - slime: false spider: false - squid: false + giant: false zombie: false - wolf: false - cave_spider: false + slime: false + ghast: false + pig_zombie: false enderman: false + cave_spider: false silverfish: false - ender_dragon: false - villager: false blaze: false - mushroom_cow: false magma_cube: false + ender_dragon: false + pig: false + sheep: false + cow: false + chicken: false + squid: false + wolf: false + mushroom_cow: false snowman: false + ocelot: false + iron_golem: false + villager: false # Maximum height the creeper should explode. -1 allows them to explode everywhere. # Set prevent.creeper-explosion to true, if you want to disable creeper explosions. diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index fe3cadbbe..1868e20c1 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -274,7 +274,7 @@ public class EssentialsProtectEntityListener implements Listener { return; } - final CreatureType creature = event.getCreatureType(); + final EntityType creature = event.getEntityType(); if (creature == null) { return; -- cgit v1.2.3 From 29a190f93a89c0b9d5532aadd7a84f16b1a4c736 Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 23 Mar 2012 12:10:46 +0100 Subject: http://youtu.be/8DdeLUA0Fms --- Essentials/src/com/earth2me/essentials/I18n.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Essentials/src/com/earth2me/essentials/I18n.java b/Essentials/src/com/earth2me/essentials/I18n.java index 63fdcc065..97d500a6a 100644 --- a/Essentials/src/com/earth2me/essentials/I18n.java +++ b/Essentials/src/com/earth2me/essentials/I18n.java @@ -114,6 +114,7 @@ public class I18n implements II18n { currentLocale = new Locale(parts[0], parts[1], parts[2]); } + ResourceBundle.clearCache(); Logger.getLogger("Minecraft").log(Level.INFO, String.format("Using locale %s", currentLocale.toString())); customBundle = ResourceBundle.getBundle(MESSAGES, currentLocale, new FileResClassLoader(I18n.class.getClassLoader(), ess)); localeBundle = ResourceBundle.getBundle(MESSAGES, currentLocale); -- cgit v1.2.3 From 8a22258945e4737230a977202128a581d4d3aeef Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 23 Mar 2012 14:22:10 +0100 Subject: Fix utf-8 decoding problems. --- .../src/com/earth2me/essentials/EssentialsConf.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsConf.java b/Essentials/src/com/earth2me/essentials/EssentialsConf.java index 846a7b4b0..89fb53d34 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsConf.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsConf.java @@ -126,23 +126,25 @@ public class EssentialsConf extends YamlConfiguration { buffer.rewind(); data.clear(); - LOGGER.log(Level.INFO, "File {0} is not utf-8 encoded, trying {1}", new Object[] - { - configFile.getAbsolutePath().toString(), Charset.defaultCharset().displayName() - }); + LOGGER.log(Level.INFO, "File " + configFile.getAbsolutePath().toString() + "is not utf-8 encoded, trying " + Charset.defaultCharset().displayName()); decoder = Charset.defaultCharset().newDecoder(); result = decoder.decode(buffer, data, true); if (result.isError()) { throw new InvalidConfigurationException("Invalid Characters in file " + configFile.getAbsolutePath().toString()); - } else { + } + else + { decoder.flush(data); } - } else { + } + else + { decoder.flush(data); } + final int end = data.position(); data.rewind(); - super.loadFromString(data.toString()); + super.loadFromString(data.subSequence(0, end).toString()); } finally { -- cgit v1.2.3 From c503adabc5ab0e2780fa0faeadfe1008112d9019 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 23 Mar 2012 13:26:03 +0000 Subject: Fix url matching. --- Essentials/src/com/earth2me/essentials/Util.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index 48eb770b2..510ab8a9a 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -495,7 +495,7 @@ public class Util } return buf.toString(); } - private static transient final Pattern URL_PATTERN = Pattern.compile("^((?:(?:https?)://)?[\\w-_\\.]{2,})\\.([a-z]{2,3}(?:/\\S+)?)$"); + private static transient final Pattern URL_PATTERN = Pattern.compile("((?:(?:https?)://)?[\\w-_\\.]{2,})\\.([a-z]{2,3}(?:/\\S+)?)"); private static transient final Pattern VANILLA_PATTERN = Pattern.compile("\u00A7+[0-9A-FK-ORa-fk-or]"); private static transient final Pattern REPLACE_PATTERN = Pattern.compile("&([0-9a-fk-or])"); private static transient final Pattern VANILLA_COLOR_PATTERN = Pattern.compile("\u00A7+[0-9A-Fa-f]"); @@ -529,7 +529,12 @@ public class Util { return null; } - return URL_PATTERN.matcher(input).replaceAll("$1 $2"); + String text = URL_PATTERN.matcher(input).replaceAll("$1 $2"); + while (URL_PATTERN.matcher(text).find()) + { + text = URL_PATTERN.matcher(text).replaceAll("$1 $2"); + } + return text; } public static String formatString(final IUser user, final String permBase, final String input) -- cgit v1.2.3 From a0cba8e63d95b62dfc34db77927f715aac162c1c Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 23 Mar 2012 14:30:00 +0100 Subject: Spaaaaaace! So much space! Gotta see it all! --- Essentials/src/com/earth2me/essentials/EssentialsConf.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsConf.java b/Essentials/src/com/earth2me/essentials/EssentialsConf.java index 89fb53d34..85c2bbd8c 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsConf.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsConf.java @@ -126,7 +126,7 @@ public class EssentialsConf extends YamlConfiguration { buffer.rewind(); data.clear(); - LOGGER.log(Level.INFO, "File " + configFile.getAbsolutePath().toString() + "is not utf-8 encoded, trying " + Charset.defaultCharset().displayName()); + LOGGER.log(Level.INFO, "File " + configFile.getAbsolutePath().toString() + " is not utf-8 encoded, trying " + Charset.defaultCharset().displayName()); decoder = Charset.defaultCharset().newDecoder(); result = decoder.decode(buffer, data, true); if (result.isError()) -- cgit v1.2.3 From 0a74da88d6afdc5be4045309cf8415ca2acb38cd Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 23 Mar 2012 17:16:09 +0000 Subject: Help command refresh. --- .../earth2me/essentials/commands/Commandhelp.java | 11 ++++- .../earth2me/essentials/textreader/HelpInput.java | 51 ++++++++++++++++------ .../earth2me/essentials/textreader/TextPager.java | 21 ++++++++- Essentials/src/messages.properties | 7 ++- Essentials/src/messages_da.properties | 5 ++- Essentials/src/messages_de.properties | 5 ++- Essentials/src/messages_en.properties | 5 ++- Essentials/src/messages_es.properties | 5 ++- Essentials/src/messages_fr.properties | 5 ++- Essentials/src/messages_nl.properties | 5 ++- 10 files changed, 95 insertions(+), 25 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java index 769aac483..6339359f1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java @@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; import com.earth2me.essentials.textreader.*; +import java.util.Locale; import org.bukkit.Server; import org.bukkit.command.CommandSender; @@ -21,6 +22,7 @@ public class Commandhelp extends EssentialsCommand IText output; String pageStr = args.length > 0 ? args[0] : null; String chapterPageStr = args.length > 1 ? args[1] : null; + String command = commandLabel; final IText input = new TextInput(user, "help", false, ess); if (input.getLines().isEmpty()) @@ -31,7 +33,12 @@ public class Commandhelp extends EssentialsCommand } else { - output = new HelpInput(user, pageStr, ess); + if (pageStr.length() > 26) + { + pageStr = pageStr.substring(0, 25); + } + output = new HelpInput(user, pageStr.toLowerCase(Locale.ENGLISH), ess); + command = command.concat(" ").concat(pageStr); pageStr = chapterPageStr; } chapterPageStr = null; @@ -41,7 +48,7 @@ public class Commandhelp extends EssentialsCommand output = new KeywordReplacer(input, user, ess); } final TextPager pager = new TextPager(output); - pager.showPage(pageStr, chapterPageStr, commandLabel, user); + pager.showPage(pageStr, chapterPageStr, command, user); } @Override diff --git a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java index 6d4efd811..76316c94d 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java @@ -24,33 +24,46 @@ public class HelpInput implements IText public HelpInput(final User user, final String match, final IEssentials ess) throws IOException { boolean reported = false; + final List newLines = new ArrayList(); String pluginName = ""; + String pluginNameLow = ""; + if (!match.equalsIgnoreCase("")) + { + lines.add(_("helpMatching", match)); + } + for (Plugin p : ess.getServer().getPluginManager().getPlugins()) { try { final PluginDescriptionFile desc = p.getDescription(); final Map> cmds = desc.getCommands(); - pluginName = p.getDescription().getName().toLowerCase(Locale.ENGLISH); + pluginName = p.getDescription().getName(); + pluginNameLow = pluginName.toLowerCase(Locale.ENGLISH); + if (pluginNameLow.equals(match)) + { + lines.clear(); + newLines.clear(); + lines.add(_("helpFrom", p.getDescription().getName())); + } + for (Map.Entry> k : cmds.entrySet()) { try { - if ((!match.equalsIgnoreCase("")) - && (!k.getKey().toLowerCase(Locale.ENGLISH).contains(match)) + if (!match.equalsIgnoreCase("") && (!pluginNameLow.contains(match)) && (!k.getKey().toLowerCase(Locale.ENGLISH).contains(match)) && (!(k.getValue().get(DESCRIPTION) instanceof String - && ((String)k.getValue().get(DESCRIPTION)).toLowerCase(Locale.ENGLISH).contains(match))) - && (!pluginName.contains(match))) + && ((String)k.getValue().get(DESCRIPTION)).toLowerCase(Locale.ENGLISH).contains(match)))) { continue; } - if (pluginName.contains("essentials")) + if (pluginNameLow.contains("essentials")) { final String node = "essentials." + k.getKey(); if (!ess.getSettings().isCommandDisabled(k.getKey()) && user.isAuthorized(node)) { - lines.add(_("helpLine", k.getKey(), k.getValue().get(DESCRIPTION))); + newLines.add(_("helpLine", k.getKey(), k.getValue().get(DESCRIPTION))); } } else @@ -67,9 +80,9 @@ public class HelpInput implements IText { permissions = value.get(PERMISSIONS); } - if (user.isAuthorized("essentials.help." + pluginName)) + if (user.isAuthorized("essentials.help." + pluginNameLow)) { - lines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } else if (permissions instanceof List && !((List)permissions).isEmpty()) { @@ -84,21 +97,21 @@ public class HelpInput implements IText } if (enabled) { - lines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } } else if (permissions instanceof String && !"".equals(permissions)) { if (user.isAuthorized(permissions.toString())) { - lines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } } else { if (!ess.getSettings().hidePermissionlessHelp()) { - lines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } } } @@ -109,6 +122,17 @@ public class HelpInput implements IText continue; } } + if (!newLines.isEmpty()) + { + if (pluginNameLow.equals(match)) + { + break; + } + if (match.equalsIgnoreCase("")) + { + lines.add(_("helpPlugin", pluginName, pluginNameLow)); + } + } } catch (NullPointerException ex) { @@ -118,12 +142,13 @@ public class HelpInput implements IText { if (!reported) { - logger.log(Level.WARNING, _("commandHelpFailedForPlugin", pluginName), ex); + logger.log(Level.WARNING, _("commandHelpFailedForPlugin", pluginNameLow), ex); } reported = true; continue; } } + lines.addAll(newLines); } @Override diff --git a/Essentials/src/com/earth2me/essentials/textreader/TextPager.java b/Essentials/src/com/earth2me/essentials/textreader/TextPager.java index c23df734d..cb70839dd 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/TextPager.java +++ b/Essentials/src/com/earth2me/essentials/textreader/TextPager.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.textreader; +import com.earth2me.essentials.I18n; import static com.earth2me.essentials.I18n._; import java.util.List; import java.util.Locale; @@ -49,7 +50,23 @@ public class TextPager final int pages = lines.size() / 9 + (lines.size() % 9 > 0 ? 1 : 0); if (!onePage) { - sender.sendMessage(_("infoPages", page, pages)); + StringBuilder content = new StringBuilder(); + final String[] title = commandName.split(" ", 2); + if (title.length > 1) + { + content.append(I18n.capitalCase(title[0])).append(": "); + content.append(title[1]); + } + else if (chapterPageStr != null) + { + content.append(I18n.capitalCase(commandName)).append(": "); + content.append(chapterPageStr); + } + else + { + content.append(I18n.capitalCase(commandName)); + } + sender.sendMessage(_("infoPages", page, pages, content)); } for (int i = start; i < lines.size() && i < start + (onePage ? 20 : 9); i++) { @@ -116,7 +133,7 @@ public class TextPager if (!onePage) { - sender.sendMessage(_("infoPages", page, pages)); + sender.sendMessage(_("infoPages", page, pages, I18n.capitalCase(commandName))); } for (int i = start; i < end && i < start + (onePage ? 20 : 9); i++) { diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index aa32ad340..b0e9b80f3 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -111,9 +111,12 @@ haveBeenReleased=\u00a77You have been released heal=\u00a77You have been healed. healOther=\u00a77Healed {0}. helpConsole=To view help from the console, type ?. +helpFrom=\u00a77Commands from {0}: helpLine=\u00a76/{0}\u00a7f: {1} +helpMatching=\u00a77Commands matching "{0}": helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: +helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1} holeInFloor=Hole in floor homeSet=\u00a77Home set. homeSetToBed=\u00a77Your home is now set to this bed. @@ -125,7 +128,7 @@ illegalDate=Illegal date format. infoChapter=Select chapter: infoChapterPages=Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f: infoFileDoesNotExist=File info.txt does not exist. Creating one for you. -infoPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: +infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Page \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- infoUnknownChapter=Unknown chapter. invBigger=The other users inventory is bigger than yours. invRestored=Your inventory has been restored. @@ -133,7 +136,7 @@ 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. +invalidMob=Invalid mob type.& invalidServer=Invalid server! invalidSignLine=Line {0} on sign is invalid. invalidWorld=\u00a7cInvalid world. diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 9304c52df..ec50806a6 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -111,9 +111,12 @@ haveBeenReleased=\u00a77Du er blevet l\u00f8sladt heal=\u00a77Du er blevet healed. healOther=\u00a77Healed {0}. helpConsole=For at se hj\u00e6lp fra konsolen, skriv ?. +helpFrom=\u00a77Commands from {0}: helpLine=\u00a76/{0}\u00a7f: {1} +helpMatching=\u00a77Commands matching "{0}": helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f: +helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1} holeInFloor=Hul i gulv homeSet=\u00a77Hjem sat. homeSetToBed=\u00a77Dit hjem er nu sat til denne seng. @@ -125,7 +128,7 @@ illegalDate=Forkert datoformat. infoChapter=V\u00e6lg kapitel: infoChapterPages=Kapitel {0}, side \u00a7c{1}\u00a7f af \u00a7c{2}\u00a7f: infoFileDoesNotExist=Fil info.txt eksisterer ikke. Fixer liiige en for dig. -infoPages=Side \u00a7c{0}\u00a7f af \u00a7c{1}\u00a7f: +infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Side \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- infoUnknownChapter=Ukendt kapitel. invBigger=Den anden brugers inventory er st\u00f8rre end din. invRestored=Din inventory er blevet genoprettet. diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 9c7846008..7f2c91b69 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -111,9 +111,12 @@ haveBeenReleased=\u00a77Du wurdest frei gelassen. heal=\u00a77Du wurdest geheilt. healOther=\u00a77{0} geheilt. helpConsole=Um die Hilfe der Konsole zu sehen, schreibe ?. +helpFrom=\u00a77Commands from {0}: helpLine=\u00a76/{0}\u00a7f: {1} +helpMatching=\u00a77Commands matching "{0}": helpOp=\u00a7c[Hilfe]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Seite \u00a7c{0}\u00a7f von \u00a7c{1}\u00a7f: +helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1} holeInFloor=Loch im Boden homeSet=\u00a77Zuhause gesetzt. homeSetToBed=\u00a77Dein Zuhause ist nun an diesem Bett. @@ -125,7 +128,7 @@ illegalDate=Ung\u00fcltiges Datumsformat. infoChapter=W\u00e4hle Kapitel: infoChapterPages=Kapitel {0}, Seite \u00a7c{1}\u00a7f von \u00a7c{2}\u00a7f: infoFileDoesNotExist=Datei info.txt existiert nicht. Erzeuge eine neue Datei. -infoPages=Seite \u00a7c{0}\u00a7f von \u00a7c{1}\u00a7f: +infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Seite \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- infoUnknownChapter=Unbekanntes Kapitel: invBigger=Das andere Inventar ist gr\u00f6sser als deins. invRestored=Dein Inventar wurde wieder hergestellt. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 5cb5b8792..2c4deae80 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -111,9 +111,12 @@ haveBeenReleased=\u00a77You have been released heal=\u00a77You have been healed. healOther=\u00a77Healed {0}. helpConsole=To view help from the console, type ?. +helpFrom=\u00a77Commands from {0}: helpLine=\u00a76/{0}\u00a7f: {1} +helpMatching=\u00a77Commands matching "{0}": helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: +helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1} holeInFloor=Hole in floor homeSet=\u00a77Home set. homeSetToBed=\u00a77Your home is now set to this bed. @@ -125,7 +128,7 @@ illegalDate=Illegal date format. infoChapter=Select chapter: infoChapterPages=Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f: infoFileDoesNotExist=File info.txt does not exist. Creating one for you. -infoPages=Page \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: +infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Page \u00a74{0}\u00a76/\u00a74{1} &e---- infoUnknownChapter=Unknown chapter. invBigger=The other users inventory is bigger than yours. invRestored=Your inventory has been restored. diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index e1a256b40..3d32bf2d1 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -111,9 +111,12 @@ haveBeenReleased=\u00a77Has sido liberado heal=\u00a77Has sido curado. healOther=\u00a77Has curado a {0}. helpConsole=Para obtener ayuda de la consola, escribe ?. +helpFrom=\u00a77Commands from {0}: helpLine=\u00a76/{0}\u00a7f: {1} +helpMatching=\u00a77Commands matching "{0}": helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Pagina \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f: +helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1} holeInFloor=Agujero en el suelo homeSet=\u00a77Hogar establecido. homeSetToBed=\u00a77Tu hogar esta ahora establecido a esta cama. @@ -125,7 +128,7 @@ illegalDate=Forma de fecha ilegal. infoChapter=Selecciona una seccion: infoChapterPages=Seccion {0}, pagina \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f: infoFileDoesNotExist=El archivo info.txt no existe. Creando uno para ti. -infoPages=Pagina \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f: +infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Pagina \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- infoUnknownChapter=Seccion desconocida. invBigger=El inventario del otro usuario es mas grande que el tuyo invRestored=Tu inventario ha sido recuperado. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 1766f4df3..e4e370b90 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -111,9 +111,12 @@ haveBeenReleased=\u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9. heal=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9. healOther=\u00a77{0} a \u00e9t\u00e9 soign\u00e9. helpConsole=Pour voir l''aide tapez ? +helpFrom=\u00a77Commands from {0}: helpLine=\u00a76/{0}\u00a7f: {1} +helpMatching=\u00a77Commands matching "{0}": helpOp=\u00a7c[Aide Admin]\u00a7f \u00a77{0} : \u00a7f {1} helpPages=Page \u00a7c{0}\u00a7f sur \u00a7c{1}\u00a7f. +helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1} holeInFloor=Trou dans le Sol. homeSet=\u00a77R\u00e9sidence d\u00e9finie. homeSetToBed=\u00a77Votre r\u00e9sidence est d\u00e9sormais li\u00e9e \u00e0 ce lit. @@ -125,7 +128,7 @@ illegalDate=Format de date ill\u00e9gal. infoChapter=S\u00e9lectionnez le chapitre : infoChapterPages=Chapitre {0}, page \u00a7c{1}\u00a7f sur \u00a7c{2}\u00a7f: infoFileDoesNotExist=Le fichier info.txt n'existe pas. Le fichier est en cours de cr\u00e9ation pour vous. -infoPages=Page \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f. +infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Page \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- infoUnknownChapter=Chapitre inconnu. invBigger=Les inventaires des autres joueurs sont plus gros que le v\u00f4tre. invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu. diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index c7f715e72..8d3a4cbd7 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -111,9 +111,12 @@ haveBeenReleased=\u00a77Je bent bevrijdt heal=\u00a77Je bent genezen. healOther=\u00a77Je geneezde {0}. helpConsole=type ? om de consolehelp weer te geven. +helpFrom=\u00a77Commands from {0}: helpLine=\u00a76/{0}\u00a7f: {1} +helpMatching=\u00a77Commands matching "{0}": helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f: +helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1} holeInFloor=Gat in de vloer homeSet=\u00a77Home ingesteld. homeSetToBed=\u00a77Je home is is nu verplaatst naar dit bed. @@ -125,7 +128,7 @@ illegalDate=Illegaal data formaat. infoChapter=Selecteer hoofdstuk: infoChapterPages=Hoofdstuk {0}, Pagina \u00a7c{1}\u00a7f van de \u00a7c{2}\u00a7f: infoFileDoesNotExist=Bestand info.txt bestaat niet. Bezig met aanmaken. -infoPages=Pagina \u00a7c{0}\u00a7f van de \u00a7c{1}\u00a7f: +infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Pagina \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- infoUnknownChapter=Onbekend hoofdstuk. invBigger=De inventory van de andere speler is groter dan die van jou. invRestored=Je inventory is hersteld. -- cgit v1.2.3 From 77c6a3b7302e53f1df042e1fadf89d1b632c67d1 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 23 Mar 2012 17:50:15 +0000 Subject: Wrong colour code symbol. --- Essentials/src/messages_en.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 2c4deae80..faf5aebd7 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -128,7 +128,7 @@ illegalDate=Illegal date format. infoChapter=Select chapter: infoChapterPages=Chapter {0}, page \u00a7c{1}\u00a7f of \u00a7c{2}\u00a7f: infoFileDoesNotExist=File info.txt does not exist. Creating one for you. -infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Page \u00a74{0}\u00a76/\u00a74{1} &e---- +infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Page \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- infoUnknownChapter=Unknown chapter. invBigger=The other users inventory is bigger than yours. invRestored=Your inventory has been restored. -- cgit v1.2.3 From b3de0aabae8c8c1ca428e9c1f44edb3b7519ed11 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 23 Mar 2012 18:26:19 +0000 Subject: Fix for showing plugins when user has no permission. --- .../src/com/earth2me/essentials/textreader/HelpInput.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java index 76316c94d..4efb6c43f 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java @@ -36,6 +36,7 @@ public class HelpInput implements IText { try { + final List pluginLines = new ArrayList(); final PluginDescriptionFile desc = p.getDescription(); final Map> cmds = desc.getCommands(); pluginName = p.getDescription().getName(); @@ -63,7 +64,7 @@ public class HelpInput implements IText final String node = "essentials." + k.getKey(); if (!ess.getSettings().isCommandDisabled(k.getKey()) && user.isAuthorized(node)) { - newLines.add(_("helpLine", k.getKey(), k.getValue().get(DESCRIPTION))); + pluginLines.add(_("helpLine", k.getKey(), k.getValue().get(DESCRIPTION))); } } else @@ -82,7 +83,7 @@ public class HelpInput implements IText } if (user.isAuthorized("essentials.help." + pluginNameLow)) { - newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } else if (permissions instanceof List && !((List)permissions).isEmpty()) { @@ -97,21 +98,21 @@ public class HelpInput implements IText } if (enabled) { - newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } } else if (permissions instanceof String && !"".equals(permissions)) { if (user.isAuthorized(permissions.toString())) { - newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } } else { if (!ess.getSettings().hidePermissionlessHelp()) { - newLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); } } } @@ -122,8 +123,9 @@ public class HelpInput implements IText continue; } } - if (!newLines.isEmpty()) + if (!pluginLines.isEmpty()) { + newLines.addAll(pluginLines); if (pluginNameLow.equals(match)) { break; -- cgit v1.2.3 From dddf529ff5fcd5f11df24b2b945fdf0d4534b266 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 23 Mar 2012 20:15:03 +0000 Subject: Make sure items don't stack wrong in [free] signs. --- Essentials/src/com/earth2me/essentials/signs/SignFree.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java index 52e2b9540..24ce481ff 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java @@ -34,10 +34,12 @@ public class SignFree extends EssentialsSign throw new SignException(_("cantSpawnItem", "Air")); } - item.setAmount(item.getType().getMaxStackSize() * 36); - Inventory i = ess.getServer().createInventory(player, 36); - i.addItem(item); - player.openInventory(i); + item.setAmount(item.getType().getMaxStackSize()); + Inventory invent = ess.getServer().createInventory(player, 36); + for (int i = 0; i < 36; i++) { + invent.addItem(item); + } + player.openInventory(invent); Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), sign.getBlock().getLocation(), ess); return true; } -- cgit v1.2.3 From 72028086c0179dc5885725bc15b3dc740eab7637 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 23 Mar 2012 22:38:01 +0000 Subject: 'Enabled' looks better than 'true'. --- Essentials/src/com/earth2me/essentials/commands/Commandfly.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java index ea6192589..526fc090d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java @@ -40,7 +40,7 @@ public class Commandfly extends EssentialsCommand { user.setFlying(false); } - user.sendMessage(_("flyMode", _(user.getAllowFlight() ? "true" : "false"), user.getDisplayName())); + user.sendMessage(_("flyMode", _(user.getAllowFlight() ? "enabled" : "disabled"), user.getDisplayName())); } private void flyOtherPlayers(final Server server, final CommandSender sender, final String name) @@ -57,7 +57,7 @@ public class Commandfly extends EssentialsCommand { player.setFlying(false); } - sender.sendMessage(_("flyMode", _(player.getAllowFlight() ? "true" : "false"), player.getDisplayName())); + sender.sendMessage(_("flyMode", _(player.getAllowFlight() ? "enabled" : "disabled"), player.getDisplayName())); } } } -- cgit v1.2.3 From a8cbb5c8f53bed7cdd71bdcb39b93b2d8aa84a32 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 23 Mar 2012 23:13:04 +0000 Subject: Extra itemcsv. --- Essentials/src/items.csv | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index 703772685..2e1a331de 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -809,6 +809,7 @@ blawool,35,15 blacotton,35,15 pistonmovingpiece,36,0 pistonmp,36,0 +pistontop,36,0 yellowflower,37,0 yflower,37,0 flower,37,0 @@ -979,6 +980,9 @@ sbdstep,43,5 stonebrickdoubleslab,43,5 stonebdslab,43,5 sbdslab,43,5 +adminslab,43,6 +magicslab,43,6 +adslab,43,6 smoothstonestep,44,0 stonestep,44,0 sstep,44,0 -- cgit v1.2.3 From 7ca2b65c4f85957ca8c054fca1890a5dfd1fbe4e Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 24 Mar 2012 21:07:49 +0000 Subject: New permission check: essentials.list.hidden is now required to /getpos hidden players. --- .../earth2me/essentials/commands/Commandgetpos.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java b/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java index c61702e59..c985ef725 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java @@ -12,21 +12,23 @@ public class Commandgetpos extends EssentialsCommand { super("getpos"); } - + @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length > 0 && user.isAuthorized("essentials.getpos.others")) { final User otherUser = getPlayer(server, args, 0); - outputPosition(user, otherUser.getLocation(), user.getLocation()); - } - else - { - outputPosition(user, user.getLocation(), null); + if (!otherUser.isHidden() || user.isAuthorized("essentials.list.hidden")) + { + outputPosition(user, otherUser.getLocation(), user.getLocation()); + return; + } + } + outputPosition(user, user.getLocation(), null); } - + @Override protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { @@ -37,7 +39,7 @@ public class Commandgetpos extends EssentialsCommand final User user = getPlayer(server, args, 0); outputPosition(sender, user.getLocation(), null); } - + //TODO: Translate private void outputPosition(final CommandSender sender, final Location coords, final Location distance) { -- cgit v1.2.3 From 3c3e8d167fae9792021a0f82beeaffc217269fb2 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 24 Mar 2012 21:12:15 +0000 Subject: Better English. --- Essentials/src/messages.properties | 2 +- Essentials/src/messages_en.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index b0e9b80f3..ecaf691e6 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -171,7 +171,7 @@ kitGive=\u00a77Giving kit {0}. kitInvFull=\u00a7cYour inventory was full, placing kit on the floor kitTimed=\u00a7cYou can''t use that kit again for another {0}. kits=\u00a77Kits: {0} -lightningSmited=\u00a77You have just been smited +lightningSmited=\u00a77Thou hast been smitten lightningUse=\u00a77Smiting {0} listAfkTag = \u00a77[AFK]\u00a7f listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79 players online. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index faf5aebd7..d56675209 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -171,7 +171,7 @@ kitGive=\u00a77Giving kit {0}. kitInvFull=\u00a7cYour inventory was full, placing kit on the floor kitTimed=\u00a7cYou can''t use that kit again for another {0}. kits=\u00a77Kits: {0} -lightningSmited=\u00a77You have just been smited +lightningSmited=\u00a77Thou hast been smitten lightningUse=\u00a77Smiting {0} listAfkTag = \u00a77[AFK]\u00a7f listAmount = \u00a79There are \u00a7c{0}\u00a79 out of maximum \u00a7c{1}\u00a79 players online. -- cgit v1.2.3 From 160c3f428ce7ae3b80d6d08ca796f6881b1c8eca Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 24 Mar 2012 23:25:43 +0000 Subject: Mysql is bad. --- Essentials/src/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 2399b9be9..316394af0 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -406,6 +406,8 @@ protect: # Database settings for sign/rail protection # mysql or sqlite + # We strongly recommend against using mysql here, unless you have a good reason. + # sqllite seems to be faster in almost all cases, and in some cases mysql can be far far slower. datatype: 'sqlite' # If you specified MySQL above, you MUST enter the appropriate details here. -- cgit v1.2.3 From 71aaf81bbadf07e5ba093abb72f9afa5fa40279a Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 24 Mar 2012 23:28:56 +0000 Subject: Update Essentials/src/config.yml --- Essentials/src/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 316394af0..a1e099271 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -407,7 +407,7 @@ protect: # mysql or sqlite # We strongly recommend against using mysql here, unless you have a good reason. - # sqllite seems to be faster in almost all cases, and in some cases mysql can be far far slower. + # Sqlite seems to be faster in almost all cases, and in some cases mysql can be much slower. datatype: 'sqlite' # If you specified MySQL above, you MUST enter the appropriate details here. -- cgit v1.2.3 From b7221516dce1e10664a3b54104fd012c30c0fbef Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 25 Mar 2012 02:33:52 +0100 Subject: Invsee now shows a live player inventory in a window, rather than cloning players inventory. New Permission: essentials.invsee.modify - Player with this permission will be able to add/remove items from the other players inventory. --- .../essentials/EssentialsPlayerListener.java | 30 ++++++++++--- .../src/com/earth2me/essentials/UserData.java | 52 ++++------------------ .../essentials/commands/Commandinvsee.java | 37 ++------------- Essentials/src/plugin.yml | 6 +-- 4 files changed, 41 insertions(+), 84 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 43adf0a6f..486235993 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -20,6 +20,9 @@ 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.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryCloseEvent; +import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.player.PlayerLoginEvent.Result; import org.bukkit.event.player.*; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -107,11 +110,6 @@ public class EssentialsPlayerListener implements Listener { user.toggleGodModeEnabled(); } - if (user.getSavedInventory() != null) - { - user.getInventory().setContents(user.getSavedInventory()); - user.setSavedInventory(null); - } user.updateActivity(false); user.dispose(); } @@ -388,4 +386,26 @@ public class EssentialsPlayerListener implements Listener event.setCancelled(true); } } + + @EventHandler(priority = EventPriority.LOW) + public void onInventoryClickEvent(final InventoryClickEvent event) + { + if (event.getView().getTopInventory().getType() == InventoryType.PLAYER) + { + final User user = ess.getUser(event.getWhoClicked()); + if (user.isInvSee() && !user.isAuthorized("essentials.invsee.modify")) + { + event.setCancelled(true); + } + } + } + @EventHandler(priority = EventPriority.MONITOR) + public void onInventoryCloseEvent(final InventoryCloseEvent event) + { + if (event.getView().getTopInventory().getType() == InventoryType.PLAYER) + { + final User user = ess.getUser(event.getPlayer()); + user.setInvSee(false); + } + } } diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 3b6516277..11c701c34 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -42,7 +42,6 @@ public abstract class UserData extends PlayerExtension implements IConf lastHealTimestamp = _getLastHealTimestamp(); jail = _getJail(); mails = _getMails(); - savedInventory = _getSavedInventory(); teleportEnabled = getTeleportEnabled(); ignoredPlayers = getIgnoredPlayers(); godmode = _getGodModeEnabled(); @@ -407,50 +406,17 @@ public abstract class UserData extends PlayerExtension implements IConf mails.add(mail); setMails(mails); } - private ItemStack[] savedInventory; - - public ItemStack[] getSavedInventory() - { - return savedInventory; - } - - private ItemStack[] _getSavedInventory() - { - int size = config.getInt("inventory.size", 0); - if (size < 1 || (getInventory() != null && size > getInventory().getSize())) - { - return null; - } - ItemStack[] is = new ItemStack[size]; - for (int i = 0; i < size; i++) - { - is[i] = config.getItemStack("inventory." + i); - } - return is; + + private boolean invSee; + + public boolean isInvSee() { + return invSee; } - - public void setSavedInventory(ItemStack[] is) - { - if (is == null || is.length == 0) - { - savedInventory = null; - config.removeProperty("inventory"); - } - else - { - savedInventory = is; - config.setProperty("inventory.size", is.length); - for (int i = 0; i < is.length; i++) - { - if (is[i] == null || is[i].getType() == Material.AIR) - { - continue; - } - config.setProperty("inventory." + i, is[i]); - } - } - config.save(); + + public void setInvSee(boolean set) { + invSee = set; } + private boolean teleportEnabled; private boolean getTeleportEnabled() diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java b/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java index 1f5c32faa..a4a659e97 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java @@ -17,41 +17,12 @@ public class Commandinvsee extends EssentialsCommand @Override protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - - if (args.length < 1 && user.getSavedInventory() == null) + if (args.length < 1) { throw new NotEnoughArgumentsException(); } - User invUser = user; - if (args.length == 1) - { - invUser = getPlayer(server, args, 0); - } - if (invUser == user && user.getSavedInventory() != null) - { - invUser.getInventory().setContents(user.getSavedInventory()); - user.setSavedInventory(null); - user.sendMessage(_("invRestored")); - throw new NoChargeException(); - } - - if (user.getSavedInventory() == null) - { - user.setSavedInventory(user.getInventory().getContents()); - } - ItemStack[] invUserStack = invUser.getInventory().getContents(); - final int userStackLength = user.getInventory().getContents().length; - if (invUserStack.length < userStackLength) - { - invUserStack = Arrays.copyOf(invUserStack, userStackLength); - } - if (invUserStack.length > userStackLength) - { - throw new Exception(_("invBigger")); - } - user.getInventory().setContents(invUserStack); - user.sendMessage(_("invSee", invUser.getDisplayName())); - user.sendMessage(_("invSeeHelp")); - throw new NoChargeException(); + final User invUser = getPlayer(server, args, 0); + user.setInvSee(true); + user.openInventory(invUser.getInventory()); } } diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 7eaca70f4..2230cf71c 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -189,7 +189,7 @@ commands: killall: description: Kill all mobs in a world. usage: / [mobType] [radius] - aliases: [ekillall,butcher,ebutcher] + aliases: [ekillall,butcher,ebutcher,mobkill,emobkill] kittycannon: description: Throw an exploding kitten at your opponent usage: / @@ -308,11 +308,11 @@ commands: spawner: description: Change the mob type of a spawner usage: / - aliases: [espawner] + aliases: [espawner,changems,echangems] spawnmob: description: Spawns a mob. usage: / [:data][,[:data]] [amount] [player] - aliases: [espawnmob] + aliases: [espawnmob,mob,emob] sudo: description: Make another user perform a command. usage: / -- cgit v1.2.3 From e53a480c22c3d39fbdc845b0a96b6f1a3d0458e9 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 25 Mar 2012 02:55:19 +0100 Subject: Should probably cancel this at lowest. --- Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 486235993..d6757f025 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -387,7 +387,7 @@ public class EssentialsPlayerListener implements Listener } } - @EventHandler(priority = EventPriority.LOW) + @EventHandler(priority = EventPriority.LOWEST) public void onInventoryClickEvent(final InventoryClickEvent event) { if (event.getView().getTopInventory().getType() == InventoryType.PLAYER) -- cgit v1.2.3 From 1b2e3b19518950f6b4a72a4978259786a9787e35 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 25 Mar 2012 11:09:13 +0200 Subject: AntiCheat has different version numbers, so don't check. --- Essentials/src/com/earth2me/essentials/Essentials.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 660d4887b..b3a17de13 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -125,7 +125,8 @@ public class Essentials extends JavaPlugin implements IEssentials for (Plugin plugin : pm.getPlugins()) { if (plugin.getDescription().getName().startsWith("Essentials") - && !plugin.getDescription().getVersion().equals(this.getDescription().getVersion())) + && !plugin.getDescription().getVersion().equals(this.getDescription().getVersion()) + && !plugin.getDescription().getName().equals("EssentialsAntiCheat")) { LOGGER.log(Level.WARNING, _("versionMismatch", plugin.getDescription().getName())); } -- cgit v1.2.3 From 3e6e71ca41a3b694f44c04e8910bb0de627211be Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 25 Mar 2012 11:39:19 +0200 Subject: Optimize metrics --- .../essentials/commands/Commandessentials.java | 8 +- .../com/earth2me/essentials/metrics/Metrics.java | 268 ++++++++++++++------- .../essentials/metrics/MetricsStarter.java | 11 +- 3 files changed, 192 insertions(+), 95 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index bf1077c30..6b248f6d5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -186,8 +186,12 @@ public class Commandessentials extends EssentialsCommand try { sender.sendMessage("Essentials collects simple metrics to highlight which features to concentrate work on in the future."); - metrics.setOptOut(!metrics.isOptOut()); - sender.sendMessage("Annonmous Metrics are now: " + (metrics.isOptOut() ? "disabled" : "enabled")); + if (metrics.isOptOut()) { + metrics.enable(); + } else { + metrics.disable(); + } + sender.sendMessage("Anonymous Metrics are now: " + (metrics.isOptOut() ? "disabled" : "enabled")); } catch (IOException ex) { diff --git a/Essentials/src/com/earth2me/essentials/metrics/Metrics.java b/Essentials/src/com/earth2me/essentials/metrics/Metrics.java index a5de7816c..bf4fd9388 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/Metrics.java +++ b/Essentials/src/com/earth2me/essentials/metrics/Metrics.java @@ -23,27 +23,18 @@ package com.earth2me.essentials.metrics; * The views and conclusions contained in the software and documentation are those of the authors and contributors and * should not be interpreted as representing official policies, either expressed or implied, of anybody else. */ -import org.bukkit.Bukkit; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.PluginDescriptionFile; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.io.UnsupportedEncodingException; +import java.io.*; import java.net.Proxy; import java.net.URL; import java.net.URLConnection; import java.net.URLEncoder; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.Set; -import java.util.UUID; +import java.util.*; +import java.util.logging.Level; +import org.bukkit.Bukkit; +import org.bukkit.configuration.InvalidConfigurationException; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.PluginDescriptionFile; /** @@ -64,7 +55,7 @@ public class Metrics /** * The base url of the metrics domain */ - private static final String BASE_URL = "http://metrics.essentials3.net"; + private static final String BASE_URL = "http://metrics.griefcraft.com"; /** * The url used to report a server's status */ @@ -81,7 +72,7 @@ public class Metrics /** * Interval of time to ping (in minutes) */ - private final static int PING_INTERVAL = 10; + private static final int PING_INTERVAL = 10; /** * The plugin this metrics submits for */ @@ -97,7 +88,7 @@ public class Metrics /** * The plugin configuration file */ - private final YamlConfiguration configuration; + private final YamlConfiguration configuration; /** * The plugin configuration file */ @@ -106,8 +97,16 @@ public class Metrics * Unique server id */ private final String guid; + /** + * Lock for synchronization + */ + private final Object optOutLock = new Object(); + /** + * Id of the scheduled task + */ + private volatile int taskId = -1; - public Metrics(Plugin plugin) throws IOException + public Metrics(final Plugin plugin) throws IOException { if (plugin == null) { @@ -142,7 +141,7 @@ public class Metrics * @param name * @return Graph object created. Will never return NULL under normal circumstances unless bad parameters are given */ - public Graph createGraph(String name) + public Graph createGraph(final String name) { if (name == null) { @@ -150,7 +149,7 @@ public class Metrics } // Construct the graph object - Graph graph = new Graph(name); + final Graph graph = new Graph(name); // Now we can add our graph graphs.add(graph); @@ -164,7 +163,7 @@ public class Metrics * * @param plotter */ - public void addCustomData(Plotter plotter) + public void addCustomData(final Plotter plotter) { if (plotter == null) { @@ -178,86 +177,170 @@ public class Metrics graphs.add(defaultGraph); } - public boolean isOptOut() + /** + * Start measuring statistics. This will immediately create an async repeating task as the plugin and send the + * initial data to the metrics backend, and then after that it will post in increments of PING_INTERVAL * 1200 + * ticks. + */ + public void start() { - return configuration.getBoolean("opt-out", false); + synchronized (optOutLock) + { + // Did we opt out? + if (isOptOut()) + { + return; + } + + // Begin hitting the server with glorious data + taskId = plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable() + { + private boolean firstPost = true; + + public void run() + { + try + { + // This has to be synchronized or it can collide with the disable method. + synchronized (optOutLock) + { + // Disable Task, if it is running and the server owner decided to opt-out + if (isOptOut() && taskId > 0) + { + plugin.getServer().getScheduler().cancelTask(taskId); + taskId = -1; + } + } + + // We use the inverse of firstPost because if it is the first time we are posting, + // it is not a interval ping, so it evaluates to FALSE + // Each time thereafter it will evaluate to TRUE, i.e PING! + postPlugin(!firstPost); + + // After the first post we set firstPost to false + // Each post thereafter will be a ping + firstPost = false; + } + catch (IOException e) + { + Bukkit.getLogger().log(Level.INFO, "[Metrics] {0}", e.getMessage()); + } + } + }, 0, PING_INTERVAL * 1200); + } } - - public void setOptOut(final boolean toggle) throws IOException + + /** + * Has the server owner denied plugin metrics? + * + * @return + */ + public boolean isOptOut() { - configuration.set("opt-out", toggle); - configuration.save(configurationFile); + synchronized (optOutLock) + { + try + { + // Reload the metrics file + configuration.load(CONFIG_FILE); + } + catch (IOException ex) + { + Bukkit.getLogger().log(Level.INFO, "[Metrics] {0}", ex.getMessage()); + return true; + } + catch (InvalidConfigurationException ex) + { + Bukkit.getLogger().log(Level.INFO, "[Metrics] {0}", ex.getMessage()); + return true; + } + return configuration.getBoolean("opt-out", false); + } } /** - * Start measuring statistics. This will immediately create an async repeating task as the plugin and send the - * initial data to the metrics backend, and then after that it will post in increments of PING_INTERVAL * 1200 - * ticks. + * Enables metrics for the server by setting "opt-out" to false in the config file and starting the metrics task. + * + * @throws IOException */ - public void start() + public void enable() throws IOException { - // Did we opt out? - if (configuration.getBoolean("opt-out", false)) + // This has to be synchronized or it can collide with the check in the task. + synchronized (optOutLock) { - return; + // Check if the server owner has already set opt-out, if not, set it. + if (isOptOut()) + { + configuration.set("opt-out", false); + configuration.save(configurationFile); + } + + // Disable Task, if it is running + if (taskId < 0) + { + start(); + } } + } - // Begin hitting the server with glorious data - plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable() + /** + * Disables metrics for the server by setting "opt-out" to true in the config file and canceling the metrics task. + * + * @throws IOException + */ + public void disable() throws IOException + { + // This has to be synchronized or it can collide with the check in the task. + synchronized (optOutLock) { - private boolean firstPost = true; + // Check if the server owner has already set opt-out, if not, set it. + if (!isOptOut()) + { + configuration.set("opt-out", true); + final File file = new File(CONFIG_FILE); + configuration.save(file); + } - public void run() + // Disable Task, if it is running + if (taskId >= 0) { - try - { - // We use the inverse of firstPost because if it is the first time we are posting, - // it is not a interval ping, so it evaluates to FALSE - // Each time thereafter it will evaluate to TRUE, i.e PING! - postPlugin(!firstPost); - - // After the first post we set firstPost to false - // Each post thereafter will be a ping - firstPost = false; - } - catch (IOException e) - { - System.err.println("[Metrics] " + e.getMessage()); - } + this.plugin.getServer().getScheduler().cancelTask(taskId); + taskId = -1; } - }, 0, PING_INTERVAL * 1200); + } } /** * Generic method that posts a plugin to the metrics website */ - private void postPlugin(boolean isPing) throws IOException + private void postPlugin(final boolean isPing) throws IOException { // The plugin's description file containg all of the plugin data such as name, version, author, etc - PluginDescriptionFile description = plugin.getDescription(); + final PluginDescriptionFile description = plugin.getDescription(); // Construct the post data - String data = encode("guid") + '=' + encode(guid) - + encodeDataPair("version", description.getVersion()) - + encodeDataPair("server", Bukkit.getVersion()) - + encodeDataPair("players", Integer.toString(Bukkit.getServer().getOnlinePlayers().length)) - + encodeDataPair("revision", String.valueOf(REVISION)); + final StringBuilder data = new StringBuilder(); + data.append(encode("guid")).append('=').append(encode(guid)); + encodeDataPair(data, "version", description.getVersion()); + encodeDataPair(data, "server", Bukkit.getVersion()); + encodeDataPair(data, "players", Integer.toString(Bukkit.getServer().getOnlinePlayers().length)); + encodeDataPair(data, "revision", String.valueOf(REVISION)); // If we're pinging, append it if (isPing) { - data += encodeDataPair("ping", "true"); + encodeDataPair(data, "ping", "true"); } // Acquire a lock on the graphs, which lets us make the assumption we also lock everything // inside of the graph (e.g plotters) synchronized (graphs) { - Iterator iter = graphs.iterator(); + final Iterator iter = graphs.iterator(); while (iter.hasNext()) { - Graph graph = iter.next(); + final Graph graph = iter.next(); // Because we have a lock on the graphs set already, it is reasonable to assume // that our lock transcends down to the individual plotters in the graphs also. @@ -268,20 +351,20 @@ public class Metrics // The key name to send to the metrics server // The format is C-GRAPHNAME-PLOTTERNAME where separator - is defined at the top // Legacy (R4) submitters use the format Custom%s, or CustomPLOTTERNAME - String key = String.format("C%s%s%s%s", CUSTOM_DATA_SEPARATOR, graph.getName(), CUSTOM_DATA_SEPARATOR, plotter.getColumnName()); + final String key = String.format("C%s%s%s%s", CUSTOM_DATA_SEPARATOR, graph.getName(), CUSTOM_DATA_SEPARATOR, plotter.getColumnName()); // The value to send, which for the foreseeable future is just the string // value of plotter.getValue() - String value = Integer.toString(plotter.getValue()); + final String value = Integer.toString(plotter.getValue()); // Add it to the http post data :) - data += encodeDataPair(key, value); + encodeDataPair(data, key, value); } } } // Create the url - URL url = new URL(BASE_URL + String.format(REPORT_URL, description.getName())); + final URL url = new URL(BASE_URL + String.format(REPORT_URL, description.getName())); // Connect to the website URLConnection connection; @@ -300,19 +383,19 @@ public class Metrics connection.setDoOutput(true); // Write the data - OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream()); - writer.write(data); + final OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream()); + writer.write(data.toString()); writer.flush(); // Now read the response - BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - String response = reader.readLine(); + final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + final String response = reader.readLine(); // close resources writer.close(); reader.close(); - if (response.startsWith("ERR")) + if (response == null || response.startsWith("ERR")) { throw new IOException(response); //Throw the exception } @@ -323,11 +406,11 @@ public class Metrics { synchronized (graphs) { - Iterator iter = graphs.iterator(); + final Iterator iter = graphs.iterator(); while (iter.hasNext()) { - Graph graph = iter.next(); + final Graph graph = iter.next(); for (Plotter plotter : graph.getPlotters()) { @@ -362,16 +445,19 @@ public class Metrics *

Encode a key/value data pair to be used in a HTTP post request. This INCLUDES a & so the first key/value pair * MUST be included manually, e.g:

* - * String httpData = encode("guid") + '=' + encode("1234") + encodeDataPair("authors") + ".."; + * StringBuffer data = new StringBuffer(); + * data.append(encode("guid")).append('=').append(encode(guid)); + * encodeDataPair(data, "version", description.getVersion()); * * + * @param buffer * @param key * @param value * @return */ - private static String encodeDataPair(String key, String value) throws UnsupportedEncodingException + private static void encodeDataPair(final StringBuilder buffer, final String key, final String value) throws UnsupportedEncodingException { - return '&' + encode(key) + '=' + encode(value); + buffer.append('&').append(encode(key)).append('=').append(encode(value)); } /** @@ -380,7 +466,7 @@ public class Metrics * @param text * @return */ - private static String encode(String text) throws UnsupportedEncodingException + private static String encode(final String text) throws UnsupportedEncodingException { return URLEncoder.encode(text, "UTF-8"); } @@ -401,7 +487,7 @@ public class Metrics */ private final Set plotters = new LinkedHashSet(); - private Graph(String name) + private Graph(final String name) { this.name = name; } @@ -421,7 +507,7 @@ public class Metrics * * @param plotter */ - public void addPlotter(Plotter plotter) + public void addPlotter(final Plotter plotter) { plotters.add(plotter); } @@ -431,7 +517,7 @@ public class Metrics * * @param plotter */ - public void removePlotter(Plotter plotter) + public void removePlotter(final Plotter plotter) { plotters.remove(plotter); } @@ -453,14 +539,14 @@ public class Metrics } @Override - public boolean equals(Object object) + public boolean equals(final Object object) { if (!(object instanceof Graph)) { return false; } - Graph graph = (Graph)object; + final Graph graph = (Graph)object; return graph.name.equals(name); } } @@ -489,7 +575,7 @@ public class Metrics * * @param name */ - public Plotter(String name) + public Plotter(final String name) { this.name = name; } @@ -525,15 +611,15 @@ public class Metrics } @Override - public boolean equals(Object object) + public boolean equals(final Object object) { if (!(object instanceof Plotter)) { return false; } - Plotter plotter = (Plotter)object; + final Plotter plotter = (Plotter)object; return plotter.name.equals(name) && plotter.getValue() == getValue(); } } -} +} \ No newline at end of file diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index d5f7d634a..6380b7f6c 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -17,6 +17,7 @@ public class MetricsStarter implements Runnable private enum Modules { Essentials, + EssentialsAntiCheat, EssentialsChat, EssentialsSpawn, EssentialsProtect, @@ -146,10 +147,16 @@ public class MetricsStarter implements Runnable } final Graph depGraph = metrics.createGraph("Dependencies"); - Method method = ess.getPaymentMethod().getMethod(); + final Method method = ess.getPaymentMethod().getMethod(); if (method != null) { - depGraph.addPlotter(new SimplePlotter(method.getName() + " " + method.getVersion())); + String version = method.getVersion(); + final int dashPosition = version.indexOf('-'); + if (dashPosition > 0) + { + version = version.substring(0, dashPosition); + } + depGraph.addPlotter(new SimplePlotter(method.getName() + " " + version)); } depGraph.addPlotter(new SimplePlotter(ess.getPermissionsHandler().getName())); -- cgit v1.2.3 From 0cbded9fcab30735ebccb794c640c16ac6e4f229 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 25 Mar 2012 11:44:33 +0200 Subject: This is no longer stored in file, so it's not part of UserData anymore. --- Essentials/src/com/earth2me/essentials/User.java | 11 +++++++++++ Essentials/src/com/earth2me/essentials/UserData.java | 16 ++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index dde0c20e2..f1e6ac67d 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -23,6 +23,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser private transient long lastActivity = System.currentTimeMillis(); private boolean hidden = false; private transient Location afkPosition = null; + private boolean invSee = false; private static final Logger logger = Logger.getLogger("Minecraft"); User(final Player base, final IEssentials ess) @@ -592,4 +593,14 @@ public class User extends UserData implements Comparable, IReplyTo, IUser { return teleportRequestTime; } + + public boolean isInvSee() + { + return invSee; + } + + public void setInvSee(boolean set) + { + invSee = set; + } } diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 11c701c34..3c8066cc9 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -188,14 +188,13 @@ public abstract class UserData extends PlayerExtension implements IConf } return false; } - private String nickname; - + public String _getNickname() { return config.getString("nickname"); } - + public String getNickname() { return nickname; @@ -406,17 +405,6 @@ public abstract class UserData extends PlayerExtension implements IConf mails.add(mail); setMails(mails); } - - private boolean invSee; - - public boolean isInvSee() { - return invSee; - } - - public void setInvSee(boolean set) { - invSee = set; - } - private boolean teleportEnabled; private boolean getTeleportEnabled() -- cgit v1.2.3 From e13a2c371d6f97397fb5fac708124b3f6403c66e Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 25 Mar 2012 11:45:50 +0200 Subject: Wrong url --- Essentials/src/com/earth2me/essentials/metrics/Metrics.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/metrics/Metrics.java b/Essentials/src/com/earth2me/essentials/metrics/Metrics.java index bf4fd9388..98ca62f47 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/Metrics.java +++ b/Essentials/src/com/earth2me/essentials/metrics/Metrics.java @@ -55,7 +55,7 @@ public class Metrics /** * The base url of the metrics domain */ - private static final String BASE_URL = "http://metrics.griefcraft.com"; + private static final String BASE_URL = "http://metrics.essentials3.net"; /** * The url used to report a server's status */ -- cgit v1.2.3 From 6f86b7400ae8f2ca6f236e250992227e63406def Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 25 Mar 2012 11:47:26 +0200 Subject: CopyPaste-Fail --- Essentials/src/com/earth2me/essentials/metrics/Metrics.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/metrics/Metrics.java b/Essentials/src/com/earth2me/essentials/metrics/Metrics.java index 98ca62f47..e009daa5d 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/Metrics.java +++ b/Essentials/src/com/earth2me/essentials/metrics/Metrics.java @@ -275,7 +275,7 @@ public class Metrics configuration.save(configurationFile); } - // Disable Task, if it is running + // Enable Task, if it is not running if (taskId < 0) { start(); -- cgit v1.2.3 From 7bd7992b241dd049bbdef162536440e4c9d69b65 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 25 Mar 2012 14:20:26 +0100 Subject: Fix chat format regex. --- Essentials/src/com/earth2me/essentials/Settings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index e194cf21b..08c3b74db 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -333,7 +333,7 @@ public class Settings implements ISettings format = format.replace("{MESSAGE}", "%2$s"); format = format.replace("{WORLDNAME}", "{1}"); format = format.replace("{SHORTWORLDNAME}", "{2}"); - format = format.replaceAll("\\{(\\D*)\\}", "\\[$1\\]"); + format = format.replaceAll("\\{(\\D*?)\\}", "\\[$1\\]"); mFormat = new MessageFormat(format); chatFormats.put(group, mFormat); } -- cgit v1.2.3 From 00033c11bce3c1a960bf0d14c81b90ab8462f64a Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 25 Mar 2012 14:26:08 +0100 Subject: Update [balance] sign to use currency formatting. --- Essentials/src/com/earth2me/essentials/signs/SignBalance.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBalance.java b/Essentials/src/com/earth2me/essentials/signs/SignBalance.java index 0b7328ba5..4949cb645 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignBalance.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignBalance.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.signs; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; public class SignBalance extends EssentialsSign @@ -15,7 +16,7 @@ public class SignBalance extends EssentialsSign @Override protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException { - player.sendMessage(_("balance", player.getMoney())); + player.sendMessage(_("balance", Util.displayCurrency(player.getMoney(), ess))); return true; } } -- cgit v1.2.3 From b60363b6bd916f1c209e2fbe3bdb8c0585e08c9c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 25 Mar 2012 16:30:22 +0100 Subject: Reduce amount of move event calls being processed. --- .../src/com/earth2me/essentials/EssentialsPlayerListener.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index d6757f025..cbd4cebce 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -75,6 +75,13 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerMove(final PlayerMoveEvent event) { + if (event.getFrom().getBlockX() == event.getTo().getBlockX() + && event.getFrom().getBlockZ() == event.getTo().getBlockZ() + && event.getFrom().getBlockY() == event.getTo().getBlockY()) + { + return; + } + final User user = ess.getUser(event.getPlayer()); if (user.isAfk() && ess.getSettings().getFreezeAfkPlayers()) @@ -399,13 +406,14 @@ public class EssentialsPlayerListener implements Listener } } } + @EventHandler(priority = EventPriority.MONITOR) public void onInventoryCloseEvent(final InventoryCloseEvent event) { if (event.getView().getTopInventory().getType() == InventoryType.PLAYER) { final User user = ess.getUser(event.getPlayer()); - user.setInvSee(false); + user.setInvSee(false); } } } -- cgit v1.2.3 From 1dbb11ea552bb7f576067e4ac184fd58db40eb80 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 25 Mar 2012 16:46:36 +0100 Subject: Don't override other plugins which allow joining over capacity. --- Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index cbd4cebce..b45e1fb10 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -198,7 +198,7 @@ public class EssentialsPlayerListener implements Listener return; } - if (server.getOnlinePlayers().length >= server.getMaxPlayers() && !user.isAuthorized("essentials.joinfullserver")) + if (event.getResult() == Result.KICK_FULL && !user.isAuthorized("essentials.joinfullserver")) { event.disallow(Result.KICK_FULL, _("serverFull")); return; -- cgit v1.2.3 From d2506cd928125c44023c6e4baed2d76f661aff21 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 25 Mar 2012 17:27:06 +0100 Subject: Reorder login/join event calls. --- .../com/earth2me/essentials/EssentialsPlayerListener.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index b45e1fb10..6b6b4a034 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -126,9 +126,13 @@ public class EssentialsPlayerListener implements Listener { ess.getBackup().onPlayerJoin(); final User user = ess.getUser(event.getPlayer()); + user.setDisplayNick(); + user.setLastLogin(System.currentTimeMillis()); user.setLastLoginAddress(user.getAddress().getAddress().getHostAddress()); + user.updateActivity(false); + updateCompass(user); if (user.isAuthorized("essentials.sleepingignored")) { user.setSleepingIgnored(true); @@ -184,7 +188,10 @@ public class EssentialsPlayerListener implements Listener } User user = ess.getUser(event.getPlayer()); - user.setNPC(false); + if (user.isNPC()) + { + user.setNPC(false); + } final long currentTime = System.currentTimeMillis(); final boolean banExpired = user.checkBanTimeout(currentTime); @@ -204,9 +211,6 @@ public class EssentialsPlayerListener implements Listener return; } event.allow(); - - user.setLastLogin(System.currentTimeMillis()); - updateCompass(user); } private void updateCompass(final User user) -- cgit v1.2.3 From 47cf1289d7baa72b318ecc444102dfe234c98e75 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 25 Mar 2012 19:10:39 +0100 Subject: Don't show 'backup started' on /backup if it hasn't been configured. --- Essentials/src/com/earth2me/essentials/commands/Commandbackup.java | 7 ++++++- Essentials/src/messages.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_nl.properties | 1 + 8 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java index 32c8c9e80..9a10100c0 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java @@ -19,7 +19,12 @@ public class Commandbackup extends EssentialsCommand final Backup backup = ess.getBackup(); if (backup == null) { - throw new Exception(); + throw new Exception(_("backupDisabled")); + } + final String command = ess.getSettings().getBackupCommand(); + if (command == null || "".equals(command)) + { + throw new Exception(_("backupDisabled")); } backup.run(); sender.sendMessage(_("backupStarted")); diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index ecaf691e6..7707ac09a 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -12,6 +12,7 @@ alertUsed=used: autoAfkKickReason=You have been kicked for idling more than {0} minutes. backAfterDeath=\u00a77Use the /back command to return to your death point. backUsageMsg=\u00a77Returning to previous location. +backupDisabled=An external backup script has not been configured. backupFinished=Backup finished backupStarted=Backup started balance=\u00a77Balance: {0} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index ec50806a6..e06985430 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -12,6 +12,7 @@ alertUsed=brugte: autoAfkKickReason=Du er blevet kicked for at idle mere end {0} minutter. backAfterDeath=\u00a77Brug /back kommandoen for at teleportere til dit d\u00f8dspunkt. backUsageMsg=\u00a77Teleporterer til tidligere placering. +backupDisabled=An external backup script has not been configured. backupFinished=Backup sluttet backupStarted=Backup startet balance=\u00a77Saldo: {0} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 7f2c91b69..4e4f7e78d 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -12,6 +12,7 @@ alertUsed=benutzt: autoAfkKickReason=Du wurdest gekickt, weil du f\u00fcr {0} Minuten inaktiv warst. backAfterDeath=\u00a77Benutze den Befehl /back um zu deinem Todespunkt zur\u00fcck zu kehren. backUsageMsg=\u00a77Kehre zur letzten Position zur\u00fcck. +backupDisabled=An external backup script has not been configured. backupFinished=Backup beendet backupStarted=Backup gestartet balance=\u00a77Geldb\u00f6rse: {0} diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index d56675209..34367f115 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -12,6 +12,7 @@ alertUsed=used: autoAfkKickReason=You have been kicked for idling more than {0} minutes. backAfterDeath=\u00a77Use the /back command to return to your death point. backUsageMsg=\u00a77Returning to previous location. +backupDisabled=An external backup script has not been configured. backupFinished=Backup finished backupStarted=Backup started balance=\u00a77Balance: {0} diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 3d32bf2d1..ad1aefe6c 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -12,6 +12,7 @@ alertUsed=usado: autoAfkKickReason=Has sido echado por ausentarte mas de {0} minutos. backAfterDeath=\u00a77Usa el comando /back para volver al punto en el que moriste. backUsageMsg=\u00a77Volviendo a la localizacion anterior. +backupDisabled=An external backup script has not been configured. backupFinished=Copia de seguridad completada backupStarted=Comenzando copia de seguridad balance=\u00a77Cantidad: {0} diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index e4e370b90..0c4b94efc 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -12,6 +12,7 @@ alertUsed=a utilis\u00e9 : autoAfkKickReason=Vous avez \u00e9t\u00e9 \u00e9ject\u00e9 pour inactivit\u00e9e sup\u00e9rieure \u00e0 {0} minutes. backAfterDeath=\u00a77Utilisez la commande /back pour retourner \u00e0 l''endroit ou vous \u00eates mort. backUsageMsg=\u00a77Retour \u00e0 votre emplacement pr\u00e9c\u00c3\u00a8dent. +backupDisabled=An external backup script has not been configured. backupFinished=Sauvegarde termin\u00e9 backupStarted=D\u00e9but de la sauvegarde... balance=\u00a77Solde : {0} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 8d3a4cbd7..d0f56752b 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -12,6 +12,7 @@ alertUsed=gebruikt: autoAfkKickReason=You have been kicked for idling more than {0} minutes. backAfterDeath=\u00a77Gebruik het /back command om terug te keren naar je sterfplaats. backUsageMsg=\u00a77Naar de vorige locatie aan het gaan. +backupDisabled=An external backup script has not been configured. backupFinished=Backup voltooid backupStarted=Backup gestart balance=\u00a77Saldo: {0} -- cgit v1.2.3 From 2cc96e995b2040baa56ba3b6bf58c5766b588708 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 25 Mar 2012 23:31:02 +0100 Subject: Update tp to check if target player has tptoggle disabled. Update tpo to allow player to player tp. --- .../earth2me/essentials/commands/Commandtp.java | 8 ++++ .../earth2me/essentials/commands/Commandtpo.java | 50 ++++++++++++++-------- Essentials/src/plugin.yml | 2 +- 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java index 22d4778d3..d6d6b76f9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java @@ -49,6 +49,14 @@ public class Commandtp extends EssentialsCommand user.sendMessage(_("teleporting")); final User target = getPlayer(server, args, 0); final User toPlayer = getPlayer(server, args, 1); + if (!target.isTeleportEnabled()) + { + throw new Exception(_("teleportDisabled", target.getDisplayName())); + } + if (!toPlayer.isTeleportEnabled()) + { + throw new Exception(_("teleportDisabled", toPlayer.getDisplayName())); + } if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.world." + toPlayer.getWorld().getName())) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java index e30aee127..53204114e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java @@ -16,33 +16,49 @@ public class Commandtpo extends EssentialsCommand @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - if (args.length < 1) + switch (args.length) { + case 0: throw new NotEnoughArgumentsException(); - } - //Just basically the old tp command - final User player = getPlayer(server, args, 0, true); - // Check if user is offline - if (!player.isOnline()) - { - throw new NoSuchFieldException(_("playerNotFound")); - } - - // Verify permission - if (!player.isHidden() || user.isAuthorized("essentials.teleport.hidden")) - { + case 1: + final User player = getPlayer(server, args, 0, true); + if (!player.isOnline() || (player.isHidden() && !user.isAuthorized("essentials.teleport.hidden"))) + { + throw new NoSuchFieldException(_("playerNotFound")); + } if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.world." + player.getWorld().getName())) { throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName())); } + user.sendMessage(_("teleporting")); user.getTeleport().now(player, false, TeleportCause.COMMAND); + + default: + if (!user.isAuthorized("essentials.tp.others")) + { + throw new Exception(_("noPerm", "essentials.tp.others")); + } user.sendMessage(_("teleporting")); - } - else - { - throw new NoSuchFieldException(_("playerNotFound")); + final User target = getPlayer(server, args, 0, true); + final User toPlayer = getPlayer(server, args, 1, true); + + if (!target.isOnline() || !toPlayer.isOnline() + || ((target.isHidden() || toPlayer.isHidden()) && !user.isAuthorized("essentials.teleport.hidden"))) + { + throw new NoSuchFieldException(_("playerNotFound")); + } + + if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().isWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + toPlayer.getWorld().getName())) + { + throw new Exception(_("noPerm", "essentials.world." + toPlayer.getWorld().getName())); + } + + target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND); + target.sendMessage(_("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName())); + break; } } } diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 2230cf71c..022143b3f 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -375,7 +375,7 @@ commands: aliases: [s,etphere] tpo: description: Teleport override for tptoggle. - usage: / + usage: / [otherplayer] aliases: [etpo] tpohere: description: Teleport here override for tptoggle. -- cgit v1.2.3 From e30d9002891113200c2b8e0bfdc19cf5e4402925 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 26 Mar 2012 00:39:39 +0100 Subject: Clarify how backup works. Add option for auto save-all. --- Essentials/src/com/earth2me/essentials/Backup.java | 6 ++++++ Essentials/src/com/earth2me/essentials/commands/Commandbackup.java | 2 +- Essentials/src/config.yml | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Backup.java b/Essentials/src/com/earth2me/essentials/Backup.java index ada36c9d7..baa90e561 100644 --- a/Essentials/src/com/earth2me/essentials/Backup.java +++ b/Essentials/src/com/earth2me/essentials/Backup.java @@ -61,6 +61,12 @@ public class Backup implements Runnable { return; } + if ("save-all".equalsIgnoreCase(command)) { + final CommandSender cs = server.getConsoleSender(); + server.dispatchCommand(cs, "save-all"); + active = false; + return; + } LOGGER.log(Level.INFO, _("backupStarted")); final CommandSender cs = server.getConsoleSender(); server.dispatchCommand(cs, "save-all"); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java index 9a10100c0..38644c680 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java @@ -22,7 +22,7 @@ public class Commandbackup extends EssentialsCommand throw new Exception(_("backupDisabled")); } final String command = ess.getSettings().getBackupCommand(); - if (command == null || "".equals(command)) + if (command == null || "".equals(command) || "save-all".equalsIgnoreCase(command)) { throw new Exception(_("backupDisabled")); } diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index a1e099271..133557030 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -217,8 +217,9 @@ enabledSigns: # Backup runs a command while saving is disabled backup: # Interval in minutes - interval: 60 - # Add a command that backups your data, e.g. + interval: 30 + # Unless you add a valid backup command or script here, this feature will be useless. + # Use 'save-all' to simply force regular world saving without backup. #command: 'rdiff-backup World1 backups/World1' # Set this true to enable permission per warp. -- cgit v1.2.3 From 5d45495371bf976907e6f9bb1934eddf3f3f5d3c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 26 Mar 2012 13:28:32 +0100 Subject: Fix kit enchants for people without oversized stack permission. Add permissions lookup to debug mode. --- Essentials/src/com/earth2me/essentials/Kit.java | 5 ++- Essentials/src/com/earth2me/essentials/User.java | 4 +++ .../craftbukkit/InventoryWorkaround.java | 38 +++++++++++----------- 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index 9f7bb5a5d..36a2e60b0 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -2,7 +2,6 @@ package com.earth2me.essentials; import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.capitalCase; -import com.earth2me.essentials.commands.Commandenchant; import com.earth2me.essentials.commands.NoChargeException; import com.earth2me.essentials.craftbukkit.InventoryWorkaround; import java.util.*; @@ -104,7 +103,7 @@ public class Kit { continue; } - final Enchantment enchantment = Commandenchant.getEnchantment(split[0], user); + final Enchantment enchantment = Enchantments.getByName(split[0]); int level; if (split.length > 1) { @@ -125,7 +124,7 @@ public class Kit } else { - overfilled = InventoryWorkaround.addItem(user.getInventory(), true, new ItemStack(id, amount, data)); + overfilled = InventoryWorkaround.addItem(user.getInventory(), true, 0, stack); } for (ItemStack itemStack : overfilled.values()) { diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index f1e6ac67d..cfa6a4a4a 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -57,6 +57,10 @@ public class User extends UserData implements Comparable, IReplyTo, IUser @Override public boolean isAuthorized(final String node) { + if (ess.getSettings().isDebug()) + { + ess.getLogger().log(Level.INFO, "checking if " + base.getName() + " has " + node); + } if (base instanceof OfflinePlayer) { return false; diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/InventoryWorkaround.java b/Essentials/src/com/earth2me/essentials/craftbukkit/InventoryWorkaround.java index a6d5d4fbc..fc9cbb74b 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/InventoryWorkaround.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/InventoryWorkaround.java @@ -15,12 +15,12 @@ public final class InventoryWorkaround { } - public static int first(final Inventory inventory, final ItemStack item, final boolean forceDurability, final boolean forceAmount, final boolean forceEnchantments) + public static int first(final Inventory inventory, final ItemStack item, final boolean enforceDurability, final boolean enforceAmount, final boolean enforceEnchantments) { - return next(inventory, item, 0, forceDurability, forceAmount, forceEnchantments); + return next(inventory, item, 0, enforceDurability, enforceAmount, enforceEnchantments); } - public static int next(final Inventory cinventory, final ItemStack item, final int start, final boolean forceDurability, final boolean forceAmount, final boolean forceEnchantments) + public static int next(final Inventory cinventory, final ItemStack item, final int start, final boolean enforceDurability, final boolean enforceAmount, final boolean enforceEnchantments) { final ItemStack[] inventory = cinventory.getContents(); for (int i = start; i < inventory.length; i++) @@ -30,7 +30,7 @@ public final class InventoryWorkaround { continue; } - if (item.getTypeId() == cItem.getTypeId() && (!forceAmount || item.getAmount() == cItem.getAmount()) && (!forceDurability || cItem.getDurability() == item.getDurability()) && (!forceEnchantments || cItem.getEnchantments().equals(item.getEnchantments()))) + if (item.getTypeId() == cItem.getTypeId() && (!enforceAmount || item.getAmount() == cItem.getAmount()) && (!enforceDurability || cItem.getDurability() == item.getDurability()) && (!enforceEnchantments || cItem.getEnchantments().equals(item.getEnchantments()))) { return i; } @@ -38,12 +38,12 @@ public final class InventoryWorkaround return -1; } - public static int firstPartial(final Inventory cinventory, final ItemStack item, final boolean forceDurability) + public static int firstPartial(final Inventory cinventory, final ItemStack item, final boolean enforceDurability) { - return firstPartial(cinventory, item, forceDurability, item.getType().getMaxStackSize()); + return firstPartial(cinventory, item, enforceDurability, item.getType().getMaxStackSize()); } - public static int firstPartial(final Inventory cinventory, final ItemStack item, final boolean forceDurability, final int maxAmount) + public static int firstPartial(final Inventory cinventory, final ItemStack item, final boolean enforceDurability, final int maxAmount) { if (item == null) { @@ -57,7 +57,7 @@ public final class InventoryWorkaround { continue; } - if (item.getTypeId() == cItem.getTypeId() && cItem.getAmount() < maxAmount && (!forceDurability || cItem.getDurability() == item.getDurability()) && cItem.getEnchantments().equals(item.getEnchantments())) + if (item.getTypeId() == cItem.getTypeId() && cItem.getAmount() < maxAmount && (!enforceDurability || cItem.getDurability() == item.getDurability()) && cItem.getEnchantments().equals(item.getEnchantments())) { return i; } @@ -65,12 +65,12 @@ public final class InventoryWorkaround return -1; } - public static boolean addAllItems(final Inventory cinventory, final boolean forceDurability, final ItemStack... items) + public static boolean addAllItems(final Inventory cinventory, final boolean enforceDurability, final ItemStack... items) { final Inventory fake = new FakeInventory(cinventory.getContents()); - if (addItem(fake, forceDurability, items).isEmpty()) + if (addItem(fake, enforceDurability, items).isEmpty()) { - addItem(cinventory, forceDurability, items); + addItem(cinventory, enforceDurability, items); return true; } else @@ -84,7 +84,7 @@ public final class InventoryWorkaround return addItem(cinventory, forceDurability, 0, items); } - public static Map addItem(final Inventory cinventory, final boolean forceDurability, final int oversizedStacks, final ItemStack... items) + public static Map addItem(final Inventory cinventory, final boolean enforceDurability, final int oversizedStacks, final ItemStack... items) { final Map leftover = new HashMap(); @@ -109,7 +109,7 @@ public final class InventoryWorkaround combined[j] = items[i].clone(); break; } - if (combined[j].getTypeId() == items[i].getTypeId() && (!forceDurability || combined[j].getDurability() == items[i].getDurability()) && combined[j].getEnchantments().equals(items[i].getEnchantments())) + if (combined[j].getTypeId() == items[i].getTypeId() && (!enforceDurability || combined[j].getDurability() == items[i].getDurability()) && combined[j].getEnchantments().equals(items[i].getEnchantments())) { combined[j].setAmount(combined[j].getAmount() + items[i].getAmount()); break; @@ -130,7 +130,7 @@ public final class InventoryWorkaround { // Do we already have a stack of it? final int maxAmount = oversizedStacks > item.getType().getMaxStackSize() ? oversizedStacks : item.getType().getMaxStackSize(); - final int firstPartial = firstPartial(cinventory, item, forceDurability, maxAmount); + final int firstPartial = firstPartial(cinventory, item, enforceDurability, maxAmount); // Drat! no partial stack if (firstPartial == -1) @@ -186,7 +186,7 @@ public final class InventoryWorkaround return leftover; } - public static Map removeItem(final Inventory cinventory, final boolean forceDurability, final boolean forceEnchantments, final ItemStack... items) + public static Map removeItem(final Inventory cinventory, final boolean enforceDurability, final boolean enforceEnchantments, final ItemStack... items) { final Map leftover = new HashMap(); @@ -211,7 +211,7 @@ public final class InventoryWorkaround } // get first Item, ignore the amount - final int first = first(cinventory, item, forceDurability, false, forceEnchantments); + final int first = first(cinventory, item, enforceDurability, false, enforceEnchantments); // Drat! we don't have this type in the inventory if (first == -1) @@ -244,7 +244,7 @@ public final class InventoryWorkaround return leftover; } - public static boolean containsItem(final Inventory cinventory, final boolean forceDurability, final boolean forceEnchantments, final ItemStack... items) + public static boolean containsItem(final Inventory cinventory, final boolean enforceDurability, final boolean enforceEnchantments, final ItemStack... items) { final Map leftover = new HashMap(); @@ -266,7 +266,7 @@ public final class InventoryWorkaround combined[j] = items[i].clone(); break; } - if (combined[j].getTypeId() == items[i].getTypeId() && (!forceDurability || combined[j].getDurability() == items[i].getDurability()) && (!forceEnchantments || combined[j].getEnchantments().equals(items[i].getEnchantments()))) + if (combined[j].getTypeId() == items[i].getTypeId() && (!enforceDurability || combined[j].getDurability() == items[i].getDurability()) && (!enforceEnchantments || combined[j].getEnchantments().equals(items[i].getEnchantments()))) { combined[j].setAmount(combined[j].getAmount() + items[i].getAmount()); break; @@ -292,7 +292,7 @@ public final class InventoryWorkaround break; } - final int slot = next(cinventory, item, position, forceDurability, false, forceEnchantments); + final int slot = next(cinventory, item, position, enforceDurability, false, enforceEnchantments); // Drat! we don't have this type in the inventory if (slot == -1) -- cgit v1.2.3 From 50ea442bf0be605420befc97c715825b3eff9bfc Mon Sep 17 00:00:00 2001 From: ElgarL Date: Mon, 26 Mar 2012 19:18:19 +0100 Subject: Treat all world names as lower case for file handling (please check in your worlds folder. You should have no folders with upper case letters from now). --- EssentialsGroupManager/src/Changelog.txt | 3 +- .../dataholder/worlds/WorldsHolder.java | 44 +++++++++++++--------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 6bedf7e90..5ee1a386e 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -151,4 +151,5 @@ v 1.9: - Better reporting when a users.yml is failing to load. - Expanded '/manuadd'to accept an optional variable for the world (eg '/manuadd '). - Removed some debug spam. - - Don't remove an attachment on a player leaving as Bukkit never forgets it. This fixes non mirrored permissions being messed up if a player relogs. \ No newline at end of file + - Don't remove an attachment on a player leaving as Bukkit never forgets it. This fixes non mirrored permissions being messed up if a player relogs. + - Treat all world names as lower case for file handling (please check in your worlds folder. You should have no folders with upper case letters from now). \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java index 290a58388..35e8794b5 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java @@ -362,9 +362,10 @@ public class WorldsHolder { * @return updated world holder */ private OverloadedWorldHolder getUpdatedWorldData(String worldName) { + String worldNameLowered = worldName.toLowerCase(); - if (worldsData.containsKey(worldName.toLowerCase())) { - OverloadedWorldHolder data = worldsData.get(worldName.toLowerCase()); + if (worldsData.containsKey(worldNameLowered)) { + OverloadedWorldHolder data = worldsData.get(worldNameLowered); data.updateDataSource(); return data; } @@ -444,17 +445,19 @@ public class WorldsHolder { } public void setupWorldFolder(String worldName) { + String worldNameLowered = worldName.toLowerCase(); + worldsFolder = new File(plugin.getDataFolder(), "worlds"); if (!worldsFolder.exists()) { worldsFolder.mkdirs(); } - File defaultWorldFolder = new File(worldsFolder, worldName); - if ((!defaultWorldFolder.exists()) && ((!mirrorsGroup.containsKey(worldName.toLowerCase()))) || (!mirrorsUser.containsKey(worldName.toLowerCase()))) { + File defaultWorldFolder = new File(worldsFolder, worldNameLowered); + if ((!defaultWorldFolder.exists()) && ((!mirrorsGroup.containsKey(worldNameLowered))) || (!mirrorsUser.containsKey(worldNameLowered))) { defaultWorldFolder.mkdirs(); } if (defaultWorldFolder.exists()) { - if (!mirrorsGroup.containsKey(worldName.toLowerCase())) { + if (!mirrorsGroup.containsKey(worldNameLowered)) { File groupsFile = new File(defaultWorldFolder, "groups.yml"); if (!groupsFile.exists() || groupsFile.length() == 0) { @@ -467,7 +470,7 @@ public class WorldsHolder { } } - if (!mirrorsUser.containsKey(worldName.toLowerCase())) { + if (!mirrorsUser.containsKey(worldNameLowered)) { File usersFile = new File(defaultWorldFolder, "users.yml"); if (!usersFile.exists() || usersFile.length() == 0) { @@ -485,13 +488,15 @@ public class WorldsHolder { /** * Copies the specified world data to another world + * * @param fromWorld * @param toWorld * @return true if successfully copied. */ public boolean cloneWorld(String fromWorld, String toWorld) { - File fromWorldFolder = new File(worldsFolder, fromWorld); - File toWorldFolder = new File(worldsFolder, toWorld); + + File fromWorldFolder = new File(worldsFolder, fromWorld.toLowerCase()); + File toWorldFolder = new File(worldsFolder, toWorld.toLowerCase()); if (toWorldFolder.exists() || !fromWorldFolder.exists()) { return false; } @@ -530,17 +535,20 @@ public class WorldsHolder { * @param worldName */ public void loadWorld(String worldName, Boolean isMirror) { - if (worldsData.containsKey(worldName.toLowerCase())) { - worldsData.get(worldName.toLowerCase()).reload(); + + String worldNameLowered = worldName.toLowerCase(); + + if (worldsData.containsKey(worldNameLowered)) { + worldsData.get(worldNameLowered).reload(); return; } GroupManager.logger.finest("Trying to load world " + worldName + "..."); - File thisWorldFolder = new File(worldsFolder, worldName); + File thisWorldFolder = new File(worldsFolder, worldNameLowered); if ((isMirror) || (thisWorldFolder.exists() && thisWorldFolder.isDirectory())) { // Setup file handles, if not mirrored - File groupsFile = (mirrorsGroup.containsKey(worldName.toLowerCase()))? null : new File(thisWorldFolder, "groups.yml"); - File usersFile = (mirrorsUser.containsKey(worldName.toLowerCase()))? null : new File(thisWorldFolder, "users.yml"); + File groupsFile = (mirrorsGroup.containsKey(worldNameLowered))? null : new File(thisWorldFolder, "groups.yml"); + File usersFile = (mirrorsUser.containsKey(worldNameLowered))? null : new File(thisWorldFolder, "users.yml"); if ((groupsFile != null) && (!groupsFile.exists())) { throw new IllegalArgumentException("Groups file for world '" + worldName + "' doesnt exist: " + groupsFile.getPath()); @@ -552,14 +560,14 @@ public class WorldsHolder { WorldDataHolder tempHolder = new WorldDataHolder(worldName); // Map the group object for any mirror - if (mirrorsGroup.containsKey(worldName.toLowerCase())) - tempHolder.setGroupsObject(this.getWorldData(mirrorsGroup.get(worldName.toLowerCase())).getGroupsObject()); + if (mirrorsGroup.containsKey(worldNameLowered)) + tempHolder.setGroupsObject(this.getWorldData(mirrorsGroup.get(worldNameLowered)).getGroupsObject()); else tempHolder.loadGroups(groupsFile); // Map the user object for any mirror - if (mirrorsUser.containsKey(worldName.toLowerCase())) - tempHolder.setUsersObject(this.getWorldData(mirrorsUser.get(worldName.toLowerCase())).getUsersObject()); + if (mirrorsUser.containsKey(worldNameLowered)) + tempHolder.setUsersObject(this.getWorldData(mirrorsUser.get(worldNameLowered)).getUsersObject()); else tempHolder.loadUsers(usersFile); @@ -573,7 +581,7 @@ public class WorldsHolder { if (thisWorldData != null) { GroupManager.logger.finest("Successful load of world " + worldName + "..."); - worldsData.put(worldName.toLowerCase(), thisWorldData); + worldsData.put(worldNameLowered, thisWorldData); return; } -- cgit v1.2.3 From fe7f479e63601097c245d296140bfce0f37448b0 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Mon, 26 Mar 2012 20:06:59 +0100 Subject: Auto rename all case sensitive world folders to lower case (if possible). --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../dataholder/worlds/WorldsHolder.java | 24 ++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 5ee1a386e..bbc8abe82 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -152,4 +152,5 @@ v 1.9: - Expanded '/manuadd'to accept an optional variable for the world (eg '/manuadd '). - Removed some debug spam. - Don't remove an attachment on a player leaving as Bukkit never forgets it. This fixes non mirrored permissions being messed up if a player relogs. - - Treat all world names as lower case for file handling (please check in your worlds folder. You should have no folders with upper case letters from now). \ No newline at end of file + - Treat all world names as lower case for file handling (please check in your worlds folder. You should have no folders with upper case letters from now). + - Auto rename all case sensitive world folders to lower case (if possible). \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java index 35e8794b5..bfa7d5cd2 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java @@ -106,7 +106,12 @@ public class WorldsHolder { if (!worldsData.containsKey(folder.getName().toLowerCase()) && ((!mirrorsGroup.containsKey(folder.getName().toLowerCase())) || (!mirrorsUser.containsKey(folder.getName().toLowerCase())))) { - loadWorld(folder.getName()); + /* + * Call setupWorldFolder to check case sensitivity + * and convert to lower case, before we attempt to load this world. + */ + setupWorldFolder(folder.getName()); + loadWorld(folder.getName().toLowerCase()); } } @@ -454,7 +459,22 @@ public class WorldsHolder { File defaultWorldFolder = new File(worldsFolder, worldNameLowered); if ((!defaultWorldFolder.exists()) && ((!mirrorsGroup.containsKey(worldNameLowered))) || (!mirrorsUser.containsKey(worldNameLowered))) { - defaultWorldFolder.mkdirs(); + + /* + * check and convert all old case sensitive folders to lower case + */ + File casedWorldFolder = new File(worldsFolder, worldName); + if ((casedWorldFolder.exists()) && (casedWorldFolder.getName().toLowerCase().equals(worldNameLowered))) { + /* + * Rename the old folder to the new lower cased format + */ + casedWorldFolder.renameTo(new File(worldsFolder, worldNameLowered)); + } else { + /* + * Else we just create the folder + */ + defaultWorldFolder.mkdirs(); + } } if (defaultWorldFolder.exists()) { if (!mirrorsGroup.containsKey(worldNameLowered)) { -- cgit v1.2.3 From b8453ac7927ae83811d00448842c622d8adec5fa Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 27 Mar 2012 10:14:53 +0100 Subject: Update GlobalGroups.yml for new/changed Towny permission nodes. --- EssentialsGroupManager/src/Changelog.txt | 3 +- EssentialsGroupManager/src/globalgroups.yml | 70 ++++++++++++++--------------- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index bbc8abe82..a9ebb72aa 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -153,4 +153,5 @@ v 1.9: - Removed some debug spam. - Don't remove an attachment on a player leaving as Bukkit never forgets it. This fixes non mirrored permissions being messed up if a player relogs. - Treat all world names as lower case for file handling (please check in your worlds folder. You should have no folders with upper case letters from now). - - Auto rename all case sensitive world folders to lower case (if possible). \ No newline at end of file + - Auto rename all case sensitive world folders to lower case (if possible). + - Update GlobalGroups.yml for new/changed Towny permission nodes. \ No newline at end of file diff --git a/EssentialsGroupManager/src/globalgroups.yml b/EssentialsGroupManager/src/globalgroups.yml index e199622ee..885c6675d 100644 --- a/EssentialsGroupManager/src/globalgroups.yml +++ b/EssentialsGroupManager/src/globalgroups.yml @@ -181,47 +181,47 @@ groups: - towny.nation.* - towny.chat.tc - towny.chat.nc - - towny.wild.block.6.build - - towny.wild.block.6.destroy - - towny.wild.block.14.destroy - - towny.wild.block.15.destroy - - towny.wild.block.16.destroy - - towny.wild.block.17.build - - towny.wild.block.17.destroy - - towny.wild.block.18.destroy - - towny.wild.block.21.destroy - - towny.wild.block.31.destroy - - towny.wild.block.37.destroy - - towny.wild.block.38.destroy - - towny.wild.block.39.destroy - - towny.wild.block.40.destroy - - towny.wild.block.50.destroy - - towny.wild.block.56.destroy - - towny.wild.block.73.destroy - - towny.wild.block.74.destroy - - towny.wild.block.78.destroy - - towny.wild.block.81.destroy - - towny.wild.block.82.destroy - - towny.wild.block.83.destroy - - towny.wild.block.86.destroy - - towny.wild.block.103.destroy - - towny.wild.block.106.destroy - - towny.wild.block.111.destroy - - towny.wild.block.115.destroy + - towny.wild.build.6 + - towny.wild.destroy.6 + - towny.wild.destroy.14 + - towny.wild.destroy.15 + - towny.wild.destroy.16 + - towny.wild.build.17 + - towny.wild.destroy.17 + - towny.wild.destroy.18 + - towny.wild.destroy.21 + - towny.wild.destroy.31 + - towny.wild.destroy.37 + - towny.wild.destroy.38 + - towny.wild.destroy.39 + - towny.wild.destroy.40 + - towny.wild.destroy.50 + - towny.wild.destroy.56 + - towny.wild.destroy.73 + - towny.wild.destroy.74 + - towny.wild.destroy.78 + - towny.wild.destroy.81 + - towny.wild.destroy.82 + - towny.wild.destroy.83 + - towny.wild.destroy.86 + - towny.wild.destroy.103 + - towny.wild.destroy.106 + - towny.wild.destroy.111 + - towny.wild.destroy.115 g:towny_moderator: permissions: - towny.chat.mod - - towny.wild.block.64.switch - - towny.wild.block.83.build - - towny.wild.block.86.build - - towny.wild.block.103.build - - towny.wild.block.111.build - - towny.wild.block.115.build + - towny.wild.switch.64 + - towny.wild.build.83 + - towny.wild.build.86 + - towny.wild.build.103 + - towny.wild.build.111 + - towny.wild.build.115 g:towny_admin: permissions: - towny.admin - - -towny.wild.block.119.destroy - - -towny.wild.block.120.destroy + - -towny.wild.destroy.119 + - -towny.wild.destroy.120 - towny.chat.admin \ No newline at end of file -- cgit v1.2.3 From 97eed50ccca4455b667cb42043860055f0dfc089 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 27 Mar 2012 15:28:40 +0100 Subject: Adding world permission checks to: tpaall tpall tpahere tphere tpohere User is required to have the permission for the world he is in, before he can teleport users outside this world, to it. --- Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java | 5 +++++ .../src/com/earth2me/essentials/commands/Commandtpaccept.java | 6 ++++-- Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java | 5 +++++ Essentials/src/com/earth2me/essentials/commands/Commandtpall.java | 5 +++++ Essentials/src/com/earth2me/essentials/commands/Commandtphere.java | 5 +++++ Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java | 6 ++++++ 6 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java index c0abdc1ad..7af445c51 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java @@ -45,6 +45,11 @@ public class Commandtpaall extends EssentialsCommand { continue; } + if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + user.getWorld().getName())) + { + continue; + } try { player.requestTeleport(user, true); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java index 7f06602ae..9203f9015 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java @@ -25,12 +25,14 @@ public class Commandtpaccept extends EssentialsCommand throw new Exception(_("noPendingRequest")); } - if (user.isTpRequestHere() && !target.isAuthorized("essentials.tpahere")) + if (user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpahere") && !target.isAuthorized("essentials.tpaall")) + || (user.getWorld() != target.getWorld() && ess.getSettings().isWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + user.getWorld().getName())))) { throw new Exception(_("noPendingRequest")); } - if (!user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall")) + if (!user.isTpRequestHere() && (!target.isAuthorized("essentials.tpa") || (user.getWorld() != target.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.world." + target.getWorld().getName())))) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java index 376c2be44..9d389ecac 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java @@ -25,6 +25,11 @@ public class Commandtpahere extends EssentialsCommand { throw new Exception(_("teleportDisabled", player.getDisplayName())); } + if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + user.getWorld().getName())) + { + throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName())); + } player.requestTeleport(user, true); player.sendMessage(_("teleportHereRequest", user.getDisplayName())); player.sendMessage(_("typeTpaccept")); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java index f21f1a6bc..6335a4a54 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java @@ -42,6 +42,11 @@ public class Commandtpall extends EssentialsCommand { continue; } + if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + user.getWorld().getName())) + { + continue; + } try { player.getTeleport().now(user, false, TeleportCause.COMMAND); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java index 733091d1a..92eb87226 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java @@ -22,6 +22,11 @@ public class Commandtphere extends EssentialsCommand { throw new Exception(_("teleportDisabled", player.getDisplayName())); } + if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + user.getWorld().getName())) + { + throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName())); + } player.getTeleport().teleport(user, new Trade(this.getName(), ess), TeleportCause.COMMAND); user.sendMessage(_("teleporting")); player.sendMessage(_("teleporting")); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java index 6183bcf74..880c4e362 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java @@ -30,6 +30,12 @@ public class Commandtpohere extends EssentialsCommand throw new NoSuchFieldException(_("playerNotFound")); } + if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + user.getWorld().getName())) + { + throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName())); + } + // Verify permission if (!player.isHidden() || user.isAuthorized("essentials.teleport.hidden")) { -- cgit v1.2.3 From b14e7c197fb6e11ed26703314308db99ca241208 Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 27 Mar 2012 21:14:38 +0200 Subject: Adds pvp protection after teleport --- .../essentials/EssentialsEntityListener.java | 3 +++ .../essentials/EssentialsPlayerListener.java | 5 ++--- .../com/earth2me/essentials/EssentialsTimer.java | 1 + .../src/com/earth2me/essentials/ISettings.java | 2 ++ .../src/com/earth2me/essentials/Settings.java | 8 ++++++- Essentials/src/com/earth2me/essentials/User.java | 26 +++++++++++++++++++++- Essentials/src/config.yml | 4 ++++ 7 files changed, 44 insertions(+), 5 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java index 524edc16f..029288530 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java @@ -32,6 +32,9 @@ public class EssentialsEntityListener implements Listener { final User defender = ess.getUser(eDefend); final User attacker = ess.getUser(eAttack); + if (attacker.hasInvulnerabilityAfterTeleport() || defender.hasInvulnerabilityAfterTeleport()) { + event.setCancelled(true); + } attacker.updateActivity(true); final List commandList = attacker.getPowertool(attacker.getItemInHand()); if (commandList != null && !commandList.isEmpty()) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 6b6b4a034..97ced232d 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -229,14 +229,13 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerTeleport(final PlayerTeleportEvent event) { - + final User user = ess.getUser(event.getPlayer()); //There is TeleportCause.COMMMAND but plugins have to actively pass the cause in on their teleports. if ((event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND) && ess.getSettings().registerBackInListener()) { - final User user = ess.getUser(event.getPlayer()); user.setLastLocation(); } - + user.enableInvulnerabilityAfterTeleport(); } @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsTimer.java b/Essentials/src/com/earth2me/essentials/EssentialsTimer.java index 0c413bfc8..18f980a62 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsTimer.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsTimer.java @@ -48,6 +48,7 @@ public class EssentialsTimer implements Runnable } user.checkMuteTimeout(currentTime); user.checkJailTimeout(currentTime); + user.resetInvulnerabilityAfterTeleport(); } } } diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index 1ef8feaa9..74942640e 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -169,4 +169,6 @@ public interface ISettings extends IConf boolean isMetricsEnabled(); void setMetricsEnabled(boolean metricsEnabled); + + public long getTeleportInvulnerability(); } diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 08c3b74db..9dee4e990 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -609,7 +609,7 @@ public class Settings implements ISettings { return config.getBoolean("change-displayname", true); } - + @Override public boolean changePlayerListName() { @@ -745,4 +745,10 @@ public class Settings implements ISettings { this.metricsEnabled = metricsEnabled; } + + @Override + public long getTeleportInvulnerability() + { + return config.getLong("teleport-invulnerability", 0) * 1000; + } } diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index cfa6a4a4a..f931b07d9 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -603,8 +603,32 @@ public class User extends UserData implements Comparable, IReplyTo, IUser return invSee; } - public void setInvSee(boolean set) + public void setInvSee(final boolean set) { invSee = set; } + private transient long teleportInvulnerabilityTimestamp = 0; + + public void enableInvulnerabilityAfterTeleport() + { + final long time = ess.getSettings().getTeleportInvulnerability(); + if (time > 0) + { + teleportInvulnerabilityTimestamp = System.currentTimeMillis() + time; + } + } + + public void resetInvulnerabilityAfterTeleport() + { + if (teleportInvulnerabilityTimestamp != 0 + && teleportInvulnerabilityTimestamp < System.currentTimeMillis()) + { + teleportInvulnerabilityTimestamp = 0; + } + } + + public boolean hasInvulnerabilityAfterTeleport() + { + return teleportInvulnerabilityTimestamp != 0 && teleportInvulnerabilityTimestamp >= System.currentTimeMillis(); + } } diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 133557030..ec1f3fc8d 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -50,6 +50,10 @@ teleport-cooldown: 0 # The delay, in seconds, before a user actually teleports. If the user moves or gets attacked in this timeframe, the teleport never occurs. teleport-delay: 0 +# The delay, in seconds, a player can't be attacked by other players after he has been teleported by a command +# This will also prevent that the player can attack other players +teleport-invulnerability: 0 + # The delay, in seconds, required between /heal attempts heal-cooldown: 60 -- cgit v1.2.3 From a7df8a1a0ac858bd943a9987b33783dddda4ba4c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 27 Mar 2012 21:08:06 +0100 Subject: Try to reduce lag caused by join spam. --- .../src/com/earth2me/essentials/EssentialsPlayerListener.java | 1 - Essentials/src/com/earth2me/essentials/UserData.java | 11 ++++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 97ced232d..eb21aea39 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -129,7 +129,6 @@ public class EssentialsPlayerListener implements Listener user.setDisplayNick(); user.setLastLogin(System.currentTimeMillis()); - user.setLastLoginAddress(user.getAddress().getAddress().getHostAddress()); user.updateActivity(false); updateCompass(user); diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 3c8066cc9..abf338470 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -621,10 +621,16 @@ public abstract class UserData extends PlayerExtension implements IConf return lastLogin; } - public void setLastLogin(long time) + private void _setLastLogin(long time) { lastLogin = time; config.setProperty("timestamps.login", time); + } + + public void setLastLogin(long time) + { + _setLastLogin(time); + _setLastLoginAddress(base.getAddress().getAddress().getHostAddress()); config.save(); } private long lastLogout; @@ -657,11 +663,10 @@ public abstract class UserData extends PlayerExtension implements IConf return lastLoginAddress; } - public void setLastLoginAddress(String address) + private void _setLastLoginAddress(String address) { lastLoginAddress = address; config.setProperty("ipAddress", address); - config.save(); } private boolean afk; -- cgit v1.2.3 From 5b626614048a7aed902b3ea3a3834c54447cbd27 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 28 Mar 2012 00:59:51 +0100 Subject: Pull example perm files out of the ess jar. --- Essentials/src/examples/bpermissions.yml | 119 -------------------- Essentials/src/examples/permissionsbukkit.yml | 132 ----------------------- Essentials/src/examples/permissionsex.yml | 149 -------------------------- examples/bpermissions.yml | 119 ++++++++++++++++++++ examples/permissionsbukkit.yml | 132 +++++++++++++++++++++++ examples/permissionsex.yml | 149 ++++++++++++++++++++++++++ 6 files changed, 400 insertions(+), 400 deletions(-) delete mode 100644 Essentials/src/examples/bpermissions.yml delete mode 100644 Essentials/src/examples/permissionsbukkit.yml delete mode 100644 Essentials/src/examples/permissionsex.yml create mode 100644 examples/bpermissions.yml create mode 100644 examples/permissionsbukkit.yml create mode 100644 examples/permissionsex.yml diff --git a/Essentials/src/examples/bpermissions.yml b/Essentials/src/examples/bpermissions.yml deleted file mode 100644 index 6b7900c4f..000000000 --- a/Essentials/src/examples/bpermissions.yml +++ /dev/null @@ -1,119 +0,0 @@ -default: Default -groups: - Default: - - essentials.spawn - - essentials.rules - - essentials.motd - - essentials.list - - essentials.helpop - - essentials.help - Builder: - - essentials.build - - essentials.afk - - essentials.back - - essentials.back.ondeath - - essentials.balance - - essentials.balance.others - - essentials.balancetop - - essentials.chat.color - - essentials.chat.shout - - essentials.chat.question - - essentials.compass - - essentials.depth - - essentials.home - - essentials.ignore - - essentials.kit - - essentials.kit.tools - - essentials.mail - - essentials.mail.send - - essentials.me - - essentials.msg - - essentials.nick - - essentials.pay - - essentials.ping - - essentials.powertool - - essentials.protect - - essentials.sethome - - essentials.signs.use.* - - essentials.signs.create.disposal - - essentials.signs.create.mail - - essentials.signs.create.protection - - essentials.signs.create.trade - - essentials.signs.break.disposal - - essentials.signs.break.mail - - essentials.signs.break.protection - - essentials.signs.break.trade - - essentials.suicide - - essentials.time - - essentials.tpa - - essentials.tpaccept - - essentials.tpahere - - essentials.tpdeny - - essentials.warp - - essentials.warp.list - - essentials.worth - Moderator: - - essentials.build - - essentials.ban - - essentials.ban.notify - - essentials.banip - - essentials.broadcast - - essentials.clearinventory - - essentials.delwarp - - essentials.eco.loan - - essentials.ext - - essentials.getpos - - essentials.helpop.recieve - - essentials.home.others - - essentials.invsee - - essentials.jails - - essentials.jump - - essentials.kick - - essentials.kick.notify - - essentials.kill - - essentials.mute - - essentials.nick.others - - essentials.realname - - essentials.setwarp - - essentials.signs.create.* - - essentials.signs.break.* - - essentials.spawner - - essentials.thunder - - essentials.time - - essentials.time.set - - essentials.protect.alerts - - essentials.protect.admin - - essentials.protect.ownerinfo - - essentials.ptime - - essentials.ptime.others - - essentials.togglejail - - essentials.top - - essentials.tp - - essentials.tphere - - essentials.tppos - - essentials.tptoggle - - essentials.unban - - essentials.unbanip - - essentials.weather - - essentials.whois - - essentials.world - Admin: - # Since we use essentials.* permission here, we can still disable commands like this - # This can be done with any pemission nodes - - ^essentials.backup - - ^essentials.essentials - - ^essentials.setspawn - - ^essentials.reloadall - - essentials.* - Owner: - - essentials.* -players: - notch: - - Default - snowleo: - - Admin - - Moderator - - Builder - - Default - KHobbits: - - Owner diff --git a/Essentials/src/examples/permissionsbukkit.yml b/Essentials/src/examples/permissionsbukkit.yml deleted file mode 100644 index 515256ef1..000000000 --- a/Essentials/src/examples/permissionsbukkit.yml +++ /dev/null @@ -1,132 +0,0 @@ -users: - snowleo: - groups: - - Admin -groups: - Default: - permissions: - permissions.build: false - essentials.spawn: true - essentials.rules: true - essentials.motd: true - essentials.list: true - essentials.helpop: true - essentials.help: true - Builder: - permissions: - permissions.build: true - essentials.afk: true - essentials.back: true - essentials.back.ondeath: true - essentials.balance: true - essentials.balance.others: true - essentials.balancetop: true - essentials.chat.color: true - essentials.chat.shout: true - essentials.chat.question: true - essentials.compass: true - essentials.depth: true - essentials.home: true - essentials.ignore: true - essentials.kit: true - essentials.kit.tools: true - essentials.mail: true - essentials.mail.send: true - essentials.me: true - essentials.msg: true - essentials.nick: true - essentials.pay: true - essentials.ping: true - essentials.powertool: true - essentials.protect: true - essentials.sethome: true - essentials.signs.use.*: true - essentials.signs.create.disposal: true - essentials.signs.create.mail: true - essentials.signs.create.protection: true - essentials.signs.create.trade: true - essentials.signs.break.disposal: true - essentials.signs.break.mail: true - essentials.signs.break.protection: true - essentials.signs.break.trade: true - essentials.suicide: true - essentials.time: true - essentials.tpa: true - essentials.tpaccept: true - essentials.tpahere: true - essentials.tpdeny: true - essentials.warp: true - essentials.warp.list: true - essentials.worth: true - inheritance: - - Default - Moderator: - permissions: - essentials.ban: true - essentials.ban.notify: true - essentials.banip: true - essentials.broadcast: true - essentials.clearinventory: true - essentials.delwarp: true - essentials.eco.loan: true - essentials.ext: true - essentials.getpos: true - essentials.helpop.recieve: true - essentials.home.others: true - essentials.invsee: true - essentials.jails: true - essentials.jump: true - essentials.kick: true - essentials.kick.notify: true - essentials.kill: true - essentials.mute: true - essentials.nick.others: true - essentials.realname: true - essentials.setwarp: true - essentials.signs.create.*: true - essentials.signs.break.*: true - essentials.spawner: true - essentials.thunder: true - essentials.time: true - essentials.time.set: true - essentials.protect.alerts: true - essentials.protect.admin: true - essentials.protect.ownerinfo: true - essentials.ptime: true - essentials.ptime.others: true - essentials.togglejail: true - essentials.top: true - essentials.tp: true - essentials.tphere: true - essentials.tppos: true - essentials.tptoggle: true - essentials.unban: true - essentials.unbanip: true - essentials.weather: true - essentials.whois: true - essentials.world: true - inheritance: - - Builder - Admin: - permissions: - permissions.*: true - # Since we use essentials.* permission here, we can still disable commands like this - # This is only available for essentials permissions - -essentials.backup: true - -essentials.essentials: true - -essentials.setspawn: true - -essentials.reloadall: true - essentials.*: true - inheritance: - - Moderator - Owner: - permissions: - # Double negation - -essentials.backup: false - -essentials.essentials: false - -essentials.setspawn: false - -essentials.reloadall: false - inheritance: - - Admin -messages: - build: '&cYou do not have permission to build here.' diff --git a/Essentials/src/examples/permissionsex.yml b/Essentials/src/examples/permissionsex.yml deleted file mode 100644 index 3dc6354fb..000000000 --- a/Essentials/src/examples/permissionsex.yml +++ /dev/null @@ -1,149 +0,0 @@ -groups: - Default: - default: true - permissions: - - essentials.spawn - - essentials.rules - - essentials.motd - - essentials.list - - essentials.helpop - - essentials.help - - modifyworld.* - prefix: '&e' - options: - build: false - rank: '1000' - Builder: - permissions: - - essentials.afk - - essentials.back - - essentials.back.ondeath - - essentials.balance - - essentials.balance.others - - essentials.balancetop - - essentials.chat.color - - essentials.chat.shout - - essentials.chat.question - - essentials.compass - - essentials.depth - - essentials.home - - essentials.ignore - - essentials.kit - - essentials.kit.tools - - essentials.mail - - essentials.mail.send - - essentials.me - - essentials.msg - - essentials.nick - - essentials.pay - - essentials.ping - - essentials.powertool - - essentials.protect - - essentials.sethome - - essentials.signs.use.* - - essentials.signs.create.disposal - - essentials.signs.create.mail - - essentials.signs.create.protection - - essentials.signs.create.trade - - essentials.signs.break.disposal - - essentials.signs.break.mail - - essentials.signs.break.protection - - essentials.signs.break.trade - - essentials.suicide - - essentials.time - - essentials.tpa - - essentials.tpaccept - - essentials.tpahere - - essentials.tpdeny - - essentials.warp - - essentials.warp.list - - essentials.worth - inheritance: - - default - prefix: '&2' - options: - build: true - rank: '500' - Moderator: - permissions: - - essentials.ban - - essentials.ban.notify - - essentials.banip - - essentials.broadcast - - essentials.clearinventory - - essentials.delwarp - - essentials.eco.loan - - essentials.ext - - essentials.getpos - - essentials.helpop.recieve - - essentials.home.others - - essentials.invsee - - essentials.jails - - essentials.jump - - essentials.kick - - essentials.kick.notify - - essentials.kill - - essentials.mute - - essentials.nick.others - - essentials.realname - - essentials.setwarp - - essentials.signs.create.* - - essentials.signs.break.* - - essentials.spawner - - essentials.thunder - - essentials.time - - essentials.time.set - - essentials.protect.alerts - - essentials.protect.admin - - essentials.protect.ownerinfo - - essentials.ptime - - essentials.ptime.others - - essentials.togglejail - - essentials.top - - essentials.tp - - essentials.tphere - - essentials.tppos - - essentials.tptoggle - - essentials.unban - - essentials.unbanip - - essentials.weather - - essentials.whois - - essentials.world - - permissions.user.promote.default - - permissions.user.demote.default - - permissions.manage.membership - inheritance: - - builder - prefix: '&5' - options: - build: true - rank: '200' - Admin: - permissions: - - -essentials.backup - - -essentials.essentials - - -essentials.setspawn - - -essentials.reloadall - - essentials.* - - permissions.manage.users - - permissions.manage.users.permissions - - permissions.manage.users.permissions.timed - inheritance: - - moderator - prefix: '&c' - options: - build: true - rank: '100' - Owner: - permissions: - - '*' - inheritance: - - admin - prefix: '&4' - options: - build: true - rank: '0' -users: - snowleo: - group: - - Builder diff --git a/examples/bpermissions.yml b/examples/bpermissions.yml new file mode 100644 index 000000000..6b7900c4f --- /dev/null +++ b/examples/bpermissions.yml @@ -0,0 +1,119 @@ +default: Default +groups: + Default: + - essentials.spawn + - essentials.rules + - essentials.motd + - essentials.list + - essentials.helpop + - essentials.help + Builder: + - essentials.build + - essentials.afk + - essentials.back + - essentials.back.ondeath + - essentials.balance + - essentials.balance.others + - essentials.balancetop + - essentials.chat.color + - essentials.chat.shout + - essentials.chat.question + - essentials.compass + - essentials.depth + - essentials.home + - essentials.ignore + - essentials.kit + - essentials.kit.tools + - essentials.mail + - essentials.mail.send + - essentials.me + - essentials.msg + - essentials.nick + - essentials.pay + - essentials.ping + - essentials.powertool + - essentials.protect + - essentials.sethome + - essentials.signs.use.* + - essentials.signs.create.disposal + - essentials.signs.create.mail + - essentials.signs.create.protection + - essentials.signs.create.trade + - essentials.signs.break.disposal + - essentials.signs.break.mail + - essentials.signs.break.protection + - essentials.signs.break.trade + - essentials.suicide + - essentials.time + - essentials.tpa + - essentials.tpaccept + - essentials.tpahere + - essentials.tpdeny + - essentials.warp + - essentials.warp.list + - essentials.worth + Moderator: + - essentials.build + - essentials.ban + - essentials.ban.notify + - essentials.banip + - essentials.broadcast + - essentials.clearinventory + - essentials.delwarp + - essentials.eco.loan + - essentials.ext + - essentials.getpos + - essentials.helpop.recieve + - essentials.home.others + - essentials.invsee + - essentials.jails + - essentials.jump + - essentials.kick + - essentials.kick.notify + - essentials.kill + - essentials.mute + - essentials.nick.others + - essentials.realname + - essentials.setwarp + - essentials.signs.create.* + - essentials.signs.break.* + - essentials.spawner + - essentials.thunder + - essentials.time + - essentials.time.set + - essentials.protect.alerts + - essentials.protect.admin + - essentials.protect.ownerinfo + - essentials.ptime + - essentials.ptime.others + - essentials.togglejail + - essentials.top + - essentials.tp + - essentials.tphere + - essentials.tppos + - essentials.tptoggle + - essentials.unban + - essentials.unbanip + - essentials.weather + - essentials.whois + - essentials.world + Admin: + # Since we use essentials.* permission here, we can still disable commands like this + # This can be done with any pemission nodes + - ^essentials.backup + - ^essentials.essentials + - ^essentials.setspawn + - ^essentials.reloadall + - essentials.* + Owner: + - essentials.* +players: + notch: + - Default + snowleo: + - Admin + - Moderator + - Builder + - Default + KHobbits: + - Owner diff --git a/examples/permissionsbukkit.yml b/examples/permissionsbukkit.yml new file mode 100644 index 000000000..515256ef1 --- /dev/null +++ b/examples/permissionsbukkit.yml @@ -0,0 +1,132 @@ +users: + snowleo: + groups: + - Admin +groups: + Default: + permissions: + permissions.build: false + essentials.spawn: true + essentials.rules: true + essentials.motd: true + essentials.list: true + essentials.helpop: true + essentials.help: true + Builder: + permissions: + permissions.build: true + essentials.afk: true + essentials.back: true + essentials.back.ondeath: true + essentials.balance: true + essentials.balance.others: true + essentials.balancetop: true + essentials.chat.color: true + essentials.chat.shout: true + essentials.chat.question: true + essentials.compass: true + essentials.depth: true + essentials.home: true + essentials.ignore: true + essentials.kit: true + essentials.kit.tools: true + essentials.mail: true + essentials.mail.send: true + essentials.me: true + essentials.msg: true + essentials.nick: true + essentials.pay: true + essentials.ping: true + essentials.powertool: true + essentials.protect: true + essentials.sethome: true + essentials.signs.use.*: true + essentials.signs.create.disposal: true + essentials.signs.create.mail: true + essentials.signs.create.protection: true + essentials.signs.create.trade: true + essentials.signs.break.disposal: true + essentials.signs.break.mail: true + essentials.signs.break.protection: true + essentials.signs.break.trade: true + essentials.suicide: true + essentials.time: true + essentials.tpa: true + essentials.tpaccept: true + essentials.tpahere: true + essentials.tpdeny: true + essentials.warp: true + essentials.warp.list: true + essentials.worth: true + inheritance: + - Default + Moderator: + permissions: + essentials.ban: true + essentials.ban.notify: true + essentials.banip: true + essentials.broadcast: true + essentials.clearinventory: true + essentials.delwarp: true + essentials.eco.loan: true + essentials.ext: true + essentials.getpos: true + essentials.helpop.recieve: true + essentials.home.others: true + essentials.invsee: true + essentials.jails: true + essentials.jump: true + essentials.kick: true + essentials.kick.notify: true + essentials.kill: true + essentials.mute: true + essentials.nick.others: true + essentials.realname: true + essentials.setwarp: true + essentials.signs.create.*: true + essentials.signs.break.*: true + essentials.spawner: true + essentials.thunder: true + essentials.time: true + essentials.time.set: true + essentials.protect.alerts: true + essentials.protect.admin: true + essentials.protect.ownerinfo: true + essentials.ptime: true + essentials.ptime.others: true + essentials.togglejail: true + essentials.top: true + essentials.tp: true + essentials.tphere: true + essentials.tppos: true + essentials.tptoggle: true + essentials.unban: true + essentials.unbanip: true + essentials.weather: true + essentials.whois: true + essentials.world: true + inheritance: + - Builder + Admin: + permissions: + permissions.*: true + # Since we use essentials.* permission here, we can still disable commands like this + # This is only available for essentials permissions + -essentials.backup: true + -essentials.essentials: true + -essentials.setspawn: true + -essentials.reloadall: true + essentials.*: true + inheritance: + - Moderator + Owner: + permissions: + # Double negation + -essentials.backup: false + -essentials.essentials: false + -essentials.setspawn: false + -essentials.reloadall: false + inheritance: + - Admin +messages: + build: '&cYou do not have permission to build here.' diff --git a/examples/permissionsex.yml b/examples/permissionsex.yml new file mode 100644 index 000000000..3dc6354fb --- /dev/null +++ b/examples/permissionsex.yml @@ -0,0 +1,149 @@ +groups: + Default: + default: true + permissions: + - essentials.spawn + - essentials.rules + - essentials.motd + - essentials.list + - essentials.helpop + - essentials.help + - modifyworld.* + prefix: '&e' + options: + build: false + rank: '1000' + Builder: + permissions: + - essentials.afk + - essentials.back + - essentials.back.ondeath + - essentials.balance + - essentials.balance.others + - essentials.balancetop + - essentials.chat.color + - essentials.chat.shout + - essentials.chat.question + - essentials.compass + - essentials.depth + - essentials.home + - essentials.ignore + - essentials.kit + - essentials.kit.tools + - essentials.mail + - essentials.mail.send + - essentials.me + - essentials.msg + - essentials.nick + - essentials.pay + - essentials.ping + - essentials.powertool + - essentials.protect + - essentials.sethome + - essentials.signs.use.* + - essentials.signs.create.disposal + - essentials.signs.create.mail + - essentials.signs.create.protection + - essentials.signs.create.trade + - essentials.signs.break.disposal + - essentials.signs.break.mail + - essentials.signs.break.protection + - essentials.signs.break.trade + - essentials.suicide + - essentials.time + - essentials.tpa + - essentials.tpaccept + - essentials.tpahere + - essentials.tpdeny + - essentials.warp + - essentials.warp.list + - essentials.worth + inheritance: + - default + prefix: '&2' + options: + build: true + rank: '500' + Moderator: + permissions: + - essentials.ban + - essentials.ban.notify + - essentials.banip + - essentials.broadcast + - essentials.clearinventory + - essentials.delwarp + - essentials.eco.loan + - essentials.ext + - essentials.getpos + - essentials.helpop.recieve + - essentials.home.others + - essentials.invsee + - essentials.jails + - essentials.jump + - essentials.kick + - essentials.kick.notify + - essentials.kill + - essentials.mute + - essentials.nick.others + - essentials.realname + - essentials.setwarp + - essentials.signs.create.* + - essentials.signs.break.* + - essentials.spawner + - essentials.thunder + - essentials.time + - essentials.time.set + - essentials.protect.alerts + - essentials.protect.admin + - essentials.protect.ownerinfo + - essentials.ptime + - essentials.ptime.others + - essentials.togglejail + - essentials.top + - essentials.tp + - essentials.tphere + - essentials.tppos + - essentials.tptoggle + - essentials.unban + - essentials.unbanip + - essentials.weather + - essentials.whois + - essentials.world + - permissions.user.promote.default + - permissions.user.demote.default + - permissions.manage.membership + inheritance: + - builder + prefix: '&5' + options: + build: true + rank: '200' + Admin: + permissions: + - -essentials.backup + - -essentials.essentials + - -essentials.setspawn + - -essentials.reloadall + - essentials.* + - permissions.manage.users + - permissions.manage.users.permissions + - permissions.manage.users.permissions.timed + inheritance: + - moderator + prefix: '&c' + options: + build: true + rank: '100' + Owner: + permissions: + - '*' + inheritance: + - admin + prefix: '&4' + options: + build: true + rank: '0' +users: + snowleo: + group: + - Builder -- cgit v1.2.3 From 32c689e0f5a275d37df941d8e9e24caa62ef5890 Mon Sep 17 00:00:00 2001 From: snowleo Date: Wed, 28 Mar 2012 10:36:10 +0200 Subject: Fix isAffordableFor in Trade class This fixes buy signs giving out items, when the player has essentials.eco.loan permission, but min-money in config is set to 0. --- Essentials/src/com/earth2me/essentials/Trade.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java index fbdc471bd..502d3e34d 100644 --- a/Essentials/src/com/earth2me/essentials/Trade.java +++ b/Essentials/src/com/earth2me/essentials/Trade.java @@ -56,11 +56,9 @@ public class Trade public void isAffordableFor(final IUser user) throws ChargeException { - final double mon = user.getMoney(); if (getMoney() != null - && mon < getMoney() && getMoney() > 0 - && !user.isAuthorized("essentials.eco.loan")) + && user.canAfford(getMoney())) { throw new ChargeException(_("notEnoughMoney")); } @@ -71,12 +69,10 @@ public class Trade throw new ChargeException(_("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " "))); } + double money; if (command != null && !command.isEmpty() - && !user.isAuthorized("essentials.nocommandcost.all") - && !user.isAuthorized("essentials.nocommandcost." + command) - && mon < ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command) - && 0 < ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command) - && !user.isAuthorized("essentials.eco.loan")) + && 0 < (money = getCommandCost(user)) + && user.canAfford(money)) { throw new ChargeException(_("notEnoughMoney")); } -- cgit v1.2.3 From 71d874484037b73e8eed93194d1f0a966bb389e1 Mon Sep 17 00:00:00 2001 From: snowleo Date: Wed, 28 Mar 2012 11:21:31 +0200 Subject: Fix for the fix --- Essentials/src/com/earth2me/essentials/Trade.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java index 502d3e34d..730037d9a 100644 --- a/Essentials/src/com/earth2me/essentials/Trade.java +++ b/Essentials/src/com/earth2me/essentials/Trade.java @@ -58,7 +58,7 @@ public class Trade { if (getMoney() != null && getMoney() > 0 - && user.canAfford(getMoney())) + && !user.canAfford(getMoney())) { throw new ChargeException(_("notEnoughMoney")); } @@ -72,7 +72,7 @@ public class Trade double money; if (command != null && !command.isEmpty() && 0 < (money = getCommandCost(user)) - && user.canAfford(money)) + && !user.canAfford(money)) { throw new ChargeException(_("notEnoughMoney")); } -- cgit v1.2.3 From 9d545dcbf1fb95b6c2185de6f40e72708bdc53cd Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 28 Mar 2012 14:54:48 +0100 Subject: Don't register jail listeners, if no jails are set. --- Essentials/src/com/earth2me/essentials/Jails.java | 21 ++++++++++++++++++++- .../storage/AsyncStorageObjectHolder.java | 8 +++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java index 65f486f42..00c9d8999 100644 --- a/Essentials/src/com/earth2me/essentials/Jails.java +++ b/Essentials/src/com/earth2me/essentials/Jails.java @@ -26,16 +26,17 @@ import org.bukkit.plugin.PluginManager; public class Jails extends AsyncStorageObjectHolder implements IJails { private static final transient Logger LOGGER = Bukkit.getLogger(); + private static transient boolean enabled = false; public Jails(final IEssentials ess) { super(ess, com.earth2me.essentials.settings.Jails.class); reloadConfig(); - registerListeners(); } private void registerListeners() { + enabled = true; final PluginManager pluginManager = ess.getServer().getPluginManager(); final JailBlockListener blockListener = new JailBlockListener(); final JailPlayerListener playerListener = new JailPlayerListener(); @@ -49,6 +50,24 @@ public class Jails extends AsyncStorageObjectHolder 0) + { + registerListeners(); + } + } + + @Override + public void finishWrite() + { + if (enabled == false) + { + registerListeners(); + } + } + @Override public Location getJail(final String jailName) throws Exception { diff --git a/Essentials/src/com/earth2me/essentials/storage/AsyncStorageObjectHolder.java b/Essentials/src/com/earth2me/essentials/storage/AsyncStorageObjectHolder.java index 31c61a63f..b651dd40b 100644 --- a/Essentials/src/com/earth2me/essentials/storage/AsyncStorageObjectHolder.java +++ b/Essentials/src/com/earth2me/essentials/storage/AsyncStorageObjectHolder.java @@ -79,7 +79,11 @@ public abstract class AsyncStorageObjectHolder implemen { new StorageObjectDataReader(); } - + + public abstract void finishRead(); + + public abstract void finishWrite(); + public abstract File getStorageFile(); @@ -101,6 +105,7 @@ public abstract class AsyncStorageObjectHolder implemen public void onFinish() { unlock(); + finishWrite(); } } @@ -126,6 +131,7 @@ public abstract class AsyncStorageObjectHolder implemen data = object; } rwl.writeLock().unlock(); + finishRead(); } @Override -- cgit v1.2.3 From c45d38ca69cdae44686add9c17bc13f9eaaf25b6 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 28 Mar 2012 15:12:25 +0100 Subject: Implement all abstract methods. --- Essentials/src/com/earth2me/essentials/user/User.java | 10 ++++++++++ .../src/com/earth2me/essentials/spawn/SpawnStorage.java | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index 0e77dd6a9..589e26737 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -36,6 +36,16 @@ public class User extends UserBase implements IUser user.acquireWriteLock(); user.getData().setMoney(10 + money); } + + @Override + public void finishRead() + { + } + + @Override + public void finishWrite() + { + } @Override public long getLastTeleportTimestamp() diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/SpawnStorage.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/SpawnStorage.java index 088ee9052..9075d0b69 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/SpawnStorage.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/SpawnStorage.java @@ -25,6 +25,16 @@ public class SpawnStorage extends AsyncStorageObjectHolder implements IE { return new File(ess.getDataFolder(), "spawn.yml"); } + + @Override + public void finishRead() + { + } + + @Override + public void finishWrite() + { + } public void setSpawn(final Location loc, final String group) { -- cgit v1.2.3 From 10f82a6723b63973d6d2d3ed53aa6473a37d0f3e Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 29 Mar 2012 00:13:56 +0100 Subject: Fix using /setworth --- Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java index 734d9244d..91a1dd657 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java @@ -17,7 +17,7 @@ public class Commandsetworth extends EssentialsCommand @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - if (args.length < 2) + if (args.length < 1) { throw new NotEnoughArgumentsException(); } -- cgit v1.2.3 From d7139cb16cc4d3a85ee9290bb6c8e328edeebcb3 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 29 Mar 2012 02:00:51 +0100 Subject: Update to CB #2126 B #1425 Min CB version changed to 2122 --- .../src/com/earth2me/essentials/Essentials.java | 2 +- .../earth2me/essentials/commands/Commandbreak.java | 5 +++-- lib/bukkit.jar | Bin 4715585 -> 4715521 bytes lib/craftbukkit.jar | Bin 11095968 -> 11093197 bytes 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index b3a17de13..c3dac9b50 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 2105; + public static final int BUKKIT_VERSION = 2122; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java index 406230401..242fa9b53 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java @@ -35,8 +35,9 @@ public class Commandbreak extends EssentialsCommand { throw new Exception(_("noBreakBedrock")); } - final List list = (List)block.getDrops(); - final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase(), list); + //final List list = (List)block.getDrops(); + //final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase(), list); + final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase()); server.getPluginManager().callEvent(event); if (event.isCancelled()) { diff --git a/lib/bukkit.jar b/lib/bukkit.jar index 60ba2177d..912400ba3 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index 44b22101d..815d0a929 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From c09ada201c7652d2881f23e523f21fe9372ceb7c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 29 Mar 2012 03:06:52 +0100 Subject: Interact event cleanup --- .../earth2me/essentials/EssentialsPlayerListener.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index eb21aea39..36adf37e2 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -19,7 +19,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.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryCloseEvent; import org.bukkit.event.inventory.InventoryType; @@ -228,6 +227,7 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerTeleport(final PlayerTeleportEvent event) { + //TODO: Don't fetch user unless one of these features are enabled. final User user = ess.getUser(event.getPlayer()); //There is TeleportCause.COMMMAND but plugins have to actively pass the cause in on their teleports. if ((event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND) && ess.getSettings().registerBackInListener()) @@ -318,19 +318,16 @@ public class EssentialsPlayerListener implements Listener { return; } - if (ess.getSettings().getUpdateBedAtDaytime() && event.getClickedBlock().getType() == Material.BED_BLOCK) + if (event.getClickedBlock().getType() == Material.BED_BLOCK && ess.getSettings().getUpdateBedAtDaytime()) { event.getPlayer().setBedSpawnLocation(event.getClickedBlock().getLocation()); } break; - case LEFT_CLICK_AIR: case LEFT_CLICK_BLOCK: - if (user.hasPowerTools() && user.arePowerToolsEnabled()) + case LEFT_CLICK_AIR: + if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem())) { - if (usePowertools(user)) - { - event.setCancelled(true); - } + event.setCancelled(true); } break; default: @@ -338,9 +335,8 @@ public class EssentialsPlayerListener implements Listener } } - private boolean usePowertools(final User user) + private boolean usePowertools(final User user, final ItemStack is) { - final ItemStack is = user.getItemInHand(); int id; if (is == null || (id = is.getTypeId()) == 0) { -- cgit v1.2.3 From 1ef8ab70d141e60a92b5fa152a5be61637fd84ba Mon Sep 17 00:00:00 2001 From: ElgarL Date: Thu, 29 Mar 2012 13:41:59 +0100 Subject: Stop attempting to push empty permissions when players edit the yml's incorrectly. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../groupmanager/dataholder/WorldDataHolder.java | 24 ++++++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index a9ebb72aa..4599cbcc0 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -154,4 +154,5 @@ v 1.9: - Don't remove an attachment on a player leaving as Bukkit never forgets it. This fixes non mirrored permissions being messed up if a player relogs. - Treat all world names as lower case for file handling (please check in your worlds folder. You should have no folders with upper case letters from now). - Auto rename all case sensitive world folders to lower case (if possible). - - Update GlobalGroups.yml for new/changed Towny permission nodes. \ No newline at end of file + - Update GlobalGroups.yml for new/changed Towny permission nodes. + - Stop attempting to push empty permissions when players edit the yml's incorrectly. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index a01381fcd..c4e27fa1e 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -485,14 +485,22 @@ public class WorldDataHolder { if (thisGroupNode.get("permissions") instanceof List) { for (Object o : ((List) thisGroupNode.get("permissions"))) { try { - thisGrp.addPermission(o.toString()); + /* + * Only add this permission if it's not empty. + */ + if (!thisGroupNode.get("permissions").toString().isEmpty()) + thisGrp.addPermission(o.toString()); } catch (NullPointerException e) { // Ignore this entry as it's null. //throw new IllegalArgumentException("Invalid permission node in group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); } } } else if (thisGroupNode.get("permissions") instanceof String) { - thisGrp.addPermission((String) thisGroupNode.get("permissions")); + /* + * Only add this permission if it's not empty. + */ + if (!thisGroupNode.get("permissions").toString().isEmpty()) + thisGrp.addPermission((String) thisGroupNode.get("permissions")); } else { throw new IllegalArgumentException("Unknown type of permissions node(Should be String or List) for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); } @@ -617,11 +625,19 @@ public class WorldDataHolder { } else { if (thisUserNode.get("permissions") instanceof List) { for (Object o : ((List) thisUserNode.get("permissions"))) { - thisUser.addPermission(o.toString()); + /* + * Only add this permission if it's not empty + */ + if (!o.toString().isEmpty()) + thisUser.addPermission(o.toString()); } } else if (thisUserNode.get("permissions") instanceof String) { try { - thisUser.addPermission(thisUserNode.get("permissions").toString()); + /* + * Only add this permission if it's not empty + */ + if (!thisUserNode.get("permissions").toString().isEmpty()) + thisUser.addPermission(thisUserNode.get("permissions").toString()); } catch (NullPointerException e) { // Ignore this entry as it's null. //throw new IllegalArgumentException("Invalid permission node for user: " + thisUser.getName() + " in file: " + UserFile.getPath()); -- cgit v1.2.3 From 9dbeb1407c4d7fd3be5ab3a44bd80eb0e4936f5c Mon Sep 17 00:00:00 2001 From: ElgarL Date: Thu, 29 Mar 2012 14:02:53 +0100 Subject: Catch errors caused by bad indentation in yml's. --- EssentialsGroupManager/src/Changelog.txt | 3 +- .../org/anjocaido/groupmanager/GlobalGroups.java | 74 ++--- .../groupmanager/dataholder/WorldDataHolder.java | 344 +++++++++++---------- 3 files changed, 217 insertions(+), 204 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 4599cbcc0..c57b050c3 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -155,4 +155,5 @@ v 1.9: - Treat all world names as lower case for file handling (please check in your worlds folder. You should have no folders with upper case letters from now). - Auto rename all case sensitive world folders to lower case (if possible). - Update GlobalGroups.yml for new/changed Towny permission nodes. - - Stop attempting to push empty permissions when players edit the yml's incorrectly. \ No newline at end of file + - Stop attempting to push empty permissions when players edit the yml's incorrectly. + - Catch errors caused by bad indentation in yml's. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java index d9715d4be..0219a1a08 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java @@ -116,42 +116,46 @@ public class GlobalGroups { // Load each groups permissions list. if (allGroups != null) { - for (String groupName : allGroups.keySet()) { - Group newGroup = new Group(groupName.toLowerCase()); - Object element; - - // Permission nodes - element = GGroups.get("groups." + groupName + ".permissions"); - - if (element != null) - if (element instanceof List) { - try { - for (String node : (List) element) { - newGroup.addPermission(node); + try { + for (String groupName : allGroups.keySet()) { + Group newGroup = new Group(groupName.toLowerCase()); + Object element; + + // Permission nodes + element = GGroups.get("groups." + groupName + ".permissions"); + + if (element != null) + if (element instanceof List) { + try { + for (String node : (List) element) { + newGroup.addPermission(node); + } + } catch (ClassCastException e) { + throw new IllegalArgumentException("Invalid permission node for global group: " + groupName); } - } catch (ClassCastException e) { - throw new IllegalArgumentException("Invalid permission node for global group: " + groupName); - } - } else if (element instanceof String) { - newGroup.addPermission((String) element); - } else - throw new IllegalArgumentException("Unknown type of permission node for global group: " + groupName); - - // Info nodes - element = GGroups.get("groups." + groupName + ".info"); - - if (element != null) - if (element instanceof MemorySection) { - Map vars = new HashMap(); - for (String key : ((MemorySection) element).getKeys(false)) { - vars.put(key, ((MemorySection) element).get(key)); - } - newGroup.setVariables(vars); - } else - throw new IllegalArgumentException("Unknown type of info node for global group: " + groupName); - - // Push a new group - addGroup(newGroup); + } else if (element instanceof String) { + newGroup.addPermission((String) element); + } else + throw new IllegalArgumentException("Unknown type of permission node for global group: " + groupName); + + // Info nodes + element = GGroups.get("groups." + groupName + ".info"); + + if (element != null) + if (element instanceof MemorySection) { + Map vars = new HashMap(); + for (String key : ((MemorySection) element).getKeys(false)) { + vars.put(key, ((MemorySection) element).get(key)); + } + newGroup.setVariables(vars); + } else + throw new IllegalArgumentException("Unknown type of info node for global group: " + groupName); + + // Push a new group + addGroup(newGroup); + } + } catch (Exception e) { + throw new IllegalArgumentException("Invalid node type, or bad indentation in GlobalGroups! "); } } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index c4e27fa1e..d7f146438 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -460,93 +460,97 @@ public class WorldDataHolder { Map> inheritance = new HashMap>(); try { Map allGroupsNode = (Map) groupsRootDataNode.get("groups"); - for (String groupKey : allGroupsNode.keySet()) { - Map thisGroupNode = (Map) allGroupsNode.get(groupKey); - Group thisGrp = ph.createGroup(groupKey); - if (thisGrp == null) { - throw new IllegalArgumentException("I think this Group was declared more than once: " + groupKey + " in file: " + groupsFile.getPath()); - } - if (thisGroupNode.get("default") == null) { - thisGroupNode.put("default", false); - } - if ((Boolean.parseBoolean(thisGroupNode.get("default").toString()))) { - if (ph.getDefaultGroup() != null) { - GroupManager.logger.warning("The group " + thisGrp.getName() + " is claiming to be default where" + ph.getDefaultGroup().getName() + " already was."); - GroupManager.logger.warning("Overriding first request for file: " + groupsFile.getPath()); - } - ph.setDefaultGroup(thisGrp); - } - - //PERMISSIONS NODE - try { - if (thisGroupNode.get("permissions") == null) { - thisGroupNode.put("permissions", new ArrayList()); - } else { - if (thisGroupNode.get("permissions") instanceof List) { - for (Object o : ((List) thisGroupNode.get("permissions"))) { - try { - /* - * Only add this permission if it's not empty. - */ - if (!thisGroupNode.get("permissions").toString().isEmpty()) - thisGrp.addPermission(o.toString()); - } catch (NullPointerException e) { - // Ignore this entry as it's null. - //throw new IllegalArgumentException("Invalid permission node in group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } - } - } else if (thisGroupNode.get("permissions") instanceof String) { - /* - * Only add this permission if it's not empty. - */ - if (!thisGroupNode.get("permissions").toString().isEmpty()) - thisGrp.addPermission((String) thisGroupNode.get("permissions")); + try { + for (String groupKey : allGroupsNode.keySet()) { + Map thisGroupNode = (Map) allGroupsNode.get(groupKey); + Group thisGrp = ph.createGroup(groupKey); + if (thisGrp == null) { + throw new IllegalArgumentException("I think this Group was declared more than once: " + groupKey + " in file: " + groupsFile.getPath()); + } + if (thisGroupNode.get("default") == null) { + thisGroupNode.put("default", false); + } + if ((Boolean.parseBoolean(thisGroupNode.get("default").toString()))) { + if (ph.getDefaultGroup() != null) { + GroupManager.logger.warning("The group " + thisGrp.getName() + " is claiming to be default where" + ph.getDefaultGroup().getName() + " already was."); + GroupManager.logger.warning("Overriding first request for file: " + groupsFile.getPath()); + } + ph.setDefaultGroup(thisGrp); + } + + //PERMISSIONS NODE + try { + if (thisGroupNode.get("permissions") == null) { + thisGroupNode.put("permissions", new ArrayList()); } else { - throw new IllegalArgumentException("Unknown type of permissions node(Should be String or List) for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + if (thisGroupNode.get("permissions") instanceof List) { + for (Object o : ((List) thisGroupNode.get("permissions"))) { + try { + /* + * Only add this permission if it's not empty. + */ + if (!thisGroupNode.get("permissions").toString().isEmpty()) + thisGrp.addPermission(o.toString()); + } catch (NullPointerException e) { + // Ignore this entry as it's null. + //throw new IllegalArgumentException("Invalid permission node in group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } + } + } else if (thisGroupNode.get("permissions") instanceof String) { + /* + * Only add this permission if it's not empty. + */ + if (!thisGroupNode.get("permissions").toString().isEmpty()) + thisGrp.addPermission((String) thisGroupNode.get("permissions")); + } else { + throw new IllegalArgumentException("Unknown type of permissions node(Should be String or List) for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } + thisGrp.sortPermissions(); } - thisGrp.sortPermissions(); + } catch (Exception e) { + throw new IllegalArgumentException("Invalid formatting found in permissions section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); } - } catch (Exception e) { - throw new IllegalArgumentException("Invalid formatting found in permissions section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } - - //INFO NODE - try { - if (thisGroupNode.get("info") instanceof Map) { - Map infoNode = (Map) thisGroupNode.get("info"); - if (infoNode != null) { - thisGrp.setVariables(infoNode); - } - } else - throw new IllegalArgumentException("Unknown entry found in Info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } catch (Exception e1) { - throw new IllegalArgumentException("Invalid formatting found in info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } - - //END INFO NODE - - try { - if (thisGroupNode.get("inheritance") == null || thisGroupNode.get("inheritance") instanceof List) { - Object inheritNode = thisGroupNode.get("inheritance"); - if (inheritNode == null) { - thisGroupNode.put("inheritance", new ArrayList()); - } else if (inheritNode instanceof List) { - List groupsInh = (List) inheritNode; - for (String grp : groupsInh) { - if (inheritance.get(groupKey) == null) { - List thisInherits = new ArrayList(); - inheritance.put(groupKey, thisInherits); - } - inheritance.get(groupKey).add(grp); - - } - } - }else - throw new IllegalArgumentException("Unknown entry found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } catch (Exception e2) { - throw new IllegalArgumentException("Invalid formatting found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } - } + + //INFO NODE + try { + if (thisGroupNode.get("info") instanceof Map) { + Map infoNode = (Map) thisGroupNode.get("info"); + if (infoNode != null) { + thisGrp.setVariables(infoNode); + } + } else + throw new IllegalArgumentException("Unknown entry found in Info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } catch (Exception e1) { + throw new IllegalArgumentException("Invalid formatting found in info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } + + //END INFO NODE + + try { + if (thisGroupNode.get("inheritance") == null || thisGroupNode.get("inheritance") instanceof List) { + Object inheritNode = thisGroupNode.get("inheritance"); + if (inheritNode == null) { + thisGroupNode.put("inheritance", new ArrayList()); + } else if (inheritNode instanceof List) { + List groupsInh = (List) inheritNode; + for (String grp : groupsInh) { + if (inheritance.get(groupKey) == null) { + List thisInherits = new ArrayList(); + inheritance.put(groupKey, thisInherits); + } + inheritance.get(groupKey).add(grp); + + } + } + }else + throw new IllegalArgumentException("Unknown entry found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } catch (Exception e2) { + throw new IllegalArgumentException("Invalid formatting found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } + } + } catch (Exception e) { + throw new IllegalArgumentException("Invalid node type, or bad indentation in file: " + groupsFile.getPath()); + } } catch (Exception ex) { ex.printStackTrace(); throw new IllegalArgumentException("Your " + groupsFile.getPath() + " file is invalid. See console for details."); @@ -609,92 +613,96 @@ public class WorldDataHolder { // Load users if the file is NOT empty if (allUsersNode != null) - for (String usersKey : allUsersNode.keySet()) { - Map thisUserNode = null; - try { - thisUserNode = (Map) allUsersNode.get(usersKey); - } catch (Exception ex) { - throw new IllegalArgumentException("Bad format found in file: " + usersFile.getPath()); - } - User thisUser = ph.createUser(usersKey); - if (thisUser == null) { - throw new IllegalArgumentException("I think this user was declared more than once: " + usersKey + " in file: " + usersFile.getPath()); - } - if (thisUserNode.get("permissions") == null) { - thisUserNode.put("permissions", new ArrayList()); - } else { - if (thisUserNode.get("permissions") instanceof List) { - for (Object o : ((List) thisUserNode.get("permissions"))) { - /* - * Only add this permission if it's not empty - */ - if (!o.toString().isEmpty()) - thisUser.addPermission(o.toString()); + try { + for (String usersKey : allUsersNode.keySet()) { + Map thisUserNode = null; + try { + thisUserNode = (Map) allUsersNode.get(usersKey); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in file: " + usersFile.getPath()); + } + User thisUser = ph.createUser(usersKey); + if (thisUser == null) { + throw new IllegalArgumentException("I think this user was declared more than once: " + usersKey + " in file: " + usersFile.getPath()); + } + if (thisUserNode.get("permissions") == null) { + thisUserNode.put("permissions", new ArrayList()); + } else { + if (thisUserNode.get("permissions") instanceof List) { + for (Object o : ((List) thisUserNode.get("permissions"))) { + /* + * Only add this permission if it's not empty + */ + if (!o.toString().isEmpty()) + thisUser.addPermission(o.toString()); + } + } else if (thisUserNode.get("permissions") instanceof String) { + try { + /* + * Only add this permission if it's not empty + */ + if (!thisUserNode.get("permissions").toString().isEmpty()) + thisUser.addPermission(thisUserNode.get("permissions").toString()); + } catch (NullPointerException e) { + // Ignore this entry as it's null. + //throw new IllegalArgumentException("Invalid permission node for user: " + thisUser.getName() + " in file: " + UserFile.getPath()); + } + } + thisUser.sortPermissions(); + } + + //SUBGROUPS LOADING + if (thisUserNode.get("subgroups") == null) { + thisUserNode.put("subgroups", new ArrayList()); + } + if (thisUserNode.get("subgroups") instanceof List) { + for (Object o : ((List) thisUserNode.get("subgroups"))) { + Group subGrp = ph.getGroup(o.toString()); + if (subGrp != null) { + thisUser.addSubGroup(subGrp); + } else { + GroupManager.logger.warning("Subgroup " + o.toString() + " not found for user " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); + } + } + } else if (thisUserNode.get("subgroups") instanceof String) { + Group subGrp = ph.getGroup(thisUserNode.get("subgroups").toString()); + if (subGrp != null) { + thisUser.addSubGroup(subGrp); + } else { + GroupManager.logger.warning("Subgroup " + thisUserNode.get("subgroups").toString() + " not found for user " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); } - } else if (thisUserNode.get("permissions") instanceof String) { - try { - /* - * Only add this permission if it's not empty - */ - if (!thisUserNode.get("permissions").toString().isEmpty()) - thisUser.addPermission(thisUserNode.get("permissions").toString()); - } catch (NullPointerException e) { - // Ignore this entry as it's null. - //throw new IllegalArgumentException("Invalid permission node for user: " + thisUser.getName() + " in file: " + UserFile.getPath()); - } } - thisUser.sortPermissions(); - } - - //SUBGROUPS LOADING - if (thisUserNode.get("subgroups") == null) { - thisUserNode.put("subgroups", new ArrayList()); - } - if (thisUserNode.get("subgroups") instanceof List) { - for (Object o : ((List) thisUserNode.get("subgroups"))) { - Group subGrp = ph.getGroup(o.toString()); - if (subGrp != null) { - thisUser.addSubGroup(subGrp); - } else { - GroupManager.logger.warning("Subgroup " + o.toString() + " not found for user " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); - } - } - } else if (thisUserNode.get("subgroups") instanceof String) { - Group subGrp = ph.getGroup(thisUserNode.get("subgroups").toString()); - if (subGrp != null) { - thisUser.addSubGroup(subGrp); - } else { - GroupManager.logger.warning("Subgroup " + thisUserNode.get("subgroups").toString() + " not found for user " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); - } - } - - - //USER INFO NODE - - //INFO NODE - if (thisUserNode.get("info") instanceof Map) { - Map infoNode = (Map) thisUserNode.get("info"); - if (infoNode != null) { - thisUser.setVariables(infoNode); - } - } else if (thisUserNode.get("info") != null) - throw new IllegalArgumentException("Unknown entry found in Info section for user: " + thisUser.getName() + " in file: " + usersFile.getPath()); - - //END INFO NODE - - - if (thisUserNode.get("group") != null) { - Group hisGroup = ph.getGroup(thisUserNode.get("group").toString()); - if (hisGroup == null) { - GroupManager.logger.warning("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName() + ": Set to '" + ph.getDefaultGroup().getName() + "' for file: " + usersFile.getPath()); - hisGroup = ph.getDefaultGroup(); - //throw new IllegalArgumentException("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName()); - } - thisUser.setGroup(hisGroup); - } else { - thisUser.setGroup(ph.getDefaultGroup()); - } - } + + + //USER INFO NODE + + //INFO NODE + if (thisUserNode.get("info") instanceof Map) { + Map infoNode = (Map) thisUserNode.get("info"); + if (infoNode != null) { + thisUser.setVariables(infoNode); + } + } else if (thisUserNode.get("info") != null) + throw new IllegalArgumentException("Unknown entry found in Info section for user: " + thisUser.getName() + " in file: " + usersFile.getPath()); + + //END INFO NODE + + + if (thisUserNode.get("group") != null) { + Group hisGroup = ph.getGroup(thisUserNode.get("group").toString()); + if (hisGroup == null) { + GroupManager.logger.warning("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName() + ": Set to '" + ph.getDefaultGroup().getName() + "' for file: " + usersFile.getPath()); + hisGroup = ph.getDefaultGroup(); + //throw new IllegalArgumentException("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName()); + } + thisUser.setGroup(hisGroup); + } else { + thisUser.setGroup(ph.getDefaultGroup()); + } + } + } catch (Exception e) { + throw new IllegalArgumentException("Invalid node type, or bad indentation in file: " + usersFile.getPath()); + } ph.removeUsersChangedFlag(); // Update the LastModified time. -- cgit v1.2.3 From c2c613b6527e0e0f3bae37c62e9d10ce393c4a18 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 29 Mar 2012 16:41:13 +0100 Subject: Missing air materials. --- Essentials/src/com/earth2me/essentials/Util.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index 510ab8a9a..0070a5a6a 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -242,6 +242,7 @@ public class Util AIR_MATERIALS.add(Material.REDSTONE_TORCH_OFF.getId()); AIR_MATERIALS.add(Material.REDSTONE_TORCH_ON.getId()); AIR_MATERIALS.add(Material.STONE_BUTTON.getId()); + AIR_MATERIALS.add(Material.SNOW.getId()); AIR_MATERIALS.add(Material.SUGAR_CANE_BLOCK.getId()); AIR_MATERIALS.add(Material.DIODE_BLOCK_OFF.getId()); AIR_MATERIALS.add(Material.DIODE_BLOCK_ON.getId()); @@ -249,8 +250,10 @@ public class Util AIR_MATERIALS.add(Material.PUMPKIN_STEM.getId()); AIR_MATERIALS.add(Material.MELON_STEM.getId()); AIR_MATERIALS.add(Material.VINE.getId()); - AIR_MATERIALS.add(Material.NETHER_WARTS.getId()); + AIR_MATERIALS.add(Material.FENCE_GATE.getId()); AIR_MATERIALS.add(Material.WATER_LILY.getId()); + AIR_MATERIALS.add(Material.NETHER_FENCE.getId()); + AIR_MATERIALS.add(Material.NETHER_WARTS.getId()); for (Integer integer : AIR_MATERIALS) { -- cgit v1.2.3 From 7a249abc6712f3a0b8704656fbb05047a183f78b Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 29 Mar 2012 18:14:24 +0100 Subject: Update default permissions. --- EssentialsGroupManager/src/globalgroups.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/EssentialsGroupManager/src/globalgroups.yml b/EssentialsGroupManager/src/globalgroups.yml index 885c6675d..fa78aa36a 100644 --- a/EssentialsGroupManager/src/globalgroups.yml +++ b/EssentialsGroupManager/src/globalgroups.yml @@ -19,24 +19,32 @@ groups: - essentials.balance.others - essentials.balancetop - essentials.chat.color + - essentials.chat.format - essentials.chat.shout - essentials.chat.question - essentials.compass - essentials.depth + - essentials.getpos - essentials.home - essentials.ignore + - essentials.itemdb - essentials.kit - essentials.kit.tools - essentials.mail - essentials.mail.send - essentials.me - essentials.msg + - essentials.msg.color + - essentials.msg.format - essentials.nick - essentials.pay - essentials.ping - essentials.powertool + - essentials.powertooltoggle - essentials.protect + - essentials.seen - essentials.sethome + - essentials.sethome.multiple - essentials.signs.use.* - essentials.signs.create.disposal - essentials.signs.create.mail @@ -58,14 +66,19 @@ groups: g:essentials_moderator: permissions: + - -essentials.spawner.enderdragon + - essentials.afk.kickexempt - essentials.ban - essentials.ban.notify - essentials.banip - essentials.broadcast + - essentials.chat.url + - essentials.chat.magic - essentials.clearinventory - essentials.delwarp - essentials.eco.loan - essentials.ext + - essentials.fly - essentials.getpos - essentials.helpop.recieve - essentials.home.others @@ -75,13 +88,18 @@ groups: - essentials.kick - essentials.kick.notify - essentials.kill + - essentials.kit.* + - essentials.msg.magic - essentials.mute + - essentials.nick.color - essentials.nick.others - essentials.realname + - essentials.seen.banreason - essentials.setwarp - essentials.signs.create.* - essentials.signs.break.* - essentials.spawner + - essentials.spawner.* - essentials.thunder - essentials.time - essentials.time.set @@ -93,6 +111,7 @@ groups: - essentials.togglejail - essentials.top - essentials.tp + - essentials.tp.others - essentials.tphere - essentials.tppos - essentials.tptoggle @@ -101,6 +120,7 @@ groups: - essentials.weather - essentials.whois - essentials.world + - essentials.world.* - groupmanager.listgroups - groupmanager.mandemote - groupmanager.manpromote -- cgit v1.2.3 From 6235983ddd41f393f1e1e9193aa6ae349f1d6837 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 29 Mar 2012 18:37:22 +0100 Subject: New translation messages --- Essentials/src/messages.properties | 2 +- Essentials/src/messages_cs.properties | 423 ++++++++++++++++++++++++++++++++++ Essentials/src/messages_it.properties | 423 ++++++++++++++++++++++++++++++++++ Essentials/src/messages_pt.properties | 423 ++++++++++++++++++++++++++++++++++ 4 files changed, 1270 insertions(+), 1 deletion(-) create mode 100644 Essentials/src/messages_cs.properties create mode 100644 Essentials/src/messages_it.properties create mode 100644 Essentials/src/messages_pt.properties diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 7707ac09a..df0706ea8 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -137,7 +137,7 @@ 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.& +invalidMob=Invalid mob type. invalidServer=Invalid server! invalidSignLine=Line {0} on sign is invalid. invalidWorld=\u00a7cInvalid world. diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties new file mode 100644 index 000000000..3f153eb48 --- /dev/null +++ b/Essentials/src/messages_cs.properties @@ -0,0 +1,423 @@ +#version: 2.9.1 +# Single quotes have to be doubled: '' +# Translations start here +# by: tomasara413 - Tento preklad neni 100% presny to se opravi v dalsich verzich prekladu +action=* {0} {1} +addedToAccount=\u00a7a{0} byl p\u00f8id\u00e1n na tvuj ucet. +addedToOthersAccount=\u00a7a{0} bylo pridano na ucet hrace {1}\u00a7a. Novy obnos: {2} +alertBroke=Zlomeno: +alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} na: {3} +alertPlaced=Polozeno: +alertUsed=Pouzito: +autoAfkKickReason=BYls kopnut pro {0} minut AFK. +backAfterDeath=\u00a77Pouzij prokaz /back pro navraceni do mista umrti. +backUsageMsg=\u00a77Navraceni do puvodni lokace. +backupDisabled=An external backup script has not been configured. +backupFinished=Zaloha ukoncena +backupStarted=Probiha zaloha +balance=\u00a77Obnos: {0} +balanceTop=\u00a77Nejvyssi obnosy ({0}) +banExempt=\u00a7cNemuzes zabanovat tohoto hrace. +banIpAddress=\u00a77IP zabanovana +bannedIpsFileError=Chyba pri cteni banned-ips.txt +bannedIpsFileNotFound=Soubor banned-ips.txt nenalezen +bannedPlayersFileError=Chyba pri cteni banned-players.txt +bannedPlayersFileNotFound=Soubor banned-players.txt nenalezen +bigTreeFailure=\u00a7cGenerovani velkeho stromu selhalo. Zopakuj na hline ci trave. +bigTreeSuccess= \u00a77Velky strom vygenerovan. +blockList=Essentials predavaji tyto prikazy do jin\u00e9ho pluginu: +broadcast=[\u00a7cPrenos\u00a7f]\u00a7a {0} +buildAlert=\u00a7cNemate opravneni stavet +bukkitFormatChanged=Verze bukkitu je zmnenena. Verze neni kontrolovana. +burnMsg=\u00a77Nastavils {0} do ohne po {1} sekund. +canTalkAgain=\u00a77Ted nemuzes mluvit +cantFindGeoIpDB=Nelze najit GeoIP databazi! +cantReadGeoIpDB=Nelze precist GeoIP databazi! +cantSpawnItem=\u00a7cNemas povoleno davat si {0} +chatTypeLocal=[L] +chatTypeSpy=[Spy] +commandFailed=Prikaz {0} selhal: +commandHelpFailedForPlugin=Chyba pri ziskavani napovedy: {0} +commandNotLoaded=\u00a7cPrikaz {0} je nezpravne nacten. +compassBearing=\u00a77Lozisko: {0} ({1} stupnu). +configFileMoveError=Premistovani config.yml do zalohove lokace selhalo. +configFileRenameError=Selhalo prejmenovavani souboru config.yml +connectedPlayers=Pripojeni hraci: +connectionFailed=Nepodarilo se otevrit spojeni. +cooldownWithMessage=\u00a7cPrestavka: {0} +corruptNodeInConfig=\u00a74Poznamka: vas konfiguracni soubor je poskozeny na {0} radku. +couldNotFindTemplate=Nelze najit sablonu {0} +creatingConfigFromTemplate=Vytvari se nastaveni podle sablony: {0} +creatingEmptyConfig=Vytvari se prazdne nastaveni: {0} +creative=kreativ +currency={0}{1} +day=den +days=dny +defaultBanReason=Ban promluvil! +deleteFileError=Nelze smazat soubor: {0} +deleteHome=\u00a77Domov {0} byl odstranen. +deleteJail=\u00a77Veznice {0} byla odstranena. +deleteWarp=\u00a77Warp {0} byl odstranen. +deniedAccessCommand={0} byl odepren pristup k prikazu. +dependancyDownloaded=[Essentials] Zavyslost {0} uspesne stazena. +dependancyException=[Essentials] Chyba pri stahovani zavyslosti +dependancyNotFound=[Essentials] Doporucena zavyslost nenalezena, nyni se stahuje. +depth=\u00a77Jsi na urovni more. +depthAboveSea=\u00a77Jsi {0} bloku nad urovni more. +depthBelowSea=\u00a77Jsi {0} bloku pod urovni more. +destinationNotSet=Destinace neni nastavena +disableUnlimited=\u00a77Zakazano neomoezene staveni {0} pro {1}. +disabled=Zakazano +disabledToSpawnMob=Spawnovani tohoto zivocicha neni povolane v souboru config.yml. +dontMoveMessage=\u00a77Teleportuje vas za {0}. Nehybejte se. +downloadingGeoIp=Stahovani GeoIP databaze ... to muze chvili trvat (zeme: 0.6 MB, mesto: 20MB) +duplicatedUserdata=Duplicicitni uzivatelska data: {0} a {1} +enableUnlimited=\u00a77Davani neomezeneho mnozstvi {0} hraci {1}. +enabled=Povoleno +enchantmentApplied = \u00a77Kouzlo {0} bylo aplikovano na predmnet ve vasi ruce. +enchantmentNotFound = \u00a7cKouzlo nenalezeno +enchantmentPerm = \u00a7cNemate opravneni pro {0} +enchantmentRemoved = \u00a77Kouzlo {0} bylo odstraneno z predmnetu ve vasi ruce. +enchantments = \u00a77Kouzla: {0} +errorCallingCommand=Chyba pri volani prikazu /{0} +errorWithMessage=\u00a7cChyba: {0} +essentialsHelp1=Soubor je poskozeny a Essentials ho nemuzou otevrit. Essentials jsou nyni neaktivni. Jesli soubor neumite opravit sami, bezte na http://tiny.cc/EssentialsChat +essentialsHelp2=Soubor je poskozeny a Essentials ho nemuzou otevrit. Essentials jsou nyni neaktivni. Jesli soubor neumite opravit sami, zadejte prikaz /essentialshelp ve hre nebo bezte na http://tiny.cc/EssentialsChat +essentialsReload=\u00a77Essentials Reloaded {0} +extinguish=\u00a77Uhaste se sam. +extinguishOthers=\u00a77Jsi uhasen {0}. +failedToCloseConfig=Selhalo zavirani nastaveni {0} +failedToCreateConfig=Selhalo vytvareni nastaveni {0} +failedToWriteConfig=Selhalo psani nastaveni {0} +false=falesny +feed=\u00a77Tvuj apetit byl zasycen. +feedOther=\u00a77Nasytils hrace {0}. +fileRenameError=Prejmenovavani souboru {0} selhalo +flyMode=\u00a77Set fly mode {0} for {1}. +foreverAlone=\u00a7cNeni nikdo kdo by vam mohl odpovedet. +freedMemory=Uvolneno {0} MB. +gameMode=\u00a77Nastavil herni mod {0} hraci {1}. +gcchunks= chunky, +gcentities= entity +gcfree=Volna pamet: {0} MB +gcmax=Maximalni pamet: {0} MB +gctotal=Pouzita pamet: {0} MB +geoIpUrlEmpty=GeoIP stahovaci URL je prazdna. +geoIpUrlInvalid=GeoIP stahovaci URL je chybna. +geoipJoinFormat=Hrac {0} pochazi z {1} +godDisabledFor=Zakazan pro {0} +godEnabledFor=Povolan pro {0} +godMode=\u00a77Bozsky mod {0}. +haveBeenReleased=\u00a77Byls propusten +heal=\u00a77Byls uzdraven. +healOther=\u00a77Uzdraveno {0}. +helpConsole=Pro zobrazeni napovedy pro konzoli, typ ?. +helpFrom=\u00a77Commands from {0}: +helpLine=\u00a76/{0}\u00a7f: {1} +helpMatching=\u00a77Commands matching "{0}": +helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} +helpPages=Strana \u00a7c{0}\u00a7f z \u00a7c{1}\u00a7f: +helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1} +holeInFloor=Dira v podlaze +homeSet=\u00a77Domov nastaven. +homeSetToBed=\u00a77Tvuj domov je nyni nastaven v tve posteli. +homes=Domy: {0} +hour=hodina +hours=hodiny +ignorePlayer=Nyni ignorujes hrace {0}. +illegalDate=Nelegalni format dat. +infoChapter=Vyberte kapitolu: +infoChapterPages=Kapitol {0}, strana \u00a7c{1}\u00a7f z \u00a7c{2}\u00a7f: +infoFileDoesNotExist=Soubor info.txt neexistuje. Vytvarim jeden pro tebe. +infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Strana \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- +infoUnknownChapter=Neznama kapitola. +invBigger=Ostatni uzivatelske zasoby jsou vyssi nez vase. +invRestored=Tvuj inventar byl obnoven. +invSee=Ty prohlizis inventar hrace {0}. +invSeeHelp=Pouzij prikaz /invsee pro obnoveni tveho inventare. +invalidCharge=\u00a7cNeplatny poplatek. +invalidHome=Dum {0} neexistuje +invalidMob=Neplatny typ zivocicha. +invalidServer=Neplatny server! +invalidSignLine=Linka {0} na cedulce je neplatna. +invalidWorld=\u00a7cNeplatny svet. +inventoryCleared=\u00a77Inventar vymazan. +inventoryClearedOthers=\u00a77Inventar hrace \u00a7c{0}\u00a77 vymazan. +is=je +itemCannotBeSold=Tuto vec nelze prodat hraci. +itemMustBeStacked=Vec musi byt prodavana v stacich. Mnozstvi 2s, dvou stacku, atd. +itemNotEnough1=\u00a7cNem\u00e1te dostatek t\u00e9to v\u00ecdi k prodeji. +itemNotEnough2=\u00a77Pokud chcete prodat vsechny sv\u00e9 polozky tohoto tipu typ, /sell jmeno veci +itemNotEnough3=\u00a77/sell jmeno veci -1 proda jednu vec tohoto typu. +itemSellAir=Opravdu se snazis prodat vzduch? Vem vec do ruky. +itemSold=\u00a77Prodano za \u00a7c{0} \u00a77({1} {2} v {3} kazdem) +itemSoldConsole={0} prodan {1} pro \u00a77{2} \u00a77({3} veci na {4} kazdem) +itemSpawn=\u00a77Davani {0} {1} +itemsCsvNotLoaded=Nelze nacist items.csv. +jailAlreadyIncarcerated=\u00a7cOsoba je jiz uveznena: {0} +jailMessage=\u00a7cUdelal jste zlocin, tak si dejte na cas. +jailNotExist=Tato veznice neexistuje. +jailReleased=\u00a77Hrac \u00a7e{0}\u00a77 propusten. +jailReleasedPlayerNotify=\u00a77Byls propusten! +jailSentenceExtended=Cas ve vezeni prodlouzen na: {0) +jailSet=\u00a77Vezeni {0} nastaveno +jumpError=Toto poskodi mozek vaseho pocitace. +kickDefault=Kopnut ze serveru! +kickExempt=\u00a7cNemuzes kopnout tuto osobu. +kill=\u00a77Zabito {0}. +kitError2=\u00a7cTato sada neexistuje nebo neni uplne definovana. +kitError=\u00a7cToto neni platna sada. +kitErrorHelp=\u00a7cNechybi polozka v konfiguraci? +kitGive=\u00a77Davani sady {0}. +kitInvFull=\u00a7cTvuj inventar je plny, umistuji sadu na podlahu. +kitTimed=\u00a7cNemuzete pouzit sadu pro jinou {0}. +kits=\u00a77Sady: {0} +lightningSmited=\u00a77Byls sejmut +lightningUse=\u00a77Sejimani {0} +listAfkTag = \u00a77[AFK]\u00a7f +listAmount = \u00a79Jsou tam \u00a7c{0}\u00a79 vsichni ze maximalniho poctu \u00a7c{1}\u00a79 hracu online. +listAmountHidden = \u00a79Jsou tam, \u00a7c{0}\u00a77/{1}\u00a79 vsichni z maximalniho poctu \u00a7c{2}\u00a79 hracu online. +listGroupTag={0}\u00a7f: +listHiddenTag = \u00a77[HIDDEN]\u00a7f +loadWarpError=Selhalo nacitani warpu {0} +localFormat=Lokalni: <{0}> {1} +mailClear=\u00a7cPro oznaceni prectenyh zprav, typ /mail clear +mailCleared=\u00a77Schranka vyprazdnena! +mailSent=\u00a77Zprava odeslana! +markMailAsRead=\u00a7cPro oznaceni prectenych zprav, typ /mail clear +markedAsAway=\u00a77Nyni mate ozna\u00e8eno. +markedAsNotAway=\u00a77Nyni nemate ozna\u00e8eno. +maxHomes=Nelze nastavit vice nez {0} domovu. +mayNotJail=\u00a7cNemuzes zajmout tuto osobu +me=ja +minute=minuta +minutes=minuty +missingItems=Nemate {0}x {1}. +missingPrefixSuffix=Chybi predpone nebo pripona pro {0} +mobSpawnError=Chyba pri mneneni mob spawneru. +mobSpawnLimit=Mnozstvi zivocichu bylo omezeno na limit serveru +mobSpawnTarget=Cilovy blok musi byt mob spawner. +mobsAvailable=\u00a77Zivocichove: {0} +moneyRecievedFrom=\u00a7a{0} nebyla prijata {1} +moneySentTo=\u00a7a{0} byla odeslana {1} +moneyTaken={0} prevzato z vaseho bankovniho ucty. +month=mesic +months=mesice +moreThanZero=Mnozstvi musi byt vetsi nez 0. +msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cZtlumils tohoto hrace. +mutedPlayer=Hrac {0} ztlumen. +mutedPlayerFor=Hrac {0} ztlumen po dobu {1}. +mutedUserSpeaks={0} se pokusil(a) promluvit, ale je ztiseny(a). +nearbyPlayers=Hraci v blizkosti: {0} +negativeBalanceError=Uzivatel nesmi mit zaporny obnos. +nickChanged=Prezdivka zmnenena. +nickDisplayName=\u00a77Pro povoleni zmnenu nicku bezte do Essentials config. +nickInUse=\u00a7cToto jmeno je pouzivano. +nickNamesAlpha=\u00a7cPrezdivky musi byt alfanumericke. +nickNoMore=\u00a77UZ nemate prezdivku. +nickOthersPermission=\u00a7cNemate opravneni pro zmnenu nicku ostatnich hracu +nickSet=\u00a77Tvuj nickname je nyni \u00a7c{0} +noAccessCommand=\u00a7cNemate pristup k tomuto prikazu. +noAccessPermission=\u00a7cNemate opravneni pro toto {0}. +noBreakBedrock=Nemas povoleno znicit bedrock. +noDestroyPermission=\u00a7cNemas opravneni k zniceni {0}. +noGodWorldWarning=\u00a7cVarovani! Bozsky mod neni povolen v tomto svete. +noHelpFound=\u00a7cZadne odpovidajici prikazy. +noHomeSet=Nemas nastaveny domov. +noHomeSetPlayer=Tento hrac nema nastaveny domov. +noKitPermission=\u00a7cBudete potrebovat \u00a7c{0}\u00a7c opravneni pro pouzivani teto sady. +noKits=\u00a77Neni zadna dostupna sada +noMail=Nemate zadne nove zpravy +noMotd=\u00a7cNeexistuje zadna zprava ze dne. +noNewMail=\u00a77Nemas zadne nove zpravy. +noPendingRequest=Nemate cekajici zadost. +noPerm=\u00a7cNemate \u00a7f{0}\u00a7c opravneni. +noPermToSpawnMob=\u00a7cNemate opravneni pro spawnuti tohoto zivocicha. +noPlacePermission=\u00a7cNemate opravneni k polozeni tohoto bloku u teto cedulky. +noPowerTools=Nemate zadne pohonene nastroje. +noRules=\u00a7cNejsou zadna specificka pravidla. +noWarpsDefined=Zadny warp nedefinovan +none=zadny +notAllowedToQuestion=\u00a7cNejste opravneni pouzivat otazku. +notAllowedToShout=\u00a7cNemate opravneni kricet. +notEnoughExperience=Nemate dostatek skusenosti. +notEnoughMoney=Nemate dostatek financnich prostredku. +notRecommendedBukkit= * ! * Verze bukkitu neni doporucena pro Essentials. +notSupportedYet=Zatim nepodporovany. +nothingInHand = \u00a7cNemate nic v ruce. +now=nyni +nuke=Muze na ne prset smrt? +numberRequired=Cislo tam jde, hloupe. +onlyDayNight=/time podporuje pouze day/night. +onlyPlayers=Pouzivat mohou pouze hraci ve hre {0}. +onlySunStorm=/weather podporuje pouze sun/storm. +orderBalances=Razeni obnosu {0} uzivatelu, prosim cekejte ... +pTimeCurrent=\u00a7e{0}\u00a7f cas je {1}. +pTimeCurrentFixed=\u00a7e{0}\u00a7f cas je opraven na {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f cas je normalni a server odpovida. +pTimeOthersPermission=\u00a7cNejste dostatecne opravnen nastavit cas ostatnim hracum. +pTimePlayers=Tito hraci maji svuj vlastni cas: +pTimeReset=Cas hracu byl obnoven pro: \u00a7e{0} +pTimeSet=Cas hracu je nastaven na \u00a73{0}\u00a7f pro: \u00a7e{1} +pTimeSetFixed=Cas hracu je opraven na \u00a73{0}\u00a7f pro: \u00a7e{1} +parseError=Chyba pri analize {0} na radku {1} +pendingTeleportCancelled=\u00a7cZadost o teleport byla zrusena. +permissionsError=Ztracene Permissions/GroupManager; chatove predpony/pripony jsou nyni mimo provoz. +playerBanned=\u00a7cHrac {0} zabanovan {1} za {2} +playerInJail=\u00a7cHrac jiz je uveznen {0}. +playerJailed=\u00a77Hrac {0} uveznen. +playerJailedFor= \u00a77Hrac {0} uveznen za {1}. +playerKicked=\u00a7cHrac {0} kopnut {1} za {2} +playerMuted=\u00a77Byls ztlumen +playerMutedFor=\u00a77Byls ztlumen za {0} +playerNeverOnServer=\u00a7cHrac {0} nikdy nebyl na tomto serveru. +playerNotFound=\u00a7cHrac nenalezen. +playerUnmuted=\u00a77Byls zesilen. +pong=Pong! +possibleWorlds=\u00a77Mozne svety jsou 0 az {0}. +powerToolAir=Prikaz nemuze byt pouzit do ovzdusi. +powerToolAlreadySet=Prikaz \u00a7c{0}\u00a7f je jiz prirazen k {1}. +powerToolAttach=\u00a7c{0}\u00a7f prikaz prirazen k {1}. +powerToolClearAll=Vsechny prikazy pro elektricke naradi byli vymazany. +powerToolList={1} ma nasledujici prikazy: \u00a7c{0}\u00a7f. +powerToolListEmpty={0} nema prizazene prikazy. +powerToolNoSuchCommandAssigned=Prikaz \u00a7c{0}\u00a7f neni prirazen {1}. +powerToolRemove=Prikaz \u00a7c{0}\u00a7f odebran od {1}. +powerToolRemoveAll=Vsechny prikazy odebrany od {0}. +powerToolsDisabled=Vsechny z tvych elektrickych nastroju jsou vyrazeny. +powerToolsEnabled=Vsechny z tvych elektrickych nastroju jsou povoleny. +protectionOwner=\u00a76[EssentialsProtect] Majitel ochrany: {0} +questionFormat=\u00a77[Otazka]\u00a7f {0} +readNextPage=Typ /{0} {1} pro precteni dalsi stranky +reloadAllPlugins=\u00a77Pluginy obnoveny. +removed=\u00a77Odstraneno {0} entit. +repair=Uspesne si opravil tvuj: \u00a7e{0}. +repairAlreadyFixed=\u00a77Tato vec je jiz opravena. +repairEnchanted=\u00a77Nemas povoleno opravovat okouzlene veci. +repairInvalidType=\u00a7cTuto vec nelze opravit. +repairNone=Tato vec nepotrebuje opravit. +requestAccepted=\u00a77Zadost o teleport prijmuta. +requestAcceptedFrom=\u00a77{0} prijmul tvou zadost o teleport. +requestDenied=\u00a77Zadost o teleport zamitnuta. +requestDeniedFrom=\u00a77{0} zamitl tvou zadoust o teleport. +requestSent=\u00a77Zadost zaslana hraci {0}\u00a77. +requestTimedOut=\u00a7cZadost o teleport vyprsela +requiredBukkit= * ! * Potrebujete alespon build {0} CraftBukkitu, stahnete jej z http://dl.bukkit.org/downloads/craftbukkit/ +returnPlayerToJailError=Chyba pri navraceni hrace {0} do veznice: {1} +second=sekunda +seconds=sekundy +seenOffline=Hrac {0} je offline, protoze {1} +seenOnline=Hrac {0} je online, protoze {1} +serverFull=Server je plny. +serverTotal=Serverova kapacita: {0} +setSpawner=Zmnenils tento mobspawner na {0} spawner +sheepMalformedColor=Poskozena barva. +shoutFormat=\u00a77[Krik]\u00a7f {0} +signFormatFail=\u00a74[{0}] +signFormatSuccess=\u00a71[{0}] +signFormatTemplate=[{0}] +signProtectInvalidLocation=\u00a74Nemas povoleno vytvaret cedule zde. +similarWarpExist=Warp s podobnym nazvem jiz existuje. +slimeMalformedSize=Poskozena velikost. +soloMob=Tento zivocich je rad sam. +spawnSet=\u00a77Spawnovaci lokace pro skupinu {0}. +spawned=spawnut +sudoExempt=Nemuzete sudo tohoto uzivatele +sudoRun=Nuti {0} pro beh: /{1} {2} +suicideMessage=\u00a77Zbohem kruty svete... +suicideSuccess= \u00a77{0} si vzal svuj vlastni zivot +survival=survival +takenFromAccount=\u00a7c{0} byli prevzaty z vaseho uctu. +takenFromOthersAccount=\u00a7c{0} prevzato z {1}\u00a7c uctu. Novy obnos: {2} +teleportAAll=\u00a77Zadost o teleport byla odeslana vsem hracum... +teleportAll=\u00a77Teleportuji vsechny hrace... +teleportAtoB=\u00a77{0}\u00a77 te teleportoval k hraci {1}\u00a77. +teleportDisabled={0} teleportovani je zakazano. +teleportHereRequest=\u00a7c{0}\u00a7c pozadal(a) aby ses k nim teleportoval(a). +teleportNewPlayerError=Selhal teleport k novemu hraci +teleportRequest=\u00a7c{0}\u00a7c Pozadal(a) aby byl(a) teleportovan(a) k vam. +teleportRequestTimeoutInfo=\u00a77Tato zadost vyprsi po {0} sekundach. +teleportTop=\u00a77Teleportuji te nahoru. +teleportationCommencing=\u00a77Zahajuje se telepotovani... +teleportationDisabled=\u00a77Teleportace zakazany. +teleportationEnabled=\u00a77Teleportace povoleny. +teleporting=\u00a77Teleportovani... +teleportingPortal=\u00a77Teleportace prez portal. +tempBanned=Docasne zabanovan na serveru pro {0} +tempbanExempt=\u00a77Nemuzete docasne zabanovat tohoto hrace. +thunder=Ty si nastavil {0} pocasi ve svete +thunderDuration=Ty si nastavil {0} pocasi na tvem svete po dobu {1} sekund. +timeBeforeHeal=Cas do dalsiho vyleceni: {0} +timeBeforeTeleport=Cas do dalsi teleportace: {0} +timeFormat=\u00a73{0}\u00a7f nebo \u00a73{1}\u00a7f nebo \u00a73{2}\u00a7f +timePattern=(?:([0-9]+)\\s*y[a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)? +timeSet=Cas nastaven ve vsech svetech. +timeSetPermission=\u00a7cNejte autorizovan k nastavovani casu. +timeWorldCurrent=Aktualni cas v {0} je \u00a73{1} +timeWorldSet=cas nastaven na {0} ve: \u00a7c{1} +tradeCompleted=\u00a77Obchod dokoncen. +tradeSignEmpty=Obchodni znaceni pro vas nema nic k dispozici. +tradeSignEmptyOwner=Doslo zbozi, odstrante obchodni znaceni. +treeFailure=\u00a7cGenerace stromu selhala. Zopakujte na hline nebo trave. +treeSpawned=\u00a77Strom spawnut. +true=pravdivy +typeTpaccept=\u00a77Pro teleport, typ \u00a7c/tpaccept\u00a77. +typeTpdeny=\u00a77Pro zamitnuti zadosti, typ \u00a7c/tpdeny\u00a77. +typeWorldName=\u00a77Take muzete zadat nazev konkretniho sveta. +unableToSpawnMob=Udblokujte spawnovani tohoto zivocicha. +unbannedIP=IP odbanovana. +unbannedPlayer=Hrac odbanovan. +unignorePlayer=Jiz nejste ignorovan hracem {0}. +unknownItemId=Neplatna identifikace veci: {0} +unknownItemInList=Neplatna vec {0} v {1} listu. +unknownItemName=Neplatne jmeno veci: {0} +unlimitedItemPermission=\u00a7cZadne opravneni k neomezenym vecem {0}. +unlimitedItems=Neomezene veci: +unmutedPlayer=Hrac {0} zesilen. +upgradingFilesError=Chyba pri aktualizaci souboru +userDoesNotExist=Uzivatel {0} neexistuje. +userIsAway={0} je pric od klavesnice +userIsNotAway={0} je zpet u klavesnice +userJailed=\u00a77Byls uveznen +userUsedPortal={0} pouzij existujici portal k vychodu. +userdataMoveBackError=Nepodarilo se presunout userdata/{0}.tmp do userdata/{1} +userdataMoveError=Nepodarilo se presunout userdata/{0} do userdata/{1}.tmp +usingTempFolderForTesting=Pouzit docasne slozky pro testovani: +versionMismatch=Verze je zastarala! Prosim aktualizujte {0} na nejnovejsi verzi. +versionMismatchAll=Verze je zastarala! Prosim aktualizujte vsechny Essentials jar soubory na nejnovejsi verzi. +voiceSilenced=\u00a77Vas hlas byl umlcen +warpDeleteError=Problem pri odstranovani warp souboru. +warpListPermission=\u00a7cNemate dostatecna opravneni pro zobrazeni listu warpu. +warpNotExist=Tento warp neexistuje. +warpOverwrite=\u00a7cNemuzete prepsat tento warp. +warpSet=\u00a77Warp {0} nastaven. +warpUsePermission=\u00a7cNemate dostatecna opravneni k pouziti warpu. +warpingTo=\u00a77Warpuju te do {0}. +warps=Warpy: {0} +warpsCount=\u00a77Jsou tam {0} warpy. Ukazovani stran {1} ze {2}. +weatherStorm=\u00a77Nastavils bourku ve {0} +weatherStormFor=\u00a77Nastavils bourku ve {0} po dobu {1} sekund +weatherSun=\u00a77Nastavils slunecno ve {0} +weatherSunFor=\u00a77Nastavils slunecno ve {0} po dobu {1} sekund +whoisBanned=\u00a79 - Zabanovani hraci: {0} +whoisExp=\u00a79 - Exp: {0} (Level {1}) +whoisGamemode=\u00a79 - Mod hry: {0} +whoisGeoLocation=\u00a79 - Lokace: {0} +whoisGod=\u00a79 - Bozsky mode: {0} +whoisHealth=\u00a79 - Zdravi: {0}/20 +whoisIPAddress=\u00a79 - IP Adresy: {0} +whoisIs={0} je {1} +whoisJail=\u00a79 - Veznice: {0} +whoisLocation=\u00a79 - Lokace: ({0}, {1}, {2}, {3}) +whoisMoney=\u00a79 - Penize: {0} +whoisOP=\u00a79 - OP: {0} +whoisStatusAvailable=\u00a79 - Status: Dostupny +whoisStatusAway=\u00a79 - Status: \u00a7cAway\u00a7f +worth=\u00a77Stack z {0} hodnoty \u00a7c{1}\u00a77 ({2} vec(i) v {3} kazde) +worthMeta=\u00a77Stack z {0} metadat {1} hodnoty \u00a7c{2}\u00a77 ({3} vec(i) v {4} kazde) +worthSet=Informacni hodnota nastavena +year=rok +years=roky +youAreHealed=\u00a77Byls uzdraven. +youHaveNewMail=\u00a7cMas {0} zprav!\u00a7f Typ \u00a77/mail read\u00a7f pro zabrazeni tvych zprav. diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties new file mode 100644 index 000000000..136e44eec --- /dev/null +++ b/Essentials/src/messages_it.properties @@ -0,0 +1,423 @@ +#version: Dev2.9.129 +# Single quotes have to be doubled: '' +# Translations start here +# by: +action=* {0} {1} +addedToAccount=\u00a7a{0} e'' stato aggiunto al tuo account. +addedToOthersAccount=\u00a7a{0} e'' stato aggiunto all''account {1}\u00a7a. Nuovo bilancio: {2} +alertBroke=fallito: +alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} a: {3} +alertPlaced=collocato: +alertUsed=usato: +autoAfkKickReason=Sei stato kickato per inattivita'' oltre i {0} minuti. +backAfterDeath=\u00a77Digita il comando /back per tornare al punto dove sei morto. +backUsageMsg=\u00a77Ritorna alla posizione precedente. +backupDisabled=Un script di backup esterno non e'' stato configurato. +backupFinished=Backup terminato +backupStarted=Backup iniziato +balance=\u00a77Bilancio: {0} +balanceTop=\u00a77Top bilanci ({0}) +banExempt=\u00a7cNon puoi bannare questo player. +banIpAddress=\u00a77IP address bannato +bannedIpsFileError=Errore di lettura banned-ips.txt +bannedIpsFileNotFound=banned-ips.txt non trovato +bannedPlayersFileError=Errore di lettura banned-players.txt +bannedPlayersFileNotFound=banned-players.txt non trovato +bigTreeFailure=\u00a7cCreazione del grande albero fallita. Riprova sull''erba o sul terreno. +bigTreeSuccess= \u00a77Grande albero creato. +blockList=Essentials ha trasmesso i seguenti comandi ad un altro plugin: +broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0} +buildAlert=\u00a7cNon hai i permessi per costruire +bukkitFormatChanged=Il formato della versione Bukkit e'' cambiato. Versione non controllata. +burnMsg=\u00a77Hai impostato{0} infuocato per {1} secondi. +canTalkAgain=\u00a77Ora puoi parlare di nuovo +cantFindGeoIpDB=Non trovo il database GeoIP! +cantReadGeoIpDB=Lettura fallita del database GeoIP! +cantSpawnItem=\u00a7cNon sei abilitato a generare l''oggetto {0} +chatTypeLocal=[L] +chatTypeSpy=[Spy] +commandFailed=Comando {0} fallito: +commandHelpFailedForPlugin=Errore nella guida di: {0} +commandNotLoaded=\u00a7cIl comando {0} non e'' stato caricato correttamente. +compassBearing=\u00a77Bussola: {0} ({1} gradi). +configFileMoveError=Impossibile spostare config.yml nel backup. +configFileRenameError=Impossibile rinominare il file temporale in config.yml +connectedPlayers=Players connessi: +connectionFailed=Connessione fallita. +cooldownWithMessage=\u00a7cIn esaurimento: {0} +corruptNodeInConfig=\u00a74Avviso: errore nel tuo file di configurazione, nodo {0}. +couldNotFindTemplate=Non trovo il template {0} +creatingConfigFromTemplate=Configurazione dal template: {0} +creatingEmptyConfig=Configurazione vuota creata: {0} +creative=creativo +currency={0}{1} +day=giorno +days=giorni +defaultBanReason=Sei stato bannato! +deleteFileError=Impossibile eliminare il file: {0} +deleteHome=\u00a77La home {0} e'' stata rimossa. +deleteJail=\u00a77La prigione {0} e'' stata rimossa. +deleteWarp=\u00a77Il Warp {0} e'' stato rimosso. +deniedAccessCommand={0} Accesso negato al comando. +dependancyDownloaded=[Essentials] Dependancy {0} download effettuato con successo. +dependancyException=[Essentials] Errore durante il download di una dependacy +dependancyNotFound=[Essentials] Una dependancy necessaria non e'' stata trovata, sto effettuando il download.. +depth=\u00a77Sei al livello del mare. +depthAboveSea=\u00a77Sei {0} blocco(i) sopra il livello del mare. +depthBelowSea=\u00a77Sei {0} blocco(i) sotto il livello del mare. +destinationNotSet=Destinazione non impostata +disableUnlimited=\u00a77Collocazione illimitata di {0} per {1} disabilitata. +disabled=disabilitato +disabledToSpawnMob=La creazione di questo mob e'' stata disabilitata nel file config. +dontMoveMessage=\u00a77Il teletrasporto iniziera'' tra {0}. Attendi. +downloadingGeoIp=Download del database GeoIP... potrebbe richiedere del tempo (nazione: 0.6 MB, citta'': 20MB) +duplicatedUserdata=Dati dell''utente duplicati: {0} e {1} +enableUnlimited=\u00a77Sto inviando una quantita'' illimitata di {0} a {1}. +enabled=abilitato +enchantmentApplied = \u00a77L''incantesimo {0} e'' stato applicato all''oggetto nelle tue mani. +enchantmentNotFound = \u00a7cIncantesimo non trovato +enchantmentPerm = \u00a7cNon hai il permesso per {0} +enchantmentRemoved = \u00a77L''incantesimo {0} e'' stato rimosso dall''oggetto nelle tue mani. +enchantments = \u00a77Incantesimi: {0} +errorCallingCommand=Errore di chiamata del comando /{0} +errorWithMessage=\u00a7cErrore: {0} +essentialsHelp1=File corrotto.. Essentials non riesce ad aprirlo. Essentials ora e'' disabilitato. Se non riesci a riparare il file, vai su http://tiny.cc/EssentialsChat +essentialsHelp2=File corrotto.. Essentials non riesce ad aprirlo. Essentials ora e'' disabilitato. Se non riesci a riparare il file, digita il comando /essentialshelp o vai su http://tiny.cc/EssentialsChat +essentialsReload=\u00a77Essentials Ricaricato {0} +extinguish=\u00a77Hai spento le fiamme. +extinguishOthers=\u00a77Hai spento le fiamme di {0}. +failedToCloseConfig=Chiusura fallita del config {0} +failedToCreateConfig=Creazione fallita del config {0} +failedToWriteConfig=Scrittura fallita del config {0} +false=falso +feed=\u00a77Ora sei sazio. +feedOther=\u00a77{0} e''stato nutrito. +fileRenameError=Rinomina del file {0} fallita +flyMode=\u00a77Modalita'' volo impostata {0} per {1}. +foreverAlone=\u00a7cNon c''e'' nessuno a cui rispondere. +freedMemory=Liberati {0} MB. +gameMode=\u00a77Modalita''di gioco {0} impostata per {1}. +gcchunks= blocchi, +gcentities= entita'' +gcfree=Memoria libera: {0} MB +gcmax=Memoria massima: {0} MB +gctotal=Memoria allocata: {0} MB +geoIpUrlEmpty=L''url del download di GeoIP e'' vuoto. +geoIpUrlInvalid=L''url del download di GeoIP non e'' valido. +geoipJoinFormat=Il Player {0} proviene da {1} +godDisabledFor=God disabilitato per {0} +godEnabledFor=God abilitato per {0} +godMode=\u00a77Modalita'' God {0}. +haveBeenReleased=\u00a77Sei stato scarcerato. +heal=\u00a77Sei stato curato. +healOther=\u00a77{0} e'' stato curato. +helpConsole=Digitare ? per la guida. +helpFrom=\u00a77Comandi da {0}: +helpLine=\u00a76/{0}\u00a7f: {1} +helpMatching=\u00a77Corrispondenza comandi "{0}": +helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} +helpPages=Pagina \u00a7c{0}\u00a7f di \u00a7c{1}\u00a7f: +helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1} +holeInFloor=Buco nel terreno +homeSet=\u00a77Home impostata. +homeSetToBed=\u00a77La tua home e'' ora assegnata a questo letto. +homes=Homes: {0} +hour=ora +hours=ore +ignorePlayer=Da ora in poi ignorerai {0}. +illegalDate=Formato data/ora non riconosciuto. +infoChapter=Seleziona capitolo: +infoChapterPages=Capitolo {0}, pagina \u00a7c{1}\u00a7f di \u00a7c{2}\u00a7f: +infoFileDoesNotExist=Il file info.txt non esiste. Creane uno per te. +infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Pagina \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- +infoUnknownChapter=Capitolo sconosciuto. +invBigger=L''inventario degli altri utenti e'' piu'' grande del tuo. +invRestored=l tuo inventario e'' stato ripristinato. +invSee=Stai guardando l''inventario di {0}. +invSeeHelp=Digita /invsee per ripristinare il tuo inventario. +invalidCharge=\u00a7cIIstruzione non corretta. +invalidHome=La home {0} non esiste +invalidMob=Tipo mob non valido. +invalidServer=Server non valido! +invalidSignLine=Riga {0} non corretta. +invalidWorld=\u00a7cMondo incorretto. +inventoryCleared=\u00a77Inventario cancellato. +inventoryClearedOthers=\u00a77Inventario di \u00a7c{0}\u00a77 cancellato. +is=e'' +itemCannotBeSold=L''oggetto non puo'' essere venduto. +itemMustBeStacked=L''oggetto deve essere commerciato in pile. 2 quantita'' equivalgono a 2 pile, etc. +itemNotEnough1=\u00a7cNon hai abbastanza quantita'' di questo oggetto per venderlo. +itemNotEnough2=\u00a77Se vuoi vendere tutti gli oggetti di quel tipo, digita /sell nomeoggetto +itemNotEnough3=\u00a77/sell nomeoggetto -1 vende tutto tranne quell''oggetto, etc. +itemSellAir=Stai cercando di vendere l''aria? Metti un oggetto nella tua mano. +itemSold=\u00a77Venduto per \u00a7c{0} \u00a77({1} {2} a {3} l''uno) +itemSoldConsole={0} venduto {1} per \u00a77{2} \u00a77({3} oggetti a {4} l''uno) +itemSpawn=\u00a77Inviati {0} di {1} +itemsCsvNotLoaded=Impossibile caricare items.csv. +jailAlreadyIncarcerated=\u00a7cPlayer gia'' in prigione: {0} +jailMessage=\u00a7cAvrai tempo per riflettere..in prigione. +jailNotExist=La prigione dichiarata non esiste. +jailReleased=\u00a77Player \u00a7e{0}\u00a77 scarcerato. +jailReleasedPlayerNotify=\u00a77Sei stato scarcerato! +jailSentenceExtended=Tempo di incarcerazione aumentato di: {0) +jailSet=\u00a77{0} e'' ora una prigione. +jumpError=Cosi'' facendo danneggerai la cpu. +kickDefault=Kickato dal server +kickExempt=\u00a7cNon puoi kickare questo player. +kill=\u00a77Ucciso {0}. +kitError2=\u00a7cQuesto kit non esiste o non e'' definito. +kitError=\u00a7cNon ci sono kit validi. +kitErrorHelp=\u00a7cForse una quantita'' manca in un oggetto della configurazione? +kitGive=\u00a77Kit inviato {0}. +kitInvFull=\u00a7cIl tuo inventario e'' pieno, il kit e'' ora per terra. +kitTimed=\u00a7cNon puoi usare il kit per altri {0}. +kits=\u00a77Kits: {0} +lightningSmited=\u00a77Sei stato folgorato! +lightningUse=\u00a77{0} e'' stato folgorato! +listAfkTag = \u00a77[AFK]\u00a7f +listAmount = \u00a79Ci sono \u00a7c{0}\u00a79 players online su un massimo di \u00a7c{1}. +listAmountHidden = \u00a79Ci sono \u00a7c{0}\u00a77/{1}\u00a79 players online su un massimo di \u00a7c{2}. +listGroupTag={0}\u00a7f: +listHiddenTag = \u00a77[HIDDEN]\u00a7f +loadWarpError=Impossibile caricare il warp {0} +localFormat=Formato locale: <{0}> {1} +mailClear=\u00a7cPer cancellare la tua mail, digita /mail clear +mailCleared=\u00a77Mail cancellata! +mailSent=\u00a77Mail inviata! +markMailAsRead=\u00a7cPer contrassegnare la mail come gia'' letta, digita /mail read +markedAsAway=\u00a77Il tuo stato ora e'' "Non al computer". +markedAsNotAway=\u00a77Bentornato! +maxHomes=Non puoi assegnare piu'' di {0} home. +mayNotJail=\u00a7cNon puoi imprigionare questo player. +me=mi +minute=minuto +minutes=minuti +missingItems=Non hai {0}x {1}. +missingPrefixSuffix=Manca un prefisso o un suffisso per {0} +mobSpawnError=Errore durante il cambiamento del generatore di mob. +mobSpawnLimit=Quantita'' Mob limitata dal server +mobSpawnTarget=Il blocco designato deve essere un generatore di mob. +mobsAvailable=\u00a77Mobs: {0} +moneyRecievedFrom=\u00a7a{0} sono stati ricevuti da {1} +moneySentTo=\u00a7a{0} sono stati inviati a {1} +moneyTaken={0} prelevati dal tuo conto in banca. +month=mese +months=mesi +moreThanZero=La quantita'' deve essere maggiore di 0. +msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cNon puoi mutare questo player. +mutedPlayer=Player {0} mutato. +mutedPlayerFor=Player {0} mutato per {1}. +mutedUserSpeaks={0} ha provato a parlare, ma e'' mutato. +nearbyPlayers=Players nelle vicinanze: {0} +negativeBalanceError=User is not allowed to have a negative balance. +nickChanged=Nickname modificato. +nickDisplayName=\u00a77Devi abilitare change-displayname nel config di Essentials. +nickInUse=\u00a7cNickname gia'' in uso. +nickNamesAlpha=\u00a7cI Nickname devono essere alfanumerici. +nickNoMore=\u00a77Non disponi piu'' di un nickname. +nickOthersPermission=\u00a7cNon hai il permesso di cambiare il nickname degli altri +nickSet=\u00a77Il tuo nickname e'' ora \u00a7c{0} +noAccessCommand=\u00a7cNon hai accesso a questo comando. +noAccessPermission=\u00a7cNon hai i permessi di accesso per {0}. +noBreakBedrock=Non sei abilitato a distruggere la bedrock. +noDestroyPermission=\u00a7cNon hai i permessi per distruggere {0}. +noGodWorldWarning=\u00a7cAttenzione! Modalita'' God disabilitata in questo mondo. +noHelpFound=\u00a7cComandi non trovati. +noHomeSet=Non hai stabilito una home. +noHomeSetPlayer=Il Player non ha stabilito una home. +noKitPermission=\u00a7cHai bisogno del permesso \u00a7c{0}\u00a7c per usare questo kit. +noKits=\u00a77Non ci sono ancora kit disponibili +noMail=Non hai ricevuto nessuna mail +noMotd=\u00a7cNon c''e'' nessun messaggio del giorno. +noNewMail=\u00a77Non hai ricevuto nuove mail. +noPendingRequest=Non hai richieste in sospeso. +noPerm=\u00a7cNon hai questo permesso: \u00a7f{0} +noPermToSpawnMob=\u00a7cNon hai i permessi per generare questo mob. +noPlacePermission=\u00a7cNon hai il permesso di collocare un blocco accanto a quest''insegna. +noPowerTools=Non hai attrezzi assegnati. +noRules=\u00a7cNon ci sono regole specifiche al momento. +noWarpsDefined=Nessun warp definito +none=nessun +notAllowedToQuestion=\u00a7cNon sei autorizzato a fare domande. +notAllowedToShout=\u00a7cNon sei autorizzato a gridare. +notEnoughExperience=Non hai abbastanza esperienza. +notEnoughMoney=Non hai abbastanza denaro. +notRecommendedBukkit=* ! * La versione Bukkit in uso non e'' compatibile con Essentials. +notSupportedYet=Non ancora supportato. +nothingInHand = \u00a7cNon hai niente in mano. +now=adesso +nuke=Un regalino.. radioattivo +numberRequired=Che ne dici di metterci un numero?! +onlyDayNight=/time supporta solo day/night. +onlyPlayers=Solo i players durante il gioco possono usare {0}. +onlySunStorm=/weather supporta solo sun/storm. +orderBalances=Sto ordinando i bilanci di {0} utenti, attendere grazie... +pTimeCurrent=L''orario di \u00a7e{0}\u00a7f e'' {1}. +pTimeCurrentFixed=L''orario di \u00a7e{0}\u00a7f e'' fissato alle {1}. +pTimeNormal=L''orario di \u00a7e{0}\u00a7f e'' normale e corrisponde a quello del server. +pTimeOthersPermission=\u00a7cNon sei autorizzato a definre l''orario degli altri player. +pTimePlayers=Questi player hanno il loro orario: +pTimeReset=L''orario del Player e'' stato resettato alle: \u00a7e{0} +pTimeSet=L''orario del Player e'' stato regolato alle \u00a73{0}\u00a7f per le: \u00a7e{1} +pTimeSetFixed=L''orario del Player e'' stato fissato alle \u00a73{0}\u00a7f per le: \u00a7e{1} +parseError=Errore parsing {0} riga {1} +pendingTeleportCancelled=\u00a7cRichiesta in sospeso di teletrasporto cancellata. +permissionsError=Mancano i permessi per Permissions/GroupManager; i suffissi e prefissi in chat verrano disabilitati. +playerBanned=\u00a7cIl Player {0} e'' bannato {1} motivo: {2} +playerInJail=\u00a7cIl Player e'' gia'' nella prigione ({0}). +playerJailed=\u00a77Il Player {0} e'' stato messo in prigione. +playerJailedFor= \u00a77Il Player {0} e'' in prigione. motivo: {1}. +playerKicked=\u00a7cIl Player {0} e'' stato kickato {1} motivo: {2} +playerMuted=\u00a77Sei stato mutato +playerMutedFor=\u00a77Sei stato mutato per {0} +playerNeverOnServer=\u00a7cIl Player {0} non e'' mai stato su questo server. +playerNotFound=\u00a7cPlayer non trovato. +playerUnmuted=\u00a77Sei stato smutato +pong=Pong! +possibleWorlds=\u00a77I mondi sono numerati da 0 a {0}. +powerToolAir=Il comando non puo'' essere collegato all''aria. +powerToolAlreadySet=Il comando \u00a7c{0}\u00a7f e'' gia'' stato assegnato a {1}. +powerToolAttach=Il comando \u00a7c{0}\u00a7f e'' stato assegnato a {1}. +powerToolClearAll=Tutti i comandi per gli attrezzi sono stati cancellati. +powerToolList=L''attrezzo {1} ha i seguenti comandi: \u00a7c{0}\u00a7f. +powerToolListEmpty=L''attrezzo {0} non dispone di comandi assegnati. +powerToolNoSuchCommandAssigned=Il comando \u00a7c{0}\u00a7f non e'' stato assegnato a {1}. +powerToolRemove=Il comando \u00a7c{0}\u00a7f e'' stato rimosso da {1}. +powerToolRemoveAll=Tutti i comandi sono stati rimossi da {0}. +powerToolsDisabled=Tutti i tuoi attrezzi sono stati disabilitati. +powerToolsEnabled=Tutti i tuoi attrezzi sono stati abilitati. +protectionOwner=\u00a76[EssentialsProtect] Protetto dal proprietario: {0} +questionFormat=\u00a77[Domanda]\u00a7f {0} +readNextPage=Digita /{0} {1} per la pagina successiva +reloadAllPlugins=\u00a77Tutti i plugins ricaricati. +removed=\u00a77Rimosse {0} entitita''. +repair=Hai riparato con successo il tuo: \u00a7e{0}. +repairAlreadyFixed=\u00a77Questo oggetto non richiede riparazioni. +repairEnchanted=\u00a77Non sei abilitato a riparare oggetti magici. +repairInvalidType=\u00a7cQuesto oggetto non puo'' essere riparato. +repairNone=Non ci sono oggetti da riparare. +requestAccepted=\u00a77Richiesta di teletrasporto accettata. +requestAcceptedFrom=\u00a77{0} ha accettato la tua richiesta di teletrasporto. +requestDenied=\u00a77Richiesta di teletrasporto rifiutata. +requestDeniedFrom=\u00a77{0} ha rifiutato la tua richiesta di teletrasporto. +requestSent=\u00a77Richiesta inviata a {0}\u00a77. +requestTimedOut=\u00a7cRichiesta di teletrasporto scaduta. +requiredBukkit=* ! * e'' necessaria la versione {0} o superiore di CraftBukkit, scaricabile da http://dl.bukkit.org/downloads/craftbukkit/ +returnPlayerToJailError=Riscontrato errore nell''invio del player {0} alla prigione: {1} +second=secondo +seconds=secondi +seenOffline=Il Player {0} e'' offline da {1} +seenOnline=Il Player {0} e'' online da {1} +serverFull=Il Server e'' pieno +serverTotal=Totale Server: {0} +setSpawner=Tipo generatore modificato in {0} +sheepMalformedColor=Colore non valido. +shoutFormat=\u00a77[Grido!]\u00a7f {0} +signFormatFail=\u00a74[{0}] +signFormatSuccess=\u00a71[{0}] +signFormatTemplate=[{0}] +signProtectInvalidLocation=\u00a74Non hai il permesso per creare segnaposti qui. +similarWarpExist=Il nome del warp e'' stato gia'' utilizzato. +slimeMalformedSize=Dimensione non valida. +soloMob=Quel mob sembra essere solo +spawnSet=\u00a77Punto di rigenerazione creato per il gruppo {0}. +spawned=creato +sudoExempt=Impossibile applicare il sudo a questo utente +sudoRun=Sto obbligando {0} ad eseguire: /{1} {2} +suicideMessage=\u00a77Addio mondo crudele... +suicideSuccess= \u00a77{0} si e'' suicidato.. +survival=sopravvivenza +takenFromAccount=\u00a7c{0} sono stati prelevati dal tuo conto. +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} +teleportAAll=\u00a77Richiesta di teletrasporto inviata a tutti i players... +teleportAll=\u00a77Sto teletrasportando tutti i players... +teleportAtoB=\u00a77{0}\u00a77 ti ha teletrasportato a {1}\u00a77. +teleportDisabled={0} ha il teletrasporto disabilitato. +teleportHereRequest=\u00a7c{0}\u00a7c ha richiesto di teletrasportati da loro. +teleportNewPlayerError=Teletrasporto del nuovo player fallito +teleportRequest=\u00a7c{0}\u00a7c ha richiesto di teletrasportati da te. +teleportRequestTimeoutInfo=\u00a77Questa richiesta scadra'' tra {0} secondi. +teleportTop=\u00a77Teletrasporto in cima. +teleportationCommencing=\u00a77Inizio teletrasporto... +teleportationDisabled=\u00a77Teletrasporto disabilitato. +teleportationEnabled=\u00a77Teletrasporto abilitato. +teleporting=\u00a77Teletrasporto in corso... +teleportingPortal=\u00a77Teletrasporto tramite portale. +tempBanned=Bannato temporaneamente dal server per {0} +tempbanExempt=\u00a77Non puoi bannare questo player +thunder=Abilita i filmini dal cielo: {0} +thunderDuration=Abilita i filmini dal cielo: {0} per {1} secondi. +timeBeforeHeal=Tempo rimanente alla prossima cura: {0} +timeBeforeTeleport=Tempo rimanente al prossimo teletrasporto: {0} +timeFormat=\u00a73{0}\u00a7f oppure \u00a73{1}\u00a7f oppure \u00a73{2}\u00a7f +timePattern=(?:([0-9]+)\\s*y[a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)? +timeSet=Orario definito in tutti i mondi. +timeSetPermission=\u00a7cNon sei autorizzato a regolare l''orario. +timeWorldCurrent=L''orario attuale in {0} e'' \u00a73{1} +timeWorldSet=L''orario e'' stato regolato alle {0} in: \u00a7c{1} +tradeCompleted=\u00a77Affare concluso. +tradeSignEmpty=L''insegna non dispone di forniture sufficienti. +tradeSignEmptyOwner=Non c''e'' niente da raccogliare da quest''insegna. +treeFailure=\u00a7cCreazione dell''albero fallita. Riprova sull''erba o sul terreno. +treeSpawned=\u00a77Albero generato. +true=vero +typeTpaccept=\u00a77Per accetare il teletrasprto, digita \u00a7c/tpaccept\u00a77. +typeTpdeny=\u00a77Per rifiutare il teletrasporto, digita \u00a7c/tpdeny\u00a77. +typeWorldName=\u00a77Puoi digitare anche il nome di un mondo. +unableToSpawnMob=Impossibile generare il mob. +unbannedIP=IP address abilitato. +unbannedPlayer=Player abilitato. +unignorePlayer=Non stai piu'' ignorando il player {0}. +unknownItemId=ID oggetto sconosciuto: {0} +unknownItemInList=Oggetto {0} sconosciuto nella lista {1}. +unknownItemName=Nome oggetto sconosciuto: {0} +unlimitedItemPermission=\u00a7cNessun permesso per l''oggetto {0} illimitato. +unlimitedItems=Oggetti illimitati: +unmutedPlayer=Player {0} smutato. +upgradingFilesError=Errore durante l''aggiornamento dei file +userDoesNotExist=L''utente {0} non esiste. +userIsAway={0} e'' AFK +userIsNotAway={0} non e'' piu'' AFK +userJailed=\u00a77Sei stato messo in prigione +userUsedPortal={0} ha usato un portale. +userdataMoveBackError=Errore durante lo spostamento di userdata/{0}.tmp a userdata/{1} +userdataMoveError=Errore durante lo spostamento di userdata/{0} a userdata/{1}.tmp +usingTempFolderForTesting=Sto usando la cartella temporale per il test: +versionMismatch=Versione incorretta! Aggiornare {0} alla stessa versione. +versionMismatchAll=Versione incorretta! Aggiornare tutti i jar Essentials alla stessa versione. +voiceSilenced=\u00a77La tua voce e'' stata silenziata +warpDeleteError=Problema nell''eliminazione del file warp. +warpListPermission=\u00a7cNon hai i permessi per consultare la lista warps. +warpNotExist=Questo warp non esiste. +warpOverwrite=\u00a7cNon puoi sovrascrivere il warp. +warpSet=\u00a77Warp {0} definito. +warpUsePermission=\u00a7cNon hai i permessi per usare questo warp. +warpingTo=\u00a77Warping a {0}. +warps=Warps: {0} +warpsCount=\u00a77Ci sono {0} warps. Pagina {1} of {2}. +weatherStorm=\u00a77Hai regolato il tempo in tempesta in {0} +weatherStormFor=\u00a77Hai cambiato il tempo in tempesta in {0} per {1} secondi +weatherSun=\u00a77Hai cambiato il tempo in soleggiato in {0} +weatherSunFor=\u00a77Hai cambiato il tempo in soleggiato in {0} per {1} secondi +whoisBanned=\u00a79 - Bannati: {0} +whoisExp=\u00a79 - Exp: {0} (Livello {1}) +whoisGamemode=\u00a79 - Gamemode: {0} +whoisGeoLocation=\u00a79 - Posizione: {0} +whoisGod=\u00a79 - God mode: {0} +whoisHealth=\u00a79 - Health: {0}/20 +whoisIPAddress=\u00a79 - IP Address: {0} +whoisIs={0} e'' {1} +whoisJail=\u00a79 - Imprigionati: {0} +whoisLocation=\u00a79 - Posizione: ({0}, {1}, {2}, {3}) +whoisMoney=\u00a79 - Denaro: {0} +whoisOP=\u00a79 - OP: {0} +whoisStatusAvailable=\u00a79 - Status: Disponibile +whoisStatusAway=\u00a79 - Status: \u00a7cNon al computer\u00a7f +worth=\u00a77Pila di {0} valore \u00a7c{1}\u00a77 ({2} oggetto(i) a {3} l''uno) +worthMeta=\u00a77Pila di {0} con metadati di {1} valore \u00a7c{2}\u00a77 ({3} oggetto(i) a {4} l''uno) +worthSet=Valore definito +year=anno +years=anni +youAreHealed=\u00a77Sei stato curato. +youHaveNewMail=\u00a7cHai {0} messaggi!\u00a7f digita \u00a77/mail read\u00a7f per consultare la tua mail. diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties new file mode 100644 index 000000000..865f103f4 --- /dev/null +++ b/Essentials/src/messages_pt.properties @@ -0,0 +1,423 @@ +#version: 2.7.2 +# Single quotes have to be doubled: '' +# Translations start here +# by: FurmigaHumana +action=* {0} {1} +addedToAccount=\u00a7a{0} foi adicionado a sua conta. +addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} +alertBroke=Quebrou: +alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} em: {3} +alertPlaced=Colocou: +alertUsed=Usou: +autoAfkKickReason=Voc\u00ea foi kickado por estar inativo a mais de {0} minutos. +backAfterDeath=\u00a77Use o comando /back para voltar onde morreu. +backUsageMsg=\u00a77Retornando a posi\u00e7ao anterior... +backupDisabled=An external backup script has not been configured. +backupFinished=Backup conclu\u00eddo +backupStarted=Backup iniciado +balance=\u00a77Saldo: {0} +balanceTop=\u00a77 Top Saldos ({0}) +banExempt=\u00a7cVoc\u00ea nao pode banir este jogador. +banIpAddress=\u00a77Endere\u00e7o de IP banido +bannedIpsFileError=Erro ao ler o arquivo banned-ips.txt +bannedIpsFileNotFound=banned-ips.txt nao encontrado +bannedPlayersFileError=Erro ao ler o arquivo banned-players.txt +bannedPlayersFileNotFound=banned-players.txt nao encontrado +bigTreeFailure=\u00a7cFalha na gera\u00e7ao da \u00e1rvore grande. Tente de novo na terra ou grama. +bigTreeSuccess= \u00a77\u00c1rvore grande gerada. +blockList=Essentials passou o seguinte comando a outro plugin: +broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0} +buildAlert=\u00a7cVoc\u00ea nao tem permissao de construir. +bukkitFormatChanged=Bukkit: formato da versao alterada. Versao nao verificada. +burnMsg=\u00a77Voc\u00ea {0} foi incendiado por {1} segundos. +canTalkAgain=\u00a77Voc\u00ea pode falar de novo +cantFindGeoIpDB=Nao foi poss\u00edvel encontrar o GeoIP database! +cantReadGeoIpDB=Falhou em ler a GeoIP database! +cantSpawnItem=\u00a7cVoc\u00ea nao tem permissao de pegar este item {0} +chatTypeLocal=[L] +chatTypeSpy=[Spy] +commandFailed=Comando {0} falhou: +commandHelpFailedForPlugin=Erro ao obter ajuda para: {0} +commandNotLoaded=\u00a7cCommando {0} provavelmente esta carregado. +compassBearing=\u00a77Inclina\u00e7ao: {0} ({1} graus). +configFileMoveError=Falha ao mover arquivo config.yml ao local de backup. +configFileRenameError=Falha em renomear arquivo temporario em config.yml +connectedPlayers=Jogadores conectados: +connectionFailed=Falha ao abrir conexao. +cooldownWithMessage=\u00a7cTempo de espera: {0} +corruptNodeInConfig=\u00a74Aviso: Seu arquivo de configura\u00e7ao tem uma parte {0} corrompida. +couldNotFindTemplate=Nao foi poss\u00edvel encontrar o modelo {0} +creatingConfigFromTemplate=Criando arquivo de configura\u00e7ao com o modelo: {0} +creatingEmptyConfig=Criando arquivo de configura\u00e7ao vazio: {0} +creative=creative +currency={0}{1} +day=dia +days=dias +defaultBanReason=O Rei do Ban Falou! +deleteFileError=Nao \u00e9 poss\u00edvel deletar arquivo: {0} +deleteHome=\u00a77Casa {0} foi removida. +deleteJail=\u00a77prisao {0} foi removida. +deleteWarp=\u00a77Warp {0} foi removido. +deniedAccessCommand={0} Acesso negado ao comando. +dependancyDownloaded=[Essentials] Dependencia {0} baixada com sucesso. +dependancyException=[Essentials] Ocorreu um erro ao tentar baixar uma dependencia +dependancyNotFound=[Essentials] Uma dependencia necess\u00e1ria nao foi encontrada. Baixando agora. +depth=\u00a77Voc\u00ea esta no nivel do mar. +depthAboveSea=\u00a77Voc\u00ea esta a {0} bloco(s) acima do nivel do mar. +depthBelowSea=\u00a77Voc\u00ea esta a {0} bloco(s) abaixo do nivel do mar. +destinationNotSet=Destino nao definido. +disableUnlimited=\u00a77Desativada itens ilimitados de {0} para {1}. +disabled=desativado +disabledToSpawnMob=Desovar este mob esta desativado nas configura\u00e7\u00f5es. +dontMoveMessage=\u00a77Teleporte vai come\u00e7ar em {0}. Nao se mova. +downloadingGeoIp=Baixando GeoIP database ... pode demorar um pouco (Pais: 0.6 MB, Cidade: 20MB) +duplicatedUserdata=Dado de usu\u00e1rio duplicado: {0} e {1} +enableUnlimited=\u00a77Colocando quantidade ilimitada de {0} para {1}. +enabled=ativado +enchantmentApplied = \u00a77O encantamento {0} foi aplicado ao item na sua mao. +enchantmentNotFound = \u00a7cEncantamento nao encontrado. +enchantmentPerm = \u00a7cVoc\u00ea nao tem permissao para {0} +enchantmentRemoved = \u00a77O encantamento {0} foi removido do item na sua mao. +enchantments = \u00a77Encantamentos: {0} +errorCallingCommand=Erro no comando /{0} +errorWithMessage=\u00a7cErro: {0} +essentialsHelp1=O arquivo esta quebrado e o essentials nao consegue abrilo. Essentials esta desativado agora. Se voc\u00ea nao consegue arrumar o arquivo, va para http://tiny.cc/EssentialsChat +essentialsHelp2=O arquivo esta quebrado e o essentials nao consegue abrilo. Essentials esta desativado agora. Se voc\u00ea nao consegue arrumar o arquivo, tente digitar /essentialshelp no jogo ou va para http://tiny.cc/EssentialsChat +essentialsReload=\u00a77Essentials recarregado {0} +extinguish=\u00a77Voce se extinguiu. +extinguishOthers=\u00a77Voce foi extinguido {0}. +failedToCloseConfig=Falha em fechar o arquivo de configura\u00e7ao {0} +failedToCreateConfig=Falha em criar o arquivo de configura\u00e7ao {0} +failedToWriteConfig=Falha em escrever no arquivo de configura\u00e7ao {0} +false=falso +feed=\u00a77Seu apetite foi saciado. +feedOther=\u00a77Satisfeito {0}. +fileRenameError=Falha ao renomear o arquivo {0}. +flyMode=\u00a77Set fly mode {0} for {1}. +foreverAlone=\u00a7cVoc\u00ea nao tem ninguem a quem responder. +freedMemory=Livre {0} MB. +gameMode=\u00a77Gamemode {0} definido para {1}. +gcchunks= chunks, +gcentities= entidades +gcfree=Memoria livre: {0} MB +gcmax=Mem\u00f3ria Maxima: {0} MB +gctotal=Mem\u00f3ria alocada: {0} MB +geoIpUrlEmpty=GeoIP url de download esta vazia. +geoIpUrlInvalid=GeoIP url de download e invalida. +geoipJoinFormat=Jogador {0} veio do {1} +godDisabledFor=desativado para {0} +godEnabledFor=ativado para {0} +godMode=\u00a77Modo Deus {0}. +haveBeenReleased=\u00a77Voc\u00ea foi liberado. +heal=\u00a77Voc\u00ea foi curado. +healOther=\u00a77Curado {0}. +helpConsole=Para ver ajuda do console, digite ?. +helpFrom=\u00a77Commands from {0}: +helpLine=\u00a76/{0}\u00a7f: {1} +helpMatching=\u00a77Commands matching "{0}": +helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} +helpPages=P\u00e1gina \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: +helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1} +holeInFloor=Buraco no chao +homeSet=\u00a77Casa definida. +homeSetToBed=\u00a77Sua casa agora esta definida a esta cama. +homes=Casa: {0} +hour=hora +hours=horas +ignorePlayer=Voc\u00ea esta ignorando o jogador {0} agora. +illegalDate=Formato de data \u00edlegal. +infoChapter=Selecione o cap\u00edtulo: +infoChapterPages=Cap\u00edtulo {0}, pagina \u00a7c{1}\u00a7f de \u00a7c{2}\u00a7f: +infoFileDoesNotExist=Arquivo info.txt nao existe. Criando um para voc\u00ea. +infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Page \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- +infoUnknownChapter=Cap\u00edtulo desconhecido. +invBigger=O invent\u00e1rio do outro usu\u00e1rio e maior que o seu. +invRestored=Seu invent\u00e1rio foi restaurado. +invSee=Voc\u00ea v\u00ea o invent\u00e1rio de {0}. +invSeeHelp=Use /invsee para voltar ao seu invent\u00e1rio. +invalidCharge=\u00a7cCarga invalida. +invalidHome=Home {0} doesn't exist +invalidMob=Tipo de mob inv\u00e1lido. +invalidServer=Servidor inv\u00e1lido! +invalidSignLine=Linha {0} da placa e inv\u00e1lida. +invalidWorld=\u00a7cMundo inv\u00e1lido. +inventoryCleared=\u00a77Invent\u00e1rio limpo. +inventoryClearedOthers=\u00a77Invent\u00e1rio de \u00a7c{0}\u00a77 limpo. +is=\u00e9 +itemCannotBeSold=Este item nao pode ser vendido para o servidor. +itemMustBeStacked=O item deve ser negociado em pacotes. A qantidade de 2s seria dois pacotes, etc. +itemNotEnough1=\u00a7cVoc\u00ea nao tem esta quantidade de itens para vender. +itemNotEnough2=\u00a77Se voc\u00ea quer vender todos os itens deste tipo, use /sell NomeDoItem +itemNotEnough3=\u00a77/sell NomeDoItem -1 vai vender tudo mais um item, etc. +itemSellAir=Voc\u00ea realmente tentou vender ar? Coloque um item na sua mao. +itemSold=\u00a77Vendido para \u00a7c{0} \u00a77({1} {2} a {3} cada) +itemSoldConsole={0} vendido {1} para \u00a77{2} \u00a77({3} itens a {4} cada) +itemSpawn=\u00a77Dando {0} de {1} +itemsCsvNotLoaded=nao foi poss\u00edvel carregar items.csv. +jailAlreadyIncarcerated=\u00a7cEsta pessoa j\u00e1 esta na cadeia: {0} +jailMessage=\u00a7cVoc\u00ea faz o crime, voc\u00ea cumpre a pena. +jailNotExist=esta cadeia nao existe. +jailReleased=\u00a77Player \u00a7e{0}\u00a77 libertado. +jailReleasedPlayerNotify=\u00a77Voc\u00ea foi solto! +jailSentenceExtended=Tempo de prisao estendido para: {0) +jailSet=\u00a77Cela {0} foi definida +jumpError=Isso prejudica o c\u00e9rebro do seu computador. +kickDefault=Kickado do servidor. +kickExempt=\u00a7cVoc\u00ea nao pode kickar esta pessoa. +kill=\u00a77Assassinado {0}. +kitError2=\u00a7cEsse kit nao existe ou foi definido impropiamente. +kitError=\u00a7cNao existe kits v\u00e1lidos. +kitErrorHelp=\u00a7cTalvez um item esta faltando a quantidade nas configura\u00e7\u00f5es? +kitGive=\u00a77Dando kit {0}. +kitInvFull=\u00a7cSeu invent\u00e1rio esta cheio, colocando kit no chao +kitTimed=\u00a7cVoc\u00ea nao pode usar este kit denovo por {0}. +kits=\u00a77Kits: {0} +lightningSmited=\u00a77YVoc\u00ea acaba de ser castigado +lightningUse=\u00a77Castigando {0} +listAfkTag = \u00a77[Ausente]\u00a7f +listAmount = \u00a79Aqui tem \u00a7c{0}\u00a79 do m\u00e1ximo de \u00a7c{1}\u00a79 jogadores online. +listAmountHidden = \u00a79Aqui tem \u00a7c{0}\u00a77/{1}\u00a79 do maximo de \u00a7c{2}\u00a79 jogadores online. +listGroupTag={0}\u00a7f: +listHiddenTag = \u00a77[ESCONDIDO]\u00a7f +loadWarpError=Falha ao carregar warp {0} +localFormat=Local: <{0}> {1} +mailClear=\u00a7cPara marcar seu email como lido, use /mail clear +mailCleared=\u00a77eMail limpo! +mailSent=\u00a77eMail enviado! +markMailAsRead=\u00a7cPara marcar seu email como lido, use /mail clear +markedAsAway=\u00a77[AFK] Agora voc\u00ea esta marcado como aus\u00eante. +markedAsNotAway=\u00a77[AFK] Voc\u00ea nao esta mais marcado como aus\u00eante. +maxHomes=Voc\u00ea nao pode definir mais de {0} casas. +mayNotJail=\u00a7cVoc\u00ea nao pode prender esta pessoa +me=eu +minute=minuto +minutes=minutos +missingItems=Voc\u00ea nao tem {0}x {1}. +missingPrefixSuffix=Faltando um prefixo ou sufixo para {0} +mobSpawnError=Erro ao mudar o mob spawner. +mobSpawnLimit=Quantidade de mob limitada pelo servidor +mobSpawnTarget=Bloco de destino deve ser um mob spawner. +mobsAvailable=\u00a77Mobs: {0} +moneyRecievedFrom=\u00a7a{0} foi recebido de {1} +moneySentTo=\u00a7a{0} foi enviado para {1} +moneyTaken={0} tirado da sua conta. +month=m\u00eas +months=meses +moreThanZero=Quantidade deve ser maior que 0. +msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cVoc\u00ea nao pode mutar este jogador. +mutedPlayer=Player {0} mutado. +mutedPlayerFor=Player {0} mutado por {1}. +mutedUserSpeaks={0} tentou falar, mas esta mutado. +nearbyPlayers=Jogadores por perto: {0} +negativeBalanceError=Nao \u00e9 permitido ter um saldo negativo. +nickChanged=Apelido modificado. +nickDisplayName=\u00a77Voc\u00ea deve ativar change-displayname nas configura\u00e7\u00f5es do Essentials. +nickInUse=\u00a7cEste nome j\u00e1 esta em uso. +nickNamesAlpha=\u00a7cApelidos devem ser alfanumericos. +nickNoMore=\u00a77Voc\u00ea nao tem mais um apelido. +nickOthersPermission=\u00a7cVoc\u00ea nao tem permissao para mudar o apelido dos outros. +nickSet=\u00a77Agora seu apelido \u00e9 \u00a7c{0} +noAccessCommand=\u00a7cVoc\u00ea nao tem acesso a este comando. +noAccessPermission=\u00a7cVoc\u00ea nao tem permissao para acessar isso {0}. +noBreakBedrock=You are not allowed to destroy bedrock. +noDestroyPermission=\u00a7cVoc\u00ea nao tem permissao para destruir isso {0}. +noGodWorldWarning=\u00a7cAviso! Modo Deus neste mundo esta desativado. +noHelpFound=\u00a7cNenhum comando correspondente. +noHomeSet=Voc\u00ea nao definiu nenhuma casa. +noHomeSetPlayer=Jogador nao definiu nenhuma casa. +noKitPermission=\u00a7cVoc\u00ea precisa da permissao \u00a7c{0}\u00a7c para usar este kit. +noKits=\u00a77Ainda nao tem nenhum item disponivel +noMail=Voc\u00ea nao tem nenhum email +noMotd=\u00a7cNao h\u00e1 nenhuma mensagem do dia. +noNewMail=\u00a77Voc\u00ea nao tem nenhum novo email. +noPendingRequest=Voc\u00ea nao tem um pedido pendente. +noPerm=\u00a7cVoc\u00ea nao tem a permissao \u00a7f{0}\u00a7c. +noPermToSpawnMob=\u00a7cVoc\u00ea nao tem permissao para desovar este mob. +noPlacePermission=\u00a7cVoc\u00ea nao tem permissao de por um bloco perto daquela placa. +noPowerTools=Voc\u00ea nao tem nenhuma super ferramenta definida. +noRules=\u00a7cAinda nao foi definida as regras. +noWarpsDefined=Nenhum warp definido +none=nenhum +notAllowedToQuestion=\u00a7cVoc\u00ea nao esta autorizado a usar pergunta. +notAllowedToShout=\u00a7cVoc\u00ea nao esta autorizado a gritar. +notEnoughExperience=Voc\u00ea nao tem experiencia suficiente. +notEnoughMoney=Voc\u00ea nao tem dinheiro suficiente. +notRecommendedBukkit=* ! * Versao do bukkit nao \u00e9 a recomendada para o essentials. +notSupportedYet=Ainda nao suportado. +nothingInHand = \u00a7cVoc\u00ea nao tem nada em sua mao. +now=agora +nuke=May death rain upon them +numberRequired=Um numero vai aqui, bobinho. +onlyDayNight=/time apenas suporta day/night. +onlyPlayers=Apenas jogadores no jogo pode usar {0}. +onlySunStorm=/weather apenas suporta sun/storm. +orderBalances=Ordenando saldos de {0} usuarios, aguarde ... +pTimeCurrent=\u00a7e{0}''s\u00a7f horario e {1}. +pTimeCurrentFixed=\u00a7e{0}''s\u00a7f hor\u00e1rio foi fixado para {1}. +pTimeNormal=\u00a7e{0}''s\u00a7f o tempo esta normal e sincronisado com o servidor. +pTimeOthersPermission=\u00a7cVoc\u00ea nao esta autorisado para definir o tempo dos outros jogadores. +pTimePlayers=Estes jogadores tem seus propios hor\u00e1rios: +pTimeReset=Hor\u00e1rio do jogador foi recetado para: \u00a7e{0} +pTimeSet=Hor\u00e1rio do jogador foi definido para \u00a73{0}\u00a7f por: \u00a7e{1} +pTimeSetFixed=Hor\u00e1rio do jogador foi fixado para \u00a73{0}\u00a7f por: \u00a7e{1} +parseError=Analise de erro {0} na linha {1} +pendingTeleportCancelled=\u00a7cPedido de teleporte pendente cancelado. +permissionsError=Faltando Permissions/GroupManager; chat prefixos/sufixos serao desativados. +playerBanned=\u00a7cJogador {0} banido {1} por {2} +playerInJail=\u00a7cJogador j\u00e1 esta na cadeia {0}. +playerJailed=\u00a77Jogador {0} preso. +playerJailedFor= \u00a77Player {0} condenado por {1}. +playerKicked=\u00a7cPlayer {0} kickado {1} por {2} +playerMuted=\u00a77Voce foi desmutado +playerMutedFor=\u00a77Voce foi mutado por {0} +playerNeverOnServer=\u00a7cJogador {0} nunca esteve no servidor. +playerNotFound=\u00a7cJogador nao encontrado. +playerUnmuted=\u00a77Foi desmutado +pong=Pong! +possibleWorlds=\u00a77Mundos poss\u00edveis sao 0 at\u00e9 {0}. +powerToolAir=Comando nao pode ser definido para o ar. +powerToolAlreadySet=Comando \u00a7c{0}\u00a7f j\u00e1 esta definido para {1}. +powerToolAttach=\u00a7c{0}\u00a7f comando definido para {1}. +powerToolClearAll=Todas superferramentas foram limpas. +powerToolList={1} tem os seguintes comandos: \u00a7c{0}\u00a7f. +powerToolListEmpty={0} nenhum comando definido. +powerToolNoSuchCommandAssigned=Comando \u00a7c{0}\u00a7f nao foi definido para {1}. +powerToolRemove=Comando \u00a7c{0}\u00a7f removido do {1}. +powerToolRemoveAll=Todos comandos removidos do {0}. +powerToolsDisabled=Todas suas super ferramentas foram habilitadas. +powerToolsEnabled=Todas suas super ferramentas foram desabilitadas. +protectionOwner=\u00a76[EssentialsProtect] Dono da prote\u00e7ao: {0} +questionFormat=\u00a77[Pergunta]\u00a7f {0} +readNextPage=Digite /{0} {1} para ler a pr\u00f3xima p\u00e1gina +reloadAllPlugins=\u00a77Todos plugins recarregados. +removed=\u00a77Removido {0} entidades. +repair=Voc\u00ea reparou com sucesso sua: \u00a7e{0}. +repairAlreadyFixed=\u00a77Esse item nao precisa ser reparado. +repairEnchanted=\u00a77Voc\u00ea nao pode reparar itens encantados. +repairInvalidType=\u00a7cEsse item nao pode ser reparado. +repairNone=Nao ha itens que precisam ser reparados. +requestAccepted=\u00a77Pedido de teleporte aceito. +requestAcceptedFrom=\u00a77{0} aceitou seu pedido de teleporte. +requestDenied=\u00a77Pedido de teleporte recusado. +requestDeniedFrom=\u00a77{0} recusou seu pedido de teleporte +requestSent=\u00a77Pedindo enviado para {0}\u00a77. +requestTimedOut=\u00a7cPedido de teleporte passou o limite de tempo +requiredBukkit=* ! * Voc\u00ea precisa da ultima build {0} do CraftBukkit, baixa ela em http://dl.bukkit.org/downloads/craftbukkit/ +returnPlayerToJailError=Error occurred when trying to return player {0} to jail: {1} +second=segundo +seconds=segundos +seenOffline=Jogador {0} esta offline desde {1} +seenOnline=Jogador {0} esta online desde {1} +serverFull=O servidor esta cheio +serverTotal=Server Total: {0} +setSpawner=Spawner modificado para {0} +sheepMalformedColor=Cor malformada. +shoutFormat=\u00a77[GRITAR]\u00a7f {0} +signFormatFail=\u00a74[{0}] +signFormatSuccess=\u00a71[{0}] +signFormatTemplate=[{0}] +signProtectInvalidLocation=\u00a74Voc\u00ea nao pode criar placas aqui. +similarWarpExist=Um warp com um nome parecido j\u00e1 existe. +slimeMalformedSize=Tamanho malformado. +soloMob=Este mob gosta de ficar sozinho +spawnSet=\u00a77Ponto de spawn definido para o grupo {0}. +spawned=spawned +sudoExempt=You cannot sudo this user +sudoRun=Forcing {0} to run: /{1} {2} +suicideMessage=\u00a77Adeus mundo cruel... +suicideSuccess= \u00a77{0} tirou sua propia vida +survival=survival +takenFromAccount=\u00a7c{0} foi tirado da sua conta. +takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} +teleportAAll=\u00a77Pedido de teleporte enviado a todos os jogadores... +teleportAll=\u00a77Teleportando todos os jogadores... +teleportAtoB=\u00a77{0}\u00a77 teleportou voc\u00ea para {1}\u00a77. +teleportDisabled={0} tem o teleporte desativado. +teleportHereRequest=\u00a7c{0}\u00a7c solicitou que voc\u00ea se teleporte para ele. +teleportNewPlayerError=Falha para teleportar novo jogador +teleportRequest=\u00a7c{0}\u00a7c solicitou para se teleportar at\u00e9 voc\u00ea. +teleportRequestTimeoutInfo=\u00a77Este pedido vai acabar em {0} segundos. +teleportTop=\u00a77Teleportando para o alto. +teleportationCommencing=\u00a77Iniciando teleporte... +teleportationDisabled=\u00a77Teleporte desativado. +teleportationEnabled=\u00a77Teleporte ativado. +teleporting=\u00a77Teleportando... +teleportingPortal=\u00a77Teleportando via portal. +tempBanned=Banido temporariamente do servidor por {0} +tempbanExempt=\u00a77Voc\u00ea nao pode banir este jogador temporariamente +thunder= Voc\u00ea {0} trovejou no seu mundo +thunderDuration=Voc\u00ea {0} trovejou no seu mundo por {1} segundos. +timeBeforeHeal=Tempo at\u00e9 a proxima cura: {0} +timeBeforeTeleport=Tempo antes do proximo teleporte: {0} +timeFormat=\u00a73{0}\u00a7f or \u00a73{1}\u00a7f or \u00a73{2}\u00a7f +timePattern=(?:([0-9]+)\\s*y[a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)? +timeSet=Horario definido em todos os mundos. +timeSetPermission=\u00a7cVoc\u00ea nao tem autoriza\u00e7ao para modificar o hor\u00e1rio. +timeWorldCurrent=O hor\u00e1rio atual no mundo {0} e \u00a73{1} +timeWorldSet=O hor\u00e1rio foi definido para {0} no: \u00a7c{1} +tradeCompleted=\u00a77Compra concluida. +tradeSignEmpty=A placa de troca nao tem abastecimento suficiente. +tradeSignEmptyOwner=Nao a nada para recolher desta placa de compra. +treeFailure=\u00a7cFalha ao gerar \u00e1rvore. Tente denovo na terra ou grama. +treeSpawned=\u00a77\u00c1rvore gerada. +true=verdadeiro +typeTpaccept=\u00a77Para aceitar o teleporte, digite \u00a7c/tpaccept\u00a77. +typeTpdeny=\u00a77Para recusar o teleporte, digite \u00a7c/tpdeny\u00a77. +typeWorldName=\u00a77Voc\u00ea tambem pode digitar o nome do mundo. +unableToSpawnMob=Incapaz de gerar o mob. +unbannedIP=Endereco de IP desbanido. +unbannedPlayer=Jogador desbanido. +unignorePlayer=Agora voc\u00ea nao esta mais ignorando o {0}. +unknownItemId=ID do item desconhecido: {0} +unknownItemInList=Item desconhecido {0} em {1} lista. +unknownItemName=Nome do item desconhecido: {0} +unlimitedItemPermission=\u00a7cSem permissao para item ilimitado {0}. +unlimitedItems=Item ilimitado: +unmutedPlayer=Jogador {0} desmutado. +upgradingFilesError=Erro ao aprimorar os arquivos +userDoesNotExist=O usu\u00e1rio {0} nao existe. +userIsAway=[AFK]: {0} esta aus\u00eante. +userIsNotAway=[AFK]: {0} nao esta mais aus\u00eante. +userJailed=\u00a77Voc\u00ea foi preso, muaha! +userUsedPortal={0} usou um portal de saida existente. +userdataMoveBackError=Falha ao mover userdata/{0}.tmp para userdata/{1} +userdataMoveError=Falha ao mover userdata/{0} para userdata/{1}.tmp +usingTempFolderForTesting=Usando pasta temporaria para teste: +versionMismatch=Versao incompativel! Atualise o {0} para mesma versao. +versionMismatchAll=Versao imcompativel! Atualise todos os essentials jars para mesma versao. +voiceSilenced=\u00a77Sua voz foi silenciada +warpDeleteError=Problema ao deletar o arquivo warp. +warpListPermission=\u00a7cVoc\u00ea nao tem permissao para listar os warps. +warpNotExist=Este warp nao existe. +warpOverwrite=\u00a7cYou cannot overwrite that warp. +warpSet=\u00a77Warp {0} definido. +warpUsePermission=\u00a7cVoc\u00ea nao tem permissao para usar este warp. +warpingTo=\u00a77Warping to {0}. +warps=Warps: {0} +warpsCount=\u00a77Aqui tem {0} warps. Exibindo p\u00e1gina {1} de {2}. +weatherStorm=\u00a77Voc\u00ea modificou o tempo para chuva em {0} +weatherStormFor=\u00a77Voc\u00ea modificou o tempo para chuva em {0} por {1} segundos +weatherSun=\u00a77Voc\u00ea modificou o tempo para sol em {0} +weatherSunFor=\u00a77Voc\u00ea modificou o tempo para sol em {0} por {1} segundos +whoisBanned=\u00a79 - Banido: {0} +whoisExp=\u00a79 - Exp: {0} (Level {1}) +whoisGamemode=\u00a79 - Gamemode: {0} +whoisGeoLocation=\u00a79 - Localiza\u00e7ao: {0} +whoisGod=\u00a79 - Modo Deus: {0} +whoisHealth=\u00a79 - Sa\u00fade: {0}/20 +whoisIPAddress=\u00a79 - IP: {0} +whoisIs={0} e {1} +whoisJail=\u00a79 - Jail: {0} +whoisLocation=\u00a79 - Localiza\u00e7ao: ({0}, {1}, {2}, {3}) +whoisMoney=\u00a79 - Dinheiro: {0} +whoisOP=\u00a79 - OP: {0} +whoisStatusAvailable=\u00a79 - Estado: Dispon\u00edvel +whoisStatusAway=\u00a79 - Estado: \u00a7cAway\u00a7f +worth=\u00a77Pilha de {0} vale \u00a7c{1}\u00a77 ({2} item(s) a {3} cada) +worthMeta=\u00a77Pilha de {0} com metadados de {1} vale \u00a7c{2}\u00a77 ({3} item(s) a {4} cada) +worthSet=Definir quanto vale +year=ano +years=anos +youAreHealed=\u00a77Voc\u00ea foi curado. +youHaveNewMail=\u00a7cVoc\u00ea tem {0} mensagens!\u00a7f Digite \u00a77/mail read\u00a7f para ver seu email. -- cgit v1.2.3 From d90053c8c49f0914c833754b8c3f8e0c9af0967a Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 29 Mar 2012 18:49:56 +0100 Subject: Update TL header. --- Essentials/src/messages_cs.properties | 2 +- Essentials/src/messages_it.properties | 2 +- Essentials/src/messages_pt.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index 3f153eb48..aceb622ee 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -1,4 +1,4 @@ -#version: 2.9.1 +#version: TeamCity # Single quotes have to be doubled: '' # Translations start here # by: tomasara413 - Tento preklad neni 100% presny to se opravi v dalsich verzich prekladu diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties index 136e44eec..ee7511cb4 100644 --- a/Essentials/src/messages_it.properties +++ b/Essentials/src/messages_it.properties @@ -1,4 +1,4 @@ -#version: Dev2.9.129 +#version: TeamCity # Single quotes have to be doubled: '' # Translations start here # by: diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties index 865f103f4..c85d3fbd5 100644 --- a/Essentials/src/messages_pt.properties +++ b/Essentials/src/messages_pt.properties @@ -1,4 +1,4 @@ -#version: 2.7.2 +#version: TeamCity # Single quotes have to be doubled: '' # Translations start here # by: FurmigaHumana -- cgit v1.2.3 From c7638efc7ec0ebb781f8cec40d658e752d5bebc2 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 29 Mar 2012 21:17:50 +0100 Subject: Iaccidentally's changes to pt TL. --- Essentials/src/messages_pt.properties | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties index c85d3fbd5..674eeda1e 100644 --- a/Essentials/src/messages_pt.properties +++ b/Essentials/src/messages_pt.properties @@ -1,10 +1,10 @@ #version: TeamCity # Single quotes have to be doubled: '' # Translations start here -# by: FurmigaHumana +# by: FurmigaHumana, completed by Iaccidentally action=* {0} {1} addedToAccount=\u00a7a{0} foi adicionado a sua conta. -addedToOthersAccount=\u00a7a{0} added to {1}\u00a7a account. New balance: {2} +addedToOthersAccount=\u00a7a{0} adicionado a {1}\u00a7a saldo. Novo saldo: {2} alertBroke=Quebrou: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} em: {3} alertPlaced=Colocou: @@ -12,11 +12,11 @@ alertUsed=Usou: autoAfkKickReason=Voc\u00ea foi kickado por estar inativo a mais de {0} minutos. backAfterDeath=\u00a77Use o comando /back para voltar onde morreu. backUsageMsg=\u00a77Retornando a posi\u00e7ao anterior... -backupDisabled=An external backup script has not been configured. +backupDisabled=Um script de backup externo nao foi configurado. backupFinished=Backup conclu\u00eddo backupStarted=Backup iniciado balance=\u00a77Saldo: {0} -balanceTop=\u00a77 Top Saldos ({0}) +balanceTop=\u00a77 Saldos superiores ({0}) banExempt=\u00a7cVoc\u00ea nao pode banir este jogador. banIpAddress=\u00a77Endere\u00e7o de IP banido bannedIpsFileError=Erro ao ler o arquivo banned-ips.txt @@ -53,7 +53,7 @@ creative=creative currency={0}{1} day=dia days=dias -defaultBanReason=O Rei do Ban Falou! +defaultBanReason=O martelo proibicao falou! deleteFileError=Nao \u00e9 poss\u00edvel deletar arquivo: {0} deleteHome=\u00a77Casa {0} foi removida. deleteJail=\u00a77prisao {0} foi removida. @@ -93,7 +93,7 @@ false=falso feed=\u00a77Seu apetite foi saciado. feedOther=\u00a77Satisfeito {0}. fileRenameError=Falha ao renomear o arquivo {0}. -flyMode=\u00a77Set fly mode {0} for {1}. +flyMode=\u00a77Definir o modo de voar {0} para {1}. foreverAlone=\u00a7cVoc\u00ea nao tem ninguem a quem responder. freedMemory=Livre {0} MB. gameMode=\u00a77Gamemode {0} definido para {1}. @@ -112,9 +112,9 @@ haveBeenReleased=\u00a77Voc\u00ea foi liberado. heal=\u00a77Voc\u00ea foi curado. healOther=\u00a77Curado {0}. helpConsole=Para ver ajuda do console, digite ?. -helpFrom=\u00a77Commands from {0}: +helpFrom=\u00a77Comandos a partir de {0}: helpLine=\u00a76/{0}\u00a7f: {1} -helpMatching=\u00a77Commands matching "{0}": +helpMatching=\u00a77Comandos correspondentes "{0}": helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=P\u00e1gina \u00a7c{0}\u00a7f of \u00a7c{1}\u00a7f: helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1} @@ -136,7 +136,7 @@ invRestored=Seu invent\u00e1rio foi restaurado. invSee=Voc\u00ea v\u00ea o invent\u00e1rio de {0}. invSeeHelp=Use /invsee para voltar ao seu invent\u00e1rio. invalidCharge=\u00a7cCarga invalida. -invalidHome=Home {0} doesn't exist +invalidHome=Home {0} nao existe invalidMob=Tipo de mob inv\u00e1lido. invalidServer=Servidor inv\u00e1lido! invalidSignLine=Linha {0} da placa e inv\u00e1lida. @@ -220,7 +220,7 @@ nickOthersPermission=\u00a7cVoc\u00ea nao tem permissao para mudar o apelido dos nickSet=\u00a77Agora seu apelido \u00e9 \u00a7c{0} noAccessCommand=\u00a7cVoc\u00ea nao tem acesso a este comando. noAccessPermission=\u00a7cVoc\u00ea nao tem permissao para acessar isso {0}. -noBreakBedrock=You are not allowed to destroy bedrock. +noBreakBedrock=Voce nao tem permissao para destruir bedrock. noDestroyPermission=\u00a7cVoc\u00ea nao tem permissao para destruir isso {0}. noGodWorldWarning=\u00a7cAviso! Modo Deus neste mundo esta desativado. noHelpFound=\u00a7cNenhum comando correspondente. @@ -247,7 +247,7 @@ notRecommendedBukkit=* ! * Versao do bukkit nao \u00e9 a recomendada para o esse notSupportedYet=Ainda nao suportado. nothingInHand = \u00a7cVoc\u00ea nao tem nada em sua mao. now=agora -nuke=May death rain upon them +nuke=Pode chover a morte sobre eles numberRequired=Um numero vai aqui, bobinho. onlyDayNight=/time apenas suporta day/night. onlyPlayers=Apenas jogadores no jogo pode usar {0}. @@ -304,7 +304,7 @@ requestDeniedFrom=\u00a77{0} recusou seu pedido de teleporte requestSent=\u00a77Pedindo enviado para {0}\u00a77. requestTimedOut=\u00a7cPedido de teleporte passou o limite de tempo requiredBukkit=* ! * Voc\u00ea precisa da ultima build {0} do CraftBukkit, baixa ela em http://dl.bukkit.org/downloads/craftbukkit/ -returnPlayerToJailError=Error occurred when trying to return player {0} to jail: {1} +returnPlayerToJailError=Erro ocorreu ao tentar retornar jogador {0} para a cadeia: {1} second=segundo seconds=segundos seenOffline=Jogador {0} esta offline desde {1} @@ -322,14 +322,14 @@ similarWarpExist=Um warp com um nome parecido j\u00e1 existe. slimeMalformedSize=Tamanho malformado. soloMob=Este mob gosta de ficar sozinho spawnSet=\u00a77Ponto de spawn definido para o grupo {0}. -spawned=spawned -sudoExempt=You cannot sudo this user +spawned=desovado +sudoExempt=voce nao pode sudo este usuario sudoRun=Forcing {0} to run: /{1} {2} suicideMessage=\u00a77Adeus mundo cruel... suicideSuccess= \u00a77{0} tirou sua propia vida survival=survival takenFromAccount=\u00a7c{0} foi tirado da sua conta. -takenFromOthersAccount=\u00a7c{0} taken from {1}\u00a7c account. New balance: {2} +takenFromOthersAccount=\u00a7c{0} tirado de {1}\u00a7c conta. Novo saldo: {2} teleportAAll=\u00a77Pedido de teleporte enviado a todos os jogadores... teleportAll=\u00a77Teleportando todos os jogadores... teleportAtoB=\u00a77{0}\u00a77 teleportou voc\u00ea para {1}\u00a77. @@ -390,10 +390,10 @@ voiceSilenced=\u00a77Sua voz foi silenciada warpDeleteError=Problema ao deletar o arquivo warp. warpListPermission=\u00a7cVoc\u00ea nao tem permissao para listar os warps. warpNotExist=Este warp nao existe. -warpOverwrite=\u00a7cYou cannot overwrite that warp. +warpOverwrite=\u00a7cVoce nao pode substituir essa warp. warpSet=\u00a77Warp {0} definido. warpUsePermission=\u00a7cVoc\u00ea nao tem permissao para usar este warp. -warpingTo=\u00a77Warping to {0}. +warpingTo=\u00a77Warping para {0}. warps=Warps: {0} warpsCount=\u00a77Aqui tem {0} warps. Exibindo p\u00e1gina {1} de {2}. weatherStorm=\u00a77Voc\u00ea modificou o tempo para chuva em {0} -- cgit v1.2.3 From 1101a3243d465e7c458631640ab14c08629bde48 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 29 Mar 2012 22:32:16 +0100 Subject: Fix tpo syntax error. --- Essentials/src/com/earth2me/essentials/commands/Commandtpo.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java index 53204114e..4d7ced478 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java @@ -34,6 +34,7 @@ public class Commandtpo extends EssentialsCommand } user.sendMessage(_("teleporting")); user.getTeleport().now(player, false, TeleportCause.COMMAND); + break; default: if (!user.isAuthorized("essentials.tp.others")) -- cgit v1.2.3 From f3345247ed52880cf32f886660c714066bf7bcb5 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 30 Mar 2012 11:40:44 +0100 Subject: Reset ban reason to null on /ban , if no reason is set. --- Essentials/src/com/earth2me/essentials/commands/Commandban.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java index bc09cbba8..ca6707088 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java @@ -50,7 +50,9 @@ public class Commandban extends EssentialsCommand else { banReason = _("defaultBanReason"); + user.setBanReason(""); } + user.setBanned(true); user.kickPlayer(banReason); final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME; -- cgit v1.2.3 From e795c6ed0bb6c7bf642615d3e25c574d7d302b82 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 30 Mar 2012 13:27:57 +0100 Subject: Don't push vault version to metrics. --- .../earth2me/essentials/EssentialsPluginListener.java | 2 +- .../earth2me/essentials/metrics/MetricsStarter.java | 18 +++++++++++++----- .../earth2me/essentials/register/payment/Method.java | 7 +++++++ .../essentials/register/payment/methods/BOSE6.java | 6 ++++++ .../essentials/register/payment/methods/BOSE7.java | 6 ++++++ .../essentials/register/payment/methods/MCUR.java | 6 ++++++ .../essentials/register/payment/methods/VaultEco.java | 14 ++++++++++++-- .../essentials/register/payment/methods/iCo4.java | 8 +++++++- .../essentials/register/payment/methods/iCo5.java | 6 ++++++ .../essentials/register/payment/methods/iCo6.java | 6 ++++++ 10 files changed, 70 insertions(+), 9 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java index 11f42e701..2ec8538ca 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPluginListener.java @@ -24,7 +24,7 @@ public class EssentialsPluginListener implements Listener, IConf ess.getAlternativeCommandsHandler().addPlugin(event.getPlugin()); if (!ess.getPaymentMethod().hasMethod() && ess.getPaymentMethod().setMethod(ess.getServer().getPluginManager())) { - ess.getLogger().log(Level.INFO, "Payment method found (" + ess.getPaymentMethod().getMethod().getName() + " version: " + ess.getPaymentMethod().getMethod().getVersion() + ")"); + ess.getLogger().log(Level.INFO, "Payment method found (" + ess.getPaymentMethod().getMethod().getLongName() + " version: " + ess.getPaymentMethod().getMethod().getVersion() + ")"); } } diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index 6380b7f6c..93db9b05c 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -4,6 +4,7 @@ import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.metrics.Metrics.Graph; import com.earth2me.essentials.metrics.Metrics.Plotter; import com.earth2me.essentials.register.payment.Method; +import com.earth2me.essentials.register.payment.methods.VaultEco; import java.util.Locale; import java.util.logging.Level; @@ -150,11 +151,18 @@ public class MetricsStarter implements Runnable final Method method = ess.getPaymentMethod().getMethod(); if (method != null) { - String version = method.getVersion(); - final int dashPosition = version.indexOf('-'); - if (dashPosition > 0) - { - version = version.substring(0, dashPosition); + String version; + if (method instanceof VaultEco) { + + version = ((VaultEco)method).getEconomy(); + } + else { + version = method.getVersion(); + final int dashPosition = version.indexOf('-'); + if (dashPosition > 0) + { + version = version.substring(0, dashPosition); + } } depGraph.addPlotter(new SimplePlotter(method.getName() + " " + version)); } diff --git a/Essentials/src/com/earth2me/essentials/register/payment/Method.java b/Essentials/src/com/earth2me/essentials/register/payment/Method.java index a942667e8..c4c9d401a 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/Method.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/Method.java @@ -33,6 +33,13 @@ public interface Method * @return String Plugin name. */ public String getName(); + + /** + * Returns the reported name of this method. + * + * @return String Plugin name. + */ + public String getLongName(); /** * Returns the actual version of this method. diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java index c3b71d4e3..91537caed 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java @@ -28,6 +28,12 @@ public class BOSE6 implements Method { return "BOSEconomy"; } + + @Override + public String getLongName() + { + return getName(); + } @Override public String getVersion() diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java index d21ea6244..b112e2a30 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java @@ -28,6 +28,12 @@ public class BOSE7 implements Method { return "BOSEconomy"; } + + @Override + public String getLongName() + { + return getName(); + } @Override public String getVersion() diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java index 87d633b5c..612b07150 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java @@ -28,6 +28,12 @@ public class MCUR implements Method { return "MultiCurrency"; } + + @Override + public String getLongName() + { + return getName(); + } @Override public String getVersion() diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java index 84ce816cf..f0a8171f3 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/VaultEco.java @@ -34,8 +34,18 @@ public class VaultEco implements Method @Override public String getName() { - - return this.vault.getDescription().getName().concat(" - Economy: ").concat(economy == null ? "NoEco" : economy.getName()); + return this.vault.getDescription().getName(); + } + + public String getEconomy() + { + return economy == null ? "NoEco" : economy.getName(); + } + + @Override + public String getLongName() + { + return getName().concat(" - Economy: ").concat(getEconomy()); } @Override diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java index 52fb36e15..e505d4484 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java @@ -28,7 +28,13 @@ public class iCo4 implements Method { return "iConomy"; } - + + @Override + public String getLongName() + { + return getName(); + } + @Override public String getVersion() { diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java index 3b2fb2f6d..38e749d07 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java @@ -31,6 +31,12 @@ public class iCo5 implements Method { return "iConomy"; } + + @Override + public String getLongName() + { + return getName(); + } @Override public String getVersion() diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java index 1a2950847..b3791eef1 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java @@ -30,6 +30,12 @@ public class iCo6 implements Method { return "iConomy"; } + + @Override + public String getLongName() + { + return getName(); + } @Override public String getVersion() -- cgit v1.2.3 From 0e99b35ab26603f98142c72947cef1aad1103b15 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 30 Mar 2012 13:29:58 +0100 Subject: Formatting. --- .../src/com/earth2me/essentials/metrics/MetricsStarter.java | 7 ++++--- .../earth2me/essentials/register/payment/methods/BOSE6.java | 9 ++++----- .../earth2me/essentials/register/payment/methods/BOSE7.java | 9 ++++----- .../earth2me/essentials/register/payment/methods/MCUR.java | 8 +++----- .../earth2me/essentials/register/payment/methods/iCo4.java | 11 +++++------ .../earth2me/essentials/register/payment/methods/iCo5.java | 9 ++++----- .../earth2me/essentials/register/payment/methods/iCo6.java | 9 ++++----- 7 files changed, 28 insertions(+), 34 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index 93db9b05c..0ea692cc9 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -152,11 +152,12 @@ public class MetricsStarter implements Runnable if (method != null) { String version; - if (method instanceof VaultEco) { - + if (method instanceof VaultEco) + { version = ((VaultEco)method).getEconomy(); } - else { + else + { version = method.getVersion(); final int dashPosition = version.indexOf('-'); if (dashPosition > 0) diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java index 91537caed..a77a1d3b0 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE6.java @@ -8,9 +8,8 @@ import org.bukkit.plugin.Plugin; /** * BOSEconomy 6 Implementation of Method * - * @author Nijikokun (@nijikokun) - * @copyright (c) 2011 - * @license AOL license + * @author Nijikokun (@nijikokun) @copyright (c) 2011 @license AOL license + * */ @SuppressWarnings("deprecation") public class BOSE6 implements Method @@ -28,11 +27,11 @@ public class BOSE6 implements Method { return "BOSEconomy"; } - + @Override public String getLongName() { - return getName(); + return getName(); } @Override diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java index b112e2a30..7aab8c459 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/BOSE7.java @@ -9,9 +9,8 @@ import org.bukkit.plugin.Plugin; * BOSEconomy 7 Implementation of Method * * @author Acrobot - * @author Nijikokun (@nijikokun) - * @copyright (c) 2011 - * @license AOL license + * @author Nijikokun (@nijikokun) @copyright (c) 2011 @license AOL license + * */ public class BOSE7 implements Method { @@ -28,11 +27,11 @@ public class BOSE7 implements Method { return "BOSEconomy"; } - + @Override public String getLongName() { - return getName(); + return getName(); } @Override diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java index 612b07150..92c4f4f19 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/MCUR.java @@ -9,9 +9,7 @@ import org.bukkit.plugin.Plugin; /** * MultiCurrency Method implementation. * - * @author Acrobot - * @copyright (c) 2011 - * @license AOL license + * @author Acrobot @copyright (c) 2011 @license AOL license */ public class MCUR implements Method { @@ -28,11 +26,11 @@ public class MCUR implements Method { return "MultiCurrency"; } - + @Override public String getLongName() { - return getName(); + return getName(); } @Override diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java index e505d4484..4542f6743 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo4.java @@ -9,9 +9,8 @@ import org.bukkit.plugin.Plugin; /** * iConomy 4 Implementation of Method * - * @author Nijikokun (@nijikokun) - * @copyright (c) 2011 - * @license AOL license + * @author Nijikokun (@nijikokun) @copyright (c) 2011 @license AOL license + * */ public class iCo4 implements Method { @@ -28,13 +27,13 @@ public class iCo4 implements Method { return "iConomy"; } - + @Override public String getLongName() { - return getName(); + return getName(); } - + @Override public String getVersion() { diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java index 38e749d07..87144fa34 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo5.java @@ -12,9 +12,8 @@ import org.bukkit.plugin.Plugin; /** * iConomy 5 Implementation of Method * - * @author Nijikokun (@nijikokun) - * @copyright (c) 2011 - * @license AOL license + * @author Nijikokun (@nijikokun) @copyright (c) 2011 @license AOL license + * */ public class iCo5 implements Method { @@ -31,11 +30,11 @@ public class iCo5 implements Method { return "iConomy"; } - + @Override public String getLongName() { - return getName(); + return getName(); } @Override diff --git a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java index b3791eef1..ecd1d6aae 100644 --- a/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java +++ b/Essentials/src/com/earth2me/essentials/register/payment/methods/iCo6.java @@ -11,9 +11,8 @@ import org.bukkit.plugin.Plugin; /** * iConomy 6 Implementation of Method * - * @author Nijikokun (@nijikokun) - * @copyright (c) 2011 - * @license AOL license + * @author Nijikokun (@nijikokun) @copyright (c) 2011 @license AOL license + * */ public class iCo6 implements Method { @@ -30,11 +29,11 @@ public class iCo6 implements Method { return "iConomy"; } - + @Override public String getLongName() { - return getName(); + return getName(); } @Override -- cgit v1.2.3 From 17058c220c351deddd050995d5824e6796926a5b Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 30 Mar 2012 21:04:15 +0100 Subject: Add newish signs to default enabled commands config. --- Essentials/src/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index ec1f3fc8d..70433b5b0 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -152,8 +152,11 @@ player-commands: - signs.use.balance - signs.use.buy - signs.use.disposal + - signs.use.enchant - signs.use.free + - signs.use.gamemode - signs.use.heal + - signs.use.kit - signs.use.mail - signs.use.protection - signs.use.sell -- cgit v1.2.3 From c6f25c0df66f75b98b4c1cc8ee4f3a16bb0be417 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 30 Mar 2012 21:44:14 +0100 Subject: Minor cleanup to player events. --- .../essentials/EssentialsPlayerListener.java | 41 ++++++++++++---------- .../src/com/earth2me/essentials/ISettings.java | 4 ++- .../src/com/earth2me/essentials/Settings.java | 14 ++++++++ Essentials/src/com/earth2me/essentials/User.java | 2 +- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 36adf37e2..992c3875b 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -227,14 +227,21 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerTeleport(final PlayerTeleportEvent event) { - //TODO: Don't fetch user unless one of these features are enabled. - final User user = ess.getUser(event.getPlayer()); - //There is TeleportCause.COMMMAND but plugins have to actively pass the cause in on their teleports. - if ((event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND) && ess.getSettings().registerBackInListener()) + boolean backListener = ess.getSettings().registerBackInListener(); + boolean teleportInvulnerability = ess.getSettings().isTeleportInvulnerability(); + if (backListener || teleportInvulnerability) { - user.setLastLocation(); + final User user = ess.getUser(event.getPlayer()); + //There is TeleportCause.COMMMAND but plugins have to actively pass the cause in on their teleports. + if (backListener && (event.getCause() == TeleportCause.PLUGIN || event.getCause() == TeleportCause.COMMAND)) + { + user.setLastLocation(); + } + if (teleportInvulnerability) + { + user.enableInvulnerabilityAfterTeleport(); + } } - user.enableInvulnerabilityAfterTeleport(); } @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) @@ -309,8 +316,6 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.NORMAL) public void onPlayerInteract(final PlayerInteractEvent event) { - final User user = ess.getUser(event.getPlayer()); - user.updateActivity(true); switch (event.getAction()) { case RIGHT_CLICK_BLOCK: @@ -323,11 +328,15 @@ public class EssentialsPlayerListener implements Listener event.getPlayer().setBedSpawnLocation(event.getClickedBlock().getLocation()); } break; - case LEFT_CLICK_BLOCK: case LEFT_CLICK_AIR: - if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem())) + case LEFT_CLICK_BLOCK: + if (event.getItem() != null && event.getMaterial() != Material.AIR) { - event.setCancelled(true); + final User user = ess.getUser(event.getPlayer()); + if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getTypeId())) + { + event.setCancelled(true); + } } break; default: @@ -335,13 +344,8 @@ public class EssentialsPlayerListener implements Listener } } - private boolean usePowertools(final User user, final ItemStack is) + private boolean usePowertools(final User user, final int id) { - int id; - if (is == null || (id = is.getTypeId()) == 0) - { - return false; - } final List commandList = user.getPowertool(id); if (commandList == null || commandList.isEmpty()) { @@ -351,9 +355,8 @@ public class EssentialsPlayerListener implements Listener // We need to loop through each command and execute for (final String command : commandList) { - if (command.matches(".*\\{player\\}.*")) + if (command.contains("{player}")) { - //user.sendMessage("Click a player to use this command"); continue; } else if (command.startsWith("c:")) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index 74942640e..2c07ccd58 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -170,5 +170,7 @@ public interface ISettings extends IConf void setMetricsEnabled(boolean metricsEnabled); - public long getTeleportInvulnerability(); + long getTeleportInvulnerability(); + + boolean isTeleportInvulnerability(); } diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 9dee4e990..f63bdd335 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -382,6 +382,7 @@ public class Settings implements ISettings config.load(); noGodWorlds = new HashSet(config.getStringList("no-god-in-worlds")); enabledSigns = _getEnabledSigns(); + teleportInvulnerability = _isTeleportInvulnerability(); itemSpawnBl = _getItemSpawnBlacklist(); kits = _getKits(); chatFormats.clear(); @@ -745,10 +746,23 @@ public class Settings implements ISettings { this.metricsEnabled = metricsEnabled; } + + private boolean teleportInvulnerability; @Override public long getTeleportInvulnerability() { return config.getLong("teleport-invulnerability", 0) * 1000; } + + private boolean _isTeleportInvulnerability() + { + return (config.getLong("teleport-invulnerability", 0) > 0); + } + + @Override + public boolean isTeleportInvulnerability() + { + return teleportInvulnerability; + } } diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index f931b07d9..6e9ffdf82 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -626,7 +626,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser teleportInvulnerabilityTimestamp = 0; } } - + public boolean hasInvulnerabilityAfterTeleport() { return teleportInvulnerabilityTimestamp != 0 && teleportInvulnerabilityTimestamp >= System.currentTimeMillis(); -- cgit v1.2.3 From d72f831519d0f61951aa7d3f410f93b641b312f9 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 1 Apr 2012 02:44:11 +0100 Subject: Make sure can build checks in permbukkit/privileges work for admins/owners. --- .../src/com/earth2me/essentials/perm/PermissionsBukkitHandler.java | 2 +- Essentials/src/com/earth2me/essentials/perm/PrivilegesHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/perm/PermissionsBukkitHandler.java b/Essentials/src/com/earth2me/essentials/perm/PermissionsBukkitHandler.java index b3cc62979..aef6401d9 100644 --- a/Essentials/src/com/earth2me/essentials/perm/PermissionsBukkitHandler.java +++ b/Essentials/src/com/earth2me/essentials/perm/PermissionsBukkitHandler.java @@ -78,6 +78,6 @@ public class PermissionsBukkitHandler extends SuperpermsHandler @Override public boolean canBuild(Player base, String group) { - return base.hasPermission("essentials.build") || base.hasPermission("permissions.build"); + return hasPermission(base, "essentials.build") || hasPermission(base, "permissions.build"); } } diff --git a/Essentials/src/com/earth2me/essentials/perm/PrivilegesHandler.java b/Essentials/src/com/earth2me/essentials/perm/PrivilegesHandler.java index c81f93cbc..6cc97f30e 100644 --- a/Essentials/src/com/earth2me/essentials/perm/PrivilegesHandler.java +++ b/Essentials/src/com/earth2me/essentials/perm/PrivilegesHandler.java @@ -55,7 +55,7 @@ public class PrivilegesHandler extends SuperpermsHandler @Override public boolean canBuild(Player base, String group) { - return base.hasPermission("essentials.build") || base.hasPermission("privileges.build"); + return hasPermission(base, "essentials.build") || hasPermission(base, "privileges.build"); } } -- cgit v1.2.3 From 3f732725245955da9e3e2527a00a6150bec18044 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sun, 1 Apr 2012 03:44:37 +0100 Subject: Force remove player attachments on disconnect, and tidyup during player join in case of any errors. Fixes a bug of losing permissions. --- EssentialsGroupManager/src/Changelog.txt | 3 +- .../permissions/BukkitPermissions.java | 39 +++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index c57b050c3..c6f45bb01 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -156,4 +156,5 @@ v 1.9: - Auto rename all case sensitive world folders to lower case (if possible). - Update GlobalGroups.yml for new/changed Towny permission nodes. - Stop attempting to push empty permissions when players edit the yml's incorrectly. - - Catch errors caused by bad indentation in yml's. \ No newline at end of file + - Catch errors caused by bad indentation in yml's. + - Force remove player attachments on disconnect, and tidyup during player join in case of any errors. Fixes a bug of losing permissions. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index dc08168dc..5c711351e 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -38,6 +38,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerChangedWorldEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerKickEvent; +import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.server.PluginDisableEvent; import org.bukkit.event.server.PluginEnableEvent; import org.bukkit.permissions.Permission; @@ -342,6 +343,18 @@ public class BukkitPermissions { if (player != null) this.updatePermissions(player, null); } + + /** + * Force remove any attachments + * + * @param player + */ + private void removeAttachment(Player player) { + if (attachments.containsKey(player)) { + player.removeAttachment(attachments.get(player)); + attachments.remove(player); + } + } /** * Player events tracked to cause Superperms updates @@ -355,6 +368,12 @@ public class BukkitPermissions { public void onPlayerJoin(PlayerJoinEvent event) { setPlayer_join(true); Player player = event.getPlayer(); + + /* + * Tidy up any lose ends + */ + removeAttachment(player); + // force GM to create the player if they are not already listed. if (plugin.getWorldsHolder().getWorldData(player.getWorld().getName()).getUser(player.getName()) != null) { setPlayer_join(false); @@ -370,7 +389,25 @@ public class BukkitPermissions { @EventHandler(priority = EventPriority.LOWEST) public void onPlayerKick(PlayerKickEvent event) { - attachments.remove(event.getPlayer()); + Player player = event.getPlayer(); + + /* + * force remove any attachments as bukkit may not + */ + removeAttachment(player); + } + + @EventHandler(priority = EventPriority.LOWEST) + public void onPlayerQuit(PlayerQuitEvent event) { + if (!GroupManager.isLoaded()) + return; + + Player player = event.getPlayer(); + + /* + * force remove any attachments as bukkit may not + */ + removeAttachment(player); } } -- cgit v1.2.3 From 0e0a96b6d8ed23401ee9d7d607b12d3592127073 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 2 Apr 2012 02:22:07 +0100 Subject: Listener Cleanup --- .../earth2me/essentials/EssentialsBlockListener.java | 4 ++-- Essentials/src/com/earth2me/essentials/Settings.java | 12 +++++++++--- .../earth2me/essentials/signs/SignBlockListener.java | 20 ++++++++++---------- .../essentials/signs/SignEntityListener.java | 4 ++-- .../essentials/signs/SignPlayerListener.java | 8 ++++---- 5 files changed, 27 insertions(+), 21 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java index 17f0f1778..3423da9d0 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsBlockListener.java @@ -20,14 +20,14 @@ public class EssentialsBlockListener implements Listener @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onBlockPlace(final BlockPlaceEvent event) { - final User user = ess.getUser(event.getPlayer()); // Do not rely on getItemInHand(); - // http://leaky.bukkit.org/issues/663 + // http://leaky.bukkit.org/issues/663 final ItemStack is = Util.convertBlockToItem(event.getBlockPlaced()); if (is == null) { return; } + final User user = ess.getUser(event.getPlayer()); final boolean unlimitedForUser = user.hasUnlimited(is); if (unlimitedForUser && user.getGameMode() == GameMode.SURVIVAL) { diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index f63bdd335..7ee6a7057 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -383,6 +383,7 @@ public class Settings implements ISettings noGodWorlds = new HashSet(config.getStringList("no-god-in-worlds")); enabledSigns = _getEnabledSigns(); teleportInvulnerability = _isTeleportInvulnerability(); + disableItemPickupWhileAfk = _getDisableItemPickupWhileAfk(); itemSpawnBl = _getItemSpawnBlacklist(); kits = _getKits(); chatFormats.clear(); @@ -695,9 +696,15 @@ public class Settings implements ISettings { return config.getBoolean("register-back-in-listener", false); } + private boolean disableItemPickupWhileAfk; @Override public boolean getDisableItemPickupWhileAfk() + { + return disableItemPickupWhileAfk; + } + + private boolean _getDisableItemPickupWhileAfk() { return config.getBoolean("disable-item-pickup-while-afk", true); } @@ -746,7 +753,6 @@ public class Settings implements ISettings { this.metricsEnabled = metricsEnabled; } - private boolean teleportInvulnerability; @Override @@ -754,12 +760,12 @@ public class Settings implements ISettings { return config.getLong("teleport-invulnerability", 0) * 1000; } - + private boolean _isTeleportInvulnerability() { return (config.getLong("teleport-invulnerability", 0) > 0); } - + @Override public boolean isTeleportInvulnerability() { diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java index 8acca9804..72367e514 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java @@ -25,10 +25,10 @@ public class SignBlockListener implements Listener this.ess = ess; } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockBreak(final BlockBreakEvent event) { - if (event.isCancelled() || ess.getSettings().areSignsDisabled()) + if (ess.getSettings().areSignsDisabled()) { return; } @@ -76,10 +76,10 @@ public class SignBlockListener implements Listener return false; } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onSignChange(final SignChangeEvent event) { - if (event.isCancelled() || ess.getSettings().areSignsDisabled()) + if (ess.getSettings().areSignsDisabled()) { return; } @@ -107,10 +107,10 @@ public class SignBlockListener implements Listener } } - @EventHandler(priority = EventPriority.LOW) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onBlockPlace(final BlockPlaceEvent event) { - if (event.isCancelled() || ess.getSettings().areSignsDisabled()) + if (ess.getSettings().areSignsDisabled()) { return; } @@ -141,10 +141,10 @@ public class SignBlockListener implements Listener } } - @EventHandler(priority = EventPriority.LOW) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onBlockBurn(final BlockBurnEvent event) { - if (event.isCancelled() || ess.getSettings().areSignsDisabled()) + if (ess.getSettings().areSignsDisabled()) { return; } @@ -169,10 +169,10 @@ public class SignBlockListener implements Listener } } - @EventHandler(priority = EventPriority.LOW) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onBlockIgnite(final BlockIgniteEvent event) { - if (event.isCancelled() || ess.getSettings().areSignsDisabled()) + if (ess.getSettings().areSignsDisabled()) { return; } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java b/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java index a0446179f..8ca64869c 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java @@ -43,10 +43,10 @@ public class SignEntityListener implements Listener } } - @EventHandler(priority = EventPriority.LOW) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onEntityChangeBlock(final EntityChangeBlockEvent event) { - if (event.isCancelled() || ess.getSettings().areSignsDisabled()) + if (ess.getSettings().areSignsDisabled()) { return; } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java b/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java index f891c0fdb..75ed18500 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java @@ -20,10 +20,10 @@ public class SignPlayerListener implements Listener this.ess = ess; } - @EventHandler(priority = EventPriority.LOW) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onPlayerInteract(final PlayerInteractEvent event) { - if (event.isCancelled() || ess.getSettings().areSignsDisabled()) + if (ess.getSettings().areSignsDisabled()) { return; } @@ -33,8 +33,8 @@ public class SignPlayerListener implements Listener { return; } - final int mat = block.getTypeId(); - if (mat == Material.SIGN_POST.getId() || mat == Material.WALL_SIGN.getId()) + + if (block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { -- cgit v1.2.3 From 767703bfc9107b05f413c129457c7c30f6833d7f Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 2 Apr 2012 02:31:07 +0100 Subject: Optional second param to /gm to force gamemode on other players. --- .../essentials/commands/Commandgamemode.java | 24 +++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java index 62ace9357..aad79d616 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java @@ -24,7 +24,7 @@ public class Commandgamemode extends EssentialsCommand throw new NotEnoughArgumentsException(); } - gamemodeOtherPlayers(server, sender, args[0]); + gamemodeOtherPlayers(server, sender, args); } @Override @@ -32,7 +32,7 @@ public class Commandgamemode extends EssentialsCommand { if (args.length > 0 && !args[0].trim().isEmpty() && user.isAuthorized("essentials.gamemode.others")) { - gamemodeOtherPlayers(server, user, args[0]); + gamemodeOtherPlayers(server, user, args); return; } @@ -40,9 +40,9 @@ public class Commandgamemode extends EssentialsCommand user.sendMessage(_("gameMode", _(user.getGameMode().toString().toLowerCase(Locale.ENGLISH)), user.getDisplayName())); } - private void gamemodeOtherPlayers(final Server server, final CommandSender sender, final String name) + private void gamemodeOtherPlayers(final Server server, final CommandSender sender, final String[] args) { - for (Player matchPlayer : server.matchPlayer(name)) + for (Player matchPlayer : server.matchPlayer(args[0])) { final User player = ess.getUser(matchPlayer); if (player.isHidden()) @@ -50,7 +50,21 @@ public class Commandgamemode extends EssentialsCommand continue; } - player.setGameMode(player.getGameMode() == GameMode.SURVIVAL ? GameMode.CREATIVE : GameMode.SURVIVAL); + if (args.length > 1) + { + if (args[1].contains("creat") || args[1].equalsIgnoreCase("1")) + { + player.setGameMode(GameMode.CREATIVE); + } + else + { + player.setGameMode(GameMode.SURVIVAL); + } + } + else + { + player.setGameMode(player.getGameMode() == GameMode.SURVIVAL ? GameMode.CREATIVE : GameMode.SURVIVAL); + } sender.sendMessage(_("gameMode", _(player.getGameMode().toString().toLowerCase(Locale.ENGLISH)), player.getDisplayName())); } } -- cgit v1.2.3 From bf1e073ef4d5126b1122ad2bca05ffbc7af42359 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 2 Apr 2012 02:47:10 +0100 Subject: Allow tppos to be used in console. --- .../earth2me/essentials/commands/Commandtppos.java | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java index 226fa44e3..75910cd85 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java @@ -5,6 +5,7 @@ import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import org.bukkit.Location; import org.bukkit.Server; +import org.bukkit.command.CommandSender; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -41,4 +42,30 @@ public class Commandtppos extends EssentialsCommand user.getTeleport().teleport(location, charge, TeleportCause.COMMAND); throw new NoChargeException(); } + + @Override + public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception + { + if (args.length < 4) + { + throw new NotEnoughArgumentsException(); + } + + User user = ess.getUser(server.getPlayer(args[0])); + final int x = Integer.parseInt(args[1]); + final int y = Integer.parseInt(args[2]); + final int z = Integer.parseInt(args[3]); + final Location location = new Location(user.getWorld(), x, y, z); + if (args.length > 4) + { + location.setYaw((Float.parseFloat(args[4]) + 180 + 360) % 360); + } + if (args.length > 5) + { + location.setPitch(Float.parseFloat(args[5])); + } + sender.sendMessage(_("teleporting")); + user.sendMessage(_("teleporting")); + user.getTeleport().teleport(location, null, TeleportCause.COMMAND); + } } \ No newline at end of file -- cgit v1.2.3 From e2e51c9c95f95906ad370bee7bcf698918b9a20b Mon Sep 17 00:00:00 2001 From: ElgarL Date: Mon, 2 Apr 2012 21:12:19 +0100 Subject: Added a new permission node 'groupmanager.op'. This will cause players with this node to be treated as op's when using GroupManager commands (they will still require each commands permission node to use them). --- EssentialsGroupManager/src/Changelog.txt | 4 +++- .../src/org/anjocaido/groupmanager/GroupManager.java | 2 +- EssentialsGroupManager/src/plugin.yml | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index c6f45bb01..fd9d8ef35 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -157,4 +157,6 @@ v 1.9: - Update GlobalGroups.yml for new/changed Towny permission nodes. - Stop attempting to push empty permissions when players edit the yml's incorrectly. - Catch errors caused by bad indentation in yml's. - - Force remove player attachments on disconnect, and tidyup during player join in case of any errors. Fixes a bug of losing permissions. \ No newline at end of file + - Force remove player attachments on disconnect, and tidyup during player join in case of any errors. Fixes a bug of losing permissions. + - Added a new permission node 'groupmanager.op'. This will cause players with this node to be treated as op's when + using GroupManager commands (they will still require each commands permission node to use them). \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 09ea3b247..8bd346735 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -303,7 +303,7 @@ public class GroupManager extends JavaPlugin { senderPlayer = (Player) sender; senderUser = worldsHolder.getWorldData(senderPlayer).getUser(senderPlayer.getName()); senderGroup = senderUser.getGroup(); - isOpOverride = (isOpOverride && senderPlayer.isOp()); + isOpOverride = (isOpOverride && (senderPlayer.isOp() || worldsHolder.getWorldPermissions(senderPlayer).has(senderPlayer, "groupmanager.op"))); System.out.println("[PLAYER_COMMAND] " + senderPlayer.getName() + ": /" + commandLabel + " " + Tasks.join(args, " ")); if (isOpOverride || worldsHolder.getWorldPermissions(senderPlayer).has(senderPlayer, "groupmanager." + cmd.getName())) { diff --git a/EssentialsGroupManager/src/plugin.yml b/EssentialsGroupManager/src/plugin.yml index bf42a08c3..f7faa5896 100644 --- a/EssentialsGroupManager/src/plugin.yml +++ b/EssentialsGroupManager/src/plugin.yml @@ -163,4 +163,9 @@ commands: manclear: description: Clear world selection. Next commands will work on your world. usage: / - permissions: groupmanager.manclear \ No newline at end of file + permissions: groupmanager.manclear + +Permissions: + groupmanager.op: + description: User is treated as an op when using the GroupManager commands. + default: false \ No newline at end of file -- cgit v1.2.3 From 37370f722c5920a279c95347987b06f13be8527e Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 2 Apr 2012 22:58:07 +0100 Subject: Switch sign listeners back to compare block id, rather than materials. --- .../essentials/EssentialsPlayerListener.java | 2 +- .../essentials/signs/SignBlockListener.java | 28 ++++++++++++---------- .../essentials/signs/SignEntityListener.java | 8 +++---- .../essentials/signs/SignPlayerListener.java | 3 ++- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 992c3875b..2f97490bc 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -323,7 +323,7 @@ public class EssentialsPlayerListener implements Listener { return; } - if (event.getClickedBlock().getType() == Material.BED_BLOCK && ess.getSettings().getUpdateBedAtDaytime()) + if (event.getClickedBlock().getTypeId() == Material.BED_BLOCK.getId() && ess.getSettings().getUpdateBedAtDaytime()) { event.getPlayer().setBedSpawnLocation(event.getClickedBlock().getLocation()); } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java index 72367e514..79e5bf2be 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java @@ -19,6 +19,8 @@ public class SignBlockListener implements Listener { private final transient IEssentials ess; private final static Logger LOGGER = Logger.getLogger("Minecraft"); + private final static int WALL_SIGN = Material.WALL_SIGN.getId(); + private final static int SIGN_POST = Material.SIGN_POST.getId(); public SignBlockListener(IEssentials ess) { @@ -42,7 +44,7 @@ public class SignBlockListener implements Listener public boolean protectSignsAndBlocks(final Block block, final Player player) { final int mat = block.getTypeId(); - if (mat == Material.SIGN_POST.getId() || mat == Material.WALL_SIGN.getId()) + if (mat == SIGN_POST || mat == WALL_SIGN) { final Sign csign = (Sign)block.getState(); @@ -116,16 +118,16 @@ public class SignBlockListener implements Listener } final Block against = event.getBlockAgainst(); - if ((against.getType() == Material.WALL_SIGN - || against.getType() == Material.SIGN_POST) + if ((against.getTypeId() == WALL_SIGN + || against.getTypeId() == SIGN_POST) && EssentialsSign.isValidSign(new EssentialsSign.BlockSign(against))) { event.setCancelled(true); return; } final Block block = event.getBlock(); - if (block.getType() == Material.WALL_SIGN - || block.getType() == Material.SIGN_POST) + if (block.getTypeId() == WALL_SIGN + || block.getTypeId() == SIGN_POST) { return; } @@ -150,8 +152,8 @@ public class SignBlockListener implements Listener } final Block block = event.getBlock(); - if (((block.getType() == Material.WALL_SIGN - || block.getType() == Material.SIGN_POST) + if (((block.getTypeId() == WALL_SIGN + || block.getTypeId() == SIGN_POST) && EssentialsSign.isValidSign(new EssentialsSign.BlockSign(block))) || EssentialsSign.checkIfBlockBreaksSigns(block)) { @@ -178,8 +180,8 @@ public class SignBlockListener implements Listener } final Block block = event.getBlock(); - if (((block.getType() == Material.WALL_SIGN - || block.getType() == Material.SIGN_POST) + if (((block.getTypeId() == WALL_SIGN + || block.getTypeId() == SIGN_POST) && EssentialsSign.isValidSign(new EssentialsSign.BlockSign(block))) || EssentialsSign.checkIfBlockBreaksSigns(block)) { @@ -202,8 +204,8 @@ public class SignBlockListener implements Listener { for (Block block : event.getBlocks()) { - if (((block.getType() == Material.WALL_SIGN - || block.getType() == Material.SIGN_POST) + if (((block.getTypeId() == WALL_SIGN + || block.getTypeId() == SIGN_POST) && EssentialsSign.isValidSign(new EssentialsSign.BlockSign(block))) || EssentialsSign.checkIfBlockBreaksSigns(block)) { @@ -228,8 +230,8 @@ public class SignBlockListener implements Listener if (event.isSticky()) { final Block block = event.getBlock(); - if (((block.getType() == Material.WALL_SIGN - || block.getType() == Material.SIGN_POST) + if (((block.getTypeId() == WALL_SIGN + || block.getTypeId() == SIGN_POST) && EssentialsSign.isValidSign(new EssentialsSign.BlockSign(block))) || EssentialsSign.checkIfBlockBreaksSigns(block)) { diff --git a/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java b/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java index 8ca64869c..5a6ee177d 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignEntityListener.java @@ -24,8 +24,8 @@ public class SignEntityListener implements Listener { for (Block block : event.blockList()) { - if (((block.getType() == Material.WALL_SIGN - || block.getType() == Material.SIGN_POST) + if (((block.getTypeId() == Material.WALL_SIGN.getId() + || block.getTypeId() == Material.SIGN_POST.getId()) && EssentialsSign.isValidSign(new EssentialsSign.BlockSign(block))) || EssentialsSign.checkIfBlockBreaksSigns(block)) { @@ -52,8 +52,8 @@ public class SignEntityListener implements Listener } final Block block = event.getBlock(); - if (((block.getType() == Material.WALL_SIGN - || block.getType() == Material.SIGN_POST) + if (((block.getTypeId() == Material.WALL_SIGN.getId() + || block.getTypeId() == Material.SIGN_POST.getId()) && EssentialsSign.isValidSign(new EssentialsSign.BlockSign(block))) || EssentialsSign.checkIfBlockBreaksSigns(block)) { diff --git a/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java b/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java index 75ed18500..561d8dffc 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java @@ -34,7 +34,8 @@ public class SignPlayerListener implements Listener return; } - if (block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN) + final int mat = block.getTypeId(); + if (mat == Material.SIGN_POST.getId() || mat == Material.WALL_SIGN.getId()) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { -- cgit v1.2.3 From 183602ac28d1e195cdd71e17dc5fc26f70f3a074 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 3 Apr 2012 14:30:27 +0100 Subject: Prevent Null entries in group inheritance from throwing errors. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../org/anjocaido/groupmanager/dataholder/WorldDataHolder.java | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index fd9d8ef35..eba17517c 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -159,4 +159,5 @@ v 1.9: - Catch errors caused by bad indentation in yml's. - Force remove player attachments on disconnect, and tidyup during player join in case of any errors. Fixes a bug of losing permissions. - Added a new permission node 'groupmanager.op'. This will cause players with this node to be treated as op's when - using GroupManager commands (they will still require each commands permission node to use them). \ No newline at end of file + using GroupManager commands (they will still require each commands permission node to use them). + - Prevent Null entries in group inheritance from throwing errors. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index d7f146438..cee2ec0b8 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -563,10 +563,12 @@ public class WorldDataHolder { List inheritedList = inheritance.get(groupKey); Group thisGroup = ph.getGroup(groupKey); for (String inheritedKey : inheritedList) { - Group inheritedGroup = ph.getGroup(inheritedKey); - if (thisGroup != null && inheritedGroup != null) { - thisGroup.addInherits(inheritedGroup); - } + if (inheritedKey != null) { + Group inheritedGroup = ph.getGroup(inheritedKey); + if (thisGroup != null && inheritedGroup != null) { + thisGroup.addInherits(inheritedGroup); + } + } } } -- cgit v1.2.3 From d0f3fb4417a89f42d16c4447fec26b70f667745a Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 3 Apr 2012 15:35:13 +0100 Subject: Command cost api update: Can now set fallback costs. Repair command addition: ontop of 'repair' and 'repair-' you can now charge for 'repair-all' to charge more for /repair all or 'repair-item' to charge per item repaired. --- Essentials/src/com/earth2me/essentials/Trade.java | 21 ++++++++++++++++----- .../earth2me/essentials/commands/Commandrepair.java | 5 ++++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java index 730037d9a..3d3f36d8c 100644 --- a/Essentials/src/com/earth2me/essentials/Trade.java +++ b/Essentials/src/com/earth2me/essentials/Trade.java @@ -20,6 +20,7 @@ import org.bukkit.inventory.ItemStack; public class Trade { private final transient String command; + private final transient String fallbackCommand; private final transient Double money; private final transient ItemStack itemStack; private final transient Integer exp; @@ -27,27 +28,33 @@ public class Trade public Trade(final String command, final IEssentials ess) { - this(command, null, null, null, ess); + this(command, null, null, null, null, ess); + } + + public Trade(final String command, final String fallback, final IEssentials ess) + { + this(command, fallback, null, null, null, ess); } public Trade(final double money, final IEssentials ess) { - this(null, money, null, null, ess); + this(null, null, money, null, null, ess); } public Trade(final ItemStack items, final IEssentials ess) { - this(null, null, items, null, ess); + this(null, null, null, items, null, ess); } public Trade(final int exp, final IEssentials ess) { - this(null, null, null, exp, ess); + this(null, null, null, null, exp, ess); } - private Trade(final String command, final Double money, final ItemStack item, final Integer exp, final IEssentials ess) + private Trade(final String command, final String fallback, final Double money, final ItemStack item, final Integer exp, final IEssentials ess) { this.command = command; + this.fallbackCommand = fallback; this.money = money; this.itemStack = item; this.exp = exp; @@ -197,6 +204,10 @@ public class Trade && !user.isAuthorized("essentials.nocommandcost." + command)) { cost = ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command); + if (cost == 0.0 && fallbackCommand != null && !fallbackCommand.isEmpty()) + { + cost = ess.getSettings().getCommandCost(fallbackCommand.charAt(0) == '/' ? fallbackCommand.substring(1) : fallbackCommand); + } } return cost; } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java index 8d1278fd0..d621109f7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java @@ -53,6 +53,8 @@ public class Commandrepair extends EssentialsCommand } else if (args[0].equalsIgnoreCase("all")) { + final Trade charge = new Trade("repair-all", ess); + charge.isAffordableFor(user); final List repaired = new ArrayList(); repairItems(user.getInventory().getContents(), user, repaired); @@ -69,6 +71,7 @@ public class Commandrepair extends EssentialsCommand { user.sendMessage(_("repair", Util.joinList(repaired))); } + charge.charge(user); } else @@ -102,7 +105,7 @@ public class Commandrepair extends EssentialsCommand continue; } final String itemName = item.getType().toString().toLowerCase(Locale.ENGLISH); - final Trade charge = new Trade("repair-" + itemName.replace('_', '-'), ess); + final Trade charge = new Trade("repair-" + itemName.replace('_', '-'), "repair-item", ess); try { charge.isAffordableFor(user); -- cgit v1.2.3 From a3a3f81e1153a832f47f8b75ac4fa4c4f1589ef4 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 3 Apr 2012 16:12:49 +0100 Subject: Better hide vanished players. --- Essentials/src/com/earth2me/essentials/commands/Commandseen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index 38abb2dab..a8c3bc8cc 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -46,7 +46,7 @@ public class Commandseen extends EssentialsCommand throw new Exception(_("playerNotFound")); } player.setDisplayNick(); - sender.sendMessage(_("seenOffline", player.getDisplayName(), Util.formatDateDiff(player.getLastLogout()))); + sender.sendMessage(_("seenOffline", player.getName(), Util.formatDateDiff(player.getLastLogout()))); if (player.isBanned()) { sender.sendMessage(_("whoisBanned", show ? player.getBanReason() : _("true"))); -- cgit v1.2.3 From 195604997b6d069e11d843c891add65f23c8f794 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 4 Apr 2012 00:39:59 +0100 Subject: Enable powertools if they are disabled when setting a new tool. --- Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java index ca03364b2..679937897 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java @@ -110,6 +110,10 @@ public class Commandpowertool extends EssentialsCommand user.sendMessage(_("powerToolRemoveAll", itemName)); } + if (!user.arePowerToolsEnabled()) { + user.setPowerToolsEnabled(true); + user.sendMessage(_("powerToolsEnabled")); + } user.setPowertool(itemStack, powertools); } } -- cgit v1.2.3 From 932de333499132572983ff1cd3e05faff1cfa274 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 4 Apr 2012 00:40:58 +0100 Subject: Little bit of powertools code cleanup. --- .../essentials/commands/Commandpowertool.java | 26 ++++++++-------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java index 679937897..d1d0fb582 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java @@ -51,26 +51,18 @@ public class Commandpowertool extends EssentialsCommand { user.sendMessage(_("powerToolList", Util.joinList(powertools), itemName)); } - return; + throw new NoChargeException(); } if (command.startsWith("r:")) { - try + command = command.substring(2); + if (!powertools.contains(command)) { - command = command.substring(2); - if (!powertools.contains(command)) - { - throw new Exception(_("powerToolNoSuchCommandAssigned", command, itemName)); - } - - powertools.remove(command); - user.sendMessage(_("powerToolRemove", command, itemName)); - } - catch (Exception e) - { - user.sendMessage(e.getMessage()); - return; + throw new Exception(_("powerToolNoSuchCommandAssigned", command, itemName)); } + + powertools.remove(command); + user.sendMessage(_("powerToolRemove", command, itemName)); } else { @@ -85,7 +77,6 @@ public class Commandpowertool extends EssentialsCommand { throw new Exception(_("powerToolAlreadySet", command, itemName)); } - } else if (powertools != null && !powertools.isEmpty()) { @@ -110,7 +101,8 @@ public class Commandpowertool extends EssentialsCommand user.sendMessage(_("powerToolRemoveAll", itemName)); } - if (!user.arePowerToolsEnabled()) { + if (!user.arePowerToolsEnabled()) + { user.setPowerToolsEnabled(true); user.sendMessage(_("powerToolsEnabled")); } -- cgit v1.2.3 From e52996609afd24a9795358173c487cd9e0e67528 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 4 Apr 2012 01:18:21 +0100 Subject: Update seen to show better data for vanished users: New Perm: essentials.seen.extra - Shows some extra information for staff --- Essentials/src/com/earth2me/essentials/User.java | 4 ++++ .../com/earth2me/essentials/commands/Commandseen.java | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 6e9ffdf82..a8149e773 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -453,6 +453,10 @@ public class User extends UserData implements Comparable, IReplyTo, IUser public void setHidden(final boolean hidden) { this.hidden = hidden; + if (hidden == true) + { + setLastLogout(getLastOnlineActivity()); + } } //Returns true if status expired during this check diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index a8c3bc8cc..75f04da33 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; +import org.bukkit.Location; import org.bukkit.Server; import org.bukkit.command.CommandSender; @@ -17,16 +18,16 @@ public class Commandseen extends EssentialsCommand @Override protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { - seen(server, sender, args, true); + seen(server, sender, args, true, true); } @Override protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - seen(server, user, args, user.isAuthorized("essentials.seen.banreason")); + seen(server, user, args, user.isAuthorized("essentials.seen.banreason"), user.isAuthorized("essentials.seen.extra")); } - protected void seen(final Server server, final CommandSender sender, final String[] args, final boolean show) throws Exception + protected void seen(final Server server, final CommandSender sender, final String[] args, final boolean showBan, final boolean extra) throws Exception { if (args.length < 1) { @@ -37,6 +38,10 @@ public class Commandseen extends EssentialsCommand User player = getPlayer(server, args, 0); player.setDisplayNick(); sender.sendMessage(_("seenOnline", player.getDisplayName(), Util.formatDateDiff(player.getLastLogin()))); + if (extra) + { + sender.sendMessage(_("whoisIPAddress", player.getAddress().getAddress().toString())); + } } catch (NoSuchFieldException e) { @@ -49,7 +54,13 @@ public class Commandseen extends EssentialsCommand sender.sendMessage(_("seenOffline", player.getName(), Util.formatDateDiff(player.getLastLogout()))); if (player.isBanned()) { - sender.sendMessage(_("whoisBanned", show ? player.getBanReason() : _("true"))); + sender.sendMessage(_("whoisBanned", showBan ? player.getBanReason() : _("true"))); + } + if (extra) + { + sender.sendMessage(_("whoisIPAddress", player.getLastLoginAddress())); + final Location loc = player.getLastLocation(); + sender.sendMessage(_("whoisLocation", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); } } } -- cgit v1.2.3 From eeea16a99aece0b53a76f11a72879ce8b7a6ef5e Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 4 Apr 2012 01:55:06 +0100 Subject: Cap mute/ban/jail to 10 years (any more is silly). Cap time descriptions to 3 significant notions. --- Essentials/src/com/earth2me/essentials/Util.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index 0070a5a6a..78f31542c 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -80,11 +80,17 @@ public class Util _("second"), _("seconds") }; + int accuracy = 0; for (int i = 0; i < types.length; i++) { + if (accuracy > 2) + { + break; + } int diff = dateDiff(types[i], fromDate, toDate, future); if (diff > 0) { + accuracy++; sb.append(" ").append(diff).append(" ").append(names[i * 2 + (diff > 1 ? 1 : 0)]); } } @@ -92,7 +98,7 @@ public class Util { return "now"; } - return sb.toString(); + return sb.toString().trim(); } private static int dateDiff(int type, Calendar fromDate, Calendar toDate, boolean future) @@ -181,6 +187,10 @@ public class Util throw new Exception(_("illegalDate")); } Calendar c = new GregorianCalendar(); + if (years > 10) + { + years = 10; + } if (years > 0) { c.add(Calendar.YEAR, years * (future ? 1 : -1)); @@ -250,7 +260,7 @@ public class Util AIR_MATERIALS.add(Material.PUMPKIN_STEM.getId()); AIR_MATERIALS.add(Material.MELON_STEM.getId()); AIR_MATERIALS.add(Material.VINE.getId()); - AIR_MATERIALS.add(Material.FENCE_GATE.getId()); + AIR_MATERIALS.add(Material.FENCE_GATE.getId()); AIR_MATERIALS.add(Material.WATER_LILY.getId()); AIR_MATERIALS.add(Material.NETHER_FENCE.getId()); AIR_MATERIALS.add(Material.NETHER_WARTS.getId()); -- cgit v1.2.3 From 2b99ed9a2a6d0894ea6bf121c1bdba17e8524e47 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 4 Apr 2012 02:07:01 +0100 Subject: Catch all values greater than 10 years to avoid exploits. --- Essentials/src/com/earth2me/essentials/Util.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index 78f31542c..73817f645 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -187,10 +187,6 @@ public class Util throw new Exception(_("illegalDate")); } Calendar c = new GregorianCalendar(); - if (years > 10) - { - years = 10; - } if (years > 0) { c.add(Calendar.YEAR, years * (future ? 1 : -1)); @@ -219,6 +215,12 @@ public class Util { c.add(Calendar.SECOND, seconds * (future ? 1 : -1)); } + + Calendar max = new GregorianCalendar(); + max.add(Calendar.YEAR, 10); + if (c.after(max)) { + return max.getTimeInMillis(); + } return c.getTimeInMillis(); } // The player can stand inside these materials -- cgit v1.2.3 From 2ddd31a37d5330eefb2c844dacf97d3923c1a89b Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 4 Apr 2012 03:09:27 +0100 Subject: Report invalid enchantments in kits. Improve error logging --- Essentials/src/com/earth2me/essentials/Kit.java | 28 ++++++++++++++++++---- .../essentials/commands/Commandkillall.java | 2 +- .../earth2me/essentials/commands/Commandptime.java | 2 +- .../essentials/commands/Commandremove.java | 11 +++++---- .../essentials/commands/Commandspawnmob.java | 6 ++--- .../earth2me/essentials/commands/Commandtime.java | 2 +- .../earth2me/essentials/commands/Commandunban.java | 2 +- .../com/earth2me/essentials/signs/SignEnchant.java | 4 ++-- .../com/earth2me/essentials/signs/SignTrade.java | 2 +- 9 files changed, 40 insertions(+), 19 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index 36a2e60b0..b6363b183 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -5,6 +5,7 @@ import static com.earth2me.essentials.I18n.capitalCase; import com.earth2me.essentials.commands.NoChargeException; import com.earth2me.essentials.craftbukkit.InventoryWorkaround; import java.util.*; +import java.util.logging.Level; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.enchantments.Enchantment; @@ -31,7 +32,7 @@ public class Kit } catch (Exception ex) { - throw new Exception(_("kitError")); + throw new Exception(_("kitError"), ex); } } @@ -76,7 +77,7 @@ public class Kit catch (Exception e) { user.sendMessage(_("kitError2")); - throw new Exception(_("kitErrorHelp")); + throw new Exception(_("kitErrorHelp"),e); } } @@ -104,6 +105,10 @@ public class Kit continue; } final Enchantment enchantment = Enchantments.getByName(split[0]); + if (enchantment == null) + { + throw new Exception("Enchantment not found: " + split[0]); + } int level; if (split.length > 1) { @@ -113,7 +118,14 @@ public class Kit { level = enchantment.getMaxLevel(); } - stack.addEnchantment(enchantment, level); + try + { + stack.addEnchantment(enchantment, level); + } + catch (Exception ex) + { + throw new Exception("Enchantment " + enchantment.getName() + ": " + ex.getMessage(), ex); + } } } @@ -141,7 +153,15 @@ public class Kit catch (Exception e) { user.updateInventory(); - throw new Exception(_("kitError2")); + if (ess.getSettings().isDebug()) + { + ess.getLogger().log(Level.WARNING, e.getMessage()); + } + else + { + ess.getLogger().log(Level.WARNING, e.getMessage()); + } + throw new Exception(_("kitError2"), e); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java index c0b47d20f..a455ccc20 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java @@ -61,7 +61,7 @@ public class Commandkillall extends EssentialsCommand } catch (NumberFormatException e) { - throw new Exception(_("numberRequired")); + throw new Exception(_("numberRequired"), e); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandptime.java b/Essentials/src/com/earth2me/essentials/commands/Commandptime.java index b16cbdc34..738b8db1a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandptime.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandptime.java @@ -79,7 +79,7 @@ public class Commandptime extends EssentialsCommand } catch (NumberFormatException e) { - throw new NotEnoughArgumentsException(); + throw new NotEnoughArgumentsException(e); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandremove.java b/Essentials/src/com/earth2me/essentials/commands/Commandremove.java index d245d1239..912434f08 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandremove.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandremove.java @@ -47,7 +47,7 @@ public class Commandremove extends EssentialsCommand } catch (NumberFormatException e) { - throw new Exception(_("numberRequired")); + throw new Exception(_("numberRequired"), e); } } @@ -57,7 +57,7 @@ public class Commandremove extends EssentialsCommand } catch (IllegalArgumentException e) { - throw new NotEnoughArgumentsException(); //TODO: translate and list types + throw new NotEnoughArgumentsException(e); //TODO: translate and list types } removeEntities(user, world, toRemove, radius); @@ -84,7 +84,7 @@ public class Commandremove extends EssentialsCommand } catch (IllegalArgumentException e) { - throw new NotEnoughArgumentsException(); //TODO: translate and list types + throw new NotEnoughArgumentsException(e); //TODO: translate and list types } removeEntities(sender, world, toRemove, 0); } @@ -92,8 +92,9 @@ public class Commandremove extends EssentialsCommand protected void removeEntities(final CommandSender sender, final World world, final ToRemove toRemove, int radius) throws Exception { int removed = 0; - if (radius > 0) { - radius*=radius; + if (radius > 0) + { + radius *= radius; } for (Chunk chunk : world.getLoadedChunks()) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index fdaa0eb9e..2546a76dd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -103,7 +103,7 @@ public class Commandspawnmob extends EssentialsCommand } catch (MobException e) { - throw new Exception(_("unableToSpawnMob")); + throw new Exception(_("unableToSpawnMob"), e); } if (mountType != null) @@ -129,7 +129,7 @@ public class Commandspawnmob extends EssentialsCommand } catch (MobException e) { - throw new Exception(_("unableToSpawnMob")); + throw new Exception(_("unableToSpawnMob"), e); } spawnedMob.setPassenger(spawnedMount); } @@ -164,7 +164,7 @@ public class Commandspawnmob extends EssentialsCommand } catch (MobException e) { - throw new Exception(_("unableToSpawnMob")); + throw new Exception(_("unableToSpawnMob"), e); } spawnedMob.setPassenger(spawnedMount); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java index c49f34fbd..f22d7d01f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java @@ -49,7 +49,7 @@ public class Commandtime extends EssentialsCommand } catch (NumberFormatException e) { - throw new NotEnoughArgumentsException(); + throw new NotEnoughArgumentsException(e); } setWorldsTime(sender, worlds, ticks); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java index 8bc3ad068..dda1475d0 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java @@ -29,7 +29,7 @@ public class Commandunban extends EssentialsCommand } catch (NoSuchFieldException e) { - throw new Exception(_("playerNotFound")); + throw new Exception(_("playerNotFound"), e); } } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java b/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java index 5907442d9..a50ce967a 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java @@ -41,7 +41,7 @@ public class SignEnchant extends EssentialsSign } catch (NumberFormatException ex) { - throw new SignException(ex.getMessage()); + throw new SignException(ex.getMessage(), ex); } if (level < 1 || level > enchantment.getMaxLevel()) { @@ -57,7 +57,7 @@ public class SignEnchant extends EssentialsSign } catch (Throwable ex) { - throw new SignException(ex.getMessage()); + throw new SignException(ex.getMessage(), ex); } getTrade(sign, 3, ess); return true; diff --git a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java index 6ea4f5e80..41f9fb2a5 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java @@ -224,7 +224,7 @@ public class SignTrade extends EssentialsSign } catch (SignException e) { - throw new SignException(_("tradeSignEmpty")); + throw new SignException(_("tradeSignEmpty"), e); } } -- cgit v1.2.3 From 98b716dfbf08249350875ffe4d1fdd86e1c4d4ad Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 4 Apr 2012 03:21:14 +0100 Subject: Fix unit tests. --- .../test/com/earth2me/essentials/UtilTest.java | 82 +++++++++++----------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/Essentials/test/com/earth2me/essentials/UtilTest.java b/Essentials/test/com/earth2me/essentials/UtilTest.java index 71282a18f..2efd39e4c 100644 --- a/Essentials/test/com/earth2me/essentials/UtilTest.java +++ b/Essentials/test/com/earth2me/essentials/UtilTest.java @@ -44,67 +44,67 @@ public class UtilTest extends TestCase Calendar a, b; a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 10, 0, 1); - assertEquals(" 1 second", Util.formatDateDiff(a, b)); + assertEquals("1 second", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 10, 0, 2); - assertEquals(" 2 seconds", Util.formatDateDiff(a, b)); + assertEquals("2 seconds", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 10, 0, 3); - assertEquals(" 3 seconds", Util.formatDateDiff(a, b)); + assertEquals("3 seconds", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 10, 1, 0); - assertEquals(" 1 minute", Util.formatDateDiff(a, b)); + assertEquals("1 minute", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 10, 2, 0); - assertEquals(" 2 minutes", Util.formatDateDiff(a, b)); + assertEquals("2 minutes", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 10, 3, 0); - assertEquals(" 3 minutes", Util.formatDateDiff(a, b)); + assertEquals("3 minutes", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 11, 0, 0); - assertEquals(" 1 hour", Util.formatDateDiff(a, b)); + assertEquals("1 hour", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 12, 0, 0); - assertEquals(" 2 hours", Util.formatDateDiff(a, b)); + assertEquals("2 hours", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 13, 0, 0); - assertEquals(" 3 hours", Util.formatDateDiff(a, b)); + assertEquals("3 hours", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 2, 10, 0, 0); - assertEquals(" 1 day", Util.formatDateDiff(a, b)); + assertEquals("1 day", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 3, 10, 0, 0); - assertEquals(" 2 days", Util.formatDateDiff(a, b)); + assertEquals("2 days", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 4, 10, 0, 0); - assertEquals(" 3 days", Util.formatDateDiff(a, b)); + assertEquals("3 days", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 2, 1, 10, 0, 0); - assertEquals(" 1 month", Util.formatDateDiff(a, b)); + assertEquals("1 month", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 3, 1, 10, 0, 0); - assertEquals(" 2 months", Util.formatDateDiff(a, b)); + assertEquals("2 months", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 4, 1, 10, 0, 0); - assertEquals(" 3 months", Util.formatDateDiff(a, b)); + assertEquals("3 months", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2011, 1, 1, 10, 0, 0); - assertEquals(" 1 year", Util.formatDateDiff(a, b)); + assertEquals("1 year", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2012, 1, 1, 10, 0, 0); - assertEquals(" 2 years", Util.formatDateDiff(a, b)); + assertEquals("2 years", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2013, 1, 1, 10, 0, 0); - assertEquals(" 3 years", Util.formatDateDiff(a, b)); + assertEquals("3 years", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2011, 4, 5, 23, 38, 12); - assertEquals(" 1 year 3 months 4 days 13 hours 38 minutes 12 seconds", Util.formatDateDiff(a, b)); + assertEquals("1 year 3 months 4 days", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 9, 17, 23, 45, 45); b = new GregorianCalendar(2015, 3, 7, 10, 0, 0); - assertEquals(" 4 years 5 months 20 days 10 hours 14 minutes 15 seconds", Util.formatDateDiff(a, b)); + assertEquals("4 years 5 months 20 days", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2011, 4, 31, 10, 0, 0); b = new GregorianCalendar(2011, 4, 31, 10, 5, 0); - assertEquals(" 5 minutes", Util.formatDateDiff(a, b)); + assertEquals("5 minutes", Util.formatDateDiff(a, b)); } public void testFDDpast() @@ -112,63 +112,63 @@ public class UtilTest extends TestCase Calendar a, b; a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 9, 59, 59); - assertEquals(" 1 second", Util.formatDateDiff(a, b)); + assertEquals("1 second", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 9, 59, 58); - assertEquals(" 2 seconds", Util.formatDateDiff(a, b)); + assertEquals("2 seconds", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 9, 59, 57); - assertEquals(" 3 seconds", Util.formatDateDiff(a, b)); + assertEquals("3 seconds", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 9, 59, 0); - assertEquals(" 1 minute", Util.formatDateDiff(a, b)); + assertEquals("1 minute", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 9, 58, 0); - assertEquals(" 2 minutes", Util.formatDateDiff(a, b)); + assertEquals("2 minutes", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 9, 57, 0); - assertEquals(" 3 minutes", Util.formatDateDiff(a, b)); + assertEquals("3 minutes", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 9, 0, 0); - assertEquals(" 1 hour", Util.formatDateDiff(a, b)); + assertEquals("1 hour", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 8, 0, 0); - assertEquals(" 2 hours", Util.formatDateDiff(a, b)); + assertEquals("2 hours", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2010, 1, 1, 7, 0, 0); - assertEquals(" 3 hours", Util.formatDateDiff(a, b)); + assertEquals("3 hours", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 5, 10, 0, 0); b = new GregorianCalendar(2010, 1, 4, 10, 0, 0); - assertEquals(" 1 day", Util.formatDateDiff(a, b)); + assertEquals("1 day", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 5, 10, 0, 0); b = new GregorianCalendar(2010, 1, 3, 10, 0, 0); - assertEquals(" 2 days", Util.formatDateDiff(a, b)); + assertEquals("2 days", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 5, 10, 0, 0); b = new GregorianCalendar(2010, 1, 2, 10, 0, 0); - assertEquals(" 3 days", Util.formatDateDiff(a, b)); + assertEquals("3 days", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 5, 1, 10, 0, 0); b = new GregorianCalendar(2010, 4, 1, 10, 0, 0); - assertEquals(" 1 month", Util.formatDateDiff(a, b)); + assertEquals("1 month", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 5, 1, 10, 0, 0); b = new GregorianCalendar(2010, 3, 1, 10, 0, 0); - assertEquals(" 2 months", Util.formatDateDiff(a, b)); + assertEquals("2 months", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 5, 1, 10, 0, 0); b = new GregorianCalendar(2010, 2, 1, 10, 0, 0); - assertEquals(" 3 months", Util.formatDateDiff(a, b)); + assertEquals("3 months", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2009, 1, 1, 10, 0, 0); - assertEquals(" 1 year", Util.formatDateDiff(a, b)); + assertEquals("1 year", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2008, 1, 1, 10, 0, 0); - assertEquals(" 2 years", Util.formatDateDiff(a, b)); + assertEquals("2 years", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2007, 1, 1, 10, 0, 0); - assertEquals(" 3 years", Util.formatDateDiff(a, b)); + assertEquals("3 years", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 1, 1, 10, 0, 0); b = new GregorianCalendar(2009, 4, 5, 23, 38, 12); - assertEquals(" 8 months 26 days 10 hours 21 minutes 48 seconds", Util.formatDateDiff(a, b)); + assertEquals("8 months 26 days 10 hours", Util.formatDateDiff(a, b)); a = new GregorianCalendar(2010, 9, 17, 23, 45, 45); b = new GregorianCalendar(2000, 3, 7, 10, 0, 0); - assertEquals(" 10 years 6 months 10 days 13 hours 45 minutes 45 seconds", Util.formatDateDiff(a, b)); + assertEquals("10 years 6 months 10 days", Util.formatDateDiff(a, b)); } } -- cgit v1.2.3 From e23f491500a7d41320afa9cf1a97ef7697a88d72 Mon Sep 17 00:00:00 2001 From: ementalo Date: Wed, 4 Apr 2012 15:33:11 +0100 Subject: 1.2.5 Update Craftbukkit #2149 Bukkit ??? --- .../src/com/earth2me/essentials/Essentials.java | 2 +- lib/bukkit.jar | Bin 4715521 -> 4717318 bytes lib/craftbukkit.jar | Bin 11093197 -> 11101992 bytes 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index c3dac9b50..5a82a9fb1 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 2122; + public static final int BUKKIT_VERSION = 2149; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); diff --git a/lib/bukkit.jar b/lib/bukkit.jar index 912400ba3..54f4c9ede 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index 815d0a929..c3a206bb1 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From 5a7d733cbf741483eeaae484a9384a14ab9b7f02 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 4 Apr 2012 18:19:39 +0100 Subject: Added extra params to setHome TL key {0} world {1} x {2} y {3} z --- Essentials/src/com/earth2me/essentials/commands/Commandsethome.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java index ec19ca678..d59ac4a31 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java @@ -77,7 +77,7 @@ public class Commandsethome extends EssentialsCommand { user.setHome(); } - user.sendMessage(_("homeSet")); + user.sendMessage(_("homeSet", user.getLocation().getWorld().getName(), user.getLocation().getBlockX(), user.getLocation().getBlockY(), user.getLocation().getBlockZ())); } } -- cgit v1.2.3 From e7d1cb8bb6be78e79a4fe0e8dee81f9635f93075 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 4 Apr 2012 23:02:13 +0100 Subject: Updating plugin.yml to add sendall syntax. --- Essentials/src/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 022143b3f..459dec26f 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -203,7 +203,7 @@ commands: aliases: [strike,smite,thor,shock,elightning,estrike,esmite,ethor,eshock] mail: description: Manages inter-player, intra-server mail. - usage: / [read|clear|send [to] [message]] + usage: / [read|clear|send [to] [message]|sendall [message]] aliases: [email] me: description: Describes an action in the context of the player. -- cgit v1.2.3 From 10cb4c03b70903dbe6d6e8c412fb9e19854c5812 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 5 Apr 2012 03:22:49 +0100 Subject: Jail update, jailed people can't attack other players. --- Essentials/src/com/earth2me/essentials/Jails.java | 27 +++++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java index 00c9d8999..7353aee08 100644 --- a/Essentials/src/com/earth2me/essentials/Jails.java +++ b/Essentials/src/com/earth2me/essentials/Jails.java @@ -9,12 +9,16 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Bukkit; import org.bukkit.Location; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockDamageEvent; import org.bukkit.event.block.BlockPlaceEvent; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerRespawnEvent; @@ -38,10 +42,8 @@ public class Jails extends AsyncStorageObjectHolder Date: Thu, 5 Apr 2012 05:46:36 +0100 Subject: Added wiki names for enchantments. --- .../src/com/earth2me/essentials/Enchantments.java | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Enchantments.java b/Essentials/src/com/earth2me/essentials/Enchantments.java index 5ce10d75d..ed0051c46 100644 --- a/Essentials/src/com/earth2me/essentials/Enchantments.java +++ b/Essentials/src/com/earth2me/essentials/Enchantments.java @@ -19,47 +19,72 @@ public class Enchantments ENCHANTMENTS.put("alldamage", Enchantment.DAMAGE_ALL); ENCHANTMENTS.put("alldmg", Enchantment.DAMAGE_ALL); ENCHANTMENTS.put("sharpness", Enchantment.DAMAGE_ALL); + ENCHANTMENTS.put("arthropodsdamage", Enchantment.DAMAGE_ARTHROPODS); ENCHANTMENTS.put("ardmg", Enchantment.DAMAGE_ARTHROPODS); ENCHANTMENTS.put("baneofarthropods", Enchantment.DAMAGE_ARTHROPODS); + ENCHANTMENTS.put("undeaddamage", Enchantment.DAMAGE_UNDEAD); ENCHANTMENTS.put("smite", Enchantment.DAMAGE_UNDEAD); + ENCHANTMENTS.put("digspeed", Enchantment.DIG_SPEED); ENCHANTMENTS.put("efficiency", Enchantment.DIG_SPEED); + ENCHANTMENTS.put("durability", Enchantment.DURABILITY); ENCHANTMENTS.put("dura", Enchantment.DURABILITY); ENCHANTMENTS.put("unbreaking", Enchantment.DURABILITY); + ENCHANTMENTS.put("fireaspect", Enchantment.FIRE_ASPECT); ENCHANTMENTS.put("fire", Enchantment.FIRE_ASPECT); + ENCHANTMENTS.put("knockback", Enchantment.KNOCKBACK); + ENCHANTMENTS.put("blockslootbonus", Enchantment.LOOT_BONUS_BLOCKS); ENCHANTMENTS.put("fortune", Enchantment.LOOT_BONUS_BLOCKS); + ENCHANTMENTS.put("mobslootbonus", Enchantment.LOOT_BONUS_MOBS); ENCHANTMENTS.put("mobloot", Enchantment.LOOT_BONUS_MOBS); ENCHANTMENTS.put("looting", Enchantment.LOOT_BONUS_MOBS); + ENCHANTMENTS.put("oxygen", Enchantment.OXYGEN); ENCHANTMENTS.put("respiration", Enchantment.OXYGEN); + ENCHANTMENTS.put("protection", Enchantment.PROTECTION_ENVIRONMENTAL); ENCHANTMENTS.put("prot", Enchantment.PROTECTION_ENVIRONMENTAL); - ENCHANTMENTS.put("explosionsprotection", Enchantment.PROTECTION_EXPLOSIONS); + + ENCHANTMENTS.put("explosionsprotection", Enchantment.PROTECTION_EXPLOSIONS); ENCHANTMENTS.put("expprot", Enchantment.PROTECTION_EXPLOSIONS); ENCHANTMENTS.put("blastprotection", Enchantment.PROTECTION_EXPLOSIONS); + ENCHANTMENTS.put("fallprotection", Enchantment.PROTECTION_FALL); ENCHANTMENTS.put("fallprot", Enchantment.PROTECTION_FALL); + ENCHANTMENTS.put("featherfall", Enchantment.PROTECTION_FALL); ENCHANTMENTS.put("featherfalling", Enchantment.PROTECTION_FALL); + ENCHANTMENTS.put("fireprotection", Enchantment.PROTECTION_FIRE); ENCHANTMENTS.put("fireprot", Enchantment.PROTECTION_FIRE); + ENCHANTMENTS.put("projectileprotection", Enchantment.PROTECTION_PROJECTILE); ENCHANTMENTS.put("projprot", Enchantment.PROTECTION_PROJECTILE); + ENCHANTMENTS.put("silktouch", Enchantment.SILK_TOUCH); + ENCHANTMENTS.put("waterworker", Enchantment.WATER_WORKER); ENCHANTMENTS.put("aquaaffinity", Enchantment.WATER_WORKER); + ENCHANTMENTS.put("firearrow", Enchantment.ARROW_FIRE); + ENCHANTMENTS.put("flame", Enchantment.ARROW_FIRE); + ENCHANTMENTS.put("arrowdamage", Enchantment.ARROW_DAMAGE); + ENCHANTMENTS.put("power", Enchantment.ARROW_DAMAGE); + ENCHANTMENTS.put("arrowknockback", Enchantment.ARROW_KNOCKBACK); ENCHANTMENTS.put("arrowkb", Enchantment.ARROW_KNOCKBACK); + ENCHANTMENTS.put("punch", Enchantment.ARROW_KNOCKBACK); + ENCHANTMENTS.put("infinitearrows", Enchantment.ARROW_INFINITE); ENCHANTMENTS.put("infarrows", Enchantment.ARROW_INFINITE); + ENCHANTMENTS.put("infinity", Enchantment.ARROW_INFINITE); } public static Enchantment getByName(String name) { -- cgit v1.2.3 From 381886245b7070e989acb12442a8aa6f6f1d5009 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Thu, 5 Apr 2012 12:54:26 +0100 Subject: Update to 2.0 Fix GM reporting of permission inheritance to retain the correct order. Lower inheritance groups can no longer negate a higher groups permissions. --- EssentialsGroupManager/src/Changelog.txt | 4 ++- .../permissions/AnjoPermissionsHandler.java | 30 ++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index eba17517c..a636ac6fe 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -160,4 +160,6 @@ v 1.9: - Force remove player attachments on disconnect, and tidyup during player join in case of any errors. Fixes a bug of losing permissions. - Added a new permission node 'groupmanager.op'. This will cause players with this node to be treated as op's when using GroupManager commands (they will still require each commands permission node to use them). - - Prevent Null entries in group inheritance from throwing errors. \ No newline at end of file + - Prevent Null entries in group inheritance from throwing errors. +v 2.0: + - Fix GM reporting of permission inheritance to retain the correct order. Lower inheritance groups can no longer negate a higher groups permissions. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index 6b6ae58ea..08240441d 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java @@ -144,7 +144,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { // Perm doesn't already exists and there is no negation for it // or It's a negated perm where a normal perm doesn't exists (don't allow inheritance to negate higher perms) if ((!negated && !playerPermArray.contains(perm) && !playerPermArray.contains("-" + perm)) - || (negated && !playerPermArray.contains(perm.substring(1)))) + || (negated && !playerPermArray.contains(perm.substring(1)) && !playerPermArray.contains("-" + perm))) playerPermArray.add(perm); } } @@ -164,20 +164,17 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { if (perms.contains("*")) { permArray.addAll(GroupManager.BukkitPermissions.getAllRegisteredPermissions(includeChildren)); allPerms = true; + perms.remove("*"); } for (String perm : perms) { - - if (!perm.equalsIgnoreCase("*")) { - + /** * all permission sets are passed here pre-sorted, alphabetically. * This means negated nodes will be processed before all permissions * other than *. */ - boolean negated = false; - if (perm.startsWith("-")) - negated = true; + boolean negated = perm.startsWith("-"); if (!permArray.contains(perm)) { permArray.add(perm); @@ -195,15 +192,16 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { Map children = GroupManager.BukkitPermissions.getAllChildren((negated ? perm.substring(1) : perm), new HashSet()); if (children != null) { - if (negated || (negated && allPerms)) { + if (negated) + if (allPerms) { - // Remove children of negated nodes - for (String child : children.keySet()) - if (children.get(child)) - if (permArray.contains(child)) - permArray.remove(child); + // Remove children of negated nodes + for (String child : children.keySet()) + if (children.get(child)) + if (permArray.contains(child)) + permArray.remove(child); - } else if (!negated){ + } else { // Add child nodes for (String child : children.keySet()) @@ -214,7 +212,6 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { } } } - } } return permArray; @@ -959,7 +956,8 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { for (String sonName : now.getInherits()) { Group son = ph.getGroup(sonName); if (son != null && !alreadyVisited.contains(son)) { - stack.push(son); + // Add rather than push to retain inheritance order. + stack.add(son); alreadyVisited.add(son); } } -- cgit v1.2.3 From aa437030945a59a0cbfe7d940f36135e40072b30 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 5 Apr 2012 13:28:23 +0100 Subject: Fixing up NPE bug in jails (implemented in Dev2.9.163) --- Essentials/src/com/earth2me/essentials/Jails.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java index 7353aee08..0aa90e08c 100644 --- a/Essentials/src/com/earth2me/essentials/Jails.java +++ b/Essentials/src/com/earth2me/essentials/Jails.java @@ -221,10 +221,13 @@ public class Jails extends AsyncStorageObjectHolder Date: Thu, 5 Apr 2012 15:02:08 +0100 Subject: Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index a636ac6fe..c5fe5564d 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -162,4 +162,5 @@ v 1.9: using GroupManager commands (they will still require each commands permission node to use them). - Prevent Null entries in group inheritance from throwing errors. v 2.0: - - Fix GM reporting of permission inheritance to retain the correct order. Lower inheritance groups can no longer negate a higher groups permissions. \ No newline at end of file + - Fix GM reporting of permission inheritance to retain the correct order. Lower inheritance groups can no longer negate a higher groups permissions. + - Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index 08240441d..b40694bb0 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java @@ -155,8 +155,10 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { return playerPermArray; } - private Set populatePerms (List perms, boolean includeChildren) { + private Set populatePerms (List permsList, boolean includeChildren) { + // Create a new array so it's modifiable. + List perms = new ArrayList(permsList); Set permArray = new HashSet(); Boolean allPerms = false; -- cgit v1.2.3 From bd7af593e7e77df0d59f32cf5b3b7d4170682af3 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Thu, 5 Apr 2012 21:06:48 +0100 Subject: Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it). --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../anjocaido/groupmanager/permissions/BukkitPermissions.java | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index c5fe5564d..2cfe57f62 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -163,4 +163,5 @@ v 1.9: - Prevent Null entries in group inheritance from throwing errors. v 2.0: - Fix GM reporting of permission inheritance to retain the correct order. Lower inheritance groups can no longer negate a higher groups permissions. - - Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions. \ No newline at end of file + - Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions. + - Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it). \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index 5c711351e..6df18cb05 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -351,7 +351,14 @@ public class BukkitPermissions { */ private void removeAttachment(Player player) { if (attachments.containsKey(player)) { - player.removeAttachment(attachments.get(player)); + try { + player.removeAttachment(attachments.get(player)); + } catch (IllegalArgumentException e) { + /* + * Failed to remove attachment + * This usually means Bukkit no longer know of it. + */ + } attachments.remove(player); } } -- cgit v1.2.3 From 21ef83c0ff5c782166842c4cb102c2fdfcb12ca8 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 6 Apr 2012 07:33:10 +1000 Subject: Add polish translation, thanks losdamianos --- Essentials/src/messages_pl.properties | 423 ++++++++++++++++++++++++++++++++++ 1 file changed, 423 insertions(+) create mode 100644 Essentials/src/messages_pl.properties diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties new file mode 100644 index 000000000..a0865b768 --- /dev/null +++ b/Essentials/src/messages_pl.properties @@ -0,0 +1,423 @@ +#version: Dev2.9.145 +# Single quotes have to be doubled: '' +# Translations start here +# by: losdamianos +action=* {0} {1} +addedToAccount=\u00a7a{0} zostalo dodane do twojego konta. +addedToOthersAccount=\u00a7a{0} dodane do konta {1}\u00a7. Nowy stan konta: {2}. +alertBroke=broke: +alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} +alertPlaced=postawil: +alertUsed=uzyl: +autoAfkKickReason=Zostales wyrzucony z serwera za pozostawanie bez ruchu przez wiecej niz {0} minut. +backAfterDeath=\u00a77Uzyj komendy /back aby powrocic na miejsce swojej smierci. +backUsageMsg=\u00a77Transportowanie do poprzedniej lokacji. +backupDisabled=Zewnetrzny skrypt backupu nie zostal skonfigurowany. +backupFinished=Backup zakonczony. +backupStarted=Backup rozpoczety. +balance=\u00a77Stan konta: {0} +balanceTop=\u00a77Najbogatsi gracze ({0}) +banExempt=\u00a7cNie mozesz zbanowac tego gracza. +banIpAddress=\u00a77Zbanowano adress IP +bannedIpsFileError=Blad odczytu banned-ips.txt +bannedIpsFileNotFound=banned-ips.txt nie znaleziony +bannedPlayersFileError=Blad odczytu banned-players.txt +bannedPlayersFileNotFound=banned-players.txt nie znaleziony +bigTreeFailure=\u00a7cGenerator duzych drzew zaliczyl blad. Sprobuj ponownie na ziemi lub trawie. +bigTreeSuccess= \u00a77Utworzono duze drzewo. +blockList=Essentials relayed the following commands to another plugin: +broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0} +buildAlert=\u00a7cNie mozesz tu budowac +bukkitFormatChanged=Format wersji Bukkita jest zmieniony. Wersja nie jest sprawdzana. +burnMsg=\u00a77Podpaliles {0} na {1} sekund. +canTalkAgain=\u00a77Znow mozesz mowic. +cantFindGeoIpDB=Nie mozna znalezc bazy danych GeoIP! +cantReadGeoIpDB=Odczytywanie bazy danych GeoIP zawiodlo! +cantSpawnItem=\u00a7cNie mozesz stworzyc przedmiotu {0}. +chatTypeLocal=[L] +chatTypeSpy=[Spy] +commandFailed=Komenda {0} zawiodla. +commandHelpFailedForPlugin=Blad podczas uzyskiwania pomocy dla: {0} +commandNotLoaded=\u00a7cKomenda {0} jest zaladowana nieprawidlowo.. +compassBearing=\u00a77Bearing: {0} ({1} degrees). +configFileMoveError=Failed to move config.yml to backup location. +configFileRenameError=Failed to rename temp file to config.yml +connectedPlayers=Obecni gracze: +connectionFailed=Blad podczas otwierania polaczenia. +cooldownWithMessage=\u00a7cCooldown: {0} +corruptNodeInConfig=\u00a74Notice: Your configuration file has a corrupt {0} node. +couldNotFindTemplate=Could not find template {0} +creatingConfigFromTemplate=Creating config from template: {0} +creatingEmptyConfig=Stworzono pusty config: {0} +creative=Tworczy +currency={0}{1} +day=dzien +days=dnie +defaultBanReason=Admin ma zawsze racje! +deleteFileError=Nie mozna usunac pliku: {0} +deleteHome=\u00a77Posterunek {0} zostal usuniety +deleteJail=\u00a77Wiezienie {0} zostalo usuniete +deleteWarp=\u00a77Warp {0} zostal usuniety +deniedAccessCommand={0} nie ma dostepu do tego polecenia +dependancyDownloaded=[Essentials] Zaleznosci {0} pobrane prawidlowo. +dependancyException=[Essentials] Wystapil blad w trakcie pobierania zaleznosci. +dependancyNotFound=[Essentials] Wymagana zaleznosc nie zostala znaleziona, pobieranie. +depth=\u00a77Jestes na poziomie morza. +depthAboveSea=\u00a77Jestes {0} blok(ow) nad poziomem morza. +depthBelowSea=\u00a77Jestes {0} blok(ow) pod poziomem morza. +destinationNotSet=Cel nieokreslony. +disableUnlimited=\u00a77Wylaczone nieograniczone tworzenia {0} dla {1}. +disabled=wylaczone +disabledToSpawnMob=Tworzenie tego moba zostalo wylaczone w pliku config. +dontMoveMessage=\u00a77Teleportacja nastapi za {0}. Prosze sie nie ruszac. +downloadingGeoIp=Pobieranie bazy danych GeoIP... To moze zajac chwile (wioska: 0.6 MB, miasto: 20MB) +duplicatedUserdata=Kopiowanie danych uzytkownika: {0} i {1} +enableUnlimited=\u00a77Przyznano nielimitowane zasoby {0} dla {1}. +enabled=wlaczone +enchantmentApplied = \u00a77Ulepszenie {0} zostalo przyznane przedmiotowi w twoim reku. +enchantmentNotFound = \u00a7cUlepszenie nie odnalezione +enchantmentPerm = \u00a7cNie masz zezwolenia na {0}. +enchantmentRemoved = \u00a77Ulepszenie {0} zostalo usuniete z przedmiotu w twoim reku.. +enchantments = \u00a77Ulepszenia: {0} +errorCallingCommand=Blad wywolywania komendy /{0} +errorWithMessage=\u00a7cBlad: {0} +essentialsHelp1=Plik jest uszkodzony i Essentials nie moze go otworzyc. Essentials jest teraz wylaczone. Jesli nie mozesz samemu naprawic pliku, idz do adresu http://tiny.cc/EssentialsChat +essentialsHelp2=Plik jest uszkodzony i Essentials nie moze go otworzyc. Essentials jest teraz wylaczone. Jesli nie mozesz samemu naprawic pliku, wpisz /essentialshelp w grze lub idz do adresu http://tiny.cc/EssentialsChat +essentialsReload=\u00a77Essentials przeladowalo {0}. +extinguish=\u00a77Zostales ugaszony. +extinguishOthers=\u00a77Ugasiles {0}. +failedToCloseConfig=Blad podczas zamykania configu {0} +failedToCreateConfig=Blad podczas tworzenia configu {0} +failedToWriteConfig=Blad podczas pisania configu {0} +false=falsz +feed=\u00a77Twoj glod zostal zaspokojony. +feedOther=\u00a77Nakarmiono {0}. +fileRenameError=Blad podczas zmiany nazwy pliku “{0}”. +flyMode=\u00a77Latanie {0} dla {1}. +foreverAlone=\u00a7cNie masz komu odpisac. +freedMemory=Zwolniono {0} MB. +gameMode=\u00a77Ustawiono tryb gry {0} dla {1}. +gcchunks= chunki +gcentities= jednostki +gcfree=Wolna pamiec: {0} MB +gcmax=Maksymalna pamiec: {0} MB +gctotal=Alokowana pamiec: {0} MB +geoIpUrlEmpty=Url pobierania GeoIP jest puste. +geoIpUrlInvalid=Url pobierania GeoIP jest nieprawidlowe. +geoipJoinFormat=Gracz {0} przybyl z {1} +godDisabledFor=Godmode wylaczony dla {0}. +godEnabledFor=Godmode wlaczony dla {0}. +godMode=\u00a77Godmode {0}. +haveBeenReleased=\u00a77Zostales wypuszczony. +heal=\u00a77Uleczony +healOther=\u00a77Uleczono {0}. +helpConsole=Aby uzyskac pomoc z konsoli, wpisz “????. +helpFrom=\u00a77Komendy od {0}: +helpLine=\u00a76/{0}\u00a7f: {1} +helpMatching=\u00a77Komendy odpowiadajace "{0}": +helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} +helpPages=Strona \u00a7c{0}\u00a7f z \u00a7c{1}\u00a7f: +helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1} +holeInFloor=Czarna dziura +homeSet=\u00a77Posterunek ustawiono +homeSetToBed=\u00a77Twoj posterunek znajduje sie teraz w tym lozku. +homes=Posterunki: {0} +hour=godzina +hours=godziny +ignorePlayer=Od tej chwili ignorujesz gracza {0}. +illegalDate=Illegal date format. +infoChapter=Wybierz rozdzial: +infoChapterPages=Rozdzial {0}, strona \u00a7c{1}\u00a7f z \u00a7c{2}\u00a7f: +infoFileDoesNotExist=Plik “info.txt” nie istnieje. Tworzenie tego pliku. +infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Page \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- +infoUnknownChapter=Nieznany rozdzial. +invBigger=Ekwipunek innego gracza jest wiekszy niz Twoj. +invRestored=Twoj ekwipunek zostal przywrocony. +invSee=Widzisz ekwipunek {0}. +invSeeHelp=Wpisz /invsee aby przywrocic swoj ekwipunek. +invalidCharge=\u00a7cInvalid charge. +invalidHome=Posterunek {0} nie istnieje. +invalidMob=Niepoprawny typ moba.. +invalidServer=Niepoprawny serwer! +invalidSignLine=Linijka {0} na znaku jest bledna. +invalidWorld=\u00a7cNieprawidlowy swiat. +inventoryCleared=\u00a77Ekwipunek oprozniony. +inventoryClearedOthers=\u00a77Ekwipunek \u00a7c{0}\u00a77 oprozniony. +is=jest +itemCannotBeSold=Nie mozesz sprzedac tego przedmiotu do serwera. +itemMustBeStacked=Przedmiotem handluje sie w stackach. Wielkosc 2s to dwa stacki itd. +itemNotEnough1=\u00a7cMasz za malo tego przedmiotu, aby go sprzedac. +itemNotEnough2=\u00a77Jesli chcesz sprzedac wszystkie przedmioty tego typu, wpisz /sell nazwaprzedmiotu +itemNotEnough3=\u00a77/sell nazwaprzedmiotu -1 sprzeda cala ilosc przedmiotu poza 1 sztuka itd. +itemSellAir=Serio probujesz sprzedac powietrze? Miej w reku przedmiot.. +itemSold=\u00a77Sprzedamo za \u00a7c{0} \u00a77({1} {2} po {3} kazdy) +itemSoldConsole={0} Sprzedano {1} za \u00a77{2} \u00a77({3} sztuki po {4} kazda) +itemSpawn=\u00a77Otrzymywanie {0} {1} +itemsCsvNotLoaded=Nie mozna wczytac items.csv. +jailAlreadyIncarcerated=\u00a7cTen gracz jest juz w wiezieniu “{0}”. +jailMessage=\u00a7cZa kazde przewinienie czeka kara. +jailNotExist=Nie ma takiego wiezienia.. +jailReleased=\u00a77Gracz \u00a7e{0}\u00a77 wypuszczony z wiezienia. +jailReleasedPlayerNotify=\u00a77Zostales zwolniony! +jailSentenceExtended=Czas pobyty w wiezieniu zwiekszony do: {0) +jailSet=\u00a77Zostalo stworzone wiezienie “{0}”. +jumpError=That would hurt your computer''s brain. +kickDefault=Zostales wyproszony z serwera. +kickExempt=\u00a7cNie mozesz wyprosic tej osoby. +kill=\u00a77Zabito {0}. +kitError2=\u00a7cTen zestaw nie istnieje lub zostal zle zdefininowany. +kitError=\u00a7cNie ma prawidlowych zestawow. +kitErrorHelp=\u00a7cByc moze przedmiotowi brakuje ilosci w konfiguracji? +kitGive=\u00a77Przydzielanie zestawu {0}. +kitInvFull=\u00a7cTwoj ekwipuek jest pelen, wykladanie zestawu na podloge. +kitTimed=\u00a7cNie mozesz uzyc tego zestawu przez kolejne {0}. +kits=\u00a77Zestawy: {0} +lightningSmited=\u00a77Zostales zdzielony piorunem. +lightningUse=\u00a77Uderzanie piorunem {0}. +listAfkTag = \u00a77[AFK]\u00a7f +listAmount = \u00a79Na serwerze jest \u00a7c{0}\u00a79 graczy z maksimum \u00a7c{1}\u00a79 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=Blad przy wczytywaniu Warpu {0} +localFormat=Local: <{0}> {1} +mailClear=\u00a7cAby oczyscic skrzynke, wpisz /mail clear +mailCleared=\u00a77Skrzynka oprozniona!! +mailSent=\u00a77Wiadomosc wyslana! +markMailAsRead=\u00a7cAby oczyscic skrzynke, wpisz /mail clear +markedAsAway=\u00a77Zostales oznaczony jako nieobecny. +markedAsNotAway=\u00a77Juz nie jestes nieobecny. +maxHomes=Nie mozesz ustawic wiecej niz {0} posterunkow. +mayNotJail=\u00a7cNie mozesz wtracic do wiezienia tej osoby. +me=ja +minute=minuta +minutes=minuty +missingItems=Nie masz {0}x{1}. +missingPrefixSuffix=Missing a prefix or suffix for {0} +mobSpawnError=Blad podczas zmiany spawnera. +mobSpawnLimit=Ilosc mobow ograniczona do limitu serwera. +mobSpawnTarget=Blok musi byc spawnerem. +mobsAvailable=\u00a77Moby: {0} +moneyRecievedFrom=\u00a7a{0} otrzymane od {1} +moneySentTo=\u00a7a{0} zostalo wyslane do {1} +moneyTaken={0} zostalo zabrane z Twoich funduszy.. +month=miesiac +months=miesiecy +moreThanZero=Ilosc musi byc wieksza od 0. +msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} +muteExempt=\u00a7cNie mozesz wyciszyc tego gracza.. +mutedPlayer=Player {0} wyciszony. +mutedPlayerFor=Player {0} wyciszony na {1}. +mutedUserSpeaks={0} probowal sie odezwac, ale jest wyciszony. +nearbyPlayers=Gracze w poblizu: {0} +negativeBalanceError=Gracz nie moze miec ujemnego stanu konta. +nickChanged=Nick zmieniony. +nickDisplayName=\u00a77Musisz wlaczyc “change-displayname” w configu Essential. +nickInUse=\u00a7cTen nick jest juz w uzyciu. +nickNamesAlpha=\u00a7cNicki musza byc alfanumeryczne. +nickNoMore=\u00a77Nie masz juz nicku. +nickOthersPermission=\u00a7cNie masz uprawnienia do zmiany nicku innym. +nickSet=\u00a77Twoj nick od teraz to \u00a7c{0} +noAccessCommand=\u00a7cNie masz dostepu do tej komendy. +noAccessPermission=\u00a7cNie masz uprawnien do dostepu do {0}. +noBreakBedrock=Nie masz uprawnien do niszczenia bedrocka. +noDestroyPermission=\u00a7cNie masz uprawnien do niszczenia {0}. +noGodWorldWarning=\u00a7cUwaga! Godmode wylaczony w tym swiecie!. +noHelpFound=\u00a7cNie ma odpowiadajacych komend. +noHomeSet=Nie masz ustawionego posterunku. +noHomeSetPlayer=Gracz nie ma ustawionego posterunku. +noKitPermission=\u00a7cMusisz posiadac uprawnienia \u00a7c{0}\u00a7c aby uzywac tego zestawu. +noKits=\u00a77Nie ma jeszcze dostepnych zestawow. +noMail=Nie masz zadnych wiadomosci. +noMotd=\u00a7cNie ma wiadomosci dnia.. +noNewMail=\u00a77Nie masz zadnych nowych wiadomosci. +noPendingRequest=You do not have a pending request. +noPerm=\u00a7cNie masz uprawnien \u00a7f{0}. +noPermToSpawnMob=\u00a7cNie masz uprawnien do tworzenia tego moba.. +noPlacePermission=\u00a7cNie masz uprawnien do stawiania bloku kolo tego znaku.. +noPowerTools=Nie masz przypisanego zadnego power tool. +noRules=\u00a7cNie ustalono jeszcze zadnych zasad. +noWarpsDefined=Nie ma zadnych warpow. +none=zaden +notAllowedToQuestion=\u00a7cNie mozesz zadac tego pytania. +notAllowedToShout=\u00a7cNie mozesz krzyczec.. +notEnoughExperience=Nie masz wystarczajaco duzo doswiadczenia. +notEnoughMoney=Nie masz tyle pieniedzy. +notRecommendedBukkit= * ! * Wersja Bukkita nie jest rekomendowana wersja dla Essentials. +notSupportedYet=Jeszcze nie wspierane. +nothingInHand = \u00a7cNie masz nic w reku.. +now=teraz +nuke=Niech smierc pochlonie caly swiat! +numberRequired=Tutaj powinna byc liczba, gluptasie. +onlyDayNight=/time obsluguje tylko day/night. +onlyPlayers=Tylko gracze w grze moga uzywac {0}. +onlySunStorm=/weather obsluguje tylko sun/storm. +orderBalances=Ordering balances of {0} users, please wait ... +pTimeCurrent=Czas \u00a7e{0} u00a7f to {1}. +pTimeCurrentFixed=Czas \u00a7e{0}\u00a7f przywrocony do {1}. +pTimeNormal=Czas \u00a7e{0}'s\u00a7f jest normalny i odpowiada serwerowemu. +pTimeOthersPermission=\u00a7cNie masz uprawnien do zmiany czasu innym. +pTimePlayers=Ci gracze beda miec wlasny czas: +pTimeReset=Czas gracza zostal zresetowany dla \u00a7e{0} +pTimeSet=Czas gracza ustawiony na \u00a73{0}\u00a7f dla \u00a7e{1} +pTimeSetFixed=Czas gracza przywrocony do \u00a73{0}\u00a7f dla \u00a7e{1} +parseError=Blad skladniowy {0} w linii {1}. +pendingTeleportCancelled=\u00a7cOczekujace zapytanie teleportacji odrzucone. +permissionsError=Brakuje Permissions/GroupManager; prefixy/suffixy czatu zostana wylaczone. +playerBanned=\u00a7c{0} zbanowal {1} za {2}. +playerInJail=\u00a7cGracz jest juz w wiezieniu “{0}”. +playerJailed=\u00a77Gracz {0} wtracony do wiezienia. +playerJailedFor= \u00a77Gracz {0} wtracony do wiezienia na {1}. +playerKicked=\u00a7c{0} wywalil {1} za {2}. +playerMuted=\u00a77Zostales wyciszony. +playerMutedFor=\u00a77Zostales wyciszony na {0}. +playerNeverOnServer=\u00a7cGracz {0} nigdy nie byl na tym serwerze. +playerNotFound=\u00a7cNie odnaleziono gracza. +playerUnmuted=\u00a77Zostales przywrocony do glosu. +pong=Pong! +possibleWorlds=\u00a77Mozliwe swiaty maja numery od 0 do {0}. +powerToolAir=Nie zartuj, chcesz przypisac polecenie do powietrza? +powerToolAlreadySet=Polecenie \u00a7c{0}\u00a7f jest juz przypisane do {1}. +powerToolAttach=\u00a7c{0}\u00a7f polecenie przypisane do {1}. +powerToolClearAll=Wszystkie przypisane polecenia zostaly usuniete! +powerToolList={1} zawiera nastepujace polecenia: \u00a7c{0}\u00a7f. +powerToolListEmpty={0} nie ma przypisanych polecen. +powerToolNoSuchCommandAssigned=Polecenie \u00a7c{0}\u00a7f nie moze byc przypisane do {1}. +powerToolRemove=Polecenie \u00a7c{0}\u00a7f usuniete z {1}. +powerToolRemoveAll=Wszystkie polecenia zostaly usuniete z {0}. +powerToolsDisabled=Wszystkie twoje podpiecia zostaly zdezaktywowane. +powerToolsEnabled=Wszystkie twoje podpiecia zostaly aktywowane. +protectionOwner=\u00a76[EssentialsProtect] Wlasciciel zabezpieczen: {0} +questionFormat=\u00a77[Question]\u00a7f {0} +readNextPage=Wpisz /{0} {1} aby przeczytac nastepna strone +reloadAllPlugins=\u00a77Przeladowano wszystkie wtyczki +removed=\u00a77Usunieto {0} byty. +repair=Udalo sie naprawic twoj: \u00a7e{0}. +repairAlreadyFixed=\u00a77Ten przedmiot nie potrzebuje naprawy +repairEnchanted=\u00a77Nie masz zezwolenia do naprawiania ulepszonych przedmiotow. +repairInvalidType=\u00a7cTen przedmiot nie moze byc naprawiony. +repairNone=Zaden przedmiot nie wymagal naprawy. +requestAccepted=\u00a77Zadanie teleportacji - zaakceptowano. +requestAcceptedFrom=\u00a77{0} zaakceptowal Twoje zadanie teleportacji. +requestDenied=\u00a77Zadanie teleportacji - odrzucone. +requestDeniedFrom=\u00a77{0} odrzucil Twoje zadanie teleportacji. +requestSent=\u00a77zZadanie wyslania do {0}\u00a77. +requestTimedOut=\u00a7cZadanie teleportacji - przedawnione. +requiredBukkit= * ! * Potrzebujesz ostatniego {0} CraftBukkit-a, pobierz go z http://dl.bukkit.org/downloads/craftbukkit/ +returnPlayerToJailError=Wystapil blad podczas powrotu gracza {0} do wiezienia: {1} +second=sekunda +seconds=sekund +seenOffline=Gracz {0} jest offline od {1} +seenOnline=Gracz {0} jest online od {1} +serverFull=Serwer jest pelen graczy, sprobuj pozniej. +serverTotal=Podsumowanie serwera: {0} +setSpawner=Ustawiono spawn na {0}. +sheepMalformedColor=Niewlasciwa barwa. +shoutFormat=\u00a77[Shout]\u00a7f {0} +signFormatFail=\u00a74[{0}] +signFormatSuccess=\u00a71[{0}] +signFormatTemplate=[{0}] +signProtectInvalidLocation=\u00a74Nie masz zezwolenia do tworzenia tutaj znakow. +similarWarpExist=Warp o identycznej nazwie juz istnieje. +slimeMalformedSize=Niewlasciwy rozmiar. +soloMob=Ten mob lubi byc sam. +spawnSet=\u00a77Ustawiono punkt spawnu dla grupy {0}. +spawned=stworzono +sudoExempt=Nie mozesz podniesc uprawnien tego uzytkownika. +sudoRun=Probuje {0} uruchomic: /{1} {2} +suicideMessage=\u00a77Zegnaj okrutny swiecie. +suicideSuccess= \u00a77{0} dokonal zamachu na swoje zycie +survival=survival +takenFromAccount=\u00a7c{0} zostalo pobrane z konta. +takenFromOthersAccount=\u00a7c{0} zostalo pobrane z {1}\u00a7c konta. Nowy stan konta: {2} +teleportAAll=\u00a77Zadanie teleportacji - wyslano do wszystkich graczy. +teleportAll=\u00a77Teleportowanie wszystkich graczy. +teleportAtoB=\u00a77{0}\u00a77 przeteleportowal Ciebie do {1}\u00a77. +teleportDisabled={0} ma zdezaktywowana teleportacje. +teleportHereRequest=\u00a7c{0}\u00a7c ma zadanie przeteleportowac cie do nich. +teleportNewPlayerError=Blad przy teleportowniu nowego gracza. +teleportRequest=\u00a7c{0}\u00a7c zazadal teleportacji do Ciebie. +teleportRequestTimeoutInfo=\u00a77 Zadanie teleportacji przedawni sie za {0} sekund. +teleportTop=\u00a77Teleportacja na wierzch. +teleportationCommencing=\u00a77Teleport rozgrzewa sie... +teleportationDisabled=\u00a77Teleportacja - zdezaktywowana. +teleportationEnabled=\u00a77Teleportacja - aktywowana. +teleporting=\u00a77Teleportacja... +teleportingPortal=\u00a77Teleportacja przez portal. +tempBanned=Tymczasowo zbanowany na serwerze przez {0}. +tempbanExempt=\u00a77Nie mozesz tymczasowo zbanowac tego gracza. +thunder= {0} przywowlal burze. +thunderDuration={0} przywolal burze na {1} sekund. +timeBeforeHeal=Czas przed nastepnym uzdrowieniem: {0}. +timeBeforeTeleport=Czas przed nastepnym teleportem:{0}. +timeFormat=\u00a73{0}\u00a7f or \u00a73{1}\u00a7f or \u00a73{2}\u00a7f +timePattern=(?:([0-9]+)\\s*y[a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)? +timeSet=Czas ustawiono we wszystkich swiatach. +timeSetPermission=\u00a7cNie masz uprawnien do ustawiania czasu. +timeWorldCurrent=Obecny czas {0} to \u00a73{1}. +timeWorldSet=Czas ustawiono {0} w: \u00a7c{1}. +tradeCompleted=\u00a77Handel zakonczono. +tradeSignEmpty=Tabliczka handlowa nie jest dostepna dla Ciebie. +tradeSignEmptyOwner=Nie ma nic do pobrania z tej tabliczki. +treeFailure=\u00a7cUtworzenie drzewa nie powiodlo sie, sprobuj na trawie lub ziemi. +treeSpawned=\u00a77Drzewo utworzono. +true=prawda +typeTpaccept=\u00a77Aby zaakceptowac teleport, wpisz \u00a7c/tpaccept\u00a77. +typeTpdeny=\u00a77Aby odmowic teleportacji, wpisz \u00a7c/tpdeny\u00a77. +typeWorldName=\u00a77Mozesz rowniez wpisac nazwe danego swiata. +unableToSpawnMob=Nie udalo sie stworzyc potwora. +unbannedIP=Odbanowana gracza o danym adresie IP. +unbannedPlayer=Odbanowano gracza. +unignorePlayer=Nie ignorujesz juz gracza {0}. +unknownItemId=Nieznane id przedmiotu: {0}. +unknownItemInList=Nieznany przedmiot {0} w liscie {1} . +unknownItemName=Nieznana nazwa przedmiotu: {0}. +unlimitedItemPermission=\u00a7cBrak uprawnien dla nielimitowanego przedmiotu {0}. +unlimitedItems=Nielimitowane przedmioty: +unmutedPlayer=Gracz {0} moze znowu mowic. +upgradingFilesError=Wystapil blad podczas upgradu plikow. +userDoesNotExist=Uzytkownik {0} nie istnieje w bazie danych. +userIsAway={0} jest teraz AFK. +userIsNotAway={0} nie jest juz AFK. +userJailed=\u00a77Zostales skazany. +userUsedPortal={0} uzyl istniejacego portalu wyjscia. +userdataMoveBackError=Nie udalo sie przeniesc userdata/{0}.tmp do userdata/{1} +userdataMoveError=Nie udalo sie przeniesc userdata/{0} do userdata/{1}.tmp +usingTempFolderForTesting=Uzywam tymczasowego folderu dla testu: +versionMismatch=Niepoprawna wersja! Prosze ulepszyc {0} do tej samej wersji co inne pliki. +versionMismatchAll=Niepoprawna wersja! Prosze ulepszyc wszystkie pliki Essentials do tej samej wersji. +voiceSilenced=\u00a77Twe usta zostaly zaszyte. +warpDeleteError=Wystapil problem podczas usuwania pliku z Warpami. +warpListPermission=\u00a7cNie masz pozwolenia na sprawdzenie listy Warpow.. +warpNotExist=Ten Warp nie istnieje. +warpOverwrite=\u00a7cNie mozesz nadpisac tego Warpa. +warpSet=\u00a77Warp {0} stworzony. +warpUsePermission=\u00a7cNie masz pozwolenie na korzystanie z tego Warpa. +warpingTo=\u00a77Teleportuje do {0}. +warps=Warpy: {0} +warpsCount=\u00a77Istnieje {0} warpow. Pokazuje strone {1} z {2}. +weatherStorm=\u00a77Ustawiles burzowa pogode w {0}. +weatherStormFor=\u00a77Ustawiles burzowa pogode w {0} na {1} sekund. +weatherSun=\u00a77Ustawiles bezchmurna pogode w {0}. +weatherSunFor=\u00a77Ustawiles bezchmurna pogode w {0} na {1} sekund. +whoisBanned=\u00a79 - Zbanowany: {0}. +whoisExp=\u00a79 - Punkty Doswiadczenia: {0} (Poziom {1}). +whoisGamemode=\u00a79 - Tryb Gry: {0}. +whoisGeoLocation=\u00a79 - Lokacja: {0}. +whoisGod=\u00a79 - Godmode: {0}. +whoisHealth=\u00a79 - Zycie: {0}/20. +whoisIPAddress=\u00a79 - Adres IP: {0}. +whoisIs={0} jest {1}. +whoisJail=\u00a79 - W wiezieniu: {0}. +whoisLocation=\u00a79 - Lokacja: ({0}, {1}, {2}, {3}) +whoisMoney=\u00a79 - Pieniadze: {0}. +whoisOP=\u00a79 - OP: {0} +whoisStatusAvailable=\u00a79 - Status: Dostepny +whoisStatusAway=\u00a79 - Status: \u00a7cNieobecny\u00a7f +worth=\u00a77Stack {0} jest warty \u00a7c{1}\u00a77 ({2}rzedmiot(y) po {3} kazdy) +worthMeta=\u00a77Stack {0} z metadata {1} jest warty \u00a7c{2}\u00a77 ({3} przedmiot(y) po {4} kazdy) +worthSet=Cena przedmiotu ustawiona. +year=rok +years=lat +youAreHealed=\u00a77Zostales/las uleczony/na. +youHaveNewMail=\u00a7cMasz {0} wiadomosci!\u00a7f napisz \u00a77/mail read\u00a7f aby je przeczytac. -- cgit v1.2.3 From 798ea777365d13a8970e4c55c2fafefefd1e166a Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 6 Apr 2012 07:39:25 +1000 Subject: Add version tag --- Essentials/src/messages_pl.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties index a0865b768..803b1d1f1 100644 --- a/Essentials/src/messages_pl.properties +++ b/Essentials/src/messages_pl.properties @@ -1,4 +1,4 @@ -#version: Dev2.9.145 +#version: TeamCity # Single quotes have to be doubled: '' # Translations start here # by: losdamianos -- cgit v1.2.3 From bc876611d0df5be116c280996add50725083142c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 5 Apr 2012 23:35:56 +0100 Subject: Fix /time not working with the '##pm' syntax. --- .../earth2me/essentials/DescParseTickFormat.java | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java b/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java index bf3037e59..9c40acacc 100644 --- a/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java +++ b/Essentials/src/com/earth2me/essentials/DescParseTickFormat.java @@ -6,12 +6,11 @@ import java.util.*; /** - * This utility class is used for converting between the ingame - * time in ticks to ingame time as a friendly string. - * Note that the time is INGAME. - * + * This utility class is used for converting between the ingame time in ticks to ingame time as a friendly string. Note + * that the time is INGAME. + * * http://www.minecraftwiki.net/wiki/Day/night_cycle - * + * * @author Olof Larsson */ public final class DescParseTickFormat @@ -156,30 +155,31 @@ public final class DescParseTickFormat int hours = 0; int minutes = 0; - desc = desc.toLowerCase(Locale.ENGLISH).replaceAll("[^0-9]", ""); + desc = desc.toLowerCase(Locale.ENGLISH); + String parsetime = desc.replaceAll("[^0-9]", ""); - if (desc.length() > 4) + if (parsetime.length() > 4) { throw new NumberFormatException(); } - if (desc.length() == 4) + if (parsetime.length() == 4) { - hours += Integer.parseInt(desc.substring(0, 2)); - minutes += Integer.parseInt(desc.substring(2, 4)); + hours += Integer.parseInt(parsetime.substring(0, 2)); + minutes += Integer.parseInt(parsetime.substring(2, 4)); } - else if (desc.length() == 3) + else if (parsetime.length() == 3) { - hours += Integer.parseInt(desc.substring(0, 1)); - minutes += Integer.parseInt(desc.substring(1, 3)); + hours += Integer.parseInt(parsetime.substring(0, 1)); + minutes += Integer.parseInt(parsetime.substring(1, 3)); } - else if (desc.length() == 2) + else if (parsetime.length() == 2) { - hours += Integer.parseInt(desc.substring(0, 2)); + hours += Integer.parseInt(parsetime.substring(0, 2)); } - else if (desc.length() == 1) + else if (parsetime.length() == 1) { - hours += Integer.parseInt(desc.substring(0, 1)); + hours += Integer.parseInt(parsetime.substring(0, 1)); } else { -- cgit v1.2.3 From 6504c88bf7cb406acce0dda2c45623bc8be15734 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 6 Apr 2012 02:36:27 +0100 Subject: Chat spy, should show otherworld chat. --- .../earth2me/essentials/chat/EssentialsChatPlayer.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java index ddf928725..6bdab0919 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java @@ -126,20 +126,19 @@ public abstract class EssentialsChatPlayer implements Listener } if (!onlineUser.equals(sender)) { - final Location playerLoc = onlineUser.getLocation(); - if (playerLoc.getWorld() != world) + if (onlineUser.isAuthorized("essentials.chat.spy")) { - continue; + type = type.concat(_("chatTypeSpy")); } - final double delta = playerLoc.distanceSquared(loc); - - if (delta > chatStore.getRadius()) + else { - if (onlineUser.isAuthorized("essentials.chat.spy")) + final Location playerLoc = onlineUser.getLocation(); + if (playerLoc.getWorld() != world) { - type = type.concat(_("chatTypeSpy")); + continue; } - else + final double delta = playerLoc.distanceSquared(loc); + if (delta > chatStore.getRadius()) { continue; } -- cgit v1.2.3 From 25bd91eb807e19db9d045c8e5f4ee70ec085da33 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Fri, 6 Apr 2012 12:53:36 +0100 Subject: Remove all permission attachments when performing a manload or restart. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GroupManager.java | 3 +++ .../anjocaido/groupmanager/permissions/BukkitPermissions.java | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 2cfe57f62..a9355e608 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -164,4 +164,5 @@ v 1.9: v 2.0: - Fix GM reporting of permission inheritance to retain the correct order. Lower inheritance groups can no longer negate a higher groups permissions. - Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions. - - Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it). \ No newline at end of file + - Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it). + - Remove all permission attachments when performing a manload or restart. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 8bd346735..d1c62d4de 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -106,6 +106,9 @@ public class GroupManager extends JavaPlugin { } WorldEvents = null; + + // Remove all attachments before clearing + BukkitPermissions.removeAllAttachments(); BukkitPermissions = null; // EXAMPLE: Custom code, here we just output some info so we can check that diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index 6df18cb05..3b66c1eb9 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -362,6 +362,15 @@ public class BukkitPermissions { attachments.remove(player); } } + + /** + * Remove all attachments in case of a restart or reload. + */ + public void removeAllAttachments() { + + for (Player player : attachments.keySet()) + removeAttachment(player); + } /** * Player events tracked to cause Superperms updates -- cgit v1.2.3 From 9e866817222fd23c2ad267a936cc50efd32088d7 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 6 Apr 2012 19:19:08 +0100 Subject: Move player loading and updates to new thread, to reduce on join lag. --- .../essentials/EssentialsPlayerListener.java | 53 +++++++++++++++------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 2f97490bc..604703770 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -123,14 +123,25 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(final PlayerJoinEvent event) { - ess.getBackup().onPlayerJoin(); - final User user = ess.getUser(event.getPlayer()); + ess.scheduleAsyncDelayedTask(new Runnable() + { + @Override + public void run() + { + delayedJoin(event.getPlayer()); + } + }); + } + public void delayedJoin(final Player player) + { + ess.getBackup().onPlayerJoin(); + final User user = ess.getUser(player); user.setDisplayNick(); + updateCompass(user); user.setLastLogin(System.currentTimeMillis()); - user.updateActivity(false); - updateCompass(user); + if (user.isAuthorized("essentials.sleepingignored")) { user.setSleepingIgnored(true); @@ -172,6 +183,27 @@ public class EssentialsPlayerListener implements Listener } } + private void updateCompass(final User user) + { + Location loc = user.getHome(user.getLocation()); + if (loc == null) + { + loc = user.getBedSpawnLocation(); + } + if (loc != null) + { + final Location updateLoc = loc; + ess.scheduleSyncDelayedTask(new Runnable() + { + @Override + public void run() + { + user.setCompassTarget(updateLoc); + } + }); + } + } + @EventHandler(priority = EventPriority.HIGH) public void onPlayerLogin(final PlayerLoginEvent event) { @@ -211,19 +243,6 @@ public class EssentialsPlayerListener implements Listener event.allow(); } - private void updateCompass(final User user) - { - Location loc = user.getHome(user.getLocation()); - if (loc == null) - { - loc = user.getBedSpawnLocation(); - } - if (loc != null) - { - user.setCompassTarget(loc); - } - } - @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerTeleport(final PlayerTeleportEvent event) { -- cgit v1.2.3 From 7a6368a98003799cfa50e514b4f6cca6b80ca6c5 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 7 Apr 2012 03:07:07 +0100 Subject: Console should be able to kick everyone. --- Essentials/src/com/earth2me/essentials/commands/Commandkick.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java index ae5db48fb..3e2e08b50 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java @@ -24,7 +24,7 @@ public class Commandkick extends EssentialsCommand } final User user = getPlayer(server, args, 0); - if (user.isAuthorized("essentials.kick.exempt")) + if (sender instanceof Player && user.isAuthorized("essentials.kick.exempt")) { throw new Exception(_("kickExempt")); } -- cgit v1.2.3 From fe95cfe03bdc294bbb0c2b205d07cbb5ceead8f6 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 7 Apr 2012 03:34:01 +0100 Subject: New ingame command syntax: /kit New Permission: essentials.kit.others - allows giving kits to other people. New console commands: /kit & /kit --- Essentials/src/com/earth2me/essentials/Kit.java | 2 +- .../earth2me/essentials/commands/Commandkit.java | 79 ++++++++++++++++------ Essentials/src/plugin.yml | 2 +- 3 files changed, 60 insertions(+), 23 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index b6363b183..5edd40776 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -23,7 +23,7 @@ public class Kit final StringBuilder list = new StringBuilder(); for (String kiteItem : kits.getKeys(false)) { - if (user.isAuthorized("essentials.kit." + kiteItem.toLowerCase(Locale.ENGLISH))) + if (user == null || user.isAuthorized("essentials.kit." + kiteItem.toLowerCase(Locale.ENGLISH))) { list.append(" ").append(capitalCase(kiteItem)); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java index 67f0fafd0..514a5acca 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java @@ -4,6 +4,7 @@ import com.earth2me.essentials.*; import static com.earth2me.essentials.I18n._; import java.util.*; import org.bukkit.Server; +import org.bukkit.command.CommandSender; public class Commandkit extends EssentialsCommand @@ -18,39 +19,75 @@ public class Commandkit extends EssentialsCommand { if (args.length < 1) { - final String kitList = Kit.listKits(ess, user); - if (kitList.length() > 0) - { - user.sendMessage(_("kits", kitList)); - } - else - { - user.sendMessage(_("noKits")); - } + listKits(user); throw new NoChargeException(); } + else if (args.length > 1 && user.isAuthorized("essentials.kit.others")) + { + final User userTo = getPlayer(server, args, 1, true); + final String kitName = args[0].toLowerCase(Locale.ENGLISH); + giveKit(userTo, user, kitName); + } else { final String kitName = args[0].toLowerCase(Locale.ENGLISH); + giveKit(user, user, kitName); + } + } + + @Override + public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception + { + if (args.length < 2) + { + listKits(sender); + throw new NoChargeException(); + } + else + { + final User userTo = getPlayer(server, args, 1, true); + final String kitName = args[0].toLowerCase(Locale.ENGLISH); + final Map kit = ess.getSettings().getKit(kitName); + final List items = Kit.getItems(userTo, kit); + Kit.expandItems(ess, userTo, items); - if (!user.isAuthorized("essentials.kit." + kitName)) - { - throw new Exception(_("noKitPermission", "essentials.kit." + kitName)); - } + sender.sendMessage(_("kitGive", kitName)); + } + } - final List items = Kit.getItems(user, kit); + private void listKits(CommandSender sender) throws Exception + { + final String kitList = Kit.listKits(ess, null); + if (kitList.length() > 0) + { + sender.sendMessage(_("kits", kitList)); + } + else + { + sender.sendMessage(_("noKits")); + } + } - Kit.checkTime(user, kitName, kit); + private void giveKit(User userTo, User userFrom, String kitName) throws Exception + { + final Map kit = ess.getSettings().getKit(kitName); - final Trade charge = new Trade("kit-" + kitName, ess); - charge.isAffordableFor(user); + if (!userFrom.isAuthorized("essentials.kit." + kitName)) + { + throw new Exception(_("noKitPermission", "essentials.kit." + kitName)); + } - Kit.expandItems(ess, user, items); + final List items = Kit.getItems(userTo, kit); - charge.charge(user); - user.sendMessage(_("kitGive", kitName)); + Kit.checkTime(userFrom, kitName, kit); - } + final Trade charge = new Trade("kit-" + kitName, ess); + charge.isAffordableFor(userFrom); + + Kit.expandItems(ess, userTo, items); + + charge.charge(userFrom); + userTo.sendMessage(_("kitGive", kitName)); } } diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 459dec26f..3e1dc52c0 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -180,7 +180,7 @@ commands: aliases: [ekickall] kit: description: Obtains the specified kit or views all available kits. - usage: / [kit] + usage: / [kit] [player] aliases: [ekit,kits,ekits] kill: description: Kills specified player. -- cgit v1.2.3 From 0eefb7f5a160dce1285ccf23899700a57fffa2ff Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 7 Apr 2012 04:22:17 +0100 Subject: Remove 'set' and 'add' from /time command args, to allow use of original syntax. --- .../src/com/earth2me/essentials/commands/Commandtime.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java index f22d7d01f..fa1243d45 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.DescParseTickFormat; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; import java.util.*; import org.bukkit.Server; import org.bukkit.World; @@ -19,16 +20,22 @@ public class Commandtime extends EssentialsCommand @Override public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { + final List argList = new ArrayList(Arrays.asList(args)); + if ((argList.remove("set") || argList.remove("add")) && Util.isInt(argList.get(0))) { + ess.getLogger().info("debug edited 0" + argList.get(0).toString()); + } + final String[] validArgs = argList.toArray(new String[0]); + // Which World(s) are we interested in? String worldSelector = null; - if (args.length == 2) + if (validArgs.length == 2) { - worldSelector = args[1]; + worldSelector = validArgs[1]; } final Set worlds = getWorlds(server, sender, worldSelector); // If no arguments we are reading the time - if (args.length == 0) + if (validArgs.length == 0) { getWorldsTime(sender, worlds); return; @@ -45,7 +52,7 @@ public class Commandtime extends EssentialsCommand long ticks; try { - ticks = DescParseTickFormat.parse(args[0]); + ticks = DescParseTickFormat.parse(validArgs[0]); } catch (NumberFormatException e) { -- cgit v1.2.3 From bb83dcc82873d4931bd3ec2120d8ec3f41f25d6e Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 7 Apr 2012 04:39:12 +0100 Subject: Allow vanilla syntax of /give --- .../src/com/earth2me/essentials/commands/Commandgive.java | 10 ++++++++-- .../src/com/earth2me/essentials/commands/Commandtime.java | 9 +++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java index 701fa6577..106efa6e9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.craftbukkit.InventoryWorkaround; import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; import java.util.Locale; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -44,7 +45,12 @@ public class Commandgive extends EssentialsCommand final User giveTo = getPlayer(server, args, 0); - if (args.length > 2 && Integer.parseInt(args[2]) > 0) + if (args.length > 3 && Util.isInt(args[2]) && Util.isInt(args[3])) + { + stack.setDurability(Short.parseShort(args[2])); + stack.setAmount(Integer.parseInt(args[3])); + } + else if (args.length > 2 && Integer.parseInt(args[2]) > 0) { stack.setAmount(Integer.parseInt(args[2])); } @@ -59,7 +65,7 @@ public class Commandgive extends EssentialsCommand if (args.length > 3) { - for (int i = 3; i < args.length; i++) + for (int i = Util.isInt(args[3]) ? 4 : 3; i < args.length; i++) { final String[] split = args[i].split("[:+',;.]", 2); if (split.length < 1) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java index fa1243d45..8e5b7c017 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java @@ -21,11 +21,12 @@ public class Commandtime extends EssentialsCommand public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { final List argList = new ArrayList(Arrays.asList(args)); - if ((argList.remove("set") || argList.remove("add")) && Util.isInt(argList.get(0))) { - ess.getLogger().info("debug edited 0" + argList.get(0).toString()); + if ((argList.remove("set") || argList.remove("add")) && Util.isInt(argList.get(0))) + { + ess.getLogger().info("debug edited 0" + argList.get(0).toString()); } - final String[] validArgs = argList.toArray(new String[0]); - + final String[] validArgs = argList.toArray(new String[0]); + // Which World(s) are we interested in? String worldSelector = null; if (validArgs.length == 2) -- cgit v1.2.3 From 1c0a5c49a5c1ecd0708823034b0c8726c965cb16 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 7 Apr 2012 11:47:07 +0100 Subject: Expand 'manwhois' to also list a users subgroups. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GroupManager.java | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index a9355e608..42b7b989c 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -165,4 +165,5 @@ v 2.0: - Fix GM reporting of permission inheritance to retain the correct order. Lower inheritance groups can no longer negate a higher groups permissions. - Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions. - Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it). - - Remove all permission attachments when performing a manload or restart. \ No newline at end of file + - Remove all permission attachments when performing a manload or restart. + - Expand 'manwhois' to also list a users subgroups. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index d1c62d4de..76babb1ec 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -1398,6 +1398,16 @@ public class GroupManager extends JavaPlugin { // Seems OK sender.sendMessage(ChatColor.YELLOW + "Name: " + ChatColor.GREEN + auxUser.getName()); sender.sendMessage(ChatColor.YELLOW + "Group: " + ChatColor.GREEN + auxUser.getGroup().getName()); + // Compile a list of subgroups + auxString = ""; + for (String subGroup : auxUser.subGroupListStringCopy()) { + auxString += subGroup + ", "; + } + if (auxString.lastIndexOf(",") > 0) { + auxString = auxString.substring(0, auxString.lastIndexOf(",")); + sender.sendMessage(ChatColor.YELLOW + "subgroups: " + auxString); + } + sender.sendMessage(ChatColor.YELLOW + "Overloaded: " + ChatColor.GREEN + dataHolder.isOverloaded(auxUser.getName())); auxGroup = dataHolder.surpassOverload(auxUser.getName()).getGroup(); if (!auxGroup.equals(auxUser.getGroup())) { -- cgit v1.2.3 From e8dd96354592de9cd8b43d6eeca332417e1708f9 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 7 Apr 2012 17:21:48 +0100 Subject: Fix a concurrent modification error when removing all attachments. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../org/anjocaido/groupmanager/permissions/BukkitPermissions.java | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 42b7b989c..f699c3f6f 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -166,4 +166,5 @@ v 2.0: - Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions. - Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it). - Remove all permission attachments when performing a manload or restart. - - Expand 'manwhois' to also list a users subgroups. \ No newline at end of file + - Expand 'manwhois' to also list a users subgroups. + - Fix a concurrent modification error when removing all attachments. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index 3b66c1eb9..51f019efc 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -20,6 +20,7 @@ import java.lang.reflect.Field; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; @@ -368,8 +369,11 @@ public class BukkitPermissions { */ public void removeAllAttachments() { - for (Player player : attachments.keySet()) - removeAttachment(player); + Iterator itr = attachments.keySet().iterator(); + + while (itr.hasNext()){ + removeAttachment(itr.next()); + } } /** -- cgit v1.2.3 From e8a42e394740ebedd6ae9a386e2ef6c0dcc41e33 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 7 Apr 2012 19:24:46 +0100 Subject: Better handling of errors in user and group yml's. --- EssentialsGroupManager/src/Changelog.txt | 3 +- .../groupmanager/dataholder/WorldDataHolder.java | 407 ++++++++++++--------- 2 files changed, 232 insertions(+), 178 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index f699c3f6f..c6c3853fb 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -167,4 +167,5 @@ v 2.0: - Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it). - Remove all permission attachments when performing a manload or restart. - Expand 'manwhois' to also list a users subgroups. - - Fix a concurrent modification error when removing all attachments. \ No newline at end of file + - Fix a concurrent modification error when removing all attachments. + - Better handling of errors in user and group yml's. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index cee2ec0b8..135417068 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -14,6 +14,7 @@ import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.logging.Level; @@ -459,98 +460,140 @@ public class WorldDataHolder { //PROCESS GROUPS FILE Map> inheritance = new HashMap>(); try { + /* + * Fetch all child nodes under the 'groups' entry. + */ Map allGroupsNode = (Map) groupsRootDataNode.get("groups"); - try { - for (String groupKey : allGroupsNode.keySet()) { - Map thisGroupNode = (Map) allGroupsNode.get(groupKey); - Group thisGrp = ph.createGroup(groupKey); - if (thisGrp == null) { - throw new IllegalArgumentException("I think this Group was declared more than once: " + groupKey + " in file: " + groupsFile.getPath()); - } - if (thisGroupNode.get("default") == null) { - thisGroupNode.put("default", false); - } - if ((Boolean.parseBoolean(thisGroupNode.get("default").toString()))) { - if (ph.getDefaultGroup() != null) { - GroupManager.logger.warning("The group " + thisGrp.getName() + " is claiming to be default where" + ph.getDefaultGroup().getName() + " already was."); - GroupManager.logger.warning("Overriding first request for file: " + groupsFile.getPath()); - } - ph.setDefaultGroup(thisGrp); - } - - //PERMISSIONS NODE - try { - if (thisGroupNode.get("permissions") == null) { - thisGroupNode.put("permissions", new ArrayList()); + Iterator groupItr = allGroupsNode.keySet().iterator(); + String groupKey; + Integer groupCount = 0; + + /* + * loop each group entry + * and read it's data. + */ + while (groupItr.hasNext()) { + try { + groupCount++; + // Attempt to fetch the next group name. + groupKey = groupItr.next(); + } catch (Exception e) { + throw new IllegalArgumentException("Invalid node type for group entry (" + groupCount + ") in file: " + groupsFile.getPath()); + } + + /* + * Fetch this groups child nodes + */ + Map thisGroupNode = (Map) allGroupsNode.get(groupKey); + /* + * Create a new group with this name + * in the assigned data source. + */ + Group thisGrp = ph.createGroup(groupKey); + + if (thisGrp == null) { + throw new IllegalArgumentException("I think this Group was declared more than once: " + groupKey + " in file: " + groupsFile.getPath()); + } + /* + * If no default node is found set it as false. + */ + if (thisGroupNode.get("default") == null) { + thisGroupNode.put("default", false); + } else if ((Boolean.parseBoolean(thisGroupNode.get("default").toString()))) { + /* + * Set this as the default group. + * Warn if some other group has already claimed that position. + */ + if (ph.getDefaultGroup() != null) { + GroupManager.logger.warning("The group " + thisGrp.getName() + " is claiming to be default where" + ph.getDefaultGroup().getName() + " already was."); + GroupManager.logger.warning("Overriding first request for file: " + groupsFile.getPath()); + } + ph.setDefaultGroup(thisGrp); + } + + //PERMISSIONS NODE + try { + /* + * If no permissions node is found, or it's empty + * set an empty permission list + */ + if (thisGroupNode.get("permissions") == null) { + thisGroupNode.put("permissions", new ArrayList()); + } else { + /* + * There is a permission list Which seems to hold some data + */ + if (thisGroupNode.get("permissions") instanceof List) { + /* + * Check each entry and add it as a new permission. + */ + for (Object o : ((List) thisGroupNode.get("permissions"))) { + try { + /* + * Only add this permission if it's not empty. + */ + if (!thisGroupNode.get("permissions").toString().isEmpty()) + thisGrp.addPermission(o.toString()); + } catch (NullPointerException e) { + // Ignore this entry as it's null. It can be safely dropped + } + } + } else if (thisGroupNode.get("permissions") instanceof String) { + /* + * Only add this permission if it's not empty. + */ + if (!thisGroupNode.get("permissions").toString().isEmpty()) + thisGrp.addPermission((String) thisGroupNode.get("permissions")); } else { - if (thisGroupNode.get("permissions") instanceof List) { - for (Object o : ((List) thisGroupNode.get("permissions"))) { - try { - /* - * Only add this permission if it's not empty. - */ - if (!thisGroupNode.get("permissions").toString().isEmpty()) - thisGrp.addPermission(o.toString()); - } catch (NullPointerException e) { - // Ignore this entry as it's null. - //throw new IllegalArgumentException("Invalid permission node in group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } - } - } else if (thisGroupNode.get("permissions") instanceof String) { - /* - * Only add this permission if it's not empty. - */ - if (!thisGroupNode.get("permissions").toString().isEmpty()) - thisGrp.addPermission((String) thisGroupNode.get("permissions")); - } else { - throw new IllegalArgumentException("Unknown type of permissions node(Should be String or List) for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } - thisGrp.sortPermissions(); + throw new IllegalArgumentException("Unknown type of permissions node(Should be String or List) for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); } - } catch (Exception e) { - throw new IllegalArgumentException("Invalid formatting found in permissions section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } - - //INFO NODE - try { - if (thisGroupNode.get("info") instanceof Map) { - Map infoNode = (Map) thisGroupNode.get("info"); - if (infoNode != null) { - thisGrp.setVariables(infoNode); - } - } else - throw new IllegalArgumentException("Unknown entry found in Info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } catch (Exception e1) { - throw new IllegalArgumentException("Invalid formatting found in info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + /* + * Sort all permissions so they are in the correct order for checking. + */ + thisGrp.sortPermissions(); } - - //END INFO NODE - - try { - if (thisGroupNode.get("inheritance") == null || thisGroupNode.get("inheritance") instanceof List) { - Object inheritNode = thisGroupNode.get("inheritance"); - if (inheritNode == null) { - thisGroupNode.put("inheritance", new ArrayList()); - } else if (inheritNode instanceof List) { - List groupsInh = (List) inheritNode; - for (String grp : groupsInh) { - if (inheritance.get(groupKey) == null) { - List thisInherits = new ArrayList(); - inheritance.put(groupKey, thisInherits); - } - inheritance.get(groupKey).add(grp); - - } - } - }else - throw new IllegalArgumentException("Unknown entry found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } catch (Exception e2) { - throw new IllegalArgumentException("Invalid formatting found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } - } - } catch (Exception e) { - throw new IllegalArgumentException("Invalid node type, or bad indentation in file: " + groupsFile.getPath()); - } + } catch (Exception e) { + throw new IllegalArgumentException("Invalid formatting found in permissions section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } + + //INFO NODE + try { + if (thisGroupNode.get("info") instanceof Map) { + Map infoNode = (Map) thisGroupNode.get("info"); + if (infoNode != null) { + thisGrp.setVariables(infoNode); + } + } else + throw new IllegalArgumentException("Unknown entry found in Info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } catch (Exception e1) { + throw new IllegalArgumentException("Invalid formatting found in info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } + + //END INFO NODE + + try { + if (thisGroupNode.get("inheritance") == null || thisGroupNode.get("inheritance") instanceof List) { + Object inheritNode = thisGroupNode.get("inheritance"); + if (inheritNode == null) { + thisGroupNode.put("inheritance", new ArrayList()); + } else if (inheritNode instanceof List) { + List groupsInh = (List) inheritNode; + for (String grp : groupsInh) { + if (inheritance.get(groupKey) == null) { + List thisInherits = new ArrayList(); + inheritance.put(groupKey, thisInherits); + } + inheritance.get(groupKey).add(grp); + + } + } + }else + throw new IllegalArgumentException("Unknown entry found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } catch (Exception e2) { + throw new IllegalArgumentException("Invalid formatting found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } + } + } catch (Exception ex) { ex.printStackTrace(); throw new IllegalArgumentException("Your " + groupsFile.getPath() + " file is invalid. See console for details."); @@ -614,97 +657,107 @@ public class WorldDataHolder { Map allUsersNode = (Map) usersRootDataNode.get("users"); // Load users if the file is NOT empty - if (allUsersNode != null) - try { - for (String usersKey : allUsersNode.keySet()) { - Map thisUserNode = null; - try { - thisUserNode = (Map) allUsersNode.get(usersKey); - } catch (Exception ex) { - throw new IllegalArgumentException("Bad format found in file: " + usersFile.getPath()); - } - User thisUser = ph.createUser(usersKey); - if (thisUser == null) { - throw new IllegalArgumentException("I think this user was declared more than once: " + usersKey + " in file: " + usersFile.getPath()); - } - if (thisUserNode.get("permissions") == null) { - thisUserNode.put("permissions", new ArrayList()); - } else { - if (thisUserNode.get("permissions") instanceof List) { - for (Object o : ((List) thisUserNode.get("permissions"))) { - /* - * Only add this permission if it's not empty - */ - if (!o.toString().isEmpty()) - thisUser.addPermission(o.toString()); - } - } else if (thisUserNode.get("permissions") instanceof String) { - try { - /* - * Only add this permission if it's not empty - */ - if (!thisUserNode.get("permissions").toString().isEmpty()) - thisUser.addPermission(thisUserNode.get("permissions").toString()); - } catch (NullPointerException e) { - // Ignore this entry as it's null. - //throw new IllegalArgumentException("Invalid permission node for user: " + thisUser.getName() + " in file: " + UserFile.getPath()); - } - } - thisUser.sortPermissions(); - } - - //SUBGROUPS LOADING - if (thisUserNode.get("subgroups") == null) { - thisUserNode.put("subgroups", new ArrayList()); - } - if (thisUserNode.get("subgroups") instanceof List) { - for (Object o : ((List) thisUserNode.get("subgroups"))) { - Group subGrp = ph.getGroup(o.toString()); - if (subGrp != null) { - thisUser.addSubGroup(subGrp); - } else { - GroupManager.logger.warning("Subgroup " + o.toString() + " not found for user " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); - } - } - } else if (thisUserNode.get("subgroups") instanceof String) { - Group subGrp = ph.getGroup(thisUserNode.get("subgroups").toString()); - if (subGrp != null) { - thisUser.addSubGroup(subGrp); - } else { - GroupManager.logger.warning("Subgroup " + thisUserNode.get("subgroups").toString() + " not found for user " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); - } - } - - - //USER INFO NODE - - //INFO NODE - if (thisUserNode.get("info") instanceof Map) { - Map infoNode = (Map) thisUserNode.get("info"); - if (infoNode != null) { - thisUser.setVariables(infoNode); - } - } else if (thisUserNode.get("info") != null) - throw new IllegalArgumentException("Unknown entry found in Info section for user: " + thisUser.getName() + " in file: " + usersFile.getPath()); - - //END INFO NODE - - - if (thisUserNode.get("group") != null) { - Group hisGroup = ph.getGroup(thisUserNode.get("group").toString()); - if (hisGroup == null) { - GroupManager.logger.warning("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName() + ": Set to '" + ph.getDefaultGroup().getName() + "' for file: " + usersFile.getPath()); - hisGroup = ph.getDefaultGroup(); - //throw new IllegalArgumentException("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName()); + if (allUsersNode != null) { + + Iterator usersItr = allUsersNode.keySet().iterator(); + String usersKey; + Integer userCount = 0; + + while (usersItr.hasNext()) { + try { + userCount++; + // Attempt to fetch the next user name. + usersKey = usersItr.next(); + } catch (Exception e) { + throw new IllegalArgumentException("Invalid node type for user entry (" + userCount + ") in file: " + usersFile.getPath()); + } + + Map thisUserNode = null; + try { + thisUserNode = (Map) allUsersNode.get(usersKey); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in file: " + usersFile.getPath()); + } + User thisUser = ph.createUser(usersKey); + if (thisUser == null) { + throw new IllegalArgumentException("I think this user was declared more than once: " + usersKey + " in file: " + usersFile.getPath()); + } + if (thisUserNode.get("permissions") == null) { + thisUserNode.put("permissions", new ArrayList()); + } else { + if (thisUserNode.get("permissions") instanceof List) { + for (Object o : ((List) thisUserNode.get("permissions"))) { + /* + * Only add this permission if it's not empty + */ + if (!o.toString().isEmpty()) + thisUser.addPermission(o.toString()); } - thisUser.setGroup(hisGroup); - } else { - thisUser.setGroup(ph.getDefaultGroup()); + } else if (thisUserNode.get("permissions") instanceof String) { + try { + /* + * Only add this permission if it's not empty + */ + if (!thisUserNode.get("permissions").toString().isEmpty()) + thisUser.addPermission(thisUserNode.get("permissions").toString()); + } catch (NullPointerException e) { + // Ignore this entry as it's null. + //throw new IllegalArgumentException("Invalid permission node for user: " + thisUser.getName() + " in file: " + UserFile.getPath()); + } } - } - } catch (Exception e) { - throw new IllegalArgumentException("Invalid node type, or bad indentation in file: " + usersFile.getPath()); - } + thisUser.sortPermissions(); + } + + //SUBGROUPS LOADING + if (thisUserNode.get("subgroups") == null) { + thisUserNode.put("subgroups", new ArrayList()); + } + if (thisUserNode.get("subgroups") instanceof List) { + for (Object o : ((List) thisUserNode.get("subgroups"))) { + Group subGrp = ph.getGroup(o.toString()); + if (subGrp != null) { + thisUser.addSubGroup(subGrp); + } else { + GroupManager.logger.warning("Subgroup " + o.toString() + " not found for user " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); + } + } + } else if (thisUserNode.get("subgroups") instanceof String) { + Group subGrp = ph.getGroup(thisUserNode.get("subgroups").toString()); + if (subGrp != null) { + thisUser.addSubGroup(subGrp); + } else { + GroupManager.logger.warning("Subgroup " + thisUserNode.get("subgroups").toString() + " not found for user " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); + } + } + + + //USER INFO NODE + + //INFO NODE + if (thisUserNode.get("info") instanceof Map) { + Map infoNode = (Map) thisUserNode.get("info"); + if (infoNode != null) { + thisUser.setVariables(infoNode); + } + } else if (thisUserNode.get("info") != null) + throw new IllegalArgumentException("Unknown entry found in Info section for user: " + thisUser.getName() + " in file: " + usersFile.getPath()); + + //END INFO NODE + + + if (thisUserNode.get("group") != null) { + Group hisGroup = ph.getGroup(thisUserNode.get("group").toString()); + if (hisGroup == null) { + GroupManager.logger.warning("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName() + ": Set to '" + ph.getDefaultGroup().getName() + "' for file: " + usersFile.getPath()); + hisGroup = ph.getDefaultGroup(); + //throw new IllegalArgumentException("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName()); + } + thisUser.setGroup(hisGroup); + } else { + thisUser.setGroup(ph.getDefaultGroup()); + } + } + } ph.removeUsersChangedFlag(); // Update the LastModified time. -- cgit v1.2.3 From ec4f5cc34d2d2bd4556e092e70192a78cd7d1b0f Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 7 Apr 2012 21:30:49 +0100 Subject: Added missing confirmation message on '/manload'. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GroupManager.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index c6c3853fb..0a9708773 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -168,4 +168,5 @@ v 2.0: - Remove all permission attachments when performing a manload or restart. - Expand 'manwhois' to also list a users subgroups. - Fix a concurrent modification error when removing all attachments. - - Better handling of errors in user and group yml's. \ No newline at end of file + - Better handling of errors in user and group yml's. + - Added missing confirmation message on '/manload'. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 76babb1ec..e10675e8d 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -1590,6 +1590,8 @@ public class GroupManager extends JavaPlugin { */ onDisable(); onEnable(); + + sender.sendMessage("All settings and worlds were reloaded!"); } /** -- cgit v1.2.3 From 4c8d0ea2d995cc97ffde6a00d5de206100f22958 Mon Sep 17 00:00:00 2001 From: snowleo Date: Mon, 9 Apr 2012 17:52:46 +0300 Subject: Should fix some exp math issues --- Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java b/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java index 70d15b856..b788fa7ee 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/SetExpFix.java @@ -53,7 +53,7 @@ public class SetExpFix //Without this people would be able to use exp and then still sell it. public static int getTotalExperience(final Player player) { - int exp = (int) (getExpToLevel(player) * player.getExp()); + int exp = (int)Math.round(getExpToLevel(player) * player.getExp()); int currentLevel = player.getLevel(); while (currentLevel > 0) { -- cgit v1.2.3 From f02691863ba41d648c31a7167ed2a6fd3fe57bcd Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 10 Apr 2012 17:02:50 +0100 Subject: Properly fix concurrent modification when removing all attachments. --- .../groupmanager/permissions/BukkitPermissions.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index 51f019efc..516679544 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -357,7 +357,7 @@ public class BukkitPermissions { } catch (IllegalArgumentException e) { /* * Failed to remove attachment - * This usually means Bukkit no longer know of it. + * This usually means Bukkit no longer knows of it. */ } attachments.remove(player); @@ -372,8 +372,17 @@ public class BukkitPermissions { Iterator itr = attachments.keySet().iterator(); while (itr.hasNext()){ - removeAttachment(itr.next()); + Player player = itr.next(); + try { + player.removeAttachment(attachments.get(player)); + } catch (IllegalArgumentException e) { + /* + * Failed to remove attachment + * This usually means Bukkit no longer knows of it. + */ + } } + attachments.clear(); } /** -- cgit v1.2.3 From cdae0898c7848d9d0c3717eb1cacf9fc9bb8a199 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 10 Apr 2012 20:40:04 +0100 Subject: Stop the error on shutdown if GM failed to load at startup. GroupManager will now generate it's own log (in the GM folder) to keep things tidy, but also to account of those players unable to find/access their server.log. Startup errors will now lock out ALL commands other than '/manload' --- EssentialsGroupManager/src/Changelog.txt | 5 +- .../org/anjocaido/groupmanager/GroupManager.java | 170 ++++++++++++++++----- .../org/anjocaido/groupmanager/utils/Tasks.java | 41 +++++ 3 files changed, 173 insertions(+), 43 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 0a9708773..2c38acf1b 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -169,4 +169,7 @@ v 2.0: - Expand 'manwhois' to also list a users subgroups. - Fix a concurrent modification error when removing all attachments. - Better handling of errors in user and group yml's. - - Added missing confirmation message on '/manload'. \ No newline at end of file + - Added missing confirmation message on '/manload'. + - Stop the error on shutdown if GM failed to load at startup. + - GroupManager will now generate it's own log (in the GM folder) to keep things tidy, but also to account of those players unable to find/access their server.log. + - Startup errors will now lock out ALL commands other than '/manload' \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index e10675e8d..b39b640a4 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -14,6 +14,7 @@ import org.anjocaido.groupmanager.data.Group; import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; import org.anjocaido.groupmanager.dataholder.WorldDataHolder; import java.io.File; +import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; @@ -60,6 +61,9 @@ public class GroupManager extends JavaPlugin { private Map selectedWorlds = new HashMap(); private WorldsHolder worldsHolder; private boolean validateOnlinePlayer = true; + + private String lastError = ""; + /** * @return the validateOnlinePlayer */ @@ -108,8 +112,10 @@ public class GroupManager extends JavaPlugin { WorldEvents = null; // Remove all attachments before clearing - BukkitPermissions.removeAllAttachments(); - BukkitPermissions = null; + if (BukkitPermissions != null) { + BukkitPermissions.removeAllAttachments(); + BukkitPermissions = null; + } // EXAMPLE: Custom code, here we just output some info so we can check that // all is well @@ -118,53 +124,108 @@ public class GroupManager extends JavaPlugin { GroupManager.logger.removeHandler(ch); } - @Override + //@Override public void onEnable() { - GroupManager.logger.setUseParentHandlers(false); - ch = new GMLoggerHandler(); - GroupManager.logger.addHandler(ch); - logger.setLevel(Level.ALL); - - // 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); + + try { + lastError = ""; + + GroupManager.logger.setUseParentHandlers(false); + ch = new GMLoggerHandler(); + GroupManager.logger.addHandler(ch); + logger.setLevel(Level.ALL); + + // 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) { + GroupManager.logger.severe("Can't enable " + pdfFile.getName() + " version " + pdfFile.getVersion() + ", bad loading!"); + this.getServer().getPluginManager().disablePlugin(this); + throw new IllegalStateException("An error ocurred while loading GroupManager"); + } + + // Set a few defaults (reloads) + setLoaded(false); + + // Initialize the world listener and bukkit permissions to handle + // events. + WorldEvents = new GMWorldListener(this); + BukkitPermissions = new BukkitPermissions(this); + + enableScheduler(); + + /* + * Schedule a Bukiit Permissions update for 1 tick later. All plugins + * will be loaded by then + */ + + if (getServer().getScheduler().scheduleSyncDelayedTask(this, new BukkitPermsUpdateTask(), 1) == -1) { + GroupManager.logger.severe("Could not schedule superperms Update."); + setLoaded(true); + } + + System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!"); + + // Register as a service + this.getServer().getServicesManager().register(WorldsHolder.class, this.worldsHolder, this, ServicePriority.Lowest); + } catch (Exception ex) { + + /* + * Store the error and write to the log. + */ + saveErrorLog(ex); + /* + * Throw an error so Bukkit knows about it. + */ + throw new IllegalArgumentException(ex.getMessage(),ex); - PluginDescriptionFile pdfFile = this.getDescription(); - if (worldsHolder == null) { - GroupManager.logger.severe("Can't enable " + pdfFile.getName() + " version " + pdfFile.getVersion() + ", bad loading!"); - this.getServer().getPluginManager().disablePlugin(this); - throw new IllegalStateException("An error ocurred while loading GroupManager"); } - - // Set a few defaults (reloads) - setLoaded(false); + } + + /** + * Write an error.log + * + * @param ex + */ + private void saveErrorLog(Exception ex) { - // Initialize the world listener and bukkit permissions to handle - // events. - WorldEvents = new GMWorldListener(this); - BukkitPermissions = new BukkitPermissions(this); - - enableScheduler(); - - /* - * Schedule a Bukiit Permissions update for 1 tick later. All plugins - * will be loaded by then - */ - - if (getServer().getScheduler().scheduleSyncDelayedTask(this, new BukkitPermsUpdateTask(), 1) == -1) { - GroupManager.logger.severe("Could not schedule superperms Update."); - setLoaded(true); + if (!getDataFolder().exists()) { + getDataFolder().mkdirs(); + } + + lastError = ex.getMessage(); + + GroupManager.logger.severe("==================================================="); + GroupManager.logger.severe("= ERROR REPORT START ="); + GroupManager.logger.severe("==================================================="); + GroupManager.logger.severe("=== PLEASE COPY AND PASTE THE ERROR.LOG FROM THE =="); + GroupManager.logger.severe("= GROUPMANAGER FOLDER TO AN ESSENTIALS DEVELOPER ="); + GroupManager.logger.severe("==================================================="); + GroupManager.logger.severe(lastError); + GroupManager.logger.severe("==================================================="); + GroupManager.logger.severe("= ERROR REPORT ENDED ="); + GroupManager.logger.severe("==================================================="); + + // Append this error to the error log. + try { + String error = "=============================== GM ERROR LOG ===============================\n\n"; + error += Tasks.getStackTraceAsString(ex); + error += "\n============================================================================\n"; + + Tasks.appendStringToFile(error, (getDataFolder() + System.getProperty("file.separator") + "ERROR.LOG")); + } catch (IOException e) { + // Failed to write file. + e.printStackTrace(); } - System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!"); - - // Register as a service - this.getServer().getServicesManager().register(WorldsHolder.class, this.worldsHolder, this, ServicePriority.Lowest); } public static boolean isLoaded() { @@ -300,10 +361,17 @@ public class GroupManager extends JavaPlugin { Group senderGroup = null; User senderUser = null; boolean isOpOverride = config.isOpOverride(); + // DETERMINING PLAYER INFORMATION if (sender instanceof Player) { senderPlayer = (Player) sender; + + if (!lastError.isEmpty() && !commandLabel.equalsIgnoreCase("manload")) { + sender.sendMessage(ChatColor.RED + "All commands are locked due to an error. Check the log and then try a '/manload'.)"); + return true; + } + senderUser = worldsHolder.getWorldData(senderPlayer).getUser(senderPlayer.getName()); senderGroup = senderUser.getGroup(); isOpOverride = (isOpOverride && (senderPlayer.isOp() || worldsHolder.getWorldPermissions(senderPlayer).has(senderPlayer, "groupmanager.op"))); @@ -313,6 +381,12 @@ public class GroupManager extends JavaPlugin { playerCanDo = true; } } else if (sender instanceof ConsoleCommandSender) { + + if (!lastError.isEmpty() && !commandLabel.equalsIgnoreCase("manload")) { + sender.sendMessage(ChatColor.RED + "All commands are locked due to an error. Check the log and then try a '/manload'.)"); + return true; + } + isConsole = true; } @@ -1560,10 +1634,17 @@ public class GroupManager extends JavaPlugin { return true; case manload: + /** * Attempt to reload a specific world */ if (args.length > 0) { + + if (!lastError.isEmpty()) { + sender.sendMessage(ChatColor.RED + "All commands are locked due to an error. Check the log and then try a '/manload'.)"); + return true; + } + auxString = ""; for (int i = 0; i < args.length; i++) { auxString += args[i]; @@ -1588,6 +1669,11 @@ public class GroupManager extends JavaPlugin { /** * Reload all settings and data as no world was specified. */ + + /* + * Reset the last error as we are attempting a fresh load. + */ + lastError = ""; onDisable(); onEnable(); diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/Tasks.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/Tasks.java index f3defd94a..663da1123 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/Tasks.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/Tasks.java @@ -4,12 +4,17 @@ */ package org.anjocaido.groupmanager.utils; +import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.List; @@ -17,11 +22,25 @@ import java.util.List; import org.anjocaido.groupmanager.GroupManager; import org.anjocaido.groupmanager.data.Group; + /** * * @author gabrielcouto */ public abstract class Tasks { + + /** + * Gets the exception stack trace as a string. + * + * @param exception + * @return stack trace as a string + */ + public static String getStackTraceAsString(Exception exception) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + exception.printStackTrace(pw); + return sw.toString(); + } public static void copy(InputStream src, File dst) throws IOException { InputStream in = src; @@ -44,6 +63,28 @@ public abstract class Tasks { InputStream in = new FileInputStream(src); copy(in, dst); } + + /** + * Appends a string to a file + * + * @param data + * @param file + */ + public static void appendStringToFile(String data, String file) throws IOException { + + FileWriter outStream = new FileWriter("." + System.getProperty("file.separator") + file, true); + + BufferedWriter out = new BufferedWriter(outStream); + + data.replaceAll("\n", System.getProperty("line.separator")); + + out.append(new SimpleDateFormat("yyyy-MM-dd HH-mm").format(System.currentTimeMillis())); + out.append(System.getProperty("line.separator")); + out.append(data); + out.append(System.getProperty("line.separator")); + + out.close(); + } public static void removeOldFiles(GroupManager gm, File folder) { if (folder.isDirectory()) { -- cgit v1.2.3 From cd24ffbadac6c48931f5ff33457950103b0e62da Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 10 Apr 2012 20:48:34 +0100 Subject: Fix 'manuadd' to use the default or selected world (via 'manselect'), if the world is not specified in the command. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GroupManager.java | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 2c38acf1b..7c10cc3ac 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -172,4 +172,5 @@ v 2.0: - Added missing confirmation message on '/manload'. - Stop the error on shutdown if GM failed to load at startup. - GroupManager will now generate it's own log (in the GM folder) to keep things tidy, but also to account of those players unable to find/access their server.log. - - Startup errors will now lock out ALL commands other than '/manload' \ No newline at end of file + - Startup errors will now lock out ALL commands other than '/manload' + - Fix 'manuadd' to use the default or selected world (via 'manselect'), if the world is not specified in the command. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index b39b640a4..1177e3357 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -457,9 +457,18 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ | optional [world])"); return false; } - // Select the relevant world - dataHolder = worldsHolder.getWorldData((args.length == 3)? args[2]:Bukkit.getWorlds().get(0).getName()); - permissionHandler = dataHolder.getPermissionsHandler(); + + // Select the relevant world (if specified) + if (args.length == 3) { + dataHolder = worldsHolder.getWorldData(args[2]); + permissionHandler = dataHolder.getPermissionsHandler(); + } + + // Validating state of sender + if (dataHolder == null || permissionHandler == null) { + if (!setDefaultWorldHandler(sender)) + return true; + } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { return false; -- cgit v1.2.3 From 25759064ff4c518193185fe3e993634408230eb7 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Wed, 11 Apr 2012 19:10:28 +0100 Subject: Expand GlobalGroups.yml and groups.yml to cover the VanishNoPacket plugin. Demonstrating how to negate and add nodes when using the '*' permission with inheritance. --- EssentialsGroupManager/src/Changelog.txt | 3 +- EssentialsGroupManager/src/globalgroups.yml | 186 ++++++++++++++------- EssentialsGroupManager/src/groups.yml | 23 ++- .../groupmanager/dataholder/WorldDataHolder.java | 10 +- 4 files changed, 146 insertions(+), 76 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 7c10cc3ac..b957f4515 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -173,4 +173,5 @@ v 2.0: - Stop the error on shutdown if GM failed to load at startup. - GroupManager will now generate it's own log (in the GM folder) to keep things tidy, but also to account of those players unable to find/access their server.log. - Startup errors will now lock out ALL commands other than '/manload' - - Fix 'manuadd' to use the default or selected world (via 'manselect'), if the world is not specified in the command. \ No newline at end of file + - Fix 'manuadd' to use the default or selected world (via 'manselect'), if the world is not specified in the command. + - Expand GlobalGroups.yml and groups.yml to cover the VanishNoPacket plugin. Demonstrating how to negate and add nodes when using the '*' permission with inheritance. \ No newline at end of file diff --git a/EssentialsGroupManager/src/globalgroups.yml b/EssentialsGroupManager/src/globalgroups.yml index 885c6675d..fa8808e00 100644 --- a/EssentialsGroupManager/src/globalgroups.yml +++ b/EssentialsGroupManager/src/globalgroups.yml @@ -1,5 +1,101 @@ +# These groups only contain permission nodes. +# +# **** You can NOT add anything other than permission nodes **** +# +# These collections are to be inherited in your different worlds groups.yml's +# They can also be added as one of a users subgroups, but NOT as a primary group. +# These collections are available to ALL group and user yml's. +# +# Add to and customize these groups to fit yoru needs. + groups: +# Permission nodes for GroupManager +# by ElgarL, snowleo, continued from gabrielcouto's original +# http://dev.bukkit.org/server-mods/essentials/ + + g:groupmanager_default: + permissions: + - groupmanager.notify.self + + g:groupmanager_moderator: + permissions: + - groupmanager.listgroups + - groupmanager.mandemote + - groupmanager.manpromote + - groupmanager.manselect + - groupmanager.manuadd + - groupmanager.manudel + - groupmanager.manwhois + - groupmanager.notify.other + + g:groupmanager_admin: + permissions: + - groupmanager.mantogglevalidate + - groupmanager.mansave + - groupmanager.mangcheckp + - groupmanager.manglistp + - groupmanager.manucheckp + - groupmanager.manulistp + +# Permission nodes for CraftBukkit +# by many devs and contributors +# http://dl.bukkit.org/ + + g:bukkit_default: + permissions: + - bukkit.broadcast.user + - -bukkit.command.plugins + + g:bukkit_moderator: + permissions: + - bukkit.command.ban + - bukkit.command.ban.ip + - bukkit.command.ban.player + - bukkit.command.gamemode + - bukkit.command.kick + - bukkit.command.unban + - bukkit.command.unban.ip + - bukkit.command.unban.player + + g:bukkit_admin: + permissions: + - bukkit.broadcast + - bukkit.broadcast.admin + - bukkit.command.give + - bukkit.command.help + - bukkit.command.kill + - bukkit.command.list + - bukkit.command.me + - -bukkit.command.op + - -bukkit.command.op.give + - -bukkit.command.op.take + - bukkit.command.plugins + - bukkit.command.reload + - bukkit.command.save + - bukkit.command.save.disable + - bukkit.command.save.enable + - bukkit.command.save.perform + - bukkit.command.say + - bukkit.command.stop + - bukkit.command.teleport + - bukkit.command.tell + - bukkit.command.time + - bukkit.command.time.add + - bukkit.command.time.set + - bukkit.command.version + - bukkit.command.whitelist + - bukkit.command.whitelist.add + - bukkit.command.whitelist.disable + - bukkit.command.whitelist.enable + - bukkit.command.whitelist.list + - bukkit.command.whitelist.reload + - bukkit.command.whitelist.remove + +# Permission nodes for Essentials +# by ementalo, snowleo, and KHobbits +# http://dev.bukkit.org/server-mods/essentials/ + g:essentials_default: permissions: - essentials.help @@ -8,7 +104,6 @@ groups: - essentials.motd - essentials.rules - essentials.spawn - - groupmanager.notify.self g:essentials_builder: permissions: @@ -101,14 +196,6 @@ groups: - essentials.weather - essentials.whois - essentials.world - - groupmanager.listgroups - - groupmanager.mandemote - - groupmanager.manpromote - - groupmanager.manselect - - groupmanager.manuadd - - groupmanager.manudel - - groupmanager.manwhois - - groupmanager.notify.other g:essentials_admin: permissions: @@ -118,62 +205,13 @@ groups: - -essentials.reloadall - -essentials.plugin - essentials.* - - groupmanager.mantogglevalidate - - groupmanager.mansave - - groupmanager.mangcheckp - - groupmanager.manglistp - - groupmanager.manucheckp - - groupmanager.manulistp - - g:bukkit_default: - permissions: - - bukkit.broadcast.user - - -bukkit.command.plugins - - g:bukkit_moderator: - permissions: - - bukkit.command.ban - - bukkit.command.ban.ip - - bukkit.command.ban.player - - bukkit.command.gamemode - - bukkit.command.kick - - bukkit.command.unban - - bukkit.command.unban.ip - - bukkit.command.unban.player - g:bukkit_admin: +# Permission nodes for Towny by ElgarL +# http://dev.bukkit.org/server-mods/towny-advanced/ + + g:towny_default: permissions: - - bukkit.broadcast - - bukkit.broadcast.admin - - bukkit.command.give - - bukkit.command.help - - bukkit.command.kill - - bukkit.command.list - - bukkit.command.me - - -bukkit.command.op - - -bukkit.command.op.give - - -bukkit.command.op.take - - bukkit.command.plugins - - bukkit.command.reload - - bukkit.command.save - - bukkit.command.save.disable - - bukkit.command.save.enable - - bukkit.command.save.perform - - bukkit.command.say - - bukkit.command.stop - - bukkit.command.teleport - - bukkit.command.tell - - bukkit.command.time - - bukkit.command.time.add - - bukkit.command.time.set - - bukkit.command.version - - bukkit.command.whitelist - - bukkit.command.whitelist.add - - bukkit.command.whitelist.disable - - bukkit.command.whitelist.enable - - bukkit.command.whitelist.list - - bukkit.command.whitelist.reload - - bukkit.command.whitelist.remove + - towny.chat.general g:towny_builder: permissions: @@ -224,4 +262,24 @@ groups: - towny.admin - -towny.wild.destroy.119 - -towny.wild.destroy.120 - - towny.chat.admin \ No newline at end of file + - towny.chat.admin + +# Permission nodes for VanishNoPacket by mbaxter +# http://dev.bukkit.org/server-mods/vanish/ + + g:vanish_moderator: + permissions: + - -vanish.* + - vanish.vanish + - vanish.smokin + - vanish.nofollow + - vanish.nopickup + - vanish.preventincomingdamage + - vanish.hooks.dynmap.alwayshidden + - vanish.hooks.essentials.hide + + g:vanish_admin: + permissions: + - vanish.silentjoin + - vanish.silentquit + - vanish.silentchests \ No newline at end of file diff --git a/EssentialsGroupManager/src/groups.yml b/EssentialsGroupManager/src/groups.yml index ec8b0422f..9c63ffd94 100644 --- a/EssentialsGroupManager/src/groups.yml +++ b/EssentialsGroupManager/src/groups.yml @@ -1,10 +1,12 @@ # Group inheritance -# any inherited groups prefixed with a g: are global groups -# These groups are defined in the globalgroups.yml -# and can be inherited in any worlds groups/users.yml. +# +# Any inherited groups prefixed with a g: are global groups +# and are inherited from the GlobalGroups.yml. # # Groups without the g: prefix are groups local to this world -# and defined in the this groups.yml file. +# and are defined in the this groups.yml file. +# +# Local group inheritances define your promotion tree when using 'manpromote/mandemote' groups: Default: @@ -12,8 +14,10 @@ groups: permissions: - -bukkit.command.kill inheritance: - - g:essentials_default + - g:groupmanager_default - g:bukkit_default + - g:essentials_default + - g:towny_default info: prefix: '&e' build: false @@ -34,9 +38,11 @@ groups: permissions: [] inheritance: - builder - - g:essentials_moderator + - g:groupmanager_moderator - g:bukkit_moderator + - g:essentials_moderator - g:towny_moderator + - g:vanish_moderator info: prefix: '&5' build: true @@ -46,9 +52,11 @@ groups: permissions: [] inheritance: - moderator - - g:essentials_admin + - g:groupmanager_admin - g:bukkit_admin + - g:essentials_admin - g:towny_admin + - g:vanish_admin info: prefix: '&c' build: true @@ -57,6 +65,7 @@ groups: default: false permissions: - '*' + - -vanish.* inheritance: - admin info: diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index 135417068..8c974f34a 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -809,12 +809,14 @@ public class WorldDataHolder { String newLine = System.getProperty("line.separator"); out.write("# Group inheritance" + newLine); - out.write("# any inherited groups prefixed with a g: are global groups" + newLine); - out.write("# These groups are defined in the globalgroups.yml" + newLine); - out.write("# and can be inherited in any worlds groups/users.yml." + newLine); + out.write("#" + newLine); + out.write("# Any inherited groups prefixed with a g: are global groups" + newLine); + out.write("# and are inherited from the GlobalGroups.yml." + newLine); out.write("#" + newLine); out.write("# Groups without the g: prefix are groups local to this world" + newLine); - out.write("# and defined in the this groups.yml file." + newLine); + out.write("# and are defined in the this groups.yml file." + newLine); + out.write("#" + newLine); + out.write("# Local group inheritances define your promotion tree when using 'manpromote/mandemote'" + newLine); out.write(newLine); yaml.dump(root, out); -- cgit v1.2.3 From c9e64d9e46c3e97b4be897b4449fdad667753d8e Mon Sep 17 00:00:00 2001 From: snowleo Date: Wed, 11 Apr 2012 22:51:34 +0300 Subject: Prevent that a config file is loaded/saved by more than one thread. --- Essentials/src/com/earth2me/essentials/EssentialsConf.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsConf.java b/Essentials/src/com/earth2me/essentials/EssentialsConf.java index 85c2bbd8c..b2cb1fd12 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsConf.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsConf.java @@ -39,7 +39,7 @@ public class EssentialsConf extends YamlConfiguration this.configFile = configFile; } - public void load() + public synchronized void load() { configFile = configFile.getAbsoluteFile(); if (!configFile.getParentFile().exists()) @@ -356,7 +356,7 @@ public class EssentialsConf extends YamlConfiguration } @Override - public void save(final File file) throws IOException + public synchronized void save(final File file) throws IOException { if (file == null) { -- cgit v1.2.3 From 62a297ec6d2dc417c2e8d97d5e3e9abbf15c6ed6 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Thu, 12 Apr 2012 01:21:22 +0100 Subject: Fix silly nested throw/catch statements. Errors are now correctly generated when reading yml's. --- EssentialsGroupManager/src/Changelog.txt | 3 +- .../org/anjocaido/groupmanager/GlobalGroups.java | 101 ++++--- .../groupmanager/dataholder/WorldDataHolder.java | 313 +++++++++++---------- 3 files changed, 234 insertions(+), 183 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index b957f4515..0bf6c47bf 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -174,4 +174,5 @@ v 2.0: - GroupManager will now generate it's own log (in the GM folder) to keep things tidy, but also to account of those players unable to find/access their server.log. - Startup errors will now lock out ALL commands other than '/manload' - Fix 'manuadd' to use the default or selected world (via 'manselect'), if the world is not specified in the command. - - Expand GlobalGroups.yml and groups.yml to cover the VanishNoPacket plugin. Demonstrating how to negate and add nodes when using the '*' permission with inheritance. \ No newline at end of file + - Expand GlobalGroups.yml and groups.yml to cover the VanishNoPacket plugin. Demonstrating how to negate and add nodes when using the '*' permission with inheritance. + - Fix silly nested throw/catch statements. Errors are now correctly generated when reading yml's. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java index 0219a1a08..6fa8b0d1d 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java @@ -8,6 +8,7 @@ import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; import java.util.Collection; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; @@ -112,50 +113,70 @@ public class GlobalGroups { if (!GGroups.getKeys(false).isEmpty()) { // Read all global groups - Map allGroups = (Map) GGroups.getConfigurationSection("groups").getValues(false); + Map allGroups = new HashMap(); + + try { + allGroups = (Map) GGroups.getConfigurationSection("groups").getValues(false); + } catch (Exception ex) { + //ex.printStackTrace(); + throw new IllegalArgumentException("Your " + GlobalGroupsFile.getPath() + " file is invalid. See console for details.", ex); + } // Load each groups permissions list. if (allGroups != null) { - try { - for (String groupName : allGroups.keySet()) { - Group newGroup = new Group(groupName.toLowerCase()); - Object element; - - // Permission nodes - element = GGroups.get("groups." + groupName + ".permissions"); - - if (element != null) - if (element instanceof List) { - try { - for (String node : (List) element) { - newGroup.addPermission(node); - } - } catch (ClassCastException e) { - throw new IllegalArgumentException("Invalid permission node for global group: " + groupName); - } - } else if (element instanceof String) { - newGroup.addPermission((String) element); - } else - throw new IllegalArgumentException("Unknown type of permission node for global group: " + groupName); - - // Info nodes - element = GGroups.get("groups." + groupName + ".info"); - - if (element != null) - if (element instanceof MemorySection) { - Map vars = new HashMap(); - for (String key : ((MemorySection) element).getKeys(false)) { - vars.put(key, ((MemorySection) element).get(key)); - } - newGroup.setVariables(vars); - } else - throw new IllegalArgumentException("Unknown type of info node for global group: " + groupName); - - // Push a new group - addGroup(newGroup); + + Iterator groupItr = allGroups.keySet().iterator(); + String groupName; + Integer groupCount = 0; + + /* + * loop each group entry + * and read it's data. + */ + while (groupItr.hasNext()) { + try { + groupCount++; + // Attempt to fetch the next group name. + groupName = groupItr.next(); + } catch (Exception ex) { + throw new IllegalArgumentException("Invalid group name for GlobalGroup entry (" + groupCount + ") in file: " + GlobalGroupsFile.getPath(), ex); } - } catch (Exception e) { - throw new IllegalArgumentException("Invalid node type, or bad indentation in GlobalGroups! "); + + Group newGroup = new Group(groupName.toLowerCase()); + Object element; + + // Permission nodes + element = GGroups.get("groups." + groupName + ".permissions"); + + if (element != null) + if (element instanceof List) { + try { + for (String node : (List) element) { + newGroup.addPermission(node); + } + } catch (ClassCastException ex) { + throw new IllegalArgumentException("Invalid permission node for global group: " + groupName, ex); + } + } else if (element instanceof String) { + newGroup.addPermission((String) element); + } else + throw new IllegalArgumentException("Unknown type of permission node for global group: " + groupName); + + // Info nodes + element = GGroups.get("groups." + groupName + ".info"); + + if (element != null) + if (element instanceof MemorySection) { + Map vars = new HashMap(); + for (String key : ((MemorySection) element).getKeys(false)) { + vars.put(key, ((MemorySection) element).get(key)); + } + newGroup.setVariables(vars); + } else + throw new IllegalArgumentException("Unknown type of info node for global group: " + groupName); + + // Push a new group + addGroup(newGroup); } } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index 8c974f34a..6b5958f4b 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -459,160 +459,180 @@ public class WorldDataHolder { //PROCESS GROUPS FILE Map> inheritance = new HashMap>(); + + /* + * Fetch all child nodes under the 'groups' entry. + */ + Map allGroupsNode = new HashMap(); + try { - /* - * Fetch all child nodes under the 'groups' entry. - */ - Map allGroupsNode = (Map) groupsRootDataNode.get("groups"); - Iterator groupItr = allGroupsNode.keySet().iterator(); - String groupKey; - Integer groupCount = 0; - - /* - * loop each group entry - * and read it's data. - */ - while (groupItr.hasNext()) { - try { - groupCount++; - // Attempt to fetch the next group name. - groupKey = groupItr.next(); - } catch (Exception e) { - throw new IllegalArgumentException("Invalid node type for group entry (" + groupCount + ") in file: " + groupsFile.getPath()); - } - - /* - * Fetch this groups child nodes - */ - Map thisGroupNode = (Map) allGroupsNode.get(groupKey); - /* - * Create a new group with this name - * in the assigned data source. - */ - Group thisGrp = ph.createGroup(groupKey); - - if (thisGrp == null) { - throw new IllegalArgumentException("I think this Group was declared more than once: " + groupKey + " in file: " + groupsFile.getPath()); + allGroupsNode = (Map) groupsRootDataNode.get("groups"); + } catch (Exception ex) { + //ex.printStackTrace(); + throw new IllegalArgumentException("Your " + groupsFile.getPath() + " file is invalid. See console for details.", ex); + } + + + Iterator groupItr = allGroupsNode.keySet().iterator(); + String groupKey; + Integer groupCount = 0; + + /* + * loop each group entry + * and read it's data. + */ + while (groupItr.hasNext()) { + try { + groupCount++; + // Attempt to fetch the next group name. + groupKey = groupItr.next(); + } catch (Exception ex) { + throw new IllegalArgumentException("Invalid group name for group entry (" + groupCount + ") in file: " + groupsFile.getPath(), ex); + } + + /* + * Fetch this groups child nodes + */ + Map thisGroupNode = new HashMap(); + + try { + thisGroupNode = (Map) allGroupsNode.get(groupKey); + } catch (Exception ex) { + throw new IllegalArgumentException("Invalid child nodes for group '" + groupKey + "' in file: " + groupsFile.getPath(), ex); + } + + /* + * Create a new group with this name + * in the assigned data source. + */ + Group thisGrp = ph.createGroup(groupKey); + + if (thisGrp == null) { + throw new IllegalArgumentException("I think this Group was declared more than once: " + groupKey + " in file: " + groupsFile.getPath()); + } + + /* + * If no default node is found set it as false. + */ + if (thisGroupNode.get("default") == null) { + thisGroupNode.put("default", false); + } else if ((Boolean.parseBoolean(thisGroupNode.get("default").toString()))) { + /* + * Set this as the default group. + * Warn if some other group has already claimed that position. + */ + if (ph.getDefaultGroup() != null) { + GroupManager.logger.warning("The group " + thisGrp.getName() + " is claiming to be default where" + ph.getDefaultGroup().getName() + " already was."); + GroupManager.logger.warning("Overriding first request for file: " + groupsFile.getPath()); } - /* - * If no default node is found set it as false. - */ - if (thisGroupNode.get("default") == null) { - thisGroupNode.put("default", false); - } else if ((Boolean.parseBoolean(thisGroupNode.get("default").toString()))) { + ph.setDefaultGroup(thisGrp); + } + + //PERMISSIONS NODE + + /* + * If no permissions node is found, or it's empty + * set an empty permission list + */ + if (thisGroupNode.get("permissions") == null) { + thisGroupNode.put("permissions", new ArrayList()); + } else { + /* + * There is a permission list Which seems to hold some data + */ + if (thisGroupNode.get("permissions") instanceof List) { /* - * Set this as the default group. - * Warn if some other group has already claimed that position. + * Check each entry and add it as a new permission. */ - if (ph.getDefaultGroup() != null) { - GroupManager.logger.warning("The group " + thisGrp.getName() + " is claiming to be default where" + ph.getDefaultGroup().getName() + " already was."); - GroupManager.logger.warning("Overriding first request for file: " + groupsFile.getPath()); + for (Object o : ((List) thisGroupNode.get("permissions"))) { + try { + /* + * Only add this permission if it's not empty. + */ + if (!thisGroupNode.get("permissions").toString().isEmpty()) + thisGrp.addPermission(o.toString()); + + } catch (NullPointerException ex) { + // Ignore this entry as it's null. It can be safely dropped + } catch (Exception ex) { + throw new IllegalArgumentException("Invalid formatting found in permissions section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); + } } - ph.setDefaultGroup(thisGrp); - } - - //PERMISSIONS NODE - try { + } else if (thisGroupNode.get("permissions") instanceof String) { /* - * If no permissions node is found, or it's empty - * set an empty permission list + * Only add this permission if it's not empty. */ - if (thisGroupNode.get("permissions") == null) { - thisGroupNode.put("permissions", new ArrayList()); - } else { - /* - * There is a permission list Which seems to hold some data - */ - if (thisGroupNode.get("permissions") instanceof List) { - /* - * Check each entry and add it as a new permission. - */ - for (Object o : ((List) thisGroupNode.get("permissions"))) { - try { - /* - * Only add this permission if it's not empty. - */ - if (!thisGroupNode.get("permissions").toString().isEmpty()) - thisGrp.addPermission(o.toString()); - } catch (NullPointerException e) { - // Ignore this entry as it's null. It can be safely dropped - } - } - } else if (thisGroupNode.get("permissions") instanceof String) { - /* - * Only add this permission if it's not empty. - */ - if (!thisGroupNode.get("permissions").toString().isEmpty()) - thisGrp.addPermission((String) thisGroupNode.get("permissions")); - } else { - throw new IllegalArgumentException("Unknown type of permissions node(Should be String or List) for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } - /* - * Sort all permissions so they are in the correct order for checking. - */ - thisGrp.sortPermissions(); - } - } catch (Exception e) { - throw new IllegalArgumentException("Invalid formatting found in permissions section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } - - //INFO NODE - try { - if (thisGroupNode.get("info") instanceof Map) { - Map infoNode = (Map) thisGroupNode.get("info"); - if (infoNode != null) { - thisGrp.setVariables(infoNode); - } - } else - throw new IllegalArgumentException("Unknown entry found in Info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } catch (Exception e1) { - throw new IllegalArgumentException("Invalid formatting found in info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } + if (!thisGroupNode.get("permissions").toString().isEmpty()) + thisGrp.addPermission((String) thisGroupNode.get("permissions")); - //END INFO NODE - - try { - if (thisGroupNode.get("inheritance") == null || thisGroupNode.get("inheritance") instanceof List) { - Object inheritNode = thisGroupNode.get("inheritance"); - if (inheritNode == null) { - thisGroupNode.put("inheritance", new ArrayList()); - } else if (inheritNode instanceof List) { - List groupsInh = (List) inheritNode; - for (String grp : groupsInh) { - if (inheritance.get(groupKey) == null) { - List thisInherits = new ArrayList(); - inheritance.put(groupKey, thisInherits); - } - inheritance.get(groupKey).add(grp); - - } - } - }else - throw new IllegalArgumentException("Unknown entry found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } catch (Exception e2) { - throw new IllegalArgumentException("Invalid formatting found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } else { + throw new IllegalArgumentException("Unknown type of permissions node(Should be String or List) for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); } + /* + * Sort all permissions so they are in the correct order for checking. + */ + thisGrp.sortPermissions(); } - } catch (Exception ex) { - ex.printStackTrace(); - throw new IllegalArgumentException("Your " + groupsFile.getPath() + " file is invalid. See console for details."); + //INFO NODE + try { + if (thisGroupNode.get("info") instanceof Map) { + Map infoNode = (Map) thisGroupNode.get("info"); + if (infoNode != null) { + thisGrp.setVariables(infoNode); + } + } else + throw new IllegalArgumentException("Unknown entry found in Info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } catch (Exception ex) { + throw new IllegalArgumentException("Invalid formatting found in info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); + } + + //END INFO NODE + + try { + if (thisGroupNode.get("inheritance") == null || thisGroupNode.get("inheritance") instanceof List) { + Object inheritNode = thisGroupNode.get("inheritance"); + if (inheritNode == null) { + thisGroupNode.put("inheritance", new ArrayList()); + } else if (inheritNode instanceof List) { + List groupsInh = (List) inheritNode; + for (String grp : groupsInh) { + if (inheritance.get(groupKey) == null) { + List thisInherits = new ArrayList(); + inheritance.put(groupKey, thisInherits); + } + inheritance.get(groupKey).add(grp); + + } + } + }else + throw new IllegalArgumentException("Unknown entry found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } catch (Exception ex) { + throw new IllegalArgumentException("Invalid formatting found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); + } } + if (ph.getDefaultGroup() == null) { throw new IllegalArgumentException("There was no Default Group declared in file: " + groupsFile.getPath()); } - for (String groupKey : inheritance.keySet()) { - List inheritedList = inheritance.get(groupKey); - Group thisGroup = ph.getGroup(groupKey); - for (String inheritedKey : inheritedList) { - if (inheritedKey != null) { - Group inheritedGroup = ph.getGroup(inheritedKey); - if (thisGroup != null && inheritedGroup != null) { - thisGroup.addInherits(inheritedGroup); - } - } - } + + /* + * Build the inheritance map and recored any errors + */ + for (String group : inheritance.keySet()) { + List inheritedList = inheritance.get(group); + Group thisGroup = ph.getGroup(group); + if (thisGroup != null) + for (String inheritedKey : inheritedList) { + if (inheritedKey != null) { + Group inheritedGroup = ph.getGroup(inheritedKey); + if (inheritedGroup != null) { + thisGroup.addInherits(inheritedGroup); + } else + GroupManager.logger.warning("Inherited group '" + inheritedKey + "' not found for group " + thisGroup.getName() + ". Ignoring entry in file: " + groupsFile.getPath()); + } + } } ph.removeGroupsChangedFlag(); @@ -654,7 +674,17 @@ public class WorldDataHolder { } // PROCESS USERS FILE - Map allUsersNode = (Map) usersRootDataNode.get("users"); + Map allUsersNode = new HashMap(); + + /* + * Fetch all child nodes under the 'users' entry. + */ + try { + allUsersNode = (Map) usersRootDataNode.get("users"); + } catch (Exception ex) { + //ex.printStackTrace(); + throw new IllegalArgumentException("Your " + usersFile.getPath() + " file is invalid. See console for details.", ex); + } // Load users if the file is NOT empty if (allUsersNode != null) { @@ -668,8 +698,8 @@ public class WorldDataHolder { userCount++; // Attempt to fetch the next user name. usersKey = usersItr.next(); - } catch (Exception e) { - throw new IllegalArgumentException("Invalid node type for user entry (" + userCount + ") in file: " + usersFile.getPath()); + } catch (Exception ex) { + throw new IllegalArgumentException("Invalid node type for user entry (" + userCount + ") in file: " + usersFile.getPath(), ex); } Map thisUserNode = null; @@ -702,7 +732,6 @@ public class WorldDataHolder { thisUser.addPermission(thisUserNode.get("permissions").toString()); } catch (NullPointerException e) { // Ignore this entry as it's null. - //throw new IllegalArgumentException("Invalid permission node for user: " + thisUser.getName() + " in file: " + UserFile.getPath()); } } thisUser.sortPermissions(); -- cgit v1.2.3 From 9f744beb135fb93ca0b875369c4d3bc48a20cbb8 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Thu, 12 Apr 2012 03:21:38 +0100 Subject: Unregister the worldsHolder as a service on a reload/shutdown instead of the whole plugin. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GroupManager.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 0bf6c47bf..648f5d1de 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -175,4 +175,5 @@ v 2.0: - Startup errors will now lock out ALL commands other than '/manload' - Fix 'manuadd' to use the default or selected world (via 'manselect'), if the world is not specified in the command. - Expand GlobalGroups.yml and groups.yml to cover the VanishNoPacket plugin. Demonstrating how to negate and add nodes when using the '*' permission with inheritance. - - Fix silly nested throw/catch statements. Errors are now correctly generated when reading yml's. \ No newline at end of file + - Fix silly nested throw/catch statements. Errors are now correctly generated when reading yml's. + - Unregister the worldsHolder as a service on a reload/shutdown instead of the whole plugin. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 1177e3357..1c4011ff8 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -98,7 +98,7 @@ public class GroupManager extends JavaPlugin { setLoaded(false); // Un-register this service. - this.getServer().getServicesManager().unregister(this); + this.getServer().getServicesManager().unregister(this.worldsHolder); disableScheduler(); // Shutdown before we save, so it doesn't interfere. if (worldsHolder != null) { -- cgit v1.2.3 From d1eb7e5614f50c6483440c05efa8ebe7f283c710 Mon Sep 17 00:00:00 2001 From: ementalo Date: Thu, 12 Apr 2012 21:26:19 +0100 Subject: Display name of new world on world change --- .../com/earth2me/essentials/EssentialsPlayerListener.java | 11 ++++++++--- Essentials/src/messages.properties | 1 + Essentials/src/messages_cs.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_it.properties | 1 + Essentials/src/messages_nl.properties | 1 + Essentials/src/messages_pl.properties | 15 ++++++++------- Essentials/src/messages_pt.properties | 1 + 12 files changed, 26 insertions(+), 10 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 604703770..38243cf76 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -319,17 +319,22 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.MONITOR) public void onPlayerChangedWorld(final PlayerChangedWorldEvent event) { - final User user = ess.getUser(event.getPlayer()); + final User user = ess.getUser(event.getPlayer()); + final String newWorld = event.getPlayer().getLocation().getWorld().getName(); user.setDisplayNick(); updateCompass(user); - - if (ess.getSettings().getNoGodWorlds().contains(event.getPlayer().getLocation().getWorld().getName())) + if (ess.getSettings().getNoGodWorlds().contains(newWorld)) { if (user.isGodModeEnabledRaw()) { user.sendMessage(_("noGodWorldWarning")); } } + + if(!event.getPlayer().getWorld().getName().equals(newWorld)) + { + user.sendMessage(_("currentWorld", newWorld)); + } } @EventHandler(priority = EventPriority.NORMAL) diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index df0706ea8..92e436f0b 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -51,6 +51,7 @@ creatingConfigFromTemplate=Creating config from template: {0} creatingEmptyConfig=Creating empty config: {0} creative=creative currency={0}{1} +currentWorld=Current World: {0} day=day days=days defaultBanReason=The Ban Hammer has spoken! diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index aceb622ee..85364f185 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -51,6 +51,7 @@ creatingConfigFromTemplate=Vytvari se nastaveni podle sablony: {0} creatingEmptyConfig=Vytvari se prazdne nastaveni: {0} creative=kreativ currency={0}{1} +currentWorld=Current World: {0} day=den days=dny defaultBanReason=Ban promluvil! diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index e06985430..a76027543 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -51,6 +51,7 @@ creatingConfigFromTemplate=Opretter config fra skabelon: {0} creatingEmptyConfig=Opretter tom config: {0} creative=creative currency={0}{1} +currentWorld=Current World: {0} day=dag days=dage defaultBanReason=Banhammeren har talt! diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 4e4f7e78d..b03c91067 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -51,6 +51,7 @@ creatingConfigFromTemplate=Erstelle Konfiguration aus Vorlage: {0} creatingEmptyConfig=Erstelle leere Konfiguration: {0} creative=creative currency={0}{1} +currentWorld=Current World: {0} day=Tag days=Tage defaultBanReason=Der Bann-Hammer hat gesprochen! diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 34367f115..20e6e6a12 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -51,6 +51,7 @@ creatingConfigFromTemplate=Creating config from template: {0} creatingEmptyConfig=Creating empty config: {0} creative=creative currency={0}{1} +currentWorld=Current World: {0} day=day days=days defaultBanReason=The Ban Hammer has spoken! diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index ad1aefe6c..c0f15256b 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -51,6 +51,7 @@ creatingConfigFromTemplate=Creando configuracion desde el template: {0} creatingEmptyConfig=Creando configuracion vacia: {0} creative=creative currency={0}{1} +currentWorld=Current World: {0} day=dia days=dias defaultBanReason=Baneado por incumplir las normas! diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 0c4b94efc..a7946d3e2 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -51,6 +51,7 @@ creatingConfigFromTemplate=Cr\u00e9ation de la configuration \u00e0 partir du mo creatingEmptyConfig=Cr\u00e9ation d''une configuration vierge : {0} creative=cr\u00e9atif currency={0}{1} +currentWorld=Current World: {0} day=jour days=jours defaultBanReason=Le marteau du bannissement a frapp\u00e9 ! diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties index ee7511cb4..c27366cea 100644 --- a/Essentials/src/messages_it.properties +++ b/Essentials/src/messages_it.properties @@ -51,6 +51,7 @@ creatingConfigFromTemplate=Configurazione dal template: {0} creatingEmptyConfig=Configurazione vuota creata: {0} creative=creativo currency={0}{1} +currentWorld=Current World: {0} day=giorno days=giorni defaultBanReason=Sei stato bannato! diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index d0f56752b..ac80cca70 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -51,6 +51,7 @@ creatingConfigFromTemplate=Bezig met aanmaken van een config vanaf sjabloon: {0} creatingEmptyConfig=Bezig met een lege config aanmaken: {0} creative=creative currency={0}{1} +currentWorld=Current World: {0} day=dag days=dagen defaultBanReason=De Ban Hamer heeft gesproken! diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties index 803b1d1f1..e4666cdda 100644 --- a/Essentials/src/messages_pl.properties +++ b/Essentials/src/messages_pl.properties @@ -51,6 +51,7 @@ creatingConfigFromTemplate=Creating config from template: {0} creatingEmptyConfig=Stworzono pusty config: {0} creative=Tworczy currency={0}{1} +currentWorld=Current World: {0} day=dzien days=dnie defaultBanReason=Admin ma zawsze racje! @@ -92,7 +93,7 @@ failedToWriteConfig=Blad podczas pisania configu {0} false=falsz feed=\u00a77Twoj glod zostal zaspokojony. feedOther=\u00a77Nakarmiono {0}. -fileRenameError=Blad podczas zmiany nazwy pliku “{0}”. +fileRenameError=Blad podczas zmiany nazwy pliku \u0093{0}\u0094. flyMode=\u00a77Latanie {0} dla {1}. foreverAlone=\u00a7cNie masz komu odpisac. freedMemory=Zwolniono {0} MB. @@ -111,7 +112,7 @@ godMode=\u00a77Godmode {0}. haveBeenReleased=\u00a77Zostales wypuszczony. heal=\u00a77Uleczony healOther=\u00a77Uleczono {0}. -helpConsole=Aby uzyskac pomoc z konsoli, wpisz “????. +helpConsole=Aby uzyskac pomoc z konsoli, wpisz \u0093????. helpFrom=\u00a77Komendy od {0}: helpLine=\u00a76/{0}\u00a7f: {1} helpMatching=\u00a77Komendy odpowiadajace "{0}": @@ -128,7 +129,7 @@ ignorePlayer=Od tej chwili ignorujesz gracza {0}. illegalDate=Illegal date format. infoChapter=Wybierz rozdzial: infoChapterPages=Rozdzial {0}, strona \u00a7c{1}\u00a7f z \u00a7c{2}\u00a7f: -infoFileDoesNotExist=Plik “info.txt” nie istnieje. Tworzenie tego pliku. +infoFileDoesNotExist=Plik \u0093info.txt\u0094 nie istnieje. Tworzenie tego pliku. infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Page \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- infoUnknownChapter=Nieznany rozdzial. invBigger=Ekwipunek innego gracza jest wiekszy niz Twoj. @@ -154,13 +155,13 @@ itemSold=\u00a77Sprzedamo za \u00a7c{0} \u00a77({1} {2} po {3} kazdy) itemSoldConsole={0} Sprzedano {1} za \u00a77{2} \u00a77({3} sztuki po {4} kazda) itemSpawn=\u00a77Otrzymywanie {0} {1} itemsCsvNotLoaded=Nie mozna wczytac items.csv. -jailAlreadyIncarcerated=\u00a7cTen gracz jest juz w wiezieniu “{0}”. +jailAlreadyIncarcerated=\u00a7cTen gracz jest juz w wiezieniu \u0093{0}\u0094. jailMessage=\u00a7cZa kazde przewinienie czeka kara. jailNotExist=Nie ma takiego wiezienia.. jailReleased=\u00a77Gracz \u00a7e{0}\u00a77 wypuszczony z wiezienia. jailReleasedPlayerNotify=\u00a77Zostales zwolniony! jailSentenceExtended=Czas pobyty w wiezieniu zwiekszony do: {0) -jailSet=\u00a77Zostalo stworzone wiezienie “{0}”. +jailSet=\u00a77Zostalo stworzone wiezienie \u0093{0}\u0094. jumpError=That would hurt your computer''s brain. kickDefault=Zostales wyproszony z serwera. kickExempt=\u00a7cNie mozesz wyprosic tej osoby. @@ -212,7 +213,7 @@ mutedUserSpeaks={0} probowal sie odezwac, ale jest wyciszony. nearbyPlayers=Gracze w poblizu: {0} negativeBalanceError=Gracz nie moze miec ujemnego stanu konta. nickChanged=Nick zmieniony. -nickDisplayName=\u00a77Musisz wlaczyc “change-displayname” w configu Essential. +nickDisplayName=\u00a77Musisz wlaczyc \u0093change-displayname\u0094 w configu Essential. nickInUse=\u00a7cTen nick jest juz w uzyciu. nickNamesAlpha=\u00a7cNicki musza byc alfanumeryczne. nickNoMore=\u00a77Nie masz juz nicku. @@ -265,7 +266,7 @@ parseError=Blad skladniowy {0} w linii {1}. pendingTeleportCancelled=\u00a7cOczekujace zapytanie teleportacji odrzucone. permissionsError=Brakuje Permissions/GroupManager; prefixy/suffixy czatu zostana wylaczone. playerBanned=\u00a7c{0} zbanowal {1} za {2}. -playerInJail=\u00a7cGracz jest juz w wiezieniu “{0}”. +playerInJail=\u00a7cGracz jest juz w wiezieniu \u0093{0}\u0094. playerJailed=\u00a77Gracz {0} wtracony do wiezienia. playerJailedFor= \u00a77Gracz {0} wtracony do wiezienia na {1}. playerKicked=\u00a7c{0} wywalil {1} za {2}. diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties index 674eeda1e..4f3de9c36 100644 --- a/Essentials/src/messages_pt.properties +++ b/Essentials/src/messages_pt.properties @@ -51,6 +51,7 @@ creatingConfigFromTemplate=Criando arquivo de configura\u00e7ao com o modelo: {0 creatingEmptyConfig=Criando arquivo de configura\u00e7ao vazio: {0} creative=creative currency={0}{1} +currentWorld=Current World: {0} day=dia days=dias defaultBanReason=O martelo proibicao falou! -- cgit v1.2.3 From 2d319fe5aae3f231d6d8cda5ae074238697c1ce7 Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 12 Apr 2012 23:57:19 +0300 Subject: Fix double charge in /jump --- Essentials/src/com/earth2me/essentials/commands/Commandjump.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandjump.java b/Essentials/src/com/earth2me/essentials/commands/Commandjump.java index 39ca305e3..ab73c6e01 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandjump.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandjump.java @@ -37,5 +37,6 @@ public class Commandjump extends EssentialsCommand final Trade charge = new Trade(this.getName(), ess); charge.isAffordableFor(user); user.getTeleport().teleport(loc, charge, TeleportCause.COMMAND); + throw new NoChargeException(); } } -- cgit v1.2.3 From 677534c0b7319691c3139559943b2a5c4e8d2c88 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Fri, 13 Apr 2012 13:58:05 +0100 Subject: Fixed the 'last' nested throw/catch and rework all user and group reading to be certain to trap all errors. --- .../org/anjocaido/groupmanager/GlobalGroups.java | 3 + .../groupmanager/dataholder/WorldDataHolder.java | 292 ++++++++++++++------- 2 files changed, 193 insertions(+), 102 deletions(-) diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java index 6fa8b0d1d..904055d31 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java @@ -142,6 +142,9 @@ public class GlobalGroups { throw new IllegalArgumentException("Invalid group name for GlobalGroup entry (" + groupCount + ") in file: " + GlobalGroupsFile.getPath(), ex); } + /* + * Create a new group with this name. + */ Group newGroup = new Group(groupName.toLowerCase()); Object element; diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index 6b5958f4b..ce6db2b9b 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -439,9 +439,11 @@ public class WorldDataHolder { @SuppressWarnings({"rawtypes", "unchecked"}) protected static void loadGroups(WorldDataHolder ph, File groupsFile) throws FileNotFoundException, IOException { - //READ GROUPS FILE + // READ GROUPS FILE + Yaml yamlGroups = new Yaml(new SafeConstructor()); Map groupsRootDataNode; + if (!groupsFile.exists()) { throw new IllegalArgumentException("The file which should contain groups does not exist!\n" + groupsFile.getPath()); } @@ -457,18 +459,17 @@ public class WorldDataHolder { groupsInputStream.close(); } - //PROCESS GROUPS FILE + // PROCESS GROUPS FILE + Map> inheritance = new HashMap>(); + Map allGroupsNode = null; /* - * Fetch all child nodes under the 'groups' entry. + * Fetch all groups under the 'groups' entry. */ - Map allGroupsNode = new HashMap(); - try { allGroupsNode = (Map) groupsRootDataNode.get("groups"); } catch (Exception ex) { - //ex.printStackTrace(); throw new IllegalArgumentException("Your " + groupsFile.getPath() + " file is invalid. See console for details.", ex); } @@ -479,9 +480,10 @@ public class WorldDataHolder { /* * loop each group entry - * and read it's data. + * and process it's data. */ while (groupItr.hasNext()) { + try { groupCount++; // Attempt to fetch the next group name. @@ -493,7 +495,7 @@ public class WorldDataHolder { /* * Fetch this groups child nodes */ - Map thisGroupNode = new HashMap(); + Map thisGroupNode = null; try { thisGroupNode = (Map) allGroupsNode.get(groupKey); @@ -511,62 +513,80 @@ public class WorldDataHolder { throw new IllegalArgumentException("I think this Group was declared more than once: " + groupKey + " in file: " + groupsFile.getPath()); } - /* - * If no default node is found set it as false. - */ - if (thisGroupNode.get("default") == null) { - thisGroupNode.put("default", false); - } else if ((Boolean.parseBoolean(thisGroupNode.get("default").toString()))) { + // DEFAULT NODE + + Object nodeData = null; + try { + nodeData = thisGroupNode.get("default"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'permissions' for group: " + groupKey + " in file: " + groupsFile.getPath()); + } + + if (nodeData == null) { + /* + * If no 'default' node is found do nothing. + */ + } else if ((Boolean.parseBoolean(nodeData.toString()))) { /* * Set this as the default group. * Warn if some other group has already claimed that position. */ if (ph.getDefaultGroup() != null) { - GroupManager.logger.warning("The group " + thisGrp.getName() + " is claiming to be default where" + ph.getDefaultGroup().getName() + " already was."); - GroupManager.logger.warning("Overriding first request for file: " + groupsFile.getPath()); + GroupManager.logger.warning("The group '" + thisGrp.getName() + "' is claiming to be default where '" + ph.getDefaultGroup().getName() + "' already was."); + GroupManager.logger.warning("Overriding first default request in file: " + groupsFile.getPath()); } ph.setDefaultGroup(thisGrp); } - //PERMISSIONS NODE + // PERMISSIONS NODE + + nodeData = null; + try { + nodeData = thisGroupNode.get("permissions"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'permissions' for '" + groupKey + "' in file: " + groupsFile.getPath()); + } - /* - * If no permissions node is found, or it's empty - * set an empty permission list - */ - if (thisGroupNode.get("permissions") == null) { - thisGroupNode.put("permissions", new ArrayList()); + if (nodeData == null) { + /* + * If no permissions node is found, or it's empty + * do nothing. + */ } else { /* * There is a permission list Which seems to hold some data */ - if (thisGroupNode.get("permissions") instanceof List) { + if (nodeData instanceof List) { /* * Check each entry and add it as a new permission. */ - for (Object o : ((List) thisGroupNode.get("permissions"))) { - try { - /* - * Only add this permission if it's not empty. - */ - if (!thisGroupNode.get("permissions").toString().isEmpty()) - thisGrp.addPermission(o.toString()); - - } catch (NullPointerException ex) { - // Ignore this entry as it's null. It can be safely dropped - } catch (Exception ex) { - throw new IllegalArgumentException("Invalid formatting found in permissions section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); - } + try { + for (Object o : ((List) nodeData)) { + try { + /* + * Only add this permission if it's not empty. + */ + if (!o.toString().isEmpty()) + thisGrp.addPermission(o.toString()); + + } catch (NullPointerException ex) { + // Ignore this entry as it's null. It can be safely dropped + } + } + } catch (Exception ex) { + throw new IllegalArgumentException("Invalid formatting found in 'permissions' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); } - } else if (thisGroupNode.get("permissions") instanceof String) { + + + } else if (nodeData instanceof String) { /* * Only add this permission if it's not empty. */ - if (!thisGroupNode.get("permissions").toString().isEmpty()) - thisGrp.addPermission((String) thisGroupNode.get("permissions")); + if (!nodeData.toString().isEmpty()) + thisGrp.addPermission((String) nodeData); } else { - throw new IllegalArgumentException("Unknown type of permissions node(Should be String or List) for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + throw new IllegalArgumentException("Unknown type of 'permissions' node(Should be String or List) for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); } /* * Sort all permissions so they are in the correct order for checking. @@ -574,44 +594,70 @@ public class WorldDataHolder { thisGrp.sortPermissions(); } - //INFO NODE - try { - if (thisGroupNode.get("info") instanceof Map) { - Map infoNode = (Map) thisGroupNode.get("info"); - if (infoNode != null) { - thisGrp.setVariables(infoNode); + // INFO NODE + + nodeData = null; + try { + nodeData = thisGroupNode.get("info"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'info' section for group: " + groupKey + " in file: " + groupsFile.getPath()); + } + + if (nodeData == null) { + /* + * No info section was found, so leave all variables as defaults. + */ + GroupManager.logger.warning("The group '" + thisGrp.getName() + "' has no 'info' section!"); + GroupManager.logger.warning("Using default values: " + groupsFile.getPath()); + + } else if (nodeData instanceof Map) { + try { + if (nodeData != null) { + thisGrp.setVariables((Map) nodeData); } - } else - throw new IllegalArgumentException("Unknown entry found in Info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } catch (Exception ex) { - throw new IllegalArgumentException("Invalid formatting found in info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); + } catch (Exception ex) { + throw new IllegalArgumentException("Invalid formatting found in 'info' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); + } + + } else + throw new IllegalArgumentException("Unknown entry found in 'info' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + + // INHERITANCE NODE + + nodeData = null; + try { + nodeData = thisGroupNode.get("inheritance"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'inheritance' section for group: " + groupKey + " in file: " + groupsFile.getPath()); } - - //END INFO NODE + + if (nodeData == null || nodeData instanceof List) { + if (nodeData == null) { + /* + * If no inheritance node is found, or it's empty + * do nothing. + */ + } else if (nodeData instanceof List) { - try { - if (thisGroupNode.get("inheritance") == null || thisGroupNode.get("inheritance") instanceof List) { - Object inheritNode = thisGroupNode.get("inheritance"); - if (inheritNode == null) { - thisGroupNode.put("inheritance", new ArrayList()); - } else if (inheritNode instanceof List) { - List groupsInh = (List) inheritNode; - for (String grp : groupsInh) { + try { + for (String grp : (List) nodeData) { if (inheritance.get(groupKey) == null) { - List thisInherits = new ArrayList(); - inheritance.put(groupKey, thisInherits); + inheritance.put(groupKey, new ArrayList()); } inheritance.get(groupKey).add(grp); - } - } - }else - throw new IllegalArgumentException("Unknown entry found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } catch (Exception ex) { - throw new IllegalArgumentException("Invalid formatting found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); - } - } + } catch (Exception ex) { + throw new IllegalArgumentException("Invalid formatting found in 'inheritance' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); + } + + } + }else + throw new IllegalArgumentException("Unknown entry found in 'inheritance' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + + // END GROUP + + } if (ph.getDefaultGroup() == null) { throw new IllegalArgumentException("There was no Default Group declared in file: " + groupsFile.getPath()); @@ -655,7 +701,7 @@ public class WorldDataHolder { @SuppressWarnings({"rawtypes", "unchecked"}) protected static void loadUsers(WorldDataHolder ph, File usersFile) throws FileNotFoundException, IOException { - //READ USERS FILE + // READ USERS FILE Yaml yamlUsers = new Yaml(new SafeConstructor()); Map usersRootDataNode; if (!usersFile.exists()) { @@ -674,7 +720,8 @@ public class WorldDataHolder { } // PROCESS USERS FILE - Map allUsersNode = new HashMap(); + + Map allUsersNode = null; /* * Fetch all child nodes under the 'users' entry. @@ -682,11 +729,11 @@ public class WorldDataHolder { try { allUsersNode = (Map) usersRootDataNode.get("users"); } catch (Exception ex) { - //ex.printStackTrace(); throw new IllegalArgumentException("Your " + usersFile.getPath() + " file is invalid. See console for details.", ex); } // Load users if the file is NOT empty + if (allUsersNode != null) { Iterator usersItr = allUsersNode.keySet().iterator(); @@ -706,30 +753,44 @@ public class WorldDataHolder { try { thisUserNode = (Map) allUsersNode.get(usersKey); } catch (Exception ex) { - throw new IllegalArgumentException("Bad format found in file: " + usersFile.getPath()); + throw new IllegalArgumentException("Bad format found for user: " + usersKey + " in file: " + usersFile.getPath()); } + User thisUser = ph.createUser(usersKey); if (thisUser == null) { throw new IllegalArgumentException("I think this user was declared more than once: " + usersKey + " in file: " + usersFile.getPath()); } - if (thisUserNode.get("permissions") == null) { - thisUserNode.put("permissions", new ArrayList()); + + // USER PERMISSIONS NODES + + Object nodeData = null; + try { + nodeData = thisUserNode.get("permissions"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'permissions' for user: " + usersKey + " in file: " + usersFile.getPath()); + } + + if (nodeData == null) { + /* + * If no permissions node is found, or it's empty + * do nothing. + */ } else { - if (thisUserNode.get("permissions") instanceof List) { - for (Object o : ((List) thisUserNode.get("permissions"))) { + if (nodeData instanceof List) { + for (Object o : ((List) nodeData)) { /* * Only add this permission if it's not empty */ if (!o.toString().isEmpty()) thisUser.addPermission(o.toString()); } - } else if (thisUserNode.get("permissions") instanceof String) { + } else if (nodeData instanceof String) { try { /* * Only add this permission if it's not empty */ - if (!thisUserNode.get("permissions").toString().isEmpty()) - thisUser.addPermission(thisUserNode.get("permissions").toString()); + if (!nodeData.toString().isEmpty()) + thisUser.addPermission(nodeData.toString()); } catch (NullPointerException e) { // Ignore this entry as it's null. } @@ -737,49 +798,76 @@ public class WorldDataHolder { thisUser.sortPermissions(); } - //SUBGROUPS LOADING - if (thisUserNode.get("subgroups") == null) { - thisUserNode.put("subgroups", new ArrayList()); + // SUBGROUPS NODES + + nodeData = null; + try { + nodeData = thisUserNode.get("subgroups"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'subgroups' for user: " + usersKey + " in file: " + usersFile.getPath()); } - if (thisUserNode.get("subgroups") instanceof List) { - for (Object o : ((List) thisUserNode.get("subgroups"))) { + + if (nodeData == null) { + /* + * If no subgroups node is found, or it's empty + * do nothing. + */ + } else if (nodeData instanceof List) { + for (Object o : ((List) nodeData)) { Group subGrp = ph.getGroup(o.toString()); if (subGrp != null) { thisUser.addSubGroup(subGrp); } else { - GroupManager.logger.warning("Subgroup " + o.toString() + " not found for user " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); + GroupManager.logger.warning("Subgroup '" + o.toString() + "' not found for user: " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); } } - } else if (thisUserNode.get("subgroups") instanceof String) { - Group subGrp = ph.getGroup(thisUserNode.get("subgroups").toString()); + } else if (nodeData instanceof String) { + Group subGrp = ph.getGroup(nodeData.toString()); if (subGrp != null) { thisUser.addSubGroup(subGrp); } else { - GroupManager.logger.warning("Subgroup " + thisUserNode.get("subgroups").toString() + " not found for user " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); + GroupManager.logger.warning("Subgroup '" + nodeData.toString() + "' not found for user: " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); } } //USER INFO NODE - //INFO NODE - if (thisUserNode.get("info") instanceof Map) { - Map infoNode = (Map) thisUserNode.get("info"); - if (infoNode != null) { - thisUser.setVariables(infoNode); - } - } else if (thisUserNode.get("info") != null) - throw new IllegalArgumentException("Unknown entry found in Info section for user: " + thisUser.getName() + " in file: " + usersFile.getPath()); + nodeData = null; + try { + nodeData = thisUserNode.get("info"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'info' section for user: " + usersKey + " in file: " + usersFile.getPath()); + } + + if (nodeData == null) { + /* + * If no info node is found, or it's empty + * do nothing. + */ + } else if (nodeData instanceof Map) { + thisUser.setVariables((Map) nodeData); + + } else + throw new IllegalArgumentException("Unknown entry found in 'info' section for user: " + thisUser.getName() + " in file: " + usersFile.getPath()); //END INFO NODE - if (thisUserNode.get("group") != null) { - Group hisGroup = ph.getGroup(thisUserNode.get("group").toString()); + // PRIMARY GROUP + + nodeData = null; + try { + nodeData = thisUserNode.get("group"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'group' section for user: " + usersKey + " in file: " + usersFile.getPath()); + } + + if (nodeData != null) { + Group hisGroup = ph.getGroup(nodeData.toString()); if (hisGroup == null) { GroupManager.logger.warning("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName() + ": Set to '" + ph.getDefaultGroup().getName() + "' for file: " + usersFile.getPath()); hisGroup = ph.getDefaultGroup(); - //throw new IllegalArgumentException("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName()); } thisUser.setGroup(hisGroup); } else { -- cgit v1.2.3 From a028abe03630c1990105f5dbfef5ba44bf11602d Mon Sep 17 00:00:00 2001 From: ElgarL Date: Fri, 13 Apr 2012 14:40:26 +0100 Subject: Update all code formatting to use tabs for indentation. --- EssentialsGroupManager/src/Changelog.txt | 3 +- .../anjocaido/groupmanager/GMConfiguration.java | 144 +- .../org/anjocaido/groupmanager/GlobalGroups.java | 192 +- .../org/anjocaido/groupmanager/GroupManager.java | 317 +-- .../groupmanager/Tasks/BukkitPermsUpdateTask.java | 15 +- .../org/anjocaido/groupmanager/data/DataUnit.java | 294 +-- .../src/org/anjocaido/groupmanager/data/Group.java | 317 +-- .../groupmanager/data/GroupVariables.java | 139 +- .../src/org/anjocaido/groupmanager/data/User.java | 32 +- .../anjocaido/groupmanager/data/UserVariables.java | 73 +- .../org/anjocaido/groupmanager/data/Variables.java | 352 +-- .../groupmanager/dataholder/GroupsDataHolder.java | 20 +- .../dataholder/OverloadedWorldHolder.java | 376 ++-- .../groupmanager/dataholder/UsersDataHolder.java | 18 +- .../groupmanager/dataholder/WorldDataHolder.java | 2279 ++++++++++---------- .../dataholder/worlds/WorldsHolder.java | 1238 +++++------ .../groupmanager/events/GMGroupEvent.java | 105 +- .../groupmanager/events/GMSystemEvent.java | 65 +- .../anjocaido/groupmanager/events/GMUserEvent.java | 107 +- .../groupmanager/events/GMWorldListener.java | 24 +- .../events/GroupManagerEventHandler.java | 23 +- .../permissions/AnjoPermissionsHandler.java | 152 +- .../permissions/BukkitPermissions.java | 153 +- .../permissions/PermissionsReaderInterface.java | 440 ++-- .../groupmanager/utils/GMLoggerHandler.java | 21 +- .../utils/GroupManagerPermissions.java | 41 +- .../groupmanager/utils/PermissionCheckResult.java | 102 +- .../utils/StringPermissionComparator.java | 71 +- .../org/anjocaido/groupmanager/utils/Tasks.java | 216 +- 29 files changed, 3829 insertions(+), 3500 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 648f5d1de..5549fef17 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -176,4 +176,5 @@ v 2.0: - Fix 'manuadd' to use the default or selected world (via 'manselect'), if the world is not specified in the command. - Expand GlobalGroups.yml and groups.yml to cover the VanishNoPacket plugin. Demonstrating how to negate and add nodes when using the '*' permission with inheritance. - Fix silly nested throw/catch statements. Errors are now correctly generated when reading yml's. - - Unregister the worldsHolder as a service on a reload/shutdown instead of the whole plugin. \ No newline at end of file + - Unregister the worldsHolder as a service on a reload/shutdown instead of the whole plugin. + - Update all code formatting to use tabs for indentation. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java index 98ff075dd..0832000f2 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GMConfiguration.java @@ -13,81 +13,89 @@ import org.anjocaido.groupmanager.utils.Tasks; import org.bukkit.configuration.file.YamlConfiguration; /** - * + * * @author gabrielcouto */ public class GMConfiguration { - private GroupManager plugin; - private File configFile; - private YamlConfiguration GMconfig; - - public GMConfiguration(GroupManager plugin) { - this.plugin = plugin; - load(); - } - - public void load() { - if (!plugin.getDataFolder().exists()) { - plugin.getDataFolder().mkdirs(); - } - configFile = new File(plugin.getDataFolder(), "config.yml"); - - if (!configFile.exists()) { - try { - Tasks.copy(plugin.getResourceAsStream("config.yml"), configFile); - } catch (IOException ex) { - GroupManager.logger.log(Level.SEVERE, null, ex); - } - } - - GMconfig = new YamlConfiguration(); - - try { - GMconfig.load(configFile); - } catch (Exception ex) { - throw new IllegalArgumentException("The following file couldn't pass on Parser.\n" + configFile.getPath(), ex); - } - - // Setup defaults - adjustLoggerLevel(); - plugin.setValidateOnlinePlayer(isToggleValidate()); - } - - public boolean isOpOverride() { - return GMconfig.getBoolean("settings.config.opOverrides", true); - } - public boolean isToggleValidate() { - return GMconfig.getBoolean("settings.config.validate_toggle", true); - } - - public Map getMirrorsMap() { - // Try to fetch the old mirror path first + private GroupManager plugin; + private File configFile; + private YamlConfiguration GMconfig; + + public GMConfiguration(GroupManager plugin) { + + this.plugin = plugin; + load(); + } + + public void load() { + + if (!plugin.getDataFolder().exists()) { + plugin.getDataFolder().mkdirs(); + } + configFile = new File(plugin.getDataFolder(), "config.yml"); + + if (!configFile.exists()) { + try { + Tasks.copy(plugin.getResourceAsStream("config.yml"), configFile); + } catch (IOException ex) { + GroupManager.logger.log(Level.SEVERE, null, ex); + } + } + + GMconfig = new YamlConfiguration(); + + try { + GMconfig.load(configFile); + } catch (Exception ex) { + throw new IllegalArgumentException("The following file couldn't pass on Parser.\n" + configFile.getPath(), ex); + } + + // Setup defaults + adjustLoggerLevel(); + plugin.setValidateOnlinePlayer(isToggleValidate()); + } + + public boolean isOpOverride() { + + return GMconfig.getBoolean("settings.config.opOverrides", true); + } + + public boolean isToggleValidate() { + + return GMconfig.getBoolean("settings.config.validate_toggle", true); + } + + public Map getMirrorsMap() { + + // Try to fetch the old mirror path first if (GMconfig.isConfigurationSection("settings.permission.world.mirror")) { return (Map) GMconfig.getConfigurationSection("settings.permission.world.mirror").getValues(false); - } else if (GMconfig.isConfigurationSection("settings.mirrors")){ + } else if (GMconfig.isConfigurationSection("settings.mirrors")) { return (Map) GMconfig.getConfigurationSection("settings.mirrors").getValues(false); } return null; - - } - - public Integer getSaveInterval() { - return GMconfig.getInt("settings.data.save.minutes", 10); - } - - public Integer getBackupDuration() { - return GMconfig.getInt("settings.data.save.hours", 24); - } - - public void adjustLoggerLevel() { - - try { - GroupManager.logger.setLevel(Level.parse(GMconfig.getString("settings.logging.level", "INFO"))); - return; - } catch (Exception e) { - } - - GroupManager.logger.setLevel(Level.INFO); - } + + } + + public Integer getSaveInterval() { + + return GMconfig.getInt("settings.data.save.minutes", 10); + } + + public Integer getBackupDuration() { + + return GMconfig.getInt("settings.data.save.hours", 24); + } + + public void adjustLoggerLevel() { + + try { + GroupManager.logger.setLevel(Level.parse(GMconfig.getString("settings.logging.level", "INFO"))); + return; + } catch (Exception e) { + } + + GroupManager.logger.setLevel(Level.INFO); + } } \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java index 904055d31..647d729e5 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java @@ -24,8 +24,6 @@ import org.bukkit.configuration.file.YamlConfiguration; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Yaml; - - /** * @author ElgarL * @@ -42,6 +40,7 @@ public class GlobalGroups { protected File GlobalGroupsFile = null; public GlobalGroups(GroupManager plugin) { + this.plugin = plugin; load(); } @@ -50,6 +49,7 @@ public class GlobalGroups { * @return the haveGroupsChanged */ public boolean haveGroupsChanged() { + if (this.haveGroupsChanged) { return true; } @@ -65,20 +65,24 @@ public class GlobalGroups { * @return the timeStampGroups */ public long getTimeStampGroups() { + return timeStampGroups; } + /** * @param timeStampGroups the timeStampGroups to set */ protected void setTimeStampGroups(long timeStampGroups) { + this.timeStampGroups = timeStampGroups; } - + /** * @param haveGroupsChanged * the haveGroupsChanged to set */ public void setGroupsChanged(boolean haveGroupsChanged) { + this.haveGroupsChanged = haveGroupsChanged; } @@ -86,7 +90,7 @@ public class GlobalGroups { public void load() { GGroups = new YamlConfiguration(); - + GroupManager.setLoaded(false); // READ globalGroups FILE @@ -110,47 +114,47 @@ public class GlobalGroups { // Clear out old groups resetGlobalGroups(); - + if (!GGroups.getKeys(false).isEmpty()) { // Read all global groups Map allGroups = new HashMap(); - + try { allGroups = (Map) GGroups.getConfigurationSection("groups").getValues(false); } catch (Exception ex) { - //ex.printStackTrace(); - throw new IllegalArgumentException("Your " + GlobalGroupsFile.getPath() + " file is invalid. See console for details.", ex); - } - + // ex.printStackTrace(); + throw new IllegalArgumentException("Your " + GlobalGroupsFile.getPath() + " file is invalid. See console for details.", ex); + } + // Load each groups permissions list. if (allGroups != null) { - + Iterator groupItr = allGroups.keySet().iterator(); - String groupName; - Integer groupCount = 0; - - /* - * loop each group entry - * and read it's data. - */ - while (groupItr.hasNext()) { - try { - groupCount++; - // Attempt to fetch the next group name. - groupName = groupItr.next(); - } catch (Exception ex) { + String groupName; + Integer groupCount = 0; + + /* + * loop each group entry + * and read it's data. + */ + while (groupItr.hasNext()) { + try { + groupCount++; + // Attempt to fetch the next group name. + groupName = groupItr.next(); + } catch (Exception ex) { throw new IllegalArgumentException("Invalid group name for GlobalGroup entry (" + groupCount + ") in file: " + GlobalGroupsFile.getPath(), ex); } - /* - * Create a new group with this name. - */ - Group newGroup = new Group(groupName.toLowerCase()); + /* + * Create a new group with this name. + */ + Group newGroup = new Group(groupName.toLowerCase()); Object element; - + // Permission nodes element = GGroups.get("groups." + groupName + ".permissions"); - + if (element != null) if (element instanceof List) { try { @@ -164,31 +168,31 @@ public class GlobalGroups { newGroup.addPermission((String) element); } else throw new IllegalArgumentException("Unknown type of permission node for global group: " + groupName); - + // Info nodes element = GGroups.get("groups." + groupName + ".info"); - + if (element != null) if (element instanceof MemorySection) { Map vars = new HashMap(); for (String key : ((MemorySection) element).getKeys(false)) { - vars.put(key, ((MemorySection) element).get(key)); - } + vars.put(key, ((MemorySection) element).get(key)); + } newGroup.setVariables(vars); } else throw new IllegalArgumentException("Unknown type of info node for global group: " + groupName); - + // Push a new group addGroup(newGroup); } } - + removeGroupsChangedFlag(); } - + setTimeStampGroups(GlobalGroupsFile.lastModified()); GroupManager.setLoaded(true); - //GlobalGroupsFile = null; + // GlobalGroupsFile = null; } /** @@ -197,33 +201,33 @@ public class GlobalGroups { public void writeGroups(boolean overwrite) { - //File GlobalGroupsFile = new File(plugin.getDataFolder(), "globalgroups.yml"); + // File GlobalGroupsFile = new File(plugin.getDataFolder(), "globalgroups.yml"); if (haveGroupsChanged()) { if (overwrite || (!overwrite && (getTimeStampGroups() >= GlobalGroupsFile.lastModified()))) { Map root = new HashMap(); - + Map groupsMap = new HashMap(); root.put("groups", groupsMap); for (String groupKey : groups.keySet()) { Group group = groups.get(groupKey); - + // Group header Map aGroupMap = new HashMap(); groupsMap.put(group.getName(), aGroupMap); - + // Info nodes Map infoMap = new HashMap(); - aGroupMap.put("info", infoMap); - - for (String infoKey : group.getVariables().getVarKeyList()) { - infoMap.put(infoKey, group.getVariables().getVarObject(infoKey)); - } - - // Permission nodes + aGroupMap.put("info", infoMap); + + for (String infoKey : group.getVariables().getVarKeyList()) { + infoMap.put(infoKey, group.getVariables().getVarObject(infoKey)); + } + + // Permission nodes aGroupMap.put("permissions", group.getPermissionList()); } - + if (!root.isEmpty()) { DumperOptions opt = new DumperOptions(); opt.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); @@ -236,53 +240,55 @@ public class GlobalGroups { } setTimeStampGroups(GlobalGroupsFile.lastModified()); } else { - // Newer file found. - GroupManager.logger.log(Level.WARNING, "Newer GlobalGroups file found, but we have local changes!"); - throw new IllegalStateException("Unable to save unless you issue a '/mansave force'"); - } + // Newer file found. + GroupManager.logger.log(Level.WARNING, "Newer GlobalGroups file found, but we have local changes!"); + throw new IllegalStateException("Unable to save unless you issue a '/mansave force'"); + } removeGroupsChangedFlag(); } else { - //Check for newer file as no local changes. - if (getTimeStampGroups() < GlobalGroupsFile.lastModified()) { - System.out.print("Newer GlobalGroups file found (Loading changes)!"); - // Backup GlobalGroups file - backupFile(); - load(); - } - } + // Check for newer file as no local changes. + if (getTimeStampGroups() < GlobalGroupsFile.lastModified()) { + System.out.print("Newer GlobalGroups file found (Loading changes)!"); + // Backup GlobalGroups file + backupFile(); + load(); + } + } } - + /** - * Backup the BlobalGroups file - * @param w - */ - private void backupFile() { - - File backupFile = new File(plugin.getBackupFolder(), "bkp_ggroups_" + Tasks.getDateString() + ".yml"); - try { - Tasks.copy(GlobalGroupsFile, backupFile); - } catch (IOException ex) { - GroupManager.logger.log(Level.SEVERE, null, ex); - } - } - + * Backup the BlobalGroups file + * + * @param w + */ + private void backupFile() { + + File backupFile = new File(plugin.getBackupFolder(), "bkp_ggroups_" + Tasks.getDateString() + ".yml"); + try { + Tasks.copy(GlobalGroupsFile, backupFile); + } catch (IOException ex) { + GroupManager.logger.log(Level.SEVERE, null, ex); + } + } + /** * Adds a group, or replaces an existing one. * * @param groupToAdd */ public void addGroup(Group groupToAdd) { + // Create a new group if it already exists if (hasGroup(groupToAdd.getName())) { groupToAdd = groupToAdd.clone(); removeGroup(groupToAdd.getName()); } - + newGroup(groupToAdd); - haveGroupsChanged = true; - if (GroupManager.isLoaded()) - GroupManagerEventHandler.callEvent(groupToAdd, GMGroupEvent.Action.GROUP_ADDED); + haveGroupsChanged = true; + if (GroupManager.isLoaded()) + GroupManagerEventHandler.callEvent(groupToAdd, GMGroupEvent.Action.GROUP_ADDED); } /** @@ -291,6 +297,7 @@ public class GlobalGroups { * @param newGroup */ public Group newGroup(Group newGroup) { + // Push a new group if (!groups.containsKey(newGroup.getName().toLowerCase())) { groups.put(newGroup.getName().toLowerCase(), newGroup); @@ -306,6 +313,7 @@ public class GlobalGroups { * @param groupName */ public boolean removeGroup(String groupName) { + // Push a new group if (groups.containsKey(groupName.toLowerCase())) { groups.remove(groupName.toLowerCase()); @@ -324,6 +332,7 @@ public class GlobalGroups { * @return true if the group exists */ public boolean hasGroup(String groupName) { + return groups.containsKey(groupName.toLowerCase()); } @@ -379,6 +388,7 @@ public class GlobalGroups { * @return List of all group names */ public List getGroupsPermissions(String groupName) { + if (!hasGroup(groupName)) return null; @@ -391,6 +401,7 @@ public class GlobalGroups { * @return Set containing all group names. */ public Set getGlobalGroups() { + return groups.keySet(); } @@ -398,14 +409,16 @@ public class GlobalGroups { * Resets GlobalGroups. */ public void resetGlobalGroups() { + this.groups = new HashMap(); } - + /** * * @return a collection of the groups */ public Collection getGroupList() { + return groups.values(); } @@ -416,6 +429,7 @@ public class GlobalGroups { * @return Group object */ public Group getGroup(String groupName) { + if (!hasGroup(groupName)) return null; @@ -427,17 +441,19 @@ public class GlobalGroups { * @return the globalGroupsFile */ public File getGlobalGroupsFile() { + return GlobalGroupsFile; } - + /** * */ - public void removeGroupsChangedFlag() { - setGroupsChanged(false); - for (Group g : groups.values()) { - g.flagAsSaved(); - } - } + public void removeGroupsChangedFlag() { + + setGroupsChanged(false); + for (Group g : groups.values()) { + g.flagAsSaved(); + } + } } \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 1c4011ff8..b75c2242e 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -45,7 +45,6 @@ import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.ServicePriority; import org.bukkit.plugin.java.JavaPlugin; - @SuppressWarnings("unused") /** * @@ -61,13 +60,14 @@ public class GroupManager extends JavaPlugin { private Map selectedWorlds = new HashMap(); private WorldsHolder worldsHolder; private boolean validateOnlinePlayer = true; - + private String lastError = ""; - + /** * @return the validateOnlinePlayer */ public boolean isValidateOnlinePlayer() { + return validateOnlinePlayer; } @@ -75,6 +75,7 @@ public class GroupManager extends JavaPlugin { * @param validateOnlinePlayer the validateOnlinePlayer to set */ public void setValidateOnlinePlayer(boolean validateOnlinePlayer) { + this.validateOnlinePlayer = validateOnlinePlayer; } @@ -95,8 +96,9 @@ public class GroupManager extends JavaPlugin { @Override public void onDisable() { + setLoaded(false); - + // Un-register this service. this.getServer().getServicesManager().unregister(this.worldsHolder); @@ -110,31 +112,30 @@ public class GroupManager extends JavaPlugin { } WorldEvents = null; - + // Remove all attachments before clearing if (BukkitPermissions != null) { BukkitPermissions.removeAllAttachments(); BukkitPermissions = null; } - // EXAMPLE: Custom code, here we just output some info so we can check that - // all is well + // EXAMPLE: Custom code, here we just output some info so we can check that all is well PluginDescriptionFile pdfFile = this.getDescription(); System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is disabled!"); GroupManager.logger.removeHandler(ch); } - //@Override + // @Override public void onEnable() { - + try { lastError = ""; - + GroupManager.logger.setUseParentHandlers(false); ch = new GMLoggerHandler(); GroupManager.logger.addHandler(ch); logger.setLevel(Level.ALL); - + // Create the backup folder, if it doesn't exist. prepareFileFields(); // Load the config.yml @@ -142,41 +143,40 @@ public class GroupManager extends JavaPlugin { // Load the global groups globalGroups = new GlobalGroups(this); worldsHolder = new WorldsHolder(this); - - + PluginDescriptionFile pdfFile = this.getDescription(); if (worldsHolder == null) { GroupManager.logger.severe("Can't enable " + pdfFile.getName() + " version " + pdfFile.getVersion() + ", bad loading!"); this.getServer().getPluginManager().disablePlugin(this); throw new IllegalStateException("An error ocurred while loading GroupManager"); } - + // Set a few defaults (reloads) setLoaded(false); - - // Initialize the world listener and bukkit permissions to handle - // events. + + // Initialize the world listener and bukkit permissions to handle events. WorldEvents = new GMWorldListener(this); BukkitPermissions = new BukkitPermissions(this); - + enableScheduler(); - + /* - * Schedule a Bukiit Permissions update for 1 tick later. All plugins + * Schedule a Bukiit Permissions update for 1 tick later. All + * plugins * will be loaded by then */ - + if (getServer().getScheduler().scheduleSyncDelayedTask(this, new BukkitPermsUpdateTask(), 1) == -1) { GroupManager.logger.severe("Could not schedule superperms Update."); setLoaded(true); } - + System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!"); - + // Register as a service this.getServer().getServicesManager().register(WorldsHolder.class, this.worldsHolder, this, ServicePriority.Lowest); } catch (Exception ex) { - + /* * Store the error and write to the log. */ @@ -185,41 +185,41 @@ public class GroupManager extends JavaPlugin { /* * Throw an error so Bukkit knows about it. */ - throw new IllegalArgumentException(ex.getMessage(),ex); + throw new IllegalArgumentException(ex.getMessage(), ex); } } - + /** * Write an error.log * * @param ex */ private void saveErrorLog(Exception ex) { - + if (!getDataFolder().exists()) { - getDataFolder().mkdirs(); - } - + getDataFolder().mkdirs(); + } + lastError = ex.getMessage(); - + GroupManager.logger.severe("==================================================="); GroupManager.logger.severe("= ERROR REPORT START ="); GroupManager.logger.severe("==================================================="); GroupManager.logger.severe("=== PLEASE COPY AND PASTE THE ERROR.LOG FROM THE =="); GroupManager.logger.severe("= GROUPMANAGER FOLDER TO AN ESSENTIALS DEVELOPER ="); GroupManager.logger.severe("==================================================="); - GroupManager.logger.severe(lastError); + GroupManager.logger.severe(lastError); GroupManager.logger.severe("==================================================="); GroupManager.logger.severe("= ERROR REPORT ENDED ="); GroupManager.logger.severe("==================================================="); // Append this error to the error log. - try { - String error = "=============================== GM ERROR LOG ===============================\n\n"; - error += Tasks.getStackTraceAsString(ex); - error += "\n============================================================================\n"; - + try { + String error = "=============================== GM ERROR LOG ===============================\n\n"; + error += Tasks.getStackTraceAsString(ex); + error += "\n============================================================================\n"; + Tasks.appendStringToFile(error, (getDataFolder() + System.getProperty("file.separator") + "ERROR.LOG")); } catch (IOException e) { // Failed to write file. @@ -229,18 +229,22 @@ public class GroupManager extends JavaPlugin { } public static boolean isLoaded() { + return isLoaded; } public static void setLoaded(boolean isLoaded) { + GroupManager.isLoaded = isLoaded; } public InputStream getResourceAsStream(String fileName) { + return this.getClassLoader().getResourceAsStream(fileName); } private void prepareFileFields() { + // configFile = new File(this.getDataFolder(), "config.yml"); backupFolder = new File(this.getDataFolder(), "backup"); if (!backupFolder.exists()) { @@ -249,16 +253,19 @@ public class GroupManager extends JavaPlugin { } private void prepareConfig() { + config = new GMConfiguration(this); } public void enableScheduler() { + if (worldsHolder != null) { disableScheduler(); commiter = new Runnable() { @Override public void run() { + try { worldsHolder.saveChanges(false); GroupManager.logger.log(Level.INFO, " Data files refreshed."); @@ -268,18 +275,19 @@ public class GroupManager extends JavaPlugin { } }; scheduler = new ScheduledThreadPoolExecutor(1); - long minutes = (long)getGMConfig().getSaveInterval(); + long minutes = (long) getGMConfig().getSaveInterval(); if (minutes > 0) { - scheduler.scheduleAtFixedRate(commiter, minutes, minutes, TimeUnit.MINUTES); + scheduler.scheduleAtFixedRate(commiter, minutes, minutes, TimeUnit.MINUTES); GroupManager.logger.info("Scheduled Data Saving is set for every " + minutes + " minutes!"); } else GroupManager.logger.info("Scheduled Data Saving is Disabled!"); - + GroupManager.logger.info("Backups will be retained for " + getGMConfig().getBackupDuration() + " hours!"); } } public void disableScheduler() { + if (scheduler != null) { try { scheduler.setContinueExistingPeriodicTasksAfterShutdownPolicy(false); @@ -297,6 +305,7 @@ public class GroupManager extends JavaPlugin { */ @Deprecated public void commit() { + if (worldsHolder != null) { worldsHolder.saveChanges(); } @@ -307,10 +316,12 @@ public class GroupManager extends JavaPlugin { */ @Deprecated public void reload() { + worldsHolder.reloadAll(); } public WorldsHolder getWorldsHolder() { + return worldsHolder; } @@ -321,6 +332,7 @@ public class GroupManager extends JavaPlugin { */ @Deprecated public AnjoPermissionsHandler getPermissionHandler() { + return worldsHolder.getDefaultWorld().getPermissionsHandler(); } @@ -332,6 +344,7 @@ public class GroupManager extends JavaPlugin { */ @Deprecated public WorldDataHolder getData() { + return worldsHolder.getDefaultWorld(); } @@ -342,6 +355,7 @@ public class GroupManager extends JavaPlugin { */ @Deprecated public OverloadedWorldHolder getOverloadedClassData() { + return worldsHolder.getDefaultWorld(); } @@ -355,23 +369,23 @@ public class GroupManager extends JavaPlugin { @SuppressWarnings({ "deprecation" }) @Override public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { + boolean playerCanDo = false; boolean isConsole = false; Player senderPlayer = null, targetPlayer = null; Group senderGroup = null; User senderUser = null; boolean isOpOverride = config.isOpOverride(); - // DETERMINING PLAYER INFORMATION if (sender instanceof Player) { senderPlayer = (Player) sender; - + if (!lastError.isEmpty() && !commandLabel.equalsIgnoreCase("manload")) { sender.sendMessage(ChatColor.RED + "All commands are locked due to an error. Check the log and then try a '/manload'.)"); return true; } - + senderUser = worldsHolder.getWorldData(senderPlayer).getUser(senderPlayer.getName()); senderGroup = senderUser.getGroup(); isOpOverride = (isOpOverride && (senderPlayer.isOp() || worldsHolder.getWorldPermissions(senderPlayer).has(senderPlayer, "groupmanager.op"))); @@ -381,12 +395,12 @@ public class GroupManager extends JavaPlugin { playerCanDo = true; } } else if (sender instanceof ConsoleCommandSender) { - + if (!lastError.isEmpty() && !commandLabel.equalsIgnoreCase("manload")) { sender.sendMessage(ChatColor.RED + "All commands are locked due to an error. Check the log and then try a '/manload'.)"); return true; } - + isConsole = true; } @@ -451,29 +465,29 @@ public class GroupManager extends JavaPlugin { if (isConsole || playerCanDo) { switch (execCmd) { case manuadd: - + // Validating arguments if ((args.length != 2) && (args.length != 3)) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ | optional [world])"); return false; } - + // Select the relevant world (if specified) if (args.length == 3) { dataHolder = worldsHolder.getWorldData(args[2]); permissionHandler = dataHolder.getPermissionsHandler(); } - + // Validating state of sender if (dataHolder == null || permissionHandler == null) { if (!setDefaultWorldHandler(sender)) return true; } - + if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } - + if (match != null) { auxUser = dataHolder.getUser(match.get(0)); } else { @@ -509,7 +523,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "You changed player '" + auxUser.getName() + "' group to '" + auxGroup.getName() + "' in world '" + dataHolder.getName() + "'."); return true; - + case manudel: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -522,9 +536,9 @@ public class GroupManager extends JavaPlugin { return false; } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } - + if (match != null) { auxUser = dataHolder.getUser(match.get(0)); } else { @@ -545,7 +559,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updatePermissions(targetPlayer); return true; - + case manuaddsub: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -561,9 +575,9 @@ public class GroupManager extends JavaPlugin { return false; } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } - + if (match != null) { auxUser = dataHolder.getUser(match.get(0)); } else { @@ -586,7 +600,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "The subgroup '" + auxGroup.getName() + "' is already available to '" + auxUser.getName() + "'."); return true; - + case manudelsub: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -599,9 +613,9 @@ public class GroupManager extends JavaPlugin { return false; } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } - + if (match != null) { auxUser = dataHolder.getUser(match.get(0)); } else { @@ -622,12 +636,12 @@ public class GroupManager extends JavaPlugin { auxUser.removeSubGroup(auxGroup); sender.sendMessage(ChatColor.YELLOW + "You removed subgroup '" + auxGroup.getName() + "' from player '" + auxUser.getName() + "' list."); - //targetPlayer = this.getServer().getPlayer(auxUser.getName()); - //if (targetPlayer != null) - // BukkitPermissions.updatePermissions(targetPlayer); + // targetPlayer = this.getServer().getPlayer(auxUser.getName()); + // if (targetPlayer != null) + // BukkitPermissions.updatePermissions(targetPlayer); return true; - + case mangadd: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -649,7 +663,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "You created a group named: " + auxGroup.getName()); return true; - + case mangdel: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -673,7 +687,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updateAllPlayers(); return true; - + case manuaddp: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -686,9 +700,9 @@ public class GroupManager extends JavaPlugin { return false; } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } - + if (match != null) { auxUser = dataHolder.getUser(match.get(0)); } else { @@ -738,7 +752,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updatePermissions(targetPlayer); return true; - + case manudelp: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -751,9 +765,9 @@ public class GroupManager extends JavaPlugin { return false; } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } - + if (match != null) { auxUser = dataHolder.getUser(match.get(0)); } else { @@ -789,7 +803,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updatePermissions(targetPlayer); return true; - + case manulistp: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -801,11 +815,11 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ (+))"); return false; } - + if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } - + if (match != null) { auxUser = dataHolder.getUser(match.get(0)); } else { @@ -854,7 +868,7 @@ public class GroupManager extends JavaPlugin { } return true; - + case manucheckp: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -868,9 +882,9 @@ public class GroupManager extends JavaPlugin { } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } - + if (match != null) { auxUser = dataHolder.getUser(match.get(0)); } else { @@ -881,9 +895,9 @@ public class GroupManager extends JavaPlugin { permissionResult = permissionHandler.checkFullGMPermission(auxUser, args[1], false); if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) { - //No permissions found in GM so fall through and check Bukkit. + // No permissions found in GM so fall through and check Bukkit. sender.sendMessage(ChatColor.RED + "The player doesn't have access to that permission"); - + } else { // This permission was found in groupmanager. if (permissionResult.owner instanceof User) { @@ -909,7 +923,7 @@ public class GroupManager extends JavaPlugin { } return true; - + case mangaddp: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -964,7 +978,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updateAllPlayers(); return true; - + case mangdelp: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1005,7 +1019,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updateAllPlayers(); return true; - + case manglistp: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1054,7 +1068,7 @@ public class GroupManager extends JavaPlugin { } return true; - + case mangcheckp: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1078,8 +1092,7 @@ public class GroupManager extends JavaPlugin { return false; } // Seems OK - // auxString = - // permissionHandler.checkUserOnlyPermission(auxUser, args[1]); + // auxString = permissionHandler.checkUserOnlyPermission(auxUser, args[1]); if (permissionResult.owner instanceof Group) { if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) { sender.sendMessage(ChatColor.RED + "The group inherits the a negation permission from group: " + permissionResult.owner.getName()); @@ -1090,7 +1103,7 @@ public class GroupManager extends JavaPlugin { } return true; - + case mangaddi: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1116,7 +1129,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support inheritance."); return false; } - + // Validating permission if (permissionHandler.searchGroupInInheritance(auxGroup, auxGroup2.getName(), null)) { sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " already inherits " + auxGroup2.getName() + " (might not be directly)"); @@ -1129,7 +1142,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updateAllPlayers(); return true; - + case mangdeli: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1155,7 +1168,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support inheritance."); return false; } - + // Validating permission if (!permissionHandler.searchGroupInInheritance(auxGroup, auxGroup2.getName(), null)) { sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " does not inherits " + auxGroup2.getName() + "."); @@ -1172,7 +1185,7 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updateAllPlayers(); return true; - + case manuaddv: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1185,9 +1198,9 @@ public class GroupManager extends JavaPlugin { return false; } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } - + if (match != null) { auxUser = dataHolder.getUser(match.get(0)); } else { @@ -1204,9 +1217,9 @@ public class GroupManager extends JavaPlugin { } auxUser.getVariables().addVar(args[1], Variables.parseVariableValue(auxString)); sender.sendMessage(ChatColor.YELLOW + "Variable " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + ":'" + ChatColor.GREEN + auxString + ChatColor.YELLOW + "' added to the user " + auxUser.getName()); - + return true; - + case manudelv: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1219,9 +1232,9 @@ public class GroupManager extends JavaPlugin { return false; } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } - + if (match != null) { auxUser = dataHolder.getUser(match.get(0)); } else { @@ -1234,9 +1247,9 @@ public class GroupManager extends JavaPlugin { // Seems OK auxUser.getVariables().removeVar(args[1]); sender.sendMessage(ChatColor.YELLOW + "Variable " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + " removed from the user " + ChatColor.GREEN + auxUser.getName()); - + return true; - + case manulistv: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1249,7 +1262,7 @@ public class GroupManager extends JavaPlugin { return false; } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } if (match != null) { auxUser = dataHolder.getUser(match.get(0)); @@ -1269,9 +1282,9 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "Variables of user " + auxUser.getName() + ": "); sender.sendMessage(auxString + "."); sender.sendMessage(ChatColor.YELLOW + "Plus all variables from group: " + auxUser.getGroupName()); - + return true; - + case manucheckv: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1284,7 +1297,7 @@ public class GroupManager extends JavaPlugin { return false; } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } if (match != null) { auxUser = dataHolder.getUser(match.get(0)); @@ -1300,7 +1313,8 @@ public class GroupManager extends JavaPlugin { if (!auxUser.isSubGroupsEmpty() && auxGroup2 == null) for (Group subGroup : auxUser.subGroupListCopy()) { auxGroup2 = permissionHandler.nextGroupWithVariable(subGroup, args[1]); - if (auxGroup2 != null) continue; + if (auxGroup2 != null) + continue; } if (auxGroup2 == null) { sender.sendMessage(ChatColor.RED + "The user doesn't have access to that variable!"); @@ -1316,9 +1330,9 @@ public class GroupManager extends JavaPlugin { if (!auxGroup.equals(auxGroup2)) { sender.sendMessage(ChatColor.YELLOW + "And the value was inherited from group: " + ChatColor.GREEN + auxGroup2.getName()); } - + return true; - + case mangaddv: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1352,7 +1366,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "Variable " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + ":'" + ChatColor.GREEN + auxString + ChatColor.YELLOW + "' added to the group " + auxGroup.getName()); return true; - + case mangdelv: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1382,7 +1396,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "Variable " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + " removed from the group " + ChatColor.GREEN + auxGroup.getName()); return true; - + case manglistv: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1423,9 +1437,9 @@ public class GroupManager extends JavaPlugin { auxString = auxString.substring(0, auxString.lastIndexOf(",")); sender.sendMessage(ChatColor.YELLOW + "Plus all variables from groups: " + auxString); } - + return true; - + case mangcheckv: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1456,9 +1470,9 @@ public class GroupManager extends JavaPlugin { if (!auxGroup.equals(auxGroup2)) { sender.sendMessage(ChatColor.YELLOW + "And the value was inherited from group: " + ChatColor.GREEN + auxGroup2.getName()); } - + return true; - + case manwhois: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1471,7 +1485,7 @@ public class GroupManager extends JavaPlugin { return false; } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } if (match != null) { auxUser = dataHolder.getUser(match.get(0)); @@ -1490,7 +1504,7 @@ public class GroupManager extends JavaPlugin { auxString = auxString.substring(0, auxString.lastIndexOf(",")); sender.sendMessage(ChatColor.YELLOW + "subgroups: " + auxString); } - + sender.sendMessage(ChatColor.YELLOW + "Overloaded: " + ChatColor.GREEN + dataHolder.isOverloaded(auxUser.getName())); auxGroup = dataHolder.surpassOverload(auxUser.getName()).getGroup(); if (!auxGroup.equals(auxUser.getGroup())) { @@ -1498,7 +1512,7 @@ public class GroupManager extends JavaPlugin { } // victim.permissions.add(args[1]); return true; - + case tempadd: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1511,7 +1525,7 @@ public class GroupManager extends JavaPlugin { return false; } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } if (match != null) { auxUser = dataHolder.getUser(match.get(0)); @@ -1532,7 +1546,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "Player overloaded!"); return true; - + case tempdel: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1545,7 +1559,7 @@ public class GroupManager extends JavaPlugin { return false; } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } if (match != null) { auxUser = dataHolder.getUser(match.get(0)); @@ -1568,7 +1582,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "You removed that player's overload. He's back to normal!"); return true; - + case templist: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1597,9 +1611,9 @@ public class GroupManager extends JavaPlugin { } overloadedUsers.get(dataHolder.getName().toLowerCase()).removeAll(removeList); sender.sendMessage(ChatColor.YELLOW + " " + count + " Users in overload mode: " + ChatColor.WHITE + auxString); - + return true; - + case tempdelall: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1626,14 +1640,14 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + " " + count + "All users in overload mode are now normal again."); return true; - + case mansave: - + boolean forced = false; - + if ((args.length == 1) && (args[0].equalsIgnoreCase("force"))) forced = true; - + try { worldsHolder.saveChanges(forced); sender.sendMessage(ChatColor.YELLOW + " All changes were saved."); @@ -1643,17 +1657,17 @@ public class GroupManager extends JavaPlugin { return true; case manload: - + /** * Attempt to reload a specific world */ if (args.length > 0) { - + if (!lastError.isEmpty()) { sender.sendMessage(ChatColor.RED + "All commands are locked due to an error. Check the log and then try a '/manload'.)"); return true; } - + auxString = ""; for (int i = 0; i < args.length; i++) { auxString += args[i]; @@ -1666,7 +1680,7 @@ public class GroupManager extends JavaPlugin { globalGroups.load(); worldsHolder.loadWorld(auxString); - + sender.sendMessage("The request to reload world '" + auxString + "' was attempted."); isLoaded = true; @@ -1674,29 +1688,29 @@ public class GroupManager extends JavaPlugin { BukkitPermissions.updateAllPlayers(); } else { - + /** * Reload all settings and data as no world was specified. */ - + /* * Reset the last error as we are attempting a fresh load. */ lastError = ""; onDisable(); onEnable(); - + sender.sendMessage("All settings and worlds were reloaded!"); } - + /** * Fire an event as none will have been triggered in the reload. */ if (GroupManager.isLoaded()) - GroupManagerEventHandler.callEvent(GMSystemEvent.Action.RELOADED); + GroupManagerEventHandler.callEvent(GMSystemEvent.Action.RELOADED); return true; - + case listgroups: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1715,9 +1729,9 @@ public class GroupManager extends JavaPlugin { auxString = auxString.substring(0, auxString.lastIndexOf(",")); } sender.sendMessage(ChatColor.YELLOW + " Groups Available: " + ChatColor.WHITE + auxString); - + return true; - + case manpromote: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1730,7 +1744,7 @@ public class GroupManager extends JavaPlugin { return false; } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } if (match != null) { auxUser = dataHolder.getUser(match.get(0)); @@ -1773,7 +1787,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "You changed " + auxUser.getName() + " group to " + auxGroup.getName() + "."); return true; - + case mandemote: // Validating state of sender if (dataHolder == null || permissionHandler == null) { @@ -1786,7 +1800,7 @@ public class GroupManager extends JavaPlugin { return false; } if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { - return false; + return false; } if (match != null) { auxUser = dataHolder.getUser(match.get(0)); @@ -1829,7 +1843,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "You changed " + auxUser.getName() + " group to " + auxGroup.getName() + "."); return true; - + case mantogglevalidate: validateOnlinePlayer = !validateOnlinePlayer; sender.sendMessage(ChatColor.YELLOW + "Validade if player is online, now set to: " + Boolean.toString(validateOnlinePlayer)); @@ -1860,9 +1874,9 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.YELLOW + "Your world now uses permissions of world name: '" + dataHolder.getName() + "' "); } } - + return true; - + case manselect: if (args.length < 1) { sender.sendMessage(ChatColor.RED + "Review your arguments count! (/ )"); @@ -1893,9 +1907,9 @@ public class GroupManager extends JavaPlugin { permissionHandler = dataHolder.getPermissionsHandler(); selectedWorlds.put(sender, dataHolder.getName()); sender.sendMessage(ChatColor.YELLOW + "You have selected world '" + dataHolder.getName() + "'."); - + return true; - + case manclear: if (args.length != 0) { sender.sendMessage(ChatColor.RED + "Review your arguments count!"); @@ -1903,9 +1917,9 @@ public class GroupManager extends JavaPlugin { } selectedWorlds.remove(sender); sender.sendMessage(ChatColor.YELLOW + "You have removed your world selection. Working with current world(if possible)."); - + return true; - + default: break; } @@ -1955,7 +1969,7 @@ public class GroupManager extends JavaPlugin { } } - + /** * Load a List of players matching the name given. If none online, check * Offline. @@ -1974,7 +1988,7 @@ public class GroupManager extends JavaPlugin { if (Arrays.asList(this.getServer().getOfflinePlayers()).contains(Bukkit.getOfflinePlayer(playerName))) { match.add(playerName); } else { - //look for partial matches + // look for partial matches for (OfflinePlayer offline : this.getServer().getOfflinePlayers()) { if (offline.getName().toLowerCase().startsWith(playerName.toLowerCase())) match.add(offline.getName()); @@ -1994,7 +2008,7 @@ public class GroupManager extends JavaPlugin { sender.sendMessage(ChatColor.RED + "Too many matches found! (" + match.toString() + ")"); return null; } - + return match; } @@ -2003,6 +2017,7 @@ public class GroupManager extends JavaPlugin { * @return the config */ public GMConfiguration getGMConfig() { + return config; } @@ -2010,10 +2025,12 @@ public class GroupManager extends JavaPlugin { * @return the backupFolder */ public File getBackupFolder() { + return backupFolder; } public static GlobalGroups getGlobalGroups() { + return globalGroups; } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/Tasks/BukkitPermsUpdateTask.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/Tasks/BukkitPermsUpdateTask.java index f4b805c35..1a0fc2369 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/Tasks/BukkitPermsUpdateTask.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/Tasks/BukkitPermsUpdateTask.java @@ -5,24 +5,25 @@ import org.anjocaido.groupmanager.GroupManager; /* * * Created by ElgarL - * */ public class BukkitPermsUpdateTask implements Runnable { - + public BukkitPermsUpdateTask() { - super(); + + super(); } - + @Override public void run() { + // Signal loaded and update BukkitPermissions. GroupManager.setLoaded(true); GroupManager.BukkitPermissions.collectPermissions(); GroupManager.BukkitPermissions.updateAllPlayers(); - + GroupManager.logger.info("Bukkit Permissions Updated!"); - + } - + } \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java index e3250a1c1..bb04fa3d7 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/DataUnit.java @@ -13,151 +13,169 @@ import org.anjocaido.groupmanager.dataholder.WorldDataHolder; import org.anjocaido.groupmanager.utils.StringPermissionComparator; /** - * + * * @author gabrielcouto */ public abstract class DataUnit { - private WorldDataHolder dataSource; - private String name; - private boolean changed, sorted = false; - private ArrayList permissions = new ArrayList(); + private WorldDataHolder dataSource; + private String name; + private boolean changed, sorted = false; + private ArrayList permissions = new ArrayList(); - public DataUnit(WorldDataHolder dataSource, String name) { - this.dataSource = dataSource; - this.name = name; - } + public DataUnit(WorldDataHolder dataSource, String name) { - public DataUnit(String name) { - this.name = name; + this.dataSource = dataSource; + this.name = name; + } + + public DataUnit(String name) { + + this.name = name; + } + + /** + * Every group is matched only by their names and DataSources names. + * + * @param o + * @return true if they are equal. false if not. + */ + @Override + public boolean equals(Object o) { + + if (o instanceof DataUnit) { + DataUnit go = (DataUnit) o; + if (this.getName().equalsIgnoreCase(go.getName())) { + // Global Group match. + if (this.dataSource == null && go.getDataSource() == null) + return true; + // This is a global group, the object to test isn't. + if (this.dataSource == null && go.getDataSource() != null) + return false; + // This is not a global group, but the object to test is. + if (this.dataSource != null && go.getDataSource() == null) + return false; + // Match on group name and world name. + if (this.dataSource.getName().equalsIgnoreCase(go.getDataSource().getName())) + return true; + } + } + return false; + } + + @Override + public int hashCode() { + + int hash = 5; + hash = 71 * hash + (this.name != null ? this.name.toLowerCase().hashCode() : 0); + return hash; + } + + /** + * Set the data source to point to a different worldDataHolder + * + * @param source + */ + public void setDataSource(WorldDataHolder source) { + + this.dataSource = source; + } + + /** + * Get the current worldDataHolder this object is pointing to + * + * @return the dataSource + */ + public WorldDataHolder getDataSource() { + + return dataSource; + } + + /** + * @return the name + */ + public String getName() { + + return name; + } + + public void flagAsChanged() { + + WorldDataHolder testSource = getDataSource(); + String source = ""; + + if (testSource == null) + source = "GlobalGroups"; + else + source = testSource.getName(); + + GroupManager.logger.finest("DataSource: " + source + " - DataUnit: " + getName() + " flagged as changed!"); + // for(StackTraceElement st: Thread.currentThread().getStackTrace()){ + // GroupManager.logger.finest(st.toString()); + // } + sorted = false; + changed = true; + } + + public boolean isChanged() { + + return changed; + } + + public void flagAsSaved() { + + WorldDataHolder testSource = getDataSource(); + String source = ""; + + if (testSource == null) + source = "GlobalGroups"; + else + source = testSource.getName(); + + GroupManager.logger.finest("DataSource: " + source + " - DataUnit: " + getName() + " flagged as saved!"); + changed = false; + } + + public boolean hasSamePermissionNode(String permission) { + + return permissions.contains(permission); + } + + public void addPermission(String permission) { + + if (!hasSamePermissionNode(permission)) { + permissions.add(permission); + } + flagAsChanged(); + } + + public boolean removePermission(String permission) { + + flagAsChanged(); + return permissions.remove(permission); } /** - * Every group is matched only by their names and DataSources names. - * @param o - * @return true if they are equal. false if not. - */ - @Override - public boolean equals(Object o) { - if (o instanceof DataUnit) { - DataUnit go = (DataUnit) o; - if (this.getName().equalsIgnoreCase(go.getName())) { - // Global Group match. - if (this.dataSource == null && go.getDataSource() == null) - return true; - // This is a global group, the object to test isn't. - if (this.dataSource == null && go.getDataSource() != null) - return false; - // This is not a global group, but the object to test is. - if (this.dataSource != null && go.getDataSource() == null) - return false; - // Match on group name and world name. - if (this.dataSource.getName().equalsIgnoreCase(go.getDataSource().getName())) - return true; - } - } - return false; - } - - @Override - public int hashCode() { - int hash = 5; - hash = 71 * hash + (this.name != null ? this.name.toLowerCase().hashCode() : 0); - return hash; - } - - /** - * Set the data source to point to a different worldDataHolder - * - * @param source - */ - public void setDataSource(WorldDataHolder source) { - this.dataSource = source; - } - - /** - * Get the current worldDataHolder this object is pointing to - * - * @return the dataSource - */ - public WorldDataHolder getDataSource() { - return dataSource; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - public void flagAsChanged() { - WorldDataHolder testSource = getDataSource(); - String source = ""; - - if (testSource == null) - source = "GlobalGroups"; - else - source = testSource.getName(); - - GroupManager.logger.finest("DataSource: " + source + " - DataUnit: " + getName() + " flagged as changed!"); -// for(StackTraceElement st: Thread.currentThread().getStackTrace()){ -// GroupManager.logger.finest(st.toString()); -// } - sorted = false; - changed = true; - } - - public boolean isChanged() { - return changed; - } - - public void flagAsSaved() { - WorldDataHolder testSource = getDataSource(); - String source = ""; - - if (testSource == null) - source = "GlobalGroups"; - else - source = testSource.getName(); - - GroupManager.logger.finest("DataSource: " + source + " - DataUnit: " + getName() + " flagged as saved!"); - changed = false; - } - - public boolean hasSamePermissionNode(String permission) { - return permissions.contains(permission); - } - - public void addPermission(String permission) { - if (!hasSamePermissionNode(permission)) { - permissions.add(permission); - } - flagAsChanged(); - } - - public boolean removePermission(String permission) { - flagAsChanged(); - return permissions.remove(permission); - } - - /** - * Use this only to list permissions. - * You can't edit the permissions using the returned ArrayList instance - * @return a copy of the permission list - */ - public List getPermissionList() { - return Collections.unmodifiableList(permissions); - } - - public boolean isSorted() { - return this.sorted; - } - - public void sortPermissions() { - if (!isSorted()) { - Collections.sort(permissions, StringPermissionComparator.getInstance()); - sorted = true; - } - } + * Use this only to list permissions. + * You can't edit the permissions using the returned ArrayList instance + * + * @return a copy of the permission list + */ + public List getPermissionList() { + + return Collections.unmodifiableList(permissions); + } + + public boolean isSorted() { + + return this.sorted; + } + + public void sortPermissions() { + + if (!isSorted()) { + Collections.sort(permissions, StringPermissionComparator.getInstance()); + sorted = true; + } + } } \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java index 56ef7e870..751dc8fd6 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Group.java @@ -15,160 +15,173 @@ import java.util.List; import java.util.Map; /** - * + * * @author gabrielcouto/ElgarL */ public class Group extends DataUnit implements Cloneable { - /** - * The group it inherits DIRECTLY! - */ - private ArrayList inherits = new ArrayList(); - /** - *This one holds the fields in INFO node. - * like prefix = 'c' - * or build = false - */ - private GroupVariables variables = new GroupVariables(this); - - /** - * Constructor for individual World Groups. - * - * @param name - */ - public Group(WorldDataHolder source, String name) { - super(source, name); - } - - /** - * Constructor for Global Groups. - * - * @param name - */ - public Group(String name) { - super(name); - } - - /** - * Is this a GlobalGroup - * - * @return true if this is a global group - */ - public boolean isGlobal() { - return (getDataSource() == null); - } - - /** - * Clone this group - * @return a clone of this group - */ - @Override - public Group clone() { - Group clone; - - if (isGlobal()) { - clone = new Group(this.getName()); - } else { - clone = new Group(getDataSource(), this.getName()); - clone.inherits = new ArrayList(this.getInherits()); - } - - for (String perm : this.getPermissionList()) { - clone.addPermission(perm); - } - clone.variables = ((GroupVariables) variables).clone(clone); - //clone.flagAsChanged(); - return clone; - } - - /** - * Use this to deliver a group from a different dataSource to another - * @param dataSource - * @return Null or Clone - */ - public Group clone(WorldDataHolder dataSource) { - if (dataSource.groupExists(this.getName())) { - return null; - } - - Group clone = dataSource.createGroup(this.getName()); - - // Don't add inheritance for GlobalGroups - if (!isGlobal()) { - clone.inherits = new ArrayList(this.getInherits()); - } - for (String perm : this.getPermissionList()) { - clone.addPermission(perm); - } - clone.variables = variables.clone(clone); - clone.flagAsChanged(); //use this to make the new dataSource save the new group - return clone; - } - - /** - * an unmodifiable list of inherits list - * You can't manage the list by here - * Lol... version 0.6 had a problem because this. - * @return the inherits - */ - public List getInherits() { - return Collections.unmodifiableList(inherits); - } - - /** - * @param inherit the inherits to set - */ - public void addInherits(Group inherit) { - 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 (!isGlobal()) { - if (this.inherits.contains(inherit.toLowerCase())) { - this.inherits.remove(inherit.toLowerCase()); - flagAsChanged(); - GroupManagerEventHandler.callEvent(this, Action.GROUP_INHERITANCE_CHANGED); - return true; - } - } - return false; - } - - /** - * @return the variables - */ - public GroupVariables getVariables() { - return variables; - } - - /** - * - * @param varList - */ - public void setVariables(Map varList) { - 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); - } - } - } + /** + * The group it inherits DIRECTLY! + */ + private ArrayList inherits = new ArrayList(); + /** + * This one holds the fields in INFO node. + * like prefix = 'c' + * or build = false + */ + private GroupVariables variables = new GroupVariables(this); + + /** + * Constructor for individual World Groups. + * + * @param name + */ + public Group(WorldDataHolder source, String name) { + + super(source, name); + } + + /** + * Constructor for Global Groups. + * + * @param name + */ + public Group(String name) { + + super(name); + } + + /** + * Is this a GlobalGroup + * + * @return true if this is a global group + */ + public boolean isGlobal() { + + return (getDataSource() == null); + } + + /** + * Clone this group + * + * @return a clone of this group + */ + @Override + public Group clone() { + + Group clone; + + if (isGlobal()) { + clone = new Group(this.getName()); + } else { + clone = new Group(getDataSource(), this.getName()); + clone.inherits = new ArrayList(this.getInherits()); + } + + for (String perm : this.getPermissionList()) { + clone.addPermission(perm); + } + clone.variables = ((GroupVariables) variables).clone(clone); + //clone.flagAsChanged(); + return clone; + } + + /** + * Use this to deliver a group from a different dataSource to another + * + * @param dataSource + * @return Null or Clone + */ + public Group clone(WorldDataHolder dataSource) { + + if (dataSource.groupExists(this.getName())) { + return null; + } + + Group clone = dataSource.createGroup(this.getName()); + + // Don't add inheritance for GlobalGroups + if (!isGlobal()) { + clone.inherits = new ArrayList(this.getInherits()); + } + for (String perm : this.getPermissionList()) { + clone.addPermission(perm); + } + clone.variables = variables.clone(clone); + clone.flagAsChanged(); //use this to make the new dataSource save the new group + return clone; + } + + /** + * an unmodifiable list of inherits list + * You can't manage the list by here + * Lol... version 0.6 had a problem because this. + * + * @return the inherits + */ + public List getInherits() { + + return Collections.unmodifiableList(inherits); + } + + /** + * @param inherit the inherits to set + */ + public void addInherits(Group inherit) { + + 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 (!isGlobal()) { + if (this.inherits.contains(inherit.toLowerCase())) { + this.inherits.remove(inherit.toLowerCase()); + flagAsChanged(); + GroupManagerEventHandler.callEvent(this, Action.GROUP_INHERITANCE_CHANGED); + return true; + } + } + return false; + } + + /** + * @return the variables + */ + public GroupVariables getVariables() { + + return variables; + } + + /** + * + * @param varList + */ + public void setVariables(Map varList) { + + 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/data/GroupVariables.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/GroupVariables.java index 19db58851..e08d1db7d 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/GroupVariables.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/GroupVariables.java @@ -7,81 +7,88 @@ package org.anjocaido.groupmanager.data; import java.util.Map; /** - * + * * @author gabrielcouto */ public class GroupVariables extends Variables implements Cloneable { - private Group owner; + private Group owner; - public GroupVariables(Group owner) { - super(owner); - this.owner = owner; - addVar("prefix", ""); - addVar("suffix", ""); - addVar("build", false); - } + public GroupVariables(Group owner) { - public GroupVariables(Group owner, Map varList) { - super(owner); - variables = varList; - if (variables.get("prefix") == null) { - variables.put("prefix", ""); - owner.flagAsChanged(); - } - //thisGrp.prefix = infoNode.get("prefix").toString(); + super(owner); + this.owner = owner; + addVar("prefix", ""); + addVar("suffix", ""); + addVar("build", false); + } - if (variables.get("suffix") == null) { - variables.put("suffix", ""); - owner.flagAsChanged(); - } - //thisGrp.suffix = infoNode.get("suffix").toString(); + public GroupVariables(Group owner, Map varList) { - if (variables.get("build") == null) { - variables.put("build", false); - owner.flagAsChanged(); - } - this.owner = owner; - } + super(owner); + variables = varList; + if (variables.get("prefix") == null) { + variables.put("prefix", ""); + owner.flagAsChanged(); + } + //thisGrp.prefix = infoNode.get("prefix").toString(); - /** - * A clone of all vars here. - * @return GroupVariables clone - */ - protected GroupVariables clone(Group newOwner) { - GroupVariables clone = new GroupVariables(newOwner); - for (String key : variables.keySet()) { - clone.variables.put(key, variables.get(key)); - } - newOwner.flagAsChanged(); - return clone; - } + if (variables.get("suffix") == null) { + variables.put("suffix", ""); + owner.flagAsChanged(); + } + //thisGrp.suffix = infoNode.get("suffix").toString(); - /** - * Remove a var from the list - * @param name - */ - @Override - public void removeVar(String name) { - try { - this.variables.remove(name); - } catch (Exception e) { - } - if (name.equals("prefix")) { - addVar("prefix", ""); - } else if (name.equals("suffix")) { - addVar("suffix", ""); - } else if (name.equals("build")) { - addVar("build", false); - } - owner.flagAsChanged(); - } + if (variables.get("build") == null) { + variables.put("build", false); + owner.flagAsChanged(); + } + this.owner = owner; + } - /** - * @return the owner - */ - @Override - public Group getOwner() { - return owner; - } + /** + * A clone of all vars here. + * + * @return GroupVariables clone + */ + protected GroupVariables clone(Group newOwner) { + + GroupVariables clone = new GroupVariables(newOwner); + for (String key : variables.keySet()) { + clone.variables.put(key, variables.get(key)); + } + newOwner.flagAsChanged(); + return clone; + } + + /** + * Remove a var from the list + * + * @param name + */ + @Override + public void removeVar(String name) { + + try { + this.variables.remove(name); + } catch (Exception e) { + } + if (name.equals("prefix")) { + addVar("prefix", ""); + } else if (name.equals("suffix")) { + addVar("suffix", ""); + } else if (name.equals("build")) { + addVar("build", false); + } + owner.flagAsChanged(); + } + + /** + * @return the owner + */ + @Override + public Group getOwner() { + + return owner; + } } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java index 217ab904e..25b3cb3fe 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java @@ -16,7 +16,6 @@ import java.util.Map; import org.bukkit.Bukkit; import org.bukkit.entity.Player; - /** * * @author gabrielcouto/ElgarL @@ -40,6 +39,7 @@ public class User extends DataUnit implements Cloneable { * @param name */ public User(WorldDataHolder source, String name) { + super(source, name); this.group = source.getDefaultGroup().getName(); } @@ -50,6 +50,7 @@ public class User extends DataUnit implements Cloneable { */ @Override public User clone() { + User clone = new User(getDataSource(), this.getName()); clone.group = this.group; for (String perm : this.getPermissionList()) { @@ -67,6 +68,7 @@ public class User extends DataUnit implements Cloneable { * @return null if given dataSource already contains the same user */ public User clone(WorldDataHolder dataSource) { + if (dataSource.isUserDeclared(this.getName())) { return null; } @@ -85,6 +87,7 @@ public class User extends DataUnit implements Cloneable { } public Group getGroup() { + Group result = getDataSource().getGroup(group); if (result == null) { this.setGroup(getDataSource().getDefaultGroup()); @@ -97,6 +100,7 @@ public class User extends DataUnit implements Cloneable { * @return the group */ public String getGroupName() { + Group result = getDataSource().getGroup(group); if (result == null) { group = getDataSource().getDefaultGroup().getName(); @@ -110,6 +114,7 @@ public class User extends DataUnit implements Cloneable { */ @Deprecated public void setGroup(String group) { + this.group = group; flagAsChanged(); if (GroupManager.isLoaded()) @@ -122,15 +127,17 @@ public class User extends DataUnit implements Cloneable { * the group to set */ public void setGroup(Group group) { + setGroup(group, true); } - + /** * @param group the group to set * @param updatePerms if we are to trigger a superperms update. - * + * */ public void setGroup(Group group, Boolean updatePerms) { + if (!this.getDataSource().groupExists(group.getName())) { getDataSource().addGroup(group); } @@ -151,12 +158,13 @@ public class User extends DataUnit implements Cloneable { if (notify) GroupManager.notify(this.getName(), String.format(" moved to the group %s.", group.getName())); - + GroupManagerEventHandler.callEvent(this, Action.USER_GROUP_CHANGED); } } public boolean addSubGroup(Group subGroup) { + // Don't allow adding a subgroup if it's already set as the primary. if (this.group.equalsIgnoreCase(subGroup.getName())) { return false; @@ -164,12 +172,12 @@ public class User extends DataUnit implements Cloneable { // User already has this subgroup if (containsSubGroup(subGroup)) return false; - + // If the group doesn't exists add it if (!this.getDataSource().groupExists(subGroup.getName())) { getDataSource().addGroup(subGroup); } - + subGroups.add(subGroup.getName()); flagAsChanged(); if (GroupManager.isLoaded()) { @@ -178,25 +186,29 @@ public class User extends DataUnit implements Cloneable { GroupManagerEventHandler.callEvent(this, Action.USER_SUBGROUP_CHANGED); } return true; - + //subGroup = getDataSource().getGroup(subGroup.getName()); //removeSubGroup(subGroup); //subGroups.add(subGroup.getName()); } public int subGroupsSize() { + return subGroups.size(); } public boolean isSubGroupsEmpty() { + return subGroups.isEmpty(); } public boolean containsSubGroup(Group subGroup) { + return subGroups.contains(subGroup.getName()); } public boolean removeSubGroup(Group subGroup) { + try { if (subGroups.remove(subGroup.getName())) { flagAsChanged(); @@ -212,6 +224,7 @@ public class User extends DataUnit implements Cloneable { } public ArrayList subGroupListCopy() { + ArrayList val = new ArrayList(); for (String gstr : subGroups) { Group g = getDataSource().getGroup(gstr); @@ -225,6 +238,7 @@ public class User extends DataUnit implements Cloneable { } public ArrayList subGroupListStringCopy() { + return new ArrayList(subGroups); } @@ -232,6 +246,7 @@ public class User extends DataUnit implements Cloneable { * @return the variables */ public UserVariables getVariables() { + return variables; } @@ -240,6 +255,7 @@ public class User extends DataUnit implements Cloneable { * @param varList */ public void setVariables(Map varList) { + //UserVariables temp = new UserVariables(this, varList); variables.clearVars(); for (String key : varList.keySet()) { @@ -254,6 +270,7 @@ public class User extends DataUnit implements Cloneable { } public User updatePlayer(Player player) { + if (player != null) { bukkitPlayer = player; } @@ -261,6 +278,7 @@ public class User extends DataUnit implements Cloneable { } public Player getBukkitPlayer() { + if (bukkitPlayer == null) { bukkitPlayer = Bukkit.getPlayer(this.getName()); } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/UserVariables.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/UserVariables.java index 0b3948cab..f994595c1 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/UserVariables.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/UserVariables.java @@ -7,42 +7,47 @@ package org.anjocaido.groupmanager.data; import java.util.Map; /** - * + * * @author gabrielcouto */ public class UserVariables extends Variables { - private User owner; - - public UserVariables(User owner) { - super(owner); - this.owner = owner; - } - - public UserVariables(User owner, Map varList) { - super(owner); - this.variables = varList; - this.owner = owner; - } - - /** - * A clone of all vars here. - * @return UserVariables clone - */ - protected UserVariables clone(User newOwner) { - UserVariables clone = new UserVariables(newOwner); - for (String key : variables.keySet()) { - clone.variables.put(key, variables.get(key)); - } - newOwner.flagAsChanged(); - return clone; - } - - /** - * @return the owner - */ - @Override - public User getOwner() { - return owner; - } + private User owner; + + public UserVariables(User owner) { + + super(owner); + this.owner = owner; + } + + public UserVariables(User owner, Map varList) { + + super(owner); + this.variables = varList; + this.owner = owner; + } + + /** + * A clone of all vars here. + * + * @return UserVariables clone + */ + protected UserVariables clone(User newOwner) { + + UserVariables clone = new UserVariables(newOwner); + for (String key : variables.keySet()) { + clone.variables.put(key, variables.get(key)); + } + newOwner.flagAsChanged(); + return clone; + } + + /** + * @return the owner + */ + @Override + public User getOwner() { + + return owner; + } } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Variables.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Variables.java index 140d6626a..42ceba7e4 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Variables.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/Variables.java @@ -9,178 +9,200 @@ import java.util.Map; import java.util.Set; /** - *A class that holds variables of a user/group. + * A class that holds variables of a user/group. * In groups, it holds the contents of INFO node. * Like: * prefix * suffix * build - * + * * @author gabrielcouto */ public abstract class Variables implements Cloneable { - private DataUnit owner; - protected Map variables = new HashMap(); - - public Variables(DataUnit owner) { - this.owner = owner; - } - - /** - * Add var to the the INFO node. - * examples: - * addVar("build",true); - * addVar("prefix","c"); - * @param name key name of the var - * @param o the object value of the var - */ - public void addVar(String name, Object o) { - if (o == null) { - return; - } - if (variables.containsKey(name)) { - variables.remove(name); - } - variables.put(name, o); - owner.flagAsChanged(); - } - - /** - * Returns the object inside the var - * @param name - * @return a Object if exists. null if doesn't exists - */ - public Object getVarObject(String name) { - return variables.get(name); - } - - /** - * Get the String value for the given var name - * @param name the var key name - * @return "" if null. or the toString() value of object - */ - public String getVarString(String name) { - Object o = variables.get(name); - try { - return o == null ? "" : o.toString(); - } catch (Exception e) { - return ""; - } - } - - /** - * - * @param name - * @return false if null. or a Boolean.parseBoolean of the string - */ - public Boolean getVarBoolean(String name) { - Object o = variables.get(name); - try { - return o == null ? false : Boolean.parseBoolean(o.toString()); - } catch (Exception e) { - return false; - } - } - - /** - * - * @param name - * @return -1 if null. or a parseInt of the string - */ - public Integer getVarInteger(String name) { - Object o = variables.get(name); - try { - return o == null ? -1 : Integer.parseInt(o.toString()); - } catch (Exception e) { - return -1; - } - } - - /** - * - * @param name - * @return -1 if null. or a parseDouble of the string - */ - public Double getVarDouble(String name) { - Object o = variables.get(name); - try { - return o == null ? -1.0D : Double.parseDouble(o.toString()); - } catch (Exception e) { - return -1.0D; - } - } - - /** - * All variable keys this is holding - * @return Set of all variable names. - */ - public Set getVarKeyList() { - return variables.keySet(); - } - - /** - * verify is a var exists - * @param name the key name of the var - * @return true if that var exists - */ - public boolean hasVar(String name) { - return variables.containsKey(name); - } - - /** - * Returns the quantity of vars this is holding - * @return the number of vars - */ - public int getSize() { - return variables.size(); - } - - /** - * Remove a var from the list - * @param name - */ - public void removeVar(String name) { - try { - variables.remove(name); - } catch (Exception e) { - } - owner.flagAsChanged(); - } - - public static Object parseVariableValue(String value) { - try { - Integer i = Integer.parseInt(value); - return i; - } catch (NumberFormatException e) { - } - try { - Double d = Double.parseDouble(value); - return d; - } catch (NumberFormatException e) { - } - if (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("yes") || value.equalsIgnoreCase("on")) { - return true; - } else if (value.equalsIgnoreCase("false") || value.equalsIgnoreCase("no") || value.equalsIgnoreCase("off")) { - return false; - } - return value; - - } - - public void clearVars() { - variables.clear(); - owner.flagAsChanged(); - } - - /** - * @return the owner - */ - public DataUnit getOwner() { - return owner; - } - - public boolean isEmpty() { - return variables.isEmpty(); - } + private DataUnit owner; + protected Map variables = new HashMap(); + + public Variables(DataUnit owner) { + + this.owner = owner; + } + + /** + * Add var to the the INFO node. + * examples: + * addVar("build",true); + * addVar("prefix","c"); + * + * @param name key name of the var + * @param o the object value of the var + */ + public void addVar(String name, Object o) { + + if (o == null) { + return; + } + if (variables.containsKey(name)) { + variables.remove(name); + } + variables.put(name, o); + owner.flagAsChanged(); + } + + /** + * Returns the object inside the var + * + * @param name + * @return a Object if exists. null if doesn't exists + */ + public Object getVarObject(String name) { + + return variables.get(name); + } + + /** + * Get the String value for the given var name + * + * @param name the var key name + * @return "" if null. or the toString() value of object + */ + public String getVarString(String name) { + + Object o = variables.get(name); + try { + return o == null ? "" : o.toString(); + } catch (Exception e) { + return ""; + } + } + + /** + * + * @param name + * @return false if null. or a Boolean.parseBoolean of the string + */ + public Boolean getVarBoolean(String name) { + + Object o = variables.get(name); + try { + return o == null ? false : Boolean.parseBoolean(o.toString()); + } catch (Exception e) { + return false; + } + } + + /** + * + * @param name + * @return -1 if null. or a parseInt of the string + */ + public Integer getVarInteger(String name) { + + Object o = variables.get(name); + try { + return o == null ? -1 : Integer.parseInt(o.toString()); + } catch (Exception e) { + return -1; + } + } + + /** + * + * @param name + * @return -1 if null. or a parseDouble of the string + */ + public Double getVarDouble(String name) { + + Object o = variables.get(name); + try { + return o == null ? -1.0D : Double.parseDouble(o.toString()); + } catch (Exception e) { + return -1.0D; + } + } + + /** + * All variable keys this is holding + * + * @return Set of all variable names. + */ + public Set getVarKeyList() { + + return variables.keySet(); + } + + /** + * verify is a var exists + * + * @param name the key name of the var + * @return true if that var exists + */ + public boolean hasVar(String name) { + + return variables.containsKey(name); + } + + /** + * Returns the quantity of vars this is holding + * + * @return the number of vars + */ + public int getSize() { + + return variables.size(); + } + + /** + * Remove a var from the list + * + * @param name + */ + public void removeVar(String name) { + + try { + variables.remove(name); + } catch (Exception e) { + } + owner.flagAsChanged(); + } + + public static Object parseVariableValue(String value) { + + try { + Integer i = Integer.parseInt(value); + return i; + } catch (NumberFormatException e) { + } + try { + Double d = Double.parseDouble(value); + return d; + } catch (NumberFormatException e) { + } + if (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("yes") || value.equalsIgnoreCase("on")) { + return true; + } else if (value.equalsIgnoreCase("false") || value.equalsIgnoreCase("no") || value.equalsIgnoreCase("off")) { + return false; + } + return value; + + } + + public void clearVars() { + + variables.clear(); + owner.flagAsChanged(); + } + + /** + * @return the owner + */ + public DataUnit getOwner() { + + return owner; + } + + public boolean isEmpty() { + + return variables.isEmpty(); + } } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java index 5d681013e..eaaaace74 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java @@ -6,8 +6,6 @@ import java.util.Map; import org.anjocaido.groupmanager.data.Group; - - /** * This container holds all Groups loaded from the relevant groupsFile. * @@ -31,9 +29,11 @@ public class GroupsDataHolder { * Constructor */ protected GroupsDataHolder() { + } - + public void setDataSource(WorldDataHolder dataSource) { + this.dataSource = dataSource; //push this data source to the users, so they pull the correct groups data. for (Group group : groups.values()) @@ -44,6 +44,7 @@ public class GroupsDataHolder { * @return the defaultGroup */ public Group getDefaultGroup() { + return defaultGroup; } @@ -51,6 +52,7 @@ public class GroupsDataHolder { * @param defaultGroup the defaultGroup to set */ public void setDefaultGroup(Group defaultGroup) { + this.defaultGroup = defaultGroup; } @@ -58,20 +60,23 @@ public class GroupsDataHolder { * @return the groups */ public Map getGroups() { + return groups; } - + /** * @param groups the groups to set */ public void setGroups(Map groups) { + this.groups = groups; } - + /** * @return the groupsFile */ public File getGroupsFile() { + return groupsFile; } @@ -79,6 +84,7 @@ public class GroupsDataHolder { * @param groupsFile the groupsFile to set */ public void setGroupsFile(File groupsFile) { + this.groupsFile = groupsFile; } @@ -86,6 +92,7 @@ public class GroupsDataHolder { * @return the haveGroupsChanged */ public boolean HaveGroupsChanged() { + return haveGroupsChanged; } @@ -93,6 +100,7 @@ public class GroupsDataHolder { * @param haveGroupsChanged the haveGroupsChanged to set */ public void setGroupsChanged(boolean haveGroupsChanged) { + this.haveGroupsChanged = haveGroupsChanged; } @@ -100,6 +108,7 @@ public class GroupsDataHolder { * @return the timeStampGroups */ public long getTimeStampGroups() { + return timeStampGroups; } @@ -107,6 +116,7 @@ public class GroupsDataHolder { * @param timeStampGroups the timeStampGroups to set */ public void setTimeStampGroups(long timeStampGroups) { + this.timeStampGroups = timeStampGroups; } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/OverloadedWorldHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/OverloadedWorldHolder.java index b37c55e51..c8a3eb3ae 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/OverloadedWorldHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/OverloadedWorldHolder.java @@ -11,195 +11,205 @@ import java.util.Map; import org.anjocaido.groupmanager.data.User; /** - * + * * @author gabrielcouto */ public class OverloadedWorldHolder extends WorldDataHolder { - /** + /** * */ - protected Map overloadedUsers = new HashMap(); + protected Map overloadedUsers = new HashMap(); - /** - * - * @param ph - */ - public OverloadedWorldHolder(WorldDataHolder ph) { - super(ph.getName()); - this.setGroupsFile(ph.getGroupsFile()); - this.setUsersFile(ph.getUsersFile()); - //this.setDefaultGroup(ph.getDefaultGroup()); - this.groups = ph.groups; - this.users = ph.users; - } - - /** - * - * @param userName - * @return user object or a new user if none exists. - */ - @Override - public User getUser(String userName) { - //OVERLOADED CODE - String userNameLowered = userName.toLowerCase(); - if (overloadedUsers.containsKey(userNameLowered)) { - return overloadedUsers.get(userNameLowered); - } - //END CODE - if (getUsers().containsKey(userNameLowered)) { - return getUsers().get(userNameLowered); - } - User newUser = createUser(userName); - setUsersChanged(true); - return newUser; - } - - /** - * - * @param theUser - */ - @Override - public void addUser(User theUser) { - if (theUser.getDataSource() != this) { - theUser = theUser.clone(this); - } - if (theUser == null) { - return; - } - if ((theUser.getGroup() == null) || (!getGroups().containsKey(theUser.getGroupName().toLowerCase()))) { - theUser.setGroup(getDefaultGroup()); - } - //OVERLOADED CODE - if (overloadedUsers.containsKey(theUser.getName().toLowerCase())) { - overloadedUsers.remove(theUser.getName().toLowerCase()); - overloadedUsers.put(theUser.getName().toLowerCase(), theUser); - return; - } - //END CODE - removeUser(theUser.getName()); - getUsers().put(theUser.getName().toLowerCase(), theUser); - setUsersChanged(true); - } - - /** - * - * @param userName - * @return true if removed/false if not found. - */ - @Override - public boolean removeUser(String userName) { - //OVERLOADED CODE - if (overloadedUsers.containsKey(userName.toLowerCase())) { - overloadedUsers.remove(userName.toLowerCase()); - return true; - } - //END CODE - if (getUsers().containsKey(userName.toLowerCase())) { - getUsers().remove(userName.toLowerCase()); - setUsersChanged(true); - return true; - } - return false; - } - - @Override - public boolean removeGroup(String groupName) { - if (groupName.equals(getDefaultGroup())) { - return false; - } - for (String key : getGroups().keySet()) { - if (groupName.equalsIgnoreCase(key)) { - getGroups().remove(key); - for (String userKey : getUsers().keySet()) { - User user = getUsers().get(userKey); - if (user.getGroupName().equalsIgnoreCase(key)) { - user.setGroup(getDefaultGroup()); - } - - } - //OVERLOADED CODE - for (String userKey : overloadedUsers.keySet()) { - User user = overloadedUsers.get(userKey); - if (user.getGroupName().equalsIgnoreCase(key)) { - user.setGroup(getDefaultGroup()); - } - - } - //END OVERLOAD - setGroupsChanged(true); - return true; - } - } - return false; - } - - /** - * - * @return Collection of all users - */ - @Override - public Collection getUserList() { - Collection overloadedList = new ArrayList(); - Collection normalList = getUsers().values(); - for (User u : normalList) { - if (overloadedUsers.containsKey(u.getName().toLowerCase())) { - overloadedList.add(overloadedUsers.get(u.getName().toLowerCase())); - } else { - overloadedList.add(u); - } - } - return overloadedList; - } - - /** - * - * @param userName - * @return true if user is overloaded. - */ - public boolean isOverloaded(String userName) { - return overloadedUsers.containsKey(userName.toLowerCase()); - } + /** + * + * @param ph + */ + public OverloadedWorldHolder(WorldDataHolder ph) { - /** - * - * @param userName - */ - public void overloadUser(String userName) { - if (!isOverloaded(userName)) { - User theUser = getUser(userName); - theUser = theUser.clone(); - if (overloadedUsers.containsKey(theUser.getName().toLowerCase())) { - overloadedUsers.remove(theUser.getName().toLowerCase()); - } - overloadedUsers.put(theUser.getName().toLowerCase(), theUser); - } - } - - /** - * - * @param userName - */ - public void removeOverload(String userName) { - overloadedUsers.remove(userName.toLowerCase()); - } - - /** - * Gets the user in normal state. Surpassing the overload state. - * It doesn't affect permissions. But it enables plugins change the - * actual user permissions even in overload mode. - * - * @param userName - * @return user object - */ - public User surpassOverload(String userName) { - if (!isOverloaded(userName)) { - return getUser(userName); - } - if (getUsers().containsKey(userName.toLowerCase())) { - return getUsers().get(userName.toLowerCase()); - } - User newUser = createUser(userName); - return newUser; - } + super(ph.getName()); + this.setGroupsFile(ph.getGroupsFile()); + this.setUsersFile(ph.getUsersFile()); + //this.setDefaultGroup(ph.getDefaultGroup()); + this.groups = ph.groups; + this.users = ph.users; + } + + /** + * + * @param userName + * @return user object or a new user if none exists. + */ + @Override + public User getUser(String userName) { + + //OVERLOADED CODE + String userNameLowered = userName.toLowerCase(); + if (overloadedUsers.containsKey(userNameLowered)) { + return overloadedUsers.get(userNameLowered); + } + //END CODE + if (getUsers().containsKey(userNameLowered)) { + return getUsers().get(userNameLowered); + } + User newUser = createUser(userName); + setUsersChanged(true); + return newUser; + } + + /** + * + * @param theUser + */ + @Override + public void addUser(User theUser) { + + if (theUser.getDataSource() != this) { + theUser = theUser.clone(this); + } + if (theUser == null) { + return; + } + if ((theUser.getGroup() == null) || (!getGroups().containsKey(theUser.getGroupName().toLowerCase()))) { + theUser.setGroup(getDefaultGroup()); + } + //OVERLOADED CODE + if (overloadedUsers.containsKey(theUser.getName().toLowerCase())) { + overloadedUsers.remove(theUser.getName().toLowerCase()); + overloadedUsers.put(theUser.getName().toLowerCase(), theUser); + return; + } + //END CODE + removeUser(theUser.getName()); + getUsers().put(theUser.getName().toLowerCase(), theUser); + setUsersChanged(true); + } + + /** + * + * @param userName + * @return true if removed/false if not found. + */ + @Override + public boolean removeUser(String userName) { + + //OVERLOADED CODE + if (overloadedUsers.containsKey(userName.toLowerCase())) { + overloadedUsers.remove(userName.toLowerCase()); + return true; + } + //END CODE + if (getUsers().containsKey(userName.toLowerCase())) { + getUsers().remove(userName.toLowerCase()); + setUsersChanged(true); + return true; + } + return false; + } + + @Override + public boolean removeGroup(String groupName) { + + if (groupName.equals(getDefaultGroup())) { + return false; + } + for (String key : getGroups().keySet()) { + if (groupName.equalsIgnoreCase(key)) { + getGroups().remove(key); + for (String userKey : getUsers().keySet()) { + User user = getUsers().get(userKey); + if (user.getGroupName().equalsIgnoreCase(key)) { + user.setGroup(getDefaultGroup()); + } + + } + //OVERLOADED CODE + for (String userKey : overloadedUsers.keySet()) { + User user = overloadedUsers.get(userKey); + if (user.getGroupName().equalsIgnoreCase(key)) { + user.setGroup(getDefaultGroup()); + } + + } + //END OVERLOAD + setGroupsChanged(true); + return true; + } + } + return false; + } + + /** + * + * @return Collection of all users + */ + @Override + public Collection getUserList() { + + Collection overloadedList = new ArrayList(); + Collection normalList = getUsers().values(); + for (User u : normalList) { + if (overloadedUsers.containsKey(u.getName().toLowerCase())) { + overloadedList.add(overloadedUsers.get(u.getName().toLowerCase())); + } else { + overloadedList.add(u); + } + } + return overloadedList; + } + + /** + * + * @param userName + * @return true if user is overloaded. + */ + public boolean isOverloaded(String userName) { + + return overloadedUsers.containsKey(userName.toLowerCase()); + } + + /** + * + * @param userName + */ + public void overloadUser(String userName) { + + if (!isOverloaded(userName)) { + User theUser = getUser(userName); + theUser = theUser.clone(); + if (overloadedUsers.containsKey(theUser.getName().toLowerCase())) { + overloadedUsers.remove(theUser.getName().toLowerCase()); + } + overloadedUsers.put(theUser.getName().toLowerCase(), theUser); + } + } + + /** + * + * @param userName + */ + public void removeOverload(String userName) { + + overloadedUsers.remove(userName.toLowerCase()); + } + + /** + * Gets the user in normal state. Surpassing the overload state. + * It doesn't affect permissions. But it enables plugins change the + * actual user permissions even in overload mode. + * + * @param userName + * @return user object + */ + public User surpassOverload(String userName) { + + if (!isOverloaded(userName)) { + return getUser(userName); + } + if (getUsers().containsKey(userName.toLowerCase())) { + return getUsers().get(userName.toLowerCase()); + } + User newUser = createUser(userName); + return newUser; + } } \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java index fa2ccaf84..665fe227d 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java @@ -6,8 +6,6 @@ import java.util.Map; import org.anjocaido.groupmanager.data.User; - - /** * This container holds all Users loaded from the relevant usersFile. * @@ -30,27 +28,31 @@ public class UsersDataHolder { * Constructor */ protected UsersDataHolder() { + } - + public void setDataSource(WorldDataHolder dataSource) { + this.dataSource = dataSource; //push this data source to the users, so they pull the correct groups data. for (User user : users.values()) user.setDataSource(this.dataSource); - + } /** * @return the users */ public Map getUsers() { + return users; } - + /** * @param users the users to set */ public void setUsers(Map users) { + this.users = users; } @@ -58,6 +60,7 @@ public class UsersDataHolder { * @return the usersFile */ public File getUsersFile() { + return usersFile; } @@ -65,6 +68,7 @@ public class UsersDataHolder { * @param usersFile the usersFile to set */ public void setUsersFile(File usersFile) { + this.usersFile = usersFile; } @@ -72,6 +76,7 @@ public class UsersDataHolder { * @return the haveUsersChanged */ public boolean HaveUsersChanged() { + return haveUsersChanged; } @@ -79,6 +84,7 @@ public class UsersDataHolder { * @param haveUsersChanged the haveUsersChanged to set */ public void setUsersChanged(boolean haveUsersChanged) { + this.haveUsersChanged = haveUsersChanged; } @@ -86,6 +92,7 @@ public class UsersDataHolder { * @return the timeStampUsers */ public long getTimeStampUsers() { + return timeStampUsers; } @@ -93,6 +100,7 @@ public class UsersDataHolder { * @param timeStampUsers the timeStampUsers to set */ public void setTimeStampUsers(long timeStampUsers) { + this.timeStampUsers = timeStampUsers; } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index ce6db2b9b..fefc698f9 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -45,339 +45,371 @@ import org.yaml.snakeyaml.reader.UnicodeReader; */ public class WorldDataHolder { - /** - * World name - */ - protected String name; - /** - * The actual groups holder - */ - protected GroupsDataHolder groups = new GroupsDataHolder(); /** - * The actual users holder - */ - protected UsersDataHolder users = new UsersDataHolder(); - /** + * World name + */ + protected String name; + /** + * The actual groups holder + */ + protected GroupsDataHolder groups = new GroupsDataHolder(); + /** + * The actual users holder + */ + protected UsersDataHolder users = new UsersDataHolder(); + /** * */ - protected AnjoPermissionsHandler permissionsHandler; + protected AnjoPermissionsHandler permissionsHandler; - /** - * Prevent direct instantiation - * @param worldName - */ - public WorldDataHolder(String worldName) { - name = worldName; - } - - /** - * The main constructor for a new WorldDataHolder - * @param worldName - * @param groups - * @param users - */ - public WorldDataHolder(String worldName, GroupsDataHolder groups, UsersDataHolder users) { - this.name = worldName; - this.groups = groups; - this.users = users; - - //this.defaultGroup = defaultGroup; - } - - /** - * update the dataSource to point to this object. - * - * This should be called whenever a set of world data is fetched. - */ - public void updateDataSource() { - this.groups.setDataSource(this); - this.users.setDataSource(this); - } - - /** - * Search for a user. If it doesn't exist, create a new one with - * default group. - * - * @param userName the name of the user - * @return class that manage that user permission - */ - public User getUser(String userName) { - if (getUsers().containsKey(userName.toLowerCase())) { - return getUsers().get(userName.toLowerCase()); - } - User newUser = createUser(userName); - return newUser; - } - - /** - * Add a user to the list. If it already exists, overwrite the old. - * @param theUser the user you want to add to the permission list - */ - public void addUser(User theUser) { - if (theUser.getDataSource() != this) { - theUser = theUser.clone(this); - } - if (theUser == null) { - return; - } - if ((theUser.getGroup() == null)) { - theUser.setGroup(groups.getDefaultGroup()); - } - removeUser(theUser.getName()); - getUsers().put(theUser.getName().toLowerCase(), theUser); - setUsersChanged(true); - if (GroupManager.isLoaded()) - GroupManagerEventHandler.callEvent(theUser, Action.USER_ADDED); - } - - /** - * Removes the user from the list. (he might become a default user) - * @param userName the username from the user to remove - * @return true if it had something to remove - */ - public boolean removeUser(String userName) { - if (getUsers().containsKey(userName.toLowerCase())) { - getUsers().remove(userName.toLowerCase()); - setUsersChanged(true); - if (GroupManager.isLoaded()) - GroupManagerEventHandler.callEvent(userName, GMUserEvent.Action.USER_REMOVED); - return true; - } - return false; - } - - /** - * - * @param userName - * @return true if we have data for this player. - */ - public boolean isUserDeclared(String userName) { - return getUsers().containsKey(userName.toLowerCase()); - } + * Prevent direct instantiation + * + * @param worldName + */ + public WorldDataHolder(String worldName) { - /** - * Change the default group of the file. - * @param group the group you want make default. - */ - public void setDefaultGroup(Group group) { - if (!getGroups().containsKey(group.getName().toLowerCase()) || (group.getDataSource() != this)) { - addGroup(group); - } - groups.setDefaultGroup(getGroup(group.getName())); - setGroupsChanged(true); - if (GroupManager.isLoaded()) - GroupManagerEventHandler.callEvent(GMSystemEvent.Action.DEFAULT_GROUP_CHANGED); - } - - /** - * Returns the default group of the file - * @return the default group - */ - public Group getDefaultGroup() { - return groups.getDefaultGroup(); - } - - /** - * Returns a group of the given name - * @param groupName the name of the group - * @return a group if it is found. null if not found. - */ - public Group getGroup(String groupName) { - if (groupName.toLowerCase().startsWith("g:")) - return GroupManager.getGlobalGroups().getGroup(groupName); - else - return getGroups().get(groupName.toLowerCase()); - } - - /** - * Check if a group exists. - * Its the same of getGroup, but check if it is null. - * @param groupName the name of the group - * @return true if exists. false if not. - */ - public boolean groupExists(String groupName) { - if (groupName.toLowerCase().startsWith("g:")) - return GroupManager.getGlobalGroups().hasGroup(groupName); - else - return getGroups().containsKey(groupName.toLowerCase()); - } - - /** - * Add a group to the list - * @param groupToAdd - */ - public void addGroup(Group groupToAdd) { - if (groupToAdd.getName().toLowerCase().startsWith("g:")) { - GroupManager.getGlobalGroups().addGroup(groupToAdd); - GroupManagerEventHandler.callEvent(groupToAdd, GMGroupEvent.Action.GROUP_ADDED); - return; - } - - if (groupToAdd.getDataSource() != this) { - groupToAdd = groupToAdd.clone(this); - } - removeGroup(groupToAdd.getName()); - getGroups().put(groupToAdd.getName().toLowerCase(), groupToAdd); - setGroupsChanged(true); - if (GroupManager.isLoaded()) - GroupManagerEventHandler.callEvent(groupToAdd, GMGroupEvent.Action.GROUP_ADDED); - } - - /** - * Remove the group from the list - * @param groupName - * @return true if had something to remove. false the group was default or non-existant - */ - public boolean removeGroup(String groupName) { - if (groupName.toLowerCase().startsWith("g:")) { - return GroupManager.getGlobalGroups().removeGroup(groupName); - } - - if (getDefaultGroup() != null && groupName.equalsIgnoreCase(getDefaultGroup().getName())) { - return false; - } - if (getGroups().containsKey(groupName.toLowerCase())) { - getGroups().remove(groupName.toLowerCase()); - setGroupsChanged(true); - if (GroupManager.isLoaded()) - GroupManagerEventHandler.callEvent(groupName.toLowerCase(), GMGroupEvent.Action.GROUP_REMOVED); - return true; - } - return false; - - } - - /** - * Creates a new User with the given name - * and adds it to this holder. - * @param userName the username you want - * @return null if user already exists. or new User - */ - public User createUser(String userName) { - if (getUsers().containsKey(userName.toLowerCase())) { - return null; - } - User newUser = new User(this, userName); - newUser.setGroup(groups.getDefaultGroup(), false); - addUser(newUser); - setUsersChanged(true); - return newUser; - } - - /** - * Creates a new Group with the given name - * and adds it to this holder - * @param groupName the groupname you want - * @return null if group already exists. or new Group - */ - public Group createGroup(String groupName) { - if (groupName.toLowerCase().startsWith("g:")) { - Group newGroup = new Group(groupName); - return GroupManager.getGlobalGroups().newGroup(newGroup); - } - - if (getGroups().containsKey(groupName.toLowerCase())) { - return null; - } - - Group newGroup = new Group(this, groupName); - addGroup(newGroup); - setGroupsChanged(true); - return newGroup; - } - - /** - * - * @return a collection of the groups - */ - public Collection getGroupList() { - return getGroups().values(); - } + name = worldName; + } - /** - * - * @return a collection of the users - */ - public Collection getUserList() { - return getUsers().values(); - } + /** + * The main constructor for a new WorldDataHolder + * + * @param worldName + * @param groups + * @param users + */ + public WorldDataHolder(String worldName, GroupsDataHolder groups, UsersDataHolder users) { - /** - * reads the file again - */ - public void reload() { - try { - reloadGroups(); - reloadUsers(); - } catch (Exception ex) { - Logger.getLogger(WorldDataHolder.class.getName()).log(Level.SEVERE, null, ex); - } - } - - /** - * Refresh Group data from file - */ - public void reloadGroups() { - GroupManager.setLoaded(false); - try { - // temporary holder in case the load fails. - WorldDataHolder ph = new WorldDataHolder(this.getName()); - - loadGroups(ph, getGroupsFile()); - // transfer new data - resetGroups(); - for (Group tempGroup : ph.getGroupList()) { - tempGroup.clone(this); - } - this.setDefaultGroup(getGroup(ph.getDefaultGroup().getName())); - this.removeGroupsChangedFlag(); - this.setTimeStampGroups(getGroupsFile().lastModified()); - - ph = null; - } catch (Exception ex) { - Logger.getLogger(WorldDataHolder.class.getName()).log(Level.WARNING, null, ex); - } - GroupManager.setLoaded(true); - GroupManagerEventHandler.callEvent(GMSystemEvent.Action.RELOADED); - } - - /** - * Refresh Users data from file - */ - public void reloadUsers() { - GroupManager.setLoaded(false); - try { - // temporary holder in case the load fails. - WorldDataHolder ph = new WorldDataHolder(this.getName()); - // copy groups for reference - for (Group tempGroup : this.getGroupList()) { - tempGroup.clone(ph); - } - // setup the default group before loading user data. - ph.setDefaultGroup(ph.getGroup(getDefaultGroup().getName())); - loadUsers(ph, getUsersFile()); - // transfer new data - resetUsers(); - for (User tempUser : ph.getUserList()) { - tempUser.clone(this); - } - this.removeUsersChangedFlag(); - this.setTimeStampUsers(getUsersFile().lastModified()); - - ph = null; - } catch (Exception ex) { - Logger.getLogger(WorldDataHolder.class.getName()).log(Level.WARNING, null, ex); - } - GroupManager.setLoaded(true); - GroupManagerEventHandler.callEvent(GMSystemEvent.Action.RELOADED); - } - - public void loadGroups(File groupsFile) { - - GroupManager.setLoaded(false); - try { - setGroupsFile(groupsFile); + this.name = worldName; + this.groups = groups; + this.users = users; + + // this.defaultGroup = defaultGroup; + } + + /** + * update the dataSource to point to this object. + * + * This should be called whenever a set of world data is fetched. + */ + public void updateDataSource() { + + this.groups.setDataSource(this); + this.users.setDataSource(this); + } + + /** + * Search for a user. If it doesn't exist, create a new one with + * default group. + * + * @param userName the name of the user + * @return class that manage that user permission + */ + public User getUser(String userName) { + + if (getUsers().containsKey(userName.toLowerCase())) { + return getUsers().get(userName.toLowerCase()); + } + User newUser = createUser(userName); + return newUser; + } + + /** + * Add a user to the list. If it already exists, overwrite the old. + * + * @param theUser the user you want to add to the permission list + */ + public void addUser(User theUser) { + + if (theUser.getDataSource() != this) { + theUser = theUser.clone(this); + } + if (theUser == null) { + return; + } + if ((theUser.getGroup() == null)) { + theUser.setGroup(groups.getDefaultGroup()); + } + removeUser(theUser.getName()); + getUsers().put(theUser.getName().toLowerCase(), theUser); + setUsersChanged(true); + if (GroupManager.isLoaded()) + GroupManagerEventHandler.callEvent(theUser, Action.USER_ADDED); + } + + /** + * Removes the user from the list. (he might become a default user) + * + * @param userName the username from the user to remove + * @return true if it had something to remove + */ + public boolean removeUser(String userName) { + + if (getUsers().containsKey(userName.toLowerCase())) { + getUsers().remove(userName.toLowerCase()); + setUsersChanged(true); + if (GroupManager.isLoaded()) + GroupManagerEventHandler.callEvent(userName, GMUserEvent.Action.USER_REMOVED); + return true; + } + return false; + } + + /** + * + * @param userName + * @return true if we have data for this player. + */ + public boolean isUserDeclared(String userName) { + + return getUsers().containsKey(userName.toLowerCase()); + } + + /** + * Change the default group of the file. + * + * @param group the group you want make default. + */ + public void setDefaultGroup(Group group) { + + if (!getGroups().containsKey(group.getName().toLowerCase()) || (group.getDataSource() != this)) { + addGroup(group); + } + groups.setDefaultGroup(getGroup(group.getName())); + setGroupsChanged(true); + if (GroupManager.isLoaded()) + GroupManagerEventHandler.callEvent(GMSystemEvent.Action.DEFAULT_GROUP_CHANGED); + } + + /** + * Returns the default group of the file + * + * @return the default group + */ + public Group getDefaultGroup() { + + return groups.getDefaultGroup(); + } + + /** + * Returns a group of the given name + * + * @param groupName the name of the group + * @return a group if it is found. null if not found. + */ + public Group getGroup(String groupName) { + + if (groupName.toLowerCase().startsWith("g:")) + return GroupManager.getGlobalGroups().getGroup(groupName); + else + return getGroups().get(groupName.toLowerCase()); + } + + /** + * Check if a group exists. + * Its the same of getGroup, but check if it is null. + * + * @param groupName the name of the group + * @return true if exists. false if not. + */ + public boolean groupExists(String groupName) { + + if (groupName.toLowerCase().startsWith("g:")) + return GroupManager.getGlobalGroups().hasGroup(groupName); + else + return getGroups().containsKey(groupName.toLowerCase()); + } + + /** + * Add a group to the list + * + * @param groupToAdd + */ + public void addGroup(Group groupToAdd) { + + if (groupToAdd.getName().toLowerCase().startsWith("g:")) { + GroupManager.getGlobalGroups().addGroup(groupToAdd); + GroupManagerEventHandler.callEvent(groupToAdd, GMGroupEvent.Action.GROUP_ADDED); + return; + } + + if (groupToAdd.getDataSource() != this) { + groupToAdd = groupToAdd.clone(this); + } + removeGroup(groupToAdd.getName()); + getGroups().put(groupToAdd.getName().toLowerCase(), groupToAdd); + setGroupsChanged(true); + if (GroupManager.isLoaded()) + GroupManagerEventHandler.callEvent(groupToAdd, GMGroupEvent.Action.GROUP_ADDED); + } + + /** + * Remove the group from the list + * + * @param groupName + * @return true if had something to remove. false the group was default or + * non-existant + */ + public boolean removeGroup(String groupName) { + + if (groupName.toLowerCase().startsWith("g:")) { + return GroupManager.getGlobalGroups().removeGroup(groupName); + } + + if (getDefaultGroup() != null && groupName.equalsIgnoreCase(getDefaultGroup().getName())) { + return false; + } + if (getGroups().containsKey(groupName.toLowerCase())) { + getGroups().remove(groupName.toLowerCase()); + setGroupsChanged(true); + if (GroupManager.isLoaded()) + GroupManagerEventHandler.callEvent(groupName.toLowerCase(), GMGroupEvent.Action.GROUP_REMOVED); + return true; + } + return false; + + } + + /** + * Creates a new User with the given name + * and adds it to this holder. + * + * @param userName the username you want + * @return null if user already exists. or new User + */ + public User createUser(String userName) { + + if (getUsers().containsKey(userName.toLowerCase())) { + return null; + } + User newUser = new User(this, userName); + newUser.setGroup(groups.getDefaultGroup(), false); + addUser(newUser); + setUsersChanged(true); + return newUser; + } + + /** + * Creates a new Group with the given name + * and adds it to this holder + * + * @param groupName the groupname you want + * @return null if group already exists. or new Group + */ + public Group createGroup(String groupName) { + + if (groupName.toLowerCase().startsWith("g:")) { + Group newGroup = new Group(groupName); + return GroupManager.getGlobalGroups().newGroup(newGroup); + } + + if (getGroups().containsKey(groupName.toLowerCase())) { + return null; + } + + Group newGroup = new Group(this, groupName); + addGroup(newGroup); + setGroupsChanged(true); + return newGroup; + } + + /** + * + * @return a collection of the groups + */ + public Collection getGroupList() { + + return getGroups().values(); + } + + /** + * + * @return a collection of the users + */ + public Collection getUserList() { + + return getUsers().values(); + } + + /** + * reads the file again + */ + public void reload() { + + try { + reloadGroups(); + reloadUsers(); + } catch (Exception ex) { + Logger.getLogger(WorldDataHolder.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * Refresh Group data from file + */ + public void reloadGroups() { + + GroupManager.setLoaded(false); + try { + // temporary holder in case the load fails. + WorldDataHolder ph = new WorldDataHolder(this.getName()); + + loadGroups(ph, getGroupsFile()); + // transfer new data + resetGroups(); + for (Group tempGroup : ph.getGroupList()) { + tempGroup.clone(this); + } + this.setDefaultGroup(getGroup(ph.getDefaultGroup().getName())); + this.removeGroupsChangedFlag(); + this.setTimeStampGroups(getGroupsFile().lastModified()); + + ph = null; + } catch (Exception ex) { + Logger.getLogger(WorldDataHolder.class.getName()).log(Level.WARNING, null, ex); + } + GroupManager.setLoaded(true); + GroupManagerEventHandler.callEvent(GMSystemEvent.Action.RELOADED); + } + + /** + * Refresh Users data from file + */ + public void reloadUsers() { + + GroupManager.setLoaded(false); + try { + // temporary holder in case the load fails. + WorldDataHolder ph = new WorldDataHolder(this.getName()); + // copy groups for reference + for (Group tempGroup : this.getGroupList()) { + tempGroup.clone(ph); + } + // setup the default group before loading user data. + ph.setDefaultGroup(ph.getGroup(getDefaultGroup().getName())); + loadUsers(ph, getUsersFile()); + // transfer new data + resetUsers(); + for (User tempUser : ph.getUserList()) { + tempUser.clone(this); + } + this.removeUsersChangedFlag(); + this.setTimeStampUsers(getUsersFile().lastModified()); + + ph = null; + } catch (Exception ex) { + Logger.getLogger(WorldDataHolder.class.getName()).log(Level.WARNING, null, ex); + } + GroupManager.setLoaded(true); + GroupManagerEventHandler.callEvent(GMSystemEvent.Action.RELOADED); + } + + public void loadGroups(File groupsFile) { + + GroupManager.setLoaded(false); + try { + setGroupsFile(groupsFile); loadGroups(this, groupsFile); } catch (FileNotFoundException e) { e.printStackTrace(); @@ -387,14 +419,14 @@ public class WorldDataHolder { throw new IllegalArgumentException("Error access the groups file!\n" + groupsFile.getPath()); } - GroupManager.setLoaded(true); - } - - public void loadUsers(File usersFile) { + GroupManager.setLoaded(true); + } + + public void loadUsers(File usersFile) { - GroupManager.setLoaded(false); - try { - setUsersFile(usersFile); + GroupManager.setLoaded(false); + try { + setUsersFile(usersFile); loadUsers(this, usersFile); } catch (FileNotFoundException e) { e.printStackTrace(); @@ -404,843 +436,888 @@ public class WorldDataHolder { throw new IllegalArgumentException("Error access the users file!\n" + usersFile.getPath()); } - GroupManager.setLoaded(true); - } - /** - * Returns a NEW data holder containing data read from the files - * - * @param worldName - * @param groupsFile - * @param usersFile - * - * @throws FileNotFoundException - * @throws IOException - */ - public static WorldDataHolder load(String worldName, File groupsFile, File usersFile) throws FileNotFoundException, IOException { - WorldDataHolder ph = new WorldDataHolder(worldName); - - GroupManager.setLoaded(false); - if (groupsFile != null) loadGroups(ph, groupsFile); - if (usersFile != null) loadUsers(ph, usersFile); - GroupManager.setLoaded(true); - - return ph; - } - - /** - * Updates the WorldDataHolder from the Groups file - * - * @param ph - * @param groupsFile - * - * @throws FileNotFoundException - * @throws IOException - */ - @SuppressWarnings({"rawtypes", "unchecked"}) - protected static void loadGroups(WorldDataHolder ph, File groupsFile) throws FileNotFoundException, IOException { - - // READ GROUPS FILE - - Yaml yamlGroups = new Yaml(new SafeConstructor()); - Map groupsRootDataNode; - - if (!groupsFile.exists()) { - throw new IllegalArgumentException("The file which should contain groups does not exist!\n" + groupsFile.getPath()); - } - FileInputStream groupsInputStream = new FileInputStream(groupsFile); - try { - groupsRootDataNode = (Map) yamlGroups.load(new UnicodeReader(groupsInputStream)); - if (groupsRootDataNode == null) { - throw new NullPointerException(); - } - } catch (Exception ex) { - throw new IllegalArgumentException("The following file couldn't pass on Parser.\n" + groupsFile.getPath(), ex); - } finally { - groupsInputStream.close(); - } - - // PROCESS GROUPS FILE - - Map> inheritance = new HashMap>(); - Map allGroupsNode = null; - - /* - * Fetch all groups under the 'groups' entry. - */ - try { - allGroupsNode = (Map) groupsRootDataNode.get("groups"); - } catch (Exception ex) { - throw new IllegalArgumentException("Your " + groupsFile.getPath() + " file is invalid. See console for details.", ex); - } - - - Iterator groupItr = allGroupsNode.keySet().iterator(); - String groupKey; - Integer groupCount = 0; - - /* - * loop each group entry - * and process it's data. - */ - while (groupItr.hasNext()) { - - try { - groupCount++; - // Attempt to fetch the next group name. - groupKey = groupItr.next(); - } catch (Exception ex) { + GroupManager.setLoaded(true); + } + + /** + * Returns a NEW data holder containing data read from the files + * + * @param worldName + * @param groupsFile + * @param usersFile + * + * @throws FileNotFoundException + * @throws IOException + */ + public static WorldDataHolder load(String worldName, File groupsFile, File usersFile) throws FileNotFoundException, IOException { + + WorldDataHolder ph = new WorldDataHolder(worldName); + + GroupManager.setLoaded(false); + if (groupsFile != null) + loadGroups(ph, groupsFile); + if (usersFile != null) + loadUsers(ph, usersFile); + GroupManager.setLoaded(true); + + return ph; + } + + /** + * Updates the WorldDataHolder from the Groups file + * + * @param ph + * @param groupsFile + * + * @throws FileNotFoundException + * @throws IOException + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + protected static void loadGroups(WorldDataHolder ph, File groupsFile) throws FileNotFoundException, IOException { + + // READ GROUPS FILE + + Yaml yamlGroups = new Yaml(new SafeConstructor()); + Map groupsRootDataNode; + + if (!groupsFile.exists()) { + throw new IllegalArgumentException("The file which should contain groups does not exist!\n" + groupsFile.getPath()); + } + FileInputStream groupsInputStream = new FileInputStream(groupsFile); + try { + groupsRootDataNode = (Map) yamlGroups.load(new UnicodeReader(groupsInputStream)); + if (groupsRootDataNode == null) { + throw new NullPointerException(); + } + } catch (Exception ex) { + throw new IllegalArgumentException("The following file couldn't pass on Parser.\n" + groupsFile.getPath(), ex); + } finally { + groupsInputStream.close(); + } + + // PROCESS GROUPS FILE + + Map> inheritance = new HashMap>(); + Map allGroupsNode = null; + + /* + * Fetch all groups under the 'groups' entry. + */ + try { + allGroupsNode = (Map) groupsRootDataNode.get("groups"); + } catch (Exception ex) { + throw new IllegalArgumentException("Your " + groupsFile.getPath() + " file is invalid. See console for details.", ex); + } + + Iterator groupItr = allGroupsNode.keySet().iterator(); + String groupKey; + Integer groupCount = 0; + + /* + * loop each group entry + * and process it's data. + */ + while (groupItr.hasNext()) { + + try { + groupCount++; + // Attempt to fetch the next group name. + groupKey = groupItr.next(); + } catch (Exception ex) { throw new IllegalArgumentException("Invalid group name for group entry (" + groupCount + ") in file: " + groupsFile.getPath(), ex); } - - /* - * Fetch this groups child nodes - */ - Map thisGroupNode = null; - - try { - thisGroupNode = (Map) allGroupsNode.get(groupKey); - } catch (Exception ex) { + + /* + * Fetch this groups child nodes + */ + Map thisGroupNode = null; + + try { + thisGroupNode = (Map) allGroupsNode.get(groupKey); + } catch (Exception ex) { throw new IllegalArgumentException("Invalid child nodes for group '" + groupKey + "' in file: " + groupsFile.getPath(), ex); } - - /* - * Create a new group with this name - * in the assigned data source. - */ - Group thisGrp = ph.createGroup(groupKey); - - if (thisGrp == null) { - throw new IllegalArgumentException("I think this Group was declared more than once: " + groupKey + " in file: " + groupsFile.getPath()); - } - - // DEFAULT NODE - - Object nodeData = null; - try { - nodeData = thisGroupNode.get("default"); - } catch (Exception ex) { - throw new IllegalArgumentException("Bad format found in 'permissions' for group: " + groupKey + " in file: " + groupsFile.getPath()); - } - - if (nodeData == null) { - /* - * If no 'default' node is found do nothing. - */ - } else if ((Boolean.parseBoolean(nodeData.toString()))) { - /* - * Set this as the default group. - * Warn if some other group has already claimed that position. - */ - if (ph.getDefaultGroup() != null) { - GroupManager.logger.warning("The group '" + thisGrp.getName() + "' is claiming to be default where '" + ph.getDefaultGroup().getName() + "' already was."); - GroupManager.logger.warning("Overriding first default request in file: " + groupsFile.getPath()); - } - ph.setDefaultGroup(thisGrp); - } - - // PERMISSIONS NODE - - nodeData = null; - try { - nodeData = thisGroupNode.get("permissions"); - } catch (Exception ex) { - throw new IllegalArgumentException("Bad format found in 'permissions' for '" + groupKey + "' in file: " + groupsFile.getPath()); - } - - if (nodeData == null) { - /* - * If no permissions node is found, or it's empty - * do nothing. - */ - } else { - /* - * There is a permission list Which seems to hold some data - */ - if (nodeData instanceof List) { - /* - * Check each entry and add it as a new permission. - */ - try { - for (Object o : ((List) nodeData)) { - try { - /* - * Only add this permission if it's not empty. - */ - if (!o.toString().isEmpty()) - thisGrp.addPermission(o.toString()); - - } catch (NullPointerException ex) { - // Ignore this entry as it's null. It can be safely dropped - } - } - } catch (Exception ex) { - throw new IllegalArgumentException("Invalid formatting found in 'permissions' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); - } - - - } else if (nodeData instanceof String) { - /* - * Only add this permission if it's not empty. - */ - if (!nodeData.toString().isEmpty()) - thisGrp.addPermission((String) nodeData); - - } else { - throw new IllegalArgumentException("Unknown type of 'permissions' node(Should be String or List) for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - } - /* - * Sort all permissions so they are in the correct order for checking. - */ - thisGrp.sortPermissions(); - } - - // INFO NODE - - nodeData = null; - try { - nodeData = thisGroupNode.get("info"); - } catch (Exception ex) { - throw new IllegalArgumentException("Bad format found in 'info' section for group: " + groupKey + " in file: " + groupsFile.getPath()); - } - - if (nodeData == null) { - /* - * No info section was found, so leave all variables as defaults. - */ - GroupManager.logger.warning("The group '" + thisGrp.getName() + "' has no 'info' section!"); - GroupManager.logger.warning("Using default values: " + groupsFile.getPath()); - - } else if (nodeData instanceof Map) { - try { - if (nodeData != null) { - thisGrp.setVariables((Map) nodeData); - } - } catch (Exception ex) { - throw new IllegalArgumentException("Invalid formatting found in 'info' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); - } - - } else - throw new IllegalArgumentException("Unknown entry found in 'info' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - - // INHERITANCE NODE - - nodeData = null; - try { - nodeData = thisGroupNode.get("inheritance"); - } catch (Exception ex) { - throw new IllegalArgumentException("Bad format found in 'inheritance' section for group: " + groupKey + " in file: " + groupsFile.getPath()); - } - - if (nodeData == null || nodeData instanceof List) { - if (nodeData == null) { - /* - * If no inheritance node is found, or it's empty - * do nothing. - */ - } else if (nodeData instanceof List) { - - try { - for (String grp : (List) nodeData) { - if (inheritance.get(groupKey) == null) { - inheritance.put(groupKey, new ArrayList()); - } - inheritance.get(groupKey).add(grp); - } - - } catch (Exception ex) { - throw new IllegalArgumentException("Invalid formatting found in 'inheritance' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); - } - - } - }else - throw new IllegalArgumentException("Unknown entry found in 'inheritance' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); - - // END GROUP - - } - - if (ph.getDefaultGroup() == null) { - throw new IllegalArgumentException("There was no Default Group declared in file: " + groupsFile.getPath()); - } - - /* - * Build the inheritance map and recored any errors - */ - for (String group : inheritance.keySet()) { - List inheritedList = inheritance.get(group); - Group thisGroup = ph.getGroup(group); - if (thisGroup != null) - for (String inheritedKey : inheritedList) { - if (inheritedKey != null) { - Group inheritedGroup = ph.getGroup(inheritedKey); - if (inheritedGroup != null) { - thisGroup.addInherits(inheritedGroup); - } else - GroupManager.logger.warning("Inherited group '" + inheritedKey + "' not found for group " + thisGroup.getName() + ". Ignoring entry in file: " + groupsFile.getPath()); - } - } - } - - ph.removeGroupsChangedFlag(); - // Update the LastModified time. - ph.setGroupsFile(groupsFile); - ph.setTimeStampGroups(groupsFile.lastModified()); - - //return ph; - } - - /** - * Updates the WorldDataHolder from the Users file - * - * @param ph - * @param usersFile - * - * @throws FileNotFoundException - * @throws IOException - */ - @SuppressWarnings({"rawtypes", "unchecked"}) - protected static void loadUsers(WorldDataHolder ph, File usersFile) throws FileNotFoundException, IOException { - - // READ USERS FILE - Yaml yamlUsers = new Yaml(new SafeConstructor()); - Map usersRootDataNode; - if (!usersFile.exists()) { - throw new IllegalArgumentException("The file which should contain users does not exist!\n" + usersFile.getPath()); - } - FileInputStream usersInputStream = new FileInputStream(usersFile); - try { - usersRootDataNode = (Map) yamlUsers.load(new UnicodeReader(usersInputStream)); - if (usersRootDataNode == null) { - throw new NullPointerException(); - } - } catch (Exception ex) { - throw new IllegalArgumentException("The following file couldn't pass on Parser.\n" + usersFile.getPath(), ex); - } finally { - usersInputStream.close(); - } - - // PROCESS USERS FILE - - Map allUsersNode = null; - - /* - * Fetch all child nodes under the 'users' entry. - */ - try { - allUsersNode = (Map) usersRootDataNode.get("users"); - } catch (Exception ex) { - throw new IllegalArgumentException("Your " + usersFile.getPath() + " file is invalid. See console for details.", ex); - } - - // Load users if the file is NOT empty - - if (allUsersNode != null) { - - Iterator usersItr = allUsersNode.keySet().iterator(); - String usersKey; - Integer userCount = 0; - - while (usersItr.hasNext()) { - try { - userCount++; - // Attempt to fetch the next user name. - usersKey = usersItr.next(); - } catch (Exception ex) { - throw new IllegalArgumentException("Invalid node type for user entry (" + userCount + ") in file: " + usersFile.getPath(), ex); - } - - Map thisUserNode = null; - try { - thisUserNode = (Map) allUsersNode.get(usersKey); - } catch (Exception ex) { - throw new IllegalArgumentException("Bad format found for user: " + usersKey + " in file: " + usersFile.getPath()); - } - - User thisUser = ph.createUser(usersKey); - if (thisUser == null) { - throw new IllegalArgumentException("I think this user was declared more than once: " + usersKey + " in file: " + usersFile.getPath()); - } - - // USER PERMISSIONS NODES - - Object nodeData = null; - try { - nodeData = thisUserNode.get("permissions"); - } catch (Exception ex) { - throw new IllegalArgumentException("Bad format found in 'permissions' for user: " + usersKey + " in file: " + usersFile.getPath()); - } - - if (nodeData == null) { - /* - * If no permissions node is found, or it's empty - * do nothing. - */ - } else { - if (nodeData instanceof List) { - for (Object o : ((List) nodeData)) { - /* - * Only add this permission if it's not empty - */ - if (!o.toString().isEmpty()) - thisUser.addPermission(o.toString()); - } - } else if (nodeData instanceof String) { - try { - /* - * Only add this permission if it's not empty - */ - if (!nodeData.toString().isEmpty()) - thisUser.addPermission(nodeData.toString()); - } catch (NullPointerException e) { - // Ignore this entry as it's null. - } - } - thisUser.sortPermissions(); - } - - // SUBGROUPS NODES - - nodeData = null; - try { - nodeData = thisUserNode.get("subgroups"); - } catch (Exception ex) { - throw new IllegalArgumentException("Bad format found in 'subgroups' for user: " + usersKey + " in file: " + usersFile.getPath()); - } - - if (nodeData == null) { - /* - * If no subgroups node is found, or it's empty - * do nothing. - */ - } else if (nodeData instanceof List) { - for (Object o : ((List) nodeData)) { - Group subGrp = ph.getGroup(o.toString()); - if (subGrp != null) { - thisUser.addSubGroup(subGrp); - } else { - GroupManager.logger.warning("Subgroup '" + o.toString() + "' not found for user: " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); - } - } - } else if (nodeData instanceof String) { - Group subGrp = ph.getGroup(nodeData.toString()); - if (subGrp != null) { - thisUser.addSubGroup(subGrp); - } else { - GroupManager.logger.warning("Subgroup '" + nodeData.toString() + "' not found for user: " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); - } - } - - - //USER INFO NODE - - nodeData = null; - try { - nodeData = thisUserNode.get("info"); - } catch (Exception ex) { - throw new IllegalArgumentException("Bad format found in 'info' section for user: " + usersKey + " in file: " + usersFile.getPath()); - } - - if (nodeData == null) { - /* - * If no info node is found, or it's empty - * do nothing. - */ - } else if (nodeData instanceof Map) { - thisUser.setVariables((Map) nodeData); - - } else - throw new IllegalArgumentException("Unknown entry found in 'info' section for user: " + thisUser.getName() + " in file: " + usersFile.getPath()); - - //END INFO NODE - - - // PRIMARY GROUP - - nodeData = null; - try { - nodeData = thisUserNode.get("group"); - } catch (Exception ex) { - throw new IllegalArgumentException("Bad format found in 'group' section for user: " + usersKey + " in file: " + usersFile.getPath()); - } - - if (nodeData != null) { - Group hisGroup = ph.getGroup(nodeData.toString()); - if (hisGroup == null) { - GroupManager.logger.warning("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName() + ": Set to '" + ph.getDefaultGroup().getName() + "' for file: " + usersFile.getPath()); - hisGroup = ph.getDefaultGroup(); - } - thisUser.setGroup(hisGroup); - } else { - thisUser.setGroup(ph.getDefaultGroup()); - } - } - } - - ph.removeUsersChangedFlag(); - // Update the LastModified time. - ph.setUsersFile(usersFile); - ph.setTimeStampUsers(usersFile.lastModified()); - } - - /** - * Write a dataHolder in a specified file - * @param ph - * @param groupsFile - */ - public static void writeGroups(WorldDataHolder ph, File groupsFile) { - Map root = new HashMap(); - - Map groupsMap = new HashMap(); - - root.put("groups", groupsMap); - for (String groupKey : ph.getGroups().keySet()) { - Group group = ph.getGroups().get(groupKey); - - Map aGroupMap = new HashMap(); - groupsMap.put(group.getName(), aGroupMap); - - if (ph.getDefaultGroup() == null) { - GroupManager.logger.severe("There is no default group for world: " + ph.getName()); - } - aGroupMap.put("default", group.equals(ph.getDefaultGroup())); - - Map infoMap = new HashMap(); - aGroupMap.put("info", infoMap); - - for (String infoKey : group.getVariables().getVarKeyList()) { - infoMap.put(infoKey, group.getVariables().getVarObject(infoKey)); - } - - aGroupMap.put("inheritance", group.getInherits()); - - aGroupMap.put("permissions", group.getPermissionList()); - } - - if (!root.isEmpty()) { - DumperOptions opt = new DumperOptions(); - opt.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); - final Yaml yaml = new Yaml(opt); - try { - OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(groupsFile), "UTF-8"); - - String newLine = System.getProperty("line.separator"); - - out.write("# Group inheritance" + newLine); - out.write("#" + newLine); - out.write("# Any inherited groups prefixed with a g: are global groups" + newLine); - out.write("# and are inherited from the GlobalGroups.yml." + newLine); - out.write("#" + newLine); - out.write("# Groups without the g: prefix are groups local to this world" + newLine); - out.write("# and are defined in the this groups.yml file." + newLine); - out.write("#" + newLine); - out.write("# Local group inheritances define your promotion tree when using 'manpromote/mandemote'" + newLine); - out.write(newLine); - - yaml.dump(root, out); - out.close(); - } catch (UnsupportedEncodingException ex) { - } catch (FileNotFoundException ex) { - } catch (IOException e) { + + /* + * Create a new group with this name + * in the assigned data source. + */ + Group thisGrp = ph.createGroup(groupKey); + + if (thisGrp == null) { + throw new IllegalArgumentException("I think this Group was declared more than once: " + groupKey + " in file: " + groupsFile.getPath()); } - } - - // Update the LastModified time. - ph.setGroupsFile(groupsFile); - ph.setTimeStampGroups(groupsFile.lastModified()); - ph.removeGroupsChangedFlag(); - - if (GroupManager.isLoaded()) - GroupManagerEventHandler.callEvent(GMSystemEvent.Action.SAVED); - - /*FileWriter tx = null; - try { - tx = new FileWriter(groupsFile, false); - tx.write(yaml.dump(root)); - tx.flush(); - } catch (Exception e) { - } finally { - try { - tx.close(); - } catch (IOException ex) { - } - }*/ - } - - /** - * Write a dataHolder in a specified file - * @param ph - * @param usersFile - */ - public static void writeUsers(WorldDataHolder ph, File usersFile) { - Map root = new HashMap(); - - Map usersMap = new HashMap(); - root.put("users", usersMap); - for (String userKey : ph.getUsers().keySet()) { - User user = ph.getUsers().get(userKey); - if ((user.getGroup() == null || user.getGroup().equals(ph.getDefaultGroup())) && user.getPermissionList().isEmpty() && user.getVariables().isEmpty() && user.isSubGroupsEmpty()) { - continue; - } - - Map aUserMap = new HashMap(); - usersMap.put(user.getName(), aUserMap); - - if (user.getGroup() == null) { - aUserMap.put("group", ph.getDefaultGroup().getName()); - } else { - aUserMap.put("group", user.getGroup().getName()); - } - //USER INFO NODE - BETA - if (user.getVariables().getSize() > 0) { - Map infoMap = new HashMap(); - aUserMap.put("info", infoMap); - for (String infoKey : user.getVariables().getVarKeyList()) { - infoMap.put(infoKey, user.getVariables().getVarObject(infoKey)); - } - } - //END USER INFO NODE - BETA - aUserMap.put("permissions", user.getPermissionList()); - - //SUBGROUPS NODE - BETA - aUserMap.put("subgroups", user.subGroupListStringCopy()); - //END SUBGROUPS NODE - BETA - } - - if (!root.isEmpty()) { - DumperOptions opt = new DumperOptions(); - opt.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); - final Yaml yaml = new Yaml(opt); - try { - OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(usersFile), "UTF-8"); - yaml.dump(root, out); - out.close(); - } catch (UnsupportedEncodingException ex) { - } catch (FileNotFoundException ex) { - } catch (IOException e) { + + // DEFAULT NODE + + Object nodeData = null; + try { + nodeData = thisGroupNode.get("default"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'permissions' for group: " + groupKey + " in file: " + groupsFile.getPath()); } - } - - // Update the LastModified time. - ph.setUsersFile(usersFile); - ph.setTimeStampUsers(usersFile.lastModified()); - ph.removeUsersChangedFlag(); - - if (GroupManager.isLoaded()) - GroupManagerEventHandler.callEvent(GMSystemEvent.Action.SAVED); - - /*FileWriter tx = null; - try { - tx = new FileWriter(usersFile, false); - tx.write(yaml.dump(root)); - tx.flush(); - } catch (Exception e) { - } finally { - try { - tx.close(); - } catch (IOException ex) { - } - }*/ - } - - /** - * Don't use this. Unless you want to make this plugin to interact with original Nijikokun Permissions - * This method is supposed to make the original one reload the file, and propagate the changes made here. - * - * Prefer to use the AnjoCaido's fake version of Nijikokun's Permission plugin. - * The AnjoCaido's Permission can propagate the changes made on this plugin instantly, - * without need to save the file. - * - * @param server the server that holds the plugin - * @deprecated it is not used anymore... unless if you use original Permissions - */ - @Deprecated - public static void reloadOldPlugins(Server server) { - // Only reload permissions - PluginManager pm = server.getPluginManager(); - Plugin[] plugins = pm.getPlugins(); - for (int i = 0; i < plugins.length; i++) { - //plugins[i].getConfiguration().load(); - try { - plugins[i].getClass().getMethod("setupPermissions").invoke(plugins[i]); - } catch (Exception ex) { - continue; - } - } - } - - /** - * @return the permissionsHandler - */ - public AnjoPermissionsHandler getPermissionsHandler() { - if (permissionsHandler == null) { - permissionsHandler = new AnjoPermissionsHandler(this); - } - return permissionsHandler; - } - - /** + + if (nodeData == null) { + /* + * If no 'default' node is found do nothing. + */ + } else if ((Boolean.parseBoolean(nodeData.toString()))) { + /* + * Set this as the default group. + * Warn if some other group has already claimed that position. + */ + if (ph.getDefaultGroup() != null) { + GroupManager.logger.warning("The group '" + thisGrp.getName() + "' is claiming to be default where '" + ph.getDefaultGroup().getName() + "' already was."); + GroupManager.logger.warning("Overriding first default request in file: " + groupsFile.getPath()); + } + ph.setDefaultGroup(thisGrp); + } + + // PERMISSIONS NODE + + nodeData = null; + try { + nodeData = thisGroupNode.get("permissions"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'permissions' for '" + groupKey + "' in file: " + groupsFile.getPath()); + } + + if (nodeData == null) { + /* + * If no permissions node is found, or it's empty + * do nothing. + */ + } else { + /* + * There is a permission list Which seems to hold some data + */ + if (nodeData instanceof List) { + /* + * Check each entry and add it as a new permission. + */ + try { + for (Object o : ((List) nodeData)) { + try { + /* + * Only add this permission if it's not empty. + */ + if (!o.toString().isEmpty()) + thisGrp.addPermission(o.toString()); + + } catch (NullPointerException ex) { + // Ignore this entry as it's null. It can be + // safely dropped + } + } + } catch (Exception ex) { + throw new IllegalArgumentException("Invalid formatting found in 'permissions' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); + } + + } else if (nodeData instanceof String) { + /* + * Only add this permission if it's not empty. + */ + if (!nodeData.toString().isEmpty()) + thisGrp.addPermission((String) nodeData); + + } else { + throw new IllegalArgumentException("Unknown type of 'permissions' node(Should be String or List) for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + } + /* + * Sort all permissions so they are in the correct order for + * checking. + */ + thisGrp.sortPermissions(); + } + + // INFO NODE + + nodeData = null; + try { + nodeData = thisGroupNode.get("info"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'info' section for group: " + groupKey + " in file: " + groupsFile.getPath()); + } + + if (nodeData == null) { + /* + * No info section was found, so leave all variables as + * defaults. + */ + GroupManager.logger.warning("The group '" + thisGrp.getName() + "' has no 'info' section!"); + GroupManager.logger.warning("Using default values: " + groupsFile.getPath()); + + } else if (nodeData instanceof Map) { + try { + if (nodeData != null) { + thisGrp.setVariables((Map) nodeData); + } + } catch (Exception ex) { + throw new IllegalArgumentException("Invalid formatting found in 'info' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); + } + + } else + throw new IllegalArgumentException("Unknown entry found in 'info' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + + // INHERITANCE NODE + + nodeData = null; + try { + nodeData = thisGroupNode.get("inheritance"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'inheritance' section for group: " + groupKey + " in file: " + groupsFile.getPath()); + } + + if (nodeData == null || nodeData instanceof List) { + if (nodeData == null) { + /* + * If no inheritance node is found, or it's empty + * do nothing. + */ + } else if (nodeData instanceof List) { + + try { + for (String grp : (List) nodeData) { + if (inheritance.get(groupKey) == null) { + inheritance.put(groupKey, new ArrayList()); + } + inheritance.get(groupKey).add(grp); + } + + } catch (Exception ex) { + throw new IllegalArgumentException("Invalid formatting found in 'inheritance' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath(), ex); + } + + } + } else + throw new IllegalArgumentException("Unknown entry found in 'inheritance' section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath()); + + // END GROUP + + } + + if (ph.getDefaultGroup() == null) { + throw new IllegalArgumentException("There was no Default Group declared in file: " + groupsFile.getPath()); + } + + /* + * Build the inheritance map and recored any errors + */ + for (String group : inheritance.keySet()) { + List inheritedList = inheritance.get(group); + Group thisGroup = ph.getGroup(group); + if (thisGroup != null) + for (String inheritedKey : inheritedList) { + if (inheritedKey != null) { + Group inheritedGroup = ph.getGroup(inheritedKey); + if (inheritedGroup != null) { + thisGroup.addInherits(inheritedGroup); + } else + GroupManager.logger.warning("Inherited group '" + inheritedKey + "' not found for group " + thisGroup.getName() + ". Ignoring entry in file: " + groupsFile.getPath()); + } + } + } + + ph.removeGroupsChangedFlag(); + // Update the LastModified time. + ph.setGroupsFile(groupsFile); + ph.setTimeStampGroups(groupsFile.lastModified()); + + // return ph; + } + + /** + * Updates the WorldDataHolder from the Users file + * + * @param ph + * @param usersFile + * + * @throws FileNotFoundException + * @throws IOException + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + protected static void loadUsers(WorldDataHolder ph, File usersFile) throws FileNotFoundException, IOException { + + // READ USERS FILE + Yaml yamlUsers = new Yaml(new SafeConstructor()); + Map usersRootDataNode; + if (!usersFile.exists()) { + throw new IllegalArgumentException("The file which should contain users does not exist!\n" + usersFile.getPath()); + } + FileInputStream usersInputStream = new FileInputStream(usersFile); + try { + usersRootDataNode = (Map) yamlUsers.load(new UnicodeReader(usersInputStream)); + if (usersRootDataNode == null) { + throw new NullPointerException(); + } + } catch (Exception ex) { + throw new IllegalArgumentException("The following file couldn't pass on Parser.\n" + usersFile.getPath(), ex); + } finally { + usersInputStream.close(); + } + + // PROCESS USERS FILE + + Map allUsersNode = null; + + /* + * Fetch all child nodes under the 'users' entry. + */ + try { + allUsersNode = (Map) usersRootDataNode.get("users"); + } catch (Exception ex) { + throw new IllegalArgumentException("Your " + usersFile.getPath() + " file is invalid. See console for details.", ex); + } + + // Load users if the file is NOT empty + + if (allUsersNode != null) { + + Iterator usersItr = allUsersNode.keySet().iterator(); + String usersKey; + Integer userCount = 0; + + while (usersItr.hasNext()) { + try { + userCount++; + // Attempt to fetch the next user name. + usersKey = usersItr.next(); + } catch (Exception ex) { + throw new IllegalArgumentException("Invalid node type for user entry (" + userCount + ") in file: " + usersFile.getPath(), ex); + } + + Map thisUserNode = null; + try { + thisUserNode = (Map) allUsersNode.get(usersKey); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found for user: " + usersKey + " in file: " + usersFile.getPath()); + } + + User thisUser = ph.createUser(usersKey); + if (thisUser == null) { + throw new IllegalArgumentException("I think this user was declared more than once: " + usersKey + " in file: " + usersFile.getPath()); + } + + // USER PERMISSIONS NODES + + Object nodeData = null; + try { + nodeData = thisUserNode.get("permissions"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'permissions' for user: " + usersKey + " in file: " + usersFile.getPath()); + } + + if (nodeData == null) { + /* + * If no permissions node is found, or it's empty + * do nothing. + */ + } else { + if (nodeData instanceof List) { + for (Object o : ((List) nodeData)) { + /* + * Only add this permission if it's not empty + */ + if (!o.toString().isEmpty()) + thisUser.addPermission(o.toString()); + } + } else if (nodeData instanceof String) { + try { + /* + * Only add this permission if it's not empty + */ + if (!nodeData.toString().isEmpty()) + thisUser.addPermission(nodeData.toString()); + } catch (NullPointerException e) { + // Ignore this entry as it's null. + } + } + thisUser.sortPermissions(); + } + + // SUBGROUPS NODES + + nodeData = null; + try { + nodeData = thisUserNode.get("subgroups"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'subgroups' for user: " + usersKey + " in file: " + usersFile.getPath()); + } + + if (nodeData == null) { + /* + * If no subgroups node is found, or it's empty + * do nothing. + */ + } else if (nodeData instanceof List) { + for (Object o : ((List) nodeData)) { + Group subGrp = ph.getGroup(o.toString()); + if (subGrp != null) { + thisUser.addSubGroup(subGrp); + } else { + GroupManager.logger.warning("Subgroup '" + o.toString() + "' not found for user: " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); + } + } + } else if (nodeData instanceof String) { + Group subGrp = ph.getGroup(nodeData.toString()); + if (subGrp != null) { + thisUser.addSubGroup(subGrp); + } else { + GroupManager.logger.warning("Subgroup '" + nodeData.toString() + "' not found for user: " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath()); + } + } + + // USER INFO NODE + + nodeData = null; + try { + nodeData = thisUserNode.get("info"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'info' section for user: " + usersKey + " in file: " + usersFile.getPath()); + } + + if (nodeData == null) { + /* + * If no info node is found, or it's empty + * do nothing. + */ + } else if (nodeData instanceof Map) { + thisUser.setVariables((Map) nodeData); + + } else + throw new IllegalArgumentException("Unknown entry found in 'info' section for user: " + thisUser.getName() + " in file: " + usersFile.getPath()); + + // END INFO NODE + + // PRIMARY GROUP + + nodeData = null; + try { + nodeData = thisUserNode.get("group"); + } catch (Exception ex) { + throw new IllegalArgumentException("Bad format found in 'group' section for user: " + usersKey + " in file: " + usersFile.getPath()); + } + + if (nodeData != null) { + Group hisGroup = ph.getGroup(nodeData.toString()); + if (hisGroup == null) { + GroupManager.logger.warning("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName() + ": Set to '" + ph.getDefaultGroup().getName() + "' for file: " + usersFile.getPath()); + hisGroup = ph.getDefaultGroup(); + } + thisUser.setGroup(hisGroup); + } else { + thisUser.setGroup(ph.getDefaultGroup()); + } + } + } + + ph.removeUsersChangedFlag(); + // Update the LastModified time. + ph.setUsersFile(usersFile); + ph.setTimeStampUsers(usersFile.lastModified()); + } + + /** + * Write a dataHolder in a specified file + * + * @param ph + * @param groupsFile + */ + public static void writeGroups(WorldDataHolder ph, File groupsFile) { + + Map root = new HashMap(); + + Map groupsMap = new HashMap(); + + root.put("groups", groupsMap); + for (String groupKey : ph.getGroups().keySet()) { + Group group = ph.getGroups().get(groupKey); + + Map aGroupMap = new HashMap(); + groupsMap.put(group.getName(), aGroupMap); + + if (ph.getDefaultGroup() == null) { + GroupManager.logger.severe("There is no default group for world: " + ph.getName()); + } + aGroupMap.put("default", group.equals(ph.getDefaultGroup())); + + Map infoMap = new HashMap(); + aGroupMap.put("info", infoMap); + + for (String infoKey : group.getVariables().getVarKeyList()) { + infoMap.put(infoKey, group.getVariables().getVarObject(infoKey)); + } + + aGroupMap.put("inheritance", group.getInherits()); + + aGroupMap.put("permissions", group.getPermissionList()); + } + + if (!root.isEmpty()) { + DumperOptions opt = new DumperOptions(); + opt.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); + final Yaml yaml = new Yaml(opt); + try { + OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(groupsFile), "UTF-8"); + + String newLine = System.getProperty("line.separator"); + + out.write("# Group inheritance" + newLine); + out.write("#" + newLine); + out.write("# Any inherited groups prefixed with a g: are global groups" + newLine); + out.write("# and are inherited from the GlobalGroups.yml." + newLine); + out.write("#" + newLine); + out.write("# Groups without the g: prefix are groups local to this world" + newLine); + out.write("# and are defined in the this groups.yml file." + newLine); + out.write("#" + newLine); + out.write("# Local group inheritances define your promotion tree when using 'manpromote/mandemote'" + newLine); + out.write(newLine); + + yaml.dump(root, out); + out.close(); + } catch (UnsupportedEncodingException ex) { + } catch (FileNotFoundException ex) { + } catch (IOException e) { + } + } + + // Update the LastModified time. + ph.setGroupsFile(groupsFile); + ph.setTimeStampGroups(groupsFile.lastModified()); + ph.removeGroupsChangedFlag(); + + if (GroupManager.isLoaded()) + GroupManagerEventHandler.callEvent(GMSystemEvent.Action.SAVED); + + /* + * FileWriter tx = null; + * try { + * tx = new FileWriter(groupsFile, false); + * tx.write(yaml.dump(root)); + * tx.flush(); + * } catch (Exception e) { + * } finally { + * try { + * tx.close(); + * } catch (IOException ex) { + * } + * } + */ + } + + /** + * Write a dataHolder in a specified file + * + * @param ph + * @param usersFile + */ + public static void writeUsers(WorldDataHolder ph, File usersFile) { + + Map root = new HashMap(); + + Map usersMap = new HashMap(); + root.put("users", usersMap); + for (String userKey : ph.getUsers().keySet()) { + User user = ph.getUsers().get(userKey); + if ((user.getGroup() == null || user.getGroup().equals(ph.getDefaultGroup())) && user.getPermissionList().isEmpty() && user.getVariables().isEmpty() && user.isSubGroupsEmpty()) { + continue; + } + + Map aUserMap = new HashMap(); + usersMap.put(user.getName(), aUserMap); + + if (user.getGroup() == null) { + aUserMap.put("group", ph.getDefaultGroup().getName()); + } else { + aUserMap.put("group", user.getGroup().getName()); + } + // USER INFO NODE - BETA + if (user.getVariables().getSize() > 0) { + Map infoMap = new HashMap(); + aUserMap.put("info", infoMap); + for (String infoKey : user.getVariables().getVarKeyList()) { + infoMap.put(infoKey, user.getVariables().getVarObject(infoKey)); + } + } + // END USER INFO NODE - BETA + aUserMap.put("permissions", user.getPermissionList()); + + // SUBGROUPS NODE - BETA + aUserMap.put("subgroups", user.subGroupListStringCopy()); + // END SUBGROUPS NODE - BETA + } + + if (!root.isEmpty()) { + DumperOptions opt = new DumperOptions(); + opt.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); + final Yaml yaml = new Yaml(opt); + try { + OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(usersFile), "UTF-8"); + yaml.dump(root, out); + out.close(); + } catch (UnsupportedEncodingException ex) { + } catch (FileNotFoundException ex) { + } catch (IOException e) { + } + } + + // Update the LastModified time. + ph.setUsersFile(usersFile); + ph.setTimeStampUsers(usersFile.lastModified()); + ph.removeUsersChangedFlag(); + + if (GroupManager.isLoaded()) + GroupManagerEventHandler.callEvent(GMSystemEvent.Action.SAVED); + + /* + * FileWriter tx = null; + * try { + * tx = new FileWriter(usersFile, false); + * tx.write(yaml.dump(root)); + * tx.flush(); + * } catch (Exception e) { + * } finally { + * try { + * tx.close(); + * } catch (IOException ex) { + * } + * } + */ + } + + /** + * Don't use this. Unless you want to make this plugin to interact with + * original Nijikokun Permissions + * This method is supposed to make the original one reload the file, and + * propagate the changes made here. + * + * Prefer to use the AnjoCaido's fake version of Nijikokun's Permission + * plugin. + * The AnjoCaido's Permission can propagate the changes made on this plugin + * instantly, + * without need to save the file. + * + * @param server the server that holds the plugin + * @deprecated it is not used anymore... unless if you use original + * Permissions + */ + @Deprecated + public static void reloadOldPlugins(Server server) { + + // Only reload permissions + PluginManager pm = server.getPluginManager(); + Plugin[] plugins = pm.getPlugins(); + for (int i = 0; i < plugins.length; i++) { + // plugins[i].getConfiguration().load(); + try { + plugins[i].getClass().getMethod("setupPermissions").invoke(plugins[i]); + } catch (Exception ex) { + continue; + } + } + } + + /** + * @return the permissionsHandler + */ + public AnjoPermissionsHandler getPermissionsHandler() { + + if (permissionsHandler == null) { + permissionsHandler = new AnjoPermissionsHandler(this); + } + return permissionsHandler; + } + + /** * @param haveUsersChanged the haveUsersChanged to set */ public void setUsersChanged(boolean haveUsersChanged) { + users.setUsersChanged(haveUsersChanged); } - /** - * - * @return true if any user data has changed - */ - public boolean haveUsersChanged() { - if (users.HaveUsersChanged()) { - return true; - } - for (User u : users.getUsers().values()) { - if (u.isChanged()) { - return true; - } - } - return false; - } - - /** + /** + * + * @return true if any user data has changed + */ + public boolean haveUsersChanged() { + + if (users.HaveUsersChanged()) { + return true; + } + for (User u : users.getUsers().values()) { + if (u.isChanged()) { + return true; + } + } + return false; + } + + /** * @param setGroupsChanged the haveGroupsChanged to set */ public void setGroupsChanged(boolean setGroupsChanged) { + groups.setGroupsChanged(setGroupsChanged); } - - /** - * - * @return true if any group data has changed. - */ - public boolean haveGroupsChanged() { - if (groups.HaveGroupsChanged()) { - return true; - } - for (Group g : groups.getGroups().values()) { - if (g.isChanged()) { - return true; - } - } - return false; - } - - /** + + /** + * + * @return true if any group data has changed. + */ + public boolean haveGroupsChanged() { + + if (groups.HaveGroupsChanged()) { + return true; + } + for (Group g : groups.getGroups().values()) { + if (g.isChanged()) { + return true; + } + } + return false; + } + + /** * */ - public void removeUsersChangedFlag() { - setUsersChanged(false); - for (User u : getUsers().values()) { - u.flagAsSaved(); - } - } - - /** + public void removeUsersChangedFlag() { + + setUsersChanged(false); + for (User u : getUsers().values()) { + u.flagAsSaved(); + } + } + + /** * */ - public void removeGroupsChangedFlag() { - setGroupsChanged(false); - for (Group g : getGroups().values()) { - g.flagAsSaved(); - } - } - - /** - * @return the usersFile - */ - public File getUsersFile() { - return users.getUsersFile(); - } - - /** - * @param file the usersFile to set - */ - public void setUsersFile(File file) { - users.setUsersFile(file); - } + public void removeGroupsChangedFlag() { - /** - * @return the groupsFile - */ - public File getGroupsFile() { - return groups.getGroupsFile(); - } - - /** - * @param file the groupsFile to set - */ - public void setGroupsFile(File file) { - groups.setGroupsFile(file); - } + setGroupsChanged(false); + for (Group g : getGroups().values()) { + g.flagAsSaved(); + } + } - /** - * @return the name - */ - public String getName() { - return name; - } - - /** + /** + * @return the usersFile + */ + public File getUsersFile() { + + return users.getUsersFile(); + } + + /** + * @param file the usersFile to set + */ + public void setUsersFile(File file) { + + users.setUsersFile(file); + } + + /** + * @return the groupsFile + */ + public File getGroupsFile() { + + return groups.getGroupsFile(); + } + + /** + * @param file the groupsFile to set + */ + public void setGroupsFile(File file) { + + groups.setGroupsFile(file); + } + + /** + * @return the name + */ + public String getName() { + + return name; + } + + /** * Resets Groups. */ public void resetGroups() { - //setDefaultGroup(null); + + // setDefaultGroup(null); groups.setGroups(new HashMap()); } - /** + + /** * Resets Users */ public void resetUsers() { + users.setUsers(new HashMap()); } - - /** + + /** * @return the groups */ public Map getGroups() { + return groups.getGroups(); } - /** + + /** * @return the users */ public Map getUsers() { + return users.getUsers(); } - + /** * @return the groups */ public GroupsDataHolder getGroupsObject() { + return groups; } + /** * @param groupsDataHolder the GroupsDataHolder to set */ public void setGroupsObject(GroupsDataHolder groupsDataHolder) { + groups = groupsDataHolder; } - /** + + /** * @return the users */ public UsersDataHolder getUsersObject() { + return users; } + /** * @param usersDataHolder the UsersDataHolder to set */ public void setUsersObject(UsersDataHolder usersDataHolder) { + users = usersDataHolder; } - - /** + + /** * @return the timeStampGroups */ public long getTimeStampGroups() { + return groups.getTimeStampGroups(); } - /** + + /** * @return the timeStampUsers */ public long getTimeStampUsers() { + return users.getTimeStampUsers(); } @@ -1248,20 +1325,24 @@ public class WorldDataHolder { * @param timeStampGroups the timeStampGroups to set */ protected void setTimeStampGroups(long timeStampGroups) { + groups.setTimeStampGroups(timeStampGroups); } - /** + + /** * @param timeStampUsers the timeStampUsers to set */ protected void setTimeStampUsers(long timeStampUsers) { + users.setTimeStampUsers(timeStampUsers); } - + public void setTimeStamps() { + if (getGroupsFile() != null) setTimeStampGroups(getGroupsFile().lastModified()); if (getUsersFile() != null) setTimeStampUsers(getUsersFile().lastModified()); - } - + } + } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java index bfa7d5cd2..ebacfdfac 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java @@ -26,432 +26,451 @@ import org.bukkit.configuration.MemorySection; import org.bukkit.entity.Player; /** - * + * * @author gabrielcouto */ public class WorldsHolder { - /** - * Map with instances of loaded worlds. - */ - private Map worldsData = new HashMap(); - - /** - * Map of mirrors: - * The key is the mirror. - * The object is the mirrored. - * - * Mirror shows the same data of mirrored. - */ - private Map mirrorsGroup = new HashMap(); - private Map mirrorsUser = new HashMap(); - - //private OverloadedWorldHolder defaultWorld; - private String serverDefaultWorldName; - private GroupManager plugin; - private File worldsFolder; - - /** - * - * @param plugin - */ - public WorldsHolder(GroupManager plugin) { - this.plugin = plugin; - // Setup folders and check files exist for the primary world - verifyFirstRun(); - initialLoad(); - if (serverDefaultWorldName == null) { - throw new IllegalStateException("There is no default group! OMG!"); - } - } - - private void initialLoad() { - // load the initial world - initialWorldLoading(); - // Configure and load any mirrors and additional worlds as defined in config.yml - mirrorSetUp(); - // search the worlds folder for any manually created worlds (not listed in config.yml) - loadAllSearchedWorlds(); - } - - private void initialWorldLoading() { - //Load the default world - loadWorld(serverDefaultWorldName); - //defaultWorld = getUpdatedWorldData(serverDefaultWorldName); - } - - private void loadAllSearchedWorlds() { - - /* - * Read all known worlds from Bukkit - * Create the data files if they don't already exist, - * and they are not mirrored. - */ - for (World world: plugin.getServer().getWorlds()) - if ((!worldsData.containsKey(world.getName().toLowerCase())) - && ((!mirrorsGroup.containsKey(world.getName().toLowerCase())) || (!mirrorsUser.containsKey(world.getName().toLowerCase())))) - setupWorldFolder(world.getName()); - /* - * Loop over all folders within the worlds folder - * and attempt to load the world data - */ - for (File folder : worldsFolder.listFiles()) { - if (folder.isDirectory()) { - GroupManager.logger.info("World Found: " + folder.getName()); - - /* - * don't load any worlds which are already loaded - * or fully mirrored worlds that don't need data. - */ - if (!worldsData.containsKey(folder.getName().toLowerCase()) - && ((!mirrorsGroup.containsKey(folder.getName().toLowerCase())) - || (!mirrorsUser.containsKey(folder.getName().toLowerCase())))) { - /* - * Call setupWorldFolder to check case sensitivity - * and convert to lower case, before we attempt to load this world. - */ - setupWorldFolder(folder.getName()); - loadWorld(folder.getName().toLowerCase()); - } - - } - } - } - - @SuppressWarnings("rawtypes") - public void mirrorSetUp() { - mirrorsGroup.clear(); - mirrorsUser.clear(); - Map mirrorsMap = plugin.getGMConfig().getMirrorsMap(); - - HashSet mirroredWorlds = new HashSet(); - - if (mirrorsMap != null) { - for (String source : mirrorsMap.keySet()) { - // Make sure all non mirrored worlds have a set of data files. - setupWorldFolder(source); - // Load the world data - if (!worldsData.containsKey(source.toLowerCase())) - loadWorld(source); - - if (mirrorsMap.get(source) instanceof ArrayList) { - ArrayList mirrorList = (ArrayList) mirrorsMap.get(source); - - // These worlds fully mirror their parent - for (Object o : mirrorList) { - String world = o.toString().toLowerCase(); - if (world != serverDefaultWorldName) { - try { - mirrorsGroup.remove(world); - mirrorsUser.remove(world); - } catch (Exception e) { - } - mirrorsGroup.put(world, getWorldData(source).getName()); - mirrorsUser.put(world, getWorldData(source).getName()); - - // Track this world so we can create a datasource for it later - mirroredWorlds.add(o.toString()); - - } else - GroupManager.logger.log(Level.WARNING, "Mirroring error with " + o.toString() + ". Recursive loop detected!"); - } - } else if (mirrorsMap.get(source) instanceof MemorySection) { - MemorySection subSection = (MemorySection) mirrorsMap.get(source); - - for (String key : subSection.getKeys(true)) { - - if (key.toLowerCase() != serverDefaultWorldName) { - - if (subSection.get(key) instanceof ArrayList) { - ArrayList mirrorList = (ArrayList) subSection.get(key); - - // These worlds have defined mirroring - for (Object o : mirrorList) { - String type = o.toString().toLowerCase(); - try { - if (type.equals("groups")) - mirrorsGroup.remove(key.toLowerCase()); - - if (type.equals("users")) - mirrorsUser.remove(key.toLowerCase()); - - } catch (Exception e) { - } - if (type.equals("groups")) - mirrorsGroup.put(key.toLowerCase(), getWorldData(source).getName()); - - if (type.equals("users")) - mirrorsUser.put(key.toLowerCase(), getWorldData(source).getName()); - } - - // Track this world so we can create a datasource for it later - mirroredWorlds.add(key); - - } else - GroupManager.logger.log(Level.WARNING, "Mirroring error with " + key + ". Recursive loop detected!"); - - } else { - throw new IllegalStateException("Unknown mirroring format for " + key); - } - - } - } - } - - // Create a datasource for any worlds not already loaded - for (String world : mirroredWorlds){ - if (!worldsData.containsKey(world.toLowerCase())) { - setupWorldFolder(world); - loadWorld(world, true); - } - } - } - } - - /** - * - */ - public void reloadAll() { - // Load global groups - GroupManager.getGlobalGroups().load(); - - ArrayList alreadyDone = new ArrayList(); - for (WorldDataHolder w : worldsData.values()) { - if (alreadyDone.contains(w)) { - continue; - } - if (!mirrorsGroup.containsKey(w.getName().toLowerCase())) - w.reloadGroups(); - if (!mirrorsUser.containsKey(w.getName().toLowerCase())) - w.reloadUsers(); - - alreadyDone.add(w); - } - - } - - /** - * - * @param worldName - */ - public void reloadWorld(String worldName) { - if (!mirrorsGroup.containsKey(worldName.toLowerCase())) - getWorldData(worldName).reloadGroups(); - if (!mirrorsUser.containsKey(worldName.toLowerCase())) - getWorldData(worldName).reloadUsers(); - } - - /** - * Wrapper to retain backwards compatibility - * (call this function to auto overwrite files) - */ - public void saveChanges() { - saveChanges(true); - } + /** + * Map with instances of loaded worlds. + */ + private Map worldsData = new HashMap(); + + /** + * Map of mirrors: + * The key is the mirror. + * The object is the mirrored. + * + * Mirror shows the same data of mirrored. + */ + private Map mirrorsGroup = new HashMap(); + private Map mirrorsUser = new HashMap(); + + //private OverloadedWorldHolder defaultWorld; + private String serverDefaultWorldName; + private GroupManager plugin; + private File worldsFolder; + + /** + * + * @param plugin + */ + public WorldsHolder(GroupManager plugin) { + + this.plugin = plugin; + // Setup folders and check files exist for the primary world + verifyFirstRun(); + initialLoad(); + if (serverDefaultWorldName == null) { + throw new IllegalStateException("There is no default group! OMG!"); + } + } + + private void initialLoad() { + + // load the initial world + initialWorldLoading(); + // Configure and load any mirrors and additional worlds as defined in config.yml + mirrorSetUp(); + // search the worlds folder for any manually created worlds (not listed in config.yml) + loadAllSearchedWorlds(); + } + + private void initialWorldLoading() { + + //Load the default world + loadWorld(serverDefaultWorldName); + //defaultWorld = getUpdatedWorldData(serverDefaultWorldName); + } + + private void loadAllSearchedWorlds() { + + /* + * Read all known worlds from Bukkit + * Create the data files if they don't already exist, + * and they are not mirrored. + */ + for (World world : plugin.getServer().getWorlds()) + if ((!worldsData.containsKey(world.getName().toLowerCase())) && ((!mirrorsGroup.containsKey(world.getName().toLowerCase())) || (!mirrorsUser.containsKey(world.getName().toLowerCase())))) + setupWorldFolder(world.getName()); + /* + * Loop over all folders within the worlds folder + * and attempt to load the world data + */ + for (File folder : worldsFolder.listFiles()) { + if (folder.isDirectory()) { + GroupManager.logger.info("World Found: " + folder.getName()); + + /* + * don't load any worlds which are already loaded + * or fully mirrored worlds that don't need data. + */ + if (!worldsData.containsKey(folder.getName().toLowerCase()) && ((!mirrorsGroup.containsKey(folder.getName().toLowerCase())) || (!mirrorsUser.containsKey(folder.getName().toLowerCase())))) { + /* + * Call setupWorldFolder to check case sensitivity + * and convert to lower case, before we attempt to load this + * world. + */ + setupWorldFolder(folder.getName()); + loadWorld(folder.getName().toLowerCase()); + } - /** + } + } + } + + @SuppressWarnings("rawtypes") + public void mirrorSetUp() { + + mirrorsGroup.clear(); + mirrorsUser.clear(); + Map mirrorsMap = plugin.getGMConfig().getMirrorsMap(); + + HashSet mirroredWorlds = new HashSet(); + + if (mirrorsMap != null) { + for (String source : mirrorsMap.keySet()) { + // Make sure all non mirrored worlds have a set of data files. + setupWorldFolder(source); + // Load the world data + if (!worldsData.containsKey(source.toLowerCase())) + loadWorld(source); + + if (mirrorsMap.get(source) instanceof ArrayList) { + ArrayList mirrorList = (ArrayList) mirrorsMap.get(source); + + // These worlds fully mirror their parent + for (Object o : mirrorList) { + String world = o.toString().toLowerCase(); + if (world != serverDefaultWorldName) { + try { + mirrorsGroup.remove(world); + mirrorsUser.remove(world); + } catch (Exception e) { + } + mirrorsGroup.put(world, getWorldData(source).getName()); + mirrorsUser.put(world, getWorldData(source).getName()); + + // Track this world so we can create a datasource for it later + mirroredWorlds.add(o.toString()); + + } else + GroupManager.logger.log(Level.WARNING, "Mirroring error with " + o.toString() + ". Recursive loop detected!"); + } + } else if (mirrorsMap.get(source) instanceof MemorySection) { + MemorySection subSection = (MemorySection) mirrorsMap.get(source); + + for (String key : subSection.getKeys(true)) { + + if (key.toLowerCase() != serverDefaultWorldName) { + + if (subSection.get(key) instanceof ArrayList) { + ArrayList mirrorList = (ArrayList) subSection.get(key); + + // These worlds have defined mirroring + for (Object o : mirrorList) { + String type = o.toString().toLowerCase(); + try { + if (type.equals("groups")) + mirrorsGroup.remove(key.toLowerCase()); + + if (type.equals("users")) + mirrorsUser.remove(key.toLowerCase()); + + } catch (Exception e) { + } + if (type.equals("groups")) + mirrorsGroup.put(key.toLowerCase(), getWorldData(source).getName()); + + if (type.equals("users")) + mirrorsUser.put(key.toLowerCase(), getWorldData(source).getName()); + } + + // Track this world so we can create a datasource for it later + mirroredWorlds.add(key); + + } else + GroupManager.logger.log(Level.WARNING, "Mirroring error with " + key + ". Recursive loop detected!"); + + } else { + throw new IllegalStateException("Unknown mirroring format for " + key); + } + + } + } + } + + // Create a datasource for any worlds not already loaded + for (String world : mirroredWorlds) { + if (!worldsData.containsKey(world.toLowerCase())) { + setupWorldFolder(world); + loadWorld(world, true); + } + } + } + } + + /** * */ - public void saveChanges(boolean overwrite) { - ArrayList alreadyDone = new ArrayList(); - Tasks.removeOldFiles(plugin, plugin.getBackupFolder()); - - // Write Global Groups - if (GroupManager.getGlobalGroups().haveGroupsChanged()) { - GroupManager.getGlobalGroups().writeGroups(overwrite); - } else { - if (GroupManager.getGlobalGroups().getTimeStampGroups() < GroupManager.getGlobalGroups().getGlobalGroupsFile().lastModified()) { - System.out.print("Newer GlobalGroups file found (Loading changes)!"); - GroupManager.getGlobalGroups().load(); - } - } - - for (OverloadedWorldHolder w : worldsData.values()) { - if (alreadyDone.contains(w)) { - continue; - } - if (w == null) { - GroupManager.logger.severe("WHAT HAPPENED?"); - continue; - } - if (!mirrorsGroup.containsKey(w.getName().toLowerCase())) - if (w.haveGroupsChanged()) { - if (overwrite || (!overwrite && (w.getTimeStampGroups() >= w.getGroupsFile().lastModified()))) { - // Backup Groups file - backupFile(w,true); - - WorldDataHolder.writeGroups(w, w.getGroupsFile()); - //w.removeGroupsChangedFlag(); - } else { - // Newer file found. - GroupManager.logger.log(Level.WARNING, "Newer Groups file found for " + w.getName() + ", but we have local changes!"); - throw new IllegalStateException("Unable to save unless you issue a '/mansave force'"); - } - } else { - //Check for newer file as no local changes. - if (w.getTimeStampGroups() < w.getGroupsFile().lastModified()) { - System.out.print("Newer Groups file found (Loading changes)!"); - // Backup Groups file - backupFile(w,true); - w.reloadGroups(); - } - } - if (!mirrorsUser.containsKey(w.getName().toLowerCase())) - if (w.haveUsersChanged()) { - if (overwrite || (!overwrite && (w.getTimeStampUsers() >= w.getUsersFile().lastModified()))) { - // Backup Users file - backupFile(w,false); - - WorldDataHolder.writeUsers(w, w.getUsersFile()); - //w.removeUsersChangedFlag(); - } else { - // Newer file found. - GroupManager.logger.log(Level.WARNING, "Newer Users file found for " + w.getName() + ", but we have local changes!"); - throw new IllegalStateException("Unable to save unless you issue a '/mansave force'"); - } - } else { - //Check for newer file as no local changes. - if (w.getTimeStampUsers() < w.getUsersFile().lastModified()) { - System.out.print("Newer Users file found (Loading changes)!"); - // Backup Users file - backupFile(w,false); - w.reloadUsers(); - } - } - alreadyDone.add(w); - } - } - - /** - * Backup the Groups/Users file - * @param w - * @param groups - */ - private void backupFile(OverloadedWorldHolder w, Boolean groups) { - - File backupFile = new File(plugin.getBackupFolder(), "bkp_" + w.getName() + (groups ? "_g_" : "_u_") + Tasks.getDateString() + ".yml"); - try { - Tasks.copy((groups ? w.getGroupsFile() : w.getUsersFile()), backupFile); - } catch (IOException ex) { - GroupManager.logger.log(Level.SEVERE, null, ex); - } - } - - /** - * Returns the dataHolder for the given world. - * If the world is not on the worlds list, returns the default world - * holder. - * - * Mirrors return their parent world data. - * If no mirroring data it returns the default world. + public void reloadAll() { + + // Load global groups + GroupManager.getGlobalGroups().load(); + + ArrayList alreadyDone = new ArrayList(); + for (WorldDataHolder w : worldsData.values()) { + if (alreadyDone.contains(w)) { + continue; + } + if (!mirrorsGroup.containsKey(w.getName().toLowerCase())) + w.reloadGroups(); + if (!mirrorsUser.containsKey(w.getName().toLowerCase())) + w.reloadUsers(); + + alreadyDone.add(w); + } + + } + + /** + * + * @param worldName + */ + public void reloadWorld(String worldName) { + + if (!mirrorsGroup.containsKey(worldName.toLowerCase())) + getWorldData(worldName).reloadGroups(); + if (!mirrorsUser.containsKey(worldName.toLowerCase())) + getWorldData(worldName).reloadUsers(); + } + + /** + * Wrapper to retain backwards compatibility + * (call this function to auto overwrite files) + */ + public void saveChanges() { + + saveChanges(true); + } + + /** * - * @param worldName - * @return OverloadedWorldHolder - */ - public OverloadedWorldHolder getWorldData(String worldName) { - String worldNameLowered = worldName.toLowerCase(); - - // Find this worlds data - if (worldsData.containsKey(worldNameLowered)) - return getUpdatedWorldData(worldNameLowered); - - // Oddly no data source was found for this world so return the default. - GroupManager.logger.finest("Requested world " + worldName + " not found or badly mirrored. Returning default world..."); - return getDefaultWorld(); - } - - /** - * Get the requested world data and update it's dataSource to be relevant for this world - * - * @param worldName - * @return updated world holder - */ - private OverloadedWorldHolder getUpdatedWorldData(String worldName) { - String worldNameLowered = worldName.toLowerCase(); - - if (worldsData.containsKey(worldNameLowered)) { - OverloadedWorldHolder data = worldsData.get(worldNameLowered); - data.updateDataSource(); - return data; - } - return null; - - } - - /** - * Do a matching of playerName, if its found only one player, do - * getWorldData(player) - * - * @param playerName - * @return null if matching returned no player, or more than one. */ - public OverloadedWorldHolder getWorldDataByPlayerName(String playerName) { - List matchPlayer = plugin.getServer().matchPlayer(playerName); - if (matchPlayer.size() == 1) { - return getWorldData(matchPlayer.get(0)); - } - return null; - } - - /** - * Retrieves the field player.getWorld().getName() and do - * getWorld(worldName) - * - * @param player - * @return OverloadedWorldHolder - */ - public OverloadedWorldHolder getWorldData(Player player) { - return getWorldData(player.getWorld().getName()); - } - - /** - * It does getWorld(worldName).getPermissionsHandler() - * @param worldName - * @return AnjoPermissionsHandler - */ - public AnjoPermissionsHandler getWorldPermissions(String worldName) { - return getWorldData(worldName).getPermissionsHandler(); - } - - /** - * Returns the PermissionsHandler for this player data - * @param player - * @return AnjoPermissionsHandler - */ - public AnjoPermissionsHandler getWorldPermissions(Player player) { - return getWorldData(player).getPermissionsHandler(); - } - - /** - * Id does getWorldDataByPlayerName(playerName). - * If it doesnt return null, it will return result.getPermissionsHandler() - * @param playerName - * @return null if the player matching gone wrong. - */ - public AnjoPermissionsHandler getWorldPermissionsByPlayerName(String playerName) { - WorldDataHolder dh = getWorldDataByPlayerName(playerName); - if (dh != null) { - return dh.getPermissionsHandler(); - } - return null; - } - - private void verifyFirstRun() { - - Properties server = new Properties(); - try { - server.load(new FileInputStream(new File("server.properties"))); - serverDefaultWorldName = server.getProperty("level-name").toLowerCase(); - setupWorldFolder(serverDefaultWorldName); - } catch (IOException ex) { - GroupManager.logger.log(Level.SEVERE, null, ex); - } - - } - + public void saveChanges(boolean overwrite) { + + ArrayList alreadyDone = new ArrayList(); + Tasks.removeOldFiles(plugin, plugin.getBackupFolder()); + + // Write Global Groups + if (GroupManager.getGlobalGroups().haveGroupsChanged()) { + GroupManager.getGlobalGroups().writeGroups(overwrite); + } else { + if (GroupManager.getGlobalGroups().getTimeStampGroups() < GroupManager.getGlobalGroups().getGlobalGroupsFile().lastModified()) { + System.out.print("Newer GlobalGroups file found (Loading changes)!"); + GroupManager.getGlobalGroups().load(); + } + } + + for (OverloadedWorldHolder w : worldsData.values()) { + if (alreadyDone.contains(w)) { + continue; + } + if (w == null) { + GroupManager.logger.severe("WHAT HAPPENED?"); + continue; + } + if (!mirrorsGroup.containsKey(w.getName().toLowerCase())) + if (w.haveGroupsChanged()) { + if (overwrite || (!overwrite && (w.getTimeStampGroups() >= w.getGroupsFile().lastModified()))) { + // Backup Groups file + backupFile(w, true); + + WorldDataHolder.writeGroups(w, w.getGroupsFile()); + //w.removeGroupsChangedFlag(); + } else { + // Newer file found. + GroupManager.logger.log(Level.WARNING, "Newer Groups file found for " + w.getName() + ", but we have local changes!"); + throw new IllegalStateException("Unable to save unless you issue a '/mansave force'"); + } + } else { + //Check for newer file as no local changes. + if (w.getTimeStampGroups() < w.getGroupsFile().lastModified()) { + System.out.print("Newer Groups file found (Loading changes)!"); + // Backup Groups file + backupFile(w, true); + w.reloadGroups(); + } + } + if (!mirrorsUser.containsKey(w.getName().toLowerCase())) + if (w.haveUsersChanged()) { + if (overwrite || (!overwrite && (w.getTimeStampUsers() >= w.getUsersFile().lastModified()))) { + // Backup Users file + backupFile(w, false); + + WorldDataHolder.writeUsers(w, w.getUsersFile()); + //w.removeUsersChangedFlag(); + } else { + // Newer file found. + GroupManager.logger.log(Level.WARNING, "Newer Users file found for " + w.getName() + ", but we have local changes!"); + throw new IllegalStateException("Unable to save unless you issue a '/mansave force'"); + } + } else { + //Check for newer file as no local changes. + if (w.getTimeStampUsers() < w.getUsersFile().lastModified()) { + System.out.print("Newer Users file found (Loading changes)!"); + // Backup Users file + backupFile(w, false); + w.reloadUsers(); + } + } + alreadyDone.add(w); + } + } + + /** + * Backup the Groups/Users file + * + * @param w + * @param groups + */ + private void backupFile(OverloadedWorldHolder w, Boolean groups) { + + File backupFile = new File(plugin.getBackupFolder(), "bkp_" + w.getName() + (groups ? "_g_" : "_u_") + Tasks.getDateString() + ".yml"); + try { + Tasks.copy((groups ? w.getGroupsFile() : w.getUsersFile()), backupFile); + } catch (IOException ex) { + GroupManager.logger.log(Level.SEVERE, null, ex); + } + } + + /** + * Returns the dataHolder for the given world. + * If the world is not on the worlds list, returns the default world + * holder. + * + * Mirrors return their parent world data. + * If no mirroring data it returns the default world. + * + * @param worldName + * @return OverloadedWorldHolder + */ + public OverloadedWorldHolder getWorldData(String worldName) { + + String worldNameLowered = worldName.toLowerCase(); + + // Find this worlds data + if (worldsData.containsKey(worldNameLowered)) + return getUpdatedWorldData(worldNameLowered); + + // Oddly no data source was found for this world so return the default. + GroupManager.logger.finest("Requested world " + worldName + " not found or badly mirrored. Returning default world..."); + return getDefaultWorld(); + } + + /** + * Get the requested world data and update it's dataSource to be relevant + * for this world + * + * @param worldName + * @return updated world holder + */ + private OverloadedWorldHolder getUpdatedWorldData(String worldName) { + + String worldNameLowered = worldName.toLowerCase(); + + if (worldsData.containsKey(worldNameLowered)) { + OverloadedWorldHolder data = worldsData.get(worldNameLowered); + data.updateDataSource(); + return data; + } + return null; + + } + + /** + * Do a matching of playerName, if its found only one player, do + * getWorldData(player) + * + * @param playerName + * @return null if matching returned no player, or more than one. + */ + public OverloadedWorldHolder getWorldDataByPlayerName(String playerName) { + + List matchPlayer = plugin.getServer().matchPlayer(playerName); + if (matchPlayer.size() == 1) { + return getWorldData(matchPlayer.get(0)); + } + return null; + } + + /** + * Retrieves the field player.getWorld().getName() and do + * getWorld(worldName) + * + * @param player + * @return OverloadedWorldHolder + */ + public OverloadedWorldHolder getWorldData(Player player) { + + return getWorldData(player.getWorld().getName()); + } + + /** + * It does getWorld(worldName).getPermissionsHandler() + * + * @param worldName + * @return AnjoPermissionsHandler + */ + public AnjoPermissionsHandler getWorldPermissions(String worldName) { + + return getWorldData(worldName).getPermissionsHandler(); + } + + /** + * Returns the PermissionsHandler for this player data + * + * @param player + * @return AnjoPermissionsHandler + */ + public AnjoPermissionsHandler getWorldPermissions(Player player) { + + return getWorldData(player).getPermissionsHandler(); + } + + /** + * Id does getWorldDataByPlayerName(playerName). + * If it doesnt return null, it will return result.getPermissionsHandler() + * + * @param playerName + * @return null if the player matching gone wrong. + */ + public AnjoPermissionsHandler getWorldPermissionsByPlayerName(String playerName) { + + WorldDataHolder dh = getWorldDataByPlayerName(playerName); + if (dh != null) { + return dh.getPermissionsHandler(); + } + return null; + } + + private void verifyFirstRun() { + + Properties server = new Properties(); + try { + server.load(new FileInputStream(new File("server.properties"))); + serverDefaultWorldName = server.getProperty("level-name").toLowerCase(); + setupWorldFolder(serverDefaultWorldName); + } catch (IOException ex) { + GroupManager.logger.log(Level.SEVERE, null, ex); + } + + } + public void setupWorldFolder(String worldName) { + String worldNameLowered = worldName.toLowerCase(); - + worldsFolder = new File(plugin.getDataFolder(), "worlds"); if (!worldsFolder.exists()) { worldsFolder.mkdirs(); @@ -459,22 +478,22 @@ public class WorldsHolder { File defaultWorldFolder = new File(worldsFolder, worldNameLowered); if ((!defaultWorldFolder.exists()) && ((!mirrorsGroup.containsKey(worldNameLowered))) || (!mirrorsUser.containsKey(worldNameLowered))) { - + /* - * check and convert all old case sensitive folders to lower case - */ + * check and convert all old case sensitive folders to lower case + */ File casedWorldFolder = new File(worldsFolder, worldName); - if ((casedWorldFolder.exists()) && (casedWorldFolder.getName().toLowerCase().equals(worldNameLowered))) { - /* - * Rename the old folder to the new lower cased format - */ - casedWorldFolder.renameTo(new File(worldsFolder, worldNameLowered)); - } else { - /* - * Else we just create the folder - */ - defaultWorldFolder.mkdirs(); - } + if ((casedWorldFolder.exists()) && (casedWorldFolder.getName().toLowerCase().equals(worldNameLowered))) { + /* + * Rename the old folder to the new lower cased format + */ + casedWorldFolder.renameTo(new File(worldsFolder, worldNameLowered)); + } else { + /* + * Else we just create the folder + */ + defaultWorldFolder.mkdirs(); + } } if (defaultWorldFolder.exists()) { if (!mirrorsGroup.containsKey(worldNameLowered)) { @@ -506,181 +525,188 @@ public class WorldsHolder { } } - /** - * Copies the specified world data to another world - * - * @param fromWorld - * @param toWorld - * @return true if successfully copied. - */ - public boolean cloneWorld(String fromWorld, String toWorld) { - - File fromWorldFolder = new File(worldsFolder, fromWorld.toLowerCase()); - File toWorldFolder = new File(worldsFolder, toWorld.toLowerCase()); - if (toWorldFolder.exists() || !fromWorldFolder.exists()) { - return false; - } - File fromWorldGroups = new File(fromWorldFolder, "groups.yml"); - File fromWorldUsers = new File(fromWorldFolder, "users.yml"); - if (!fromWorldGroups.exists() || !fromWorldUsers.exists()) { - return false; - } - File toWorldGroups = new File(toWorldFolder, "groups.yml"); - File toWorldUsers = new File(toWorldFolder, "users.yml"); - toWorldFolder.mkdirs(); - try { - Tasks.copy(fromWorldGroups, toWorldGroups); - Tasks.copy(fromWorldUsers, toWorldUsers); - } catch (IOException ex) { - Logger.getLogger(WorldsHolder.class.getName()).log(Level.SEVERE, null, ex); - return false; - } - return true; - } - - /** - * Wrapper for LoadWorld(String,Boolean) for backwards compatibility - * - * Load a world from file. - * If it already been loaded, summon reload method from dataHolder. - * @param worldName - */ - public void loadWorld(String worldName) { - loadWorld(worldName, false); - } - - /** - * Load a world from file. - * If it already been loaded, summon reload method from dataHolder. - * @param worldName - */ - public void loadWorld(String worldName, Boolean isMirror) { - - String worldNameLowered = worldName.toLowerCase(); - - if (worldsData.containsKey(worldNameLowered)) { - worldsData.get(worldNameLowered).reload(); - return; - } - GroupManager.logger.finest("Trying to load world " + worldName + "..."); - File thisWorldFolder = new File(worldsFolder, worldNameLowered); - if ((isMirror) || (thisWorldFolder.exists() && thisWorldFolder.isDirectory())) { - - // Setup file handles, if not mirrored - File groupsFile = (mirrorsGroup.containsKey(worldNameLowered))? null : new File(thisWorldFolder, "groups.yml"); - File usersFile = (mirrorsUser.containsKey(worldNameLowered))? null : new File(thisWorldFolder, "users.yml"); - - if ((groupsFile != null) && (!groupsFile.exists())) { - throw new IllegalArgumentException("Groups file for world '" + worldName + "' doesnt exist: " + groupsFile.getPath()); - } - if ((usersFile != null) && (!usersFile.exists())) { - throw new IllegalArgumentException("Users file for world '" + worldName + "' doesnt exist: " + usersFile.getPath()); - } - - WorldDataHolder tempHolder = new WorldDataHolder(worldName); - - // Map the group object for any mirror - if (mirrorsGroup.containsKey(worldNameLowered)) - tempHolder.setGroupsObject(this.getWorldData(mirrorsGroup.get(worldNameLowered)).getGroupsObject()); - else - tempHolder.loadGroups(groupsFile); - - // Map the user object for any mirror - if (mirrorsUser.containsKey(worldNameLowered)) - tempHolder.setUsersObject(this.getWorldData(mirrorsUser.get(worldNameLowered)).getUsersObject()); - else - tempHolder.loadUsers(usersFile); - - OverloadedWorldHolder thisWorldData = new OverloadedWorldHolder(tempHolder); - - // null the object so we don't keep file handles open where we shouldn't - tempHolder = null; - - // Set the file TimeStamps as it will be default from the initial load. - thisWorldData.setTimeStamps(); - - if (thisWorldData != null) { - GroupManager.logger.finest("Successful load of world " + worldName + "..."); - worldsData.put(worldNameLowered, thisWorldData); - return; - } - - //GroupManager.logger.severe("Failed to load world " + worldName + "..."); - } - } - - /** - * Tells if the such world has been mapped. - * - * It will return true if world is a mirror. - * - * @param worldName - * @return true if world is loaded or mirrored. false if not listed - */ - public boolean isInList(String worldName) { - if (worldsData.containsKey(worldName.toLowerCase()) || mirrorsGroup.containsKey(worldName.toLowerCase()) || mirrorsUser.containsKey(worldName.toLowerCase())) { - return true; - } - return false; - } - - /** - * Verify if world has it's own file permissions. - * - * @param worldName - * @return true if it has its own holder. false if not. - */ - public boolean hasOwnData(String worldName) { - if (worldsData.containsKey(worldName.toLowerCase()) && (!mirrorsGroup.containsKey(worldName.toLowerCase()) || !mirrorsUser.containsKey(worldName.toLowerCase()))) { - return true; - } - return false; - } - - /** - * @return the defaultWorld - */ - public OverloadedWorldHolder getDefaultWorld() { - return getUpdatedWorldData(serverDefaultWorldName); - } - - /** - * Returns all physically loaded worlds which have at least - * one of their own data sets for users or groups. - * - * @return ArrayList of all loaded worlds - */ - public ArrayList allWorldsDataList() { - ArrayList list = new ArrayList(); - for (OverloadedWorldHolder data : worldsData.values()) { - if ((!list.contains(data)) && (!mirrorsGroup.containsKey(data.getName().toLowerCase()) || !mirrorsUser.containsKey(data.getName().toLowerCase()))) { - - String worldNameLowered = data.getName().toLowerCase(); - String usersMirror = mirrorsUser.get(worldNameLowered); - String groupsMirror = mirrorsGroup.get(worldNameLowered); - - // is users mirrored? - if (usersMirror != null) { - - // If both are mirrored - if (groupsMirror != null) { - - // if the data sources are the same, return the parent - if (usersMirror == groupsMirror) { - if (!list.contains(usersMirror.toLowerCase())) - list.add(worldsData.get(usersMirror.toLowerCase())); - continue; - } - // Both data sources are mirrors, but they are from different parents - // so fall through to add the actual data object. - } - // Groups isn't a mirror so fall through to add this this worlds data source - } - - // users isn't mirrored so we need to add this worlds data source - list.add(data); - } - } - return list; - } + /** + * Copies the specified world data to another world + * + * @param fromWorld + * @param toWorld + * @return true if successfully copied. + */ + public boolean cloneWorld(String fromWorld, String toWorld) { + + File fromWorldFolder = new File(worldsFolder, fromWorld.toLowerCase()); + File toWorldFolder = new File(worldsFolder, toWorld.toLowerCase()); + if (toWorldFolder.exists() || !fromWorldFolder.exists()) { + return false; + } + File fromWorldGroups = new File(fromWorldFolder, "groups.yml"); + File fromWorldUsers = new File(fromWorldFolder, "users.yml"); + if (!fromWorldGroups.exists() || !fromWorldUsers.exists()) { + return false; + } + File toWorldGroups = new File(toWorldFolder, "groups.yml"); + File toWorldUsers = new File(toWorldFolder, "users.yml"); + toWorldFolder.mkdirs(); + try { + Tasks.copy(fromWorldGroups, toWorldGroups); + Tasks.copy(fromWorldUsers, toWorldUsers); + } catch (IOException ex) { + Logger.getLogger(WorldsHolder.class.getName()).log(Level.SEVERE, null, ex); + return false; + } + return true; + } + + /** + * Wrapper for LoadWorld(String,Boolean) for backwards compatibility + * + * Load a world from file. + * If it already been loaded, summon reload method from dataHolder. + * + * @param worldName + */ + public void loadWorld(String worldName) { + + loadWorld(worldName, false); + } + + /** + * Load a world from file. + * If it already been loaded, summon reload method from dataHolder. + * + * @param worldName + */ + public void loadWorld(String worldName, Boolean isMirror) { + + String worldNameLowered = worldName.toLowerCase(); + + if (worldsData.containsKey(worldNameLowered)) { + worldsData.get(worldNameLowered).reload(); + return; + } + GroupManager.logger.finest("Trying to load world " + worldName + "..."); + File thisWorldFolder = new File(worldsFolder, worldNameLowered); + if ((isMirror) || (thisWorldFolder.exists() && thisWorldFolder.isDirectory())) { + + // Setup file handles, if not mirrored + File groupsFile = (mirrorsGroup.containsKey(worldNameLowered)) ? null : new File(thisWorldFolder, "groups.yml"); + File usersFile = (mirrorsUser.containsKey(worldNameLowered)) ? null : new File(thisWorldFolder, "users.yml"); + + if ((groupsFile != null) && (!groupsFile.exists())) { + throw new IllegalArgumentException("Groups file for world '" + worldName + "' doesnt exist: " + groupsFile.getPath()); + } + if ((usersFile != null) && (!usersFile.exists())) { + throw new IllegalArgumentException("Users file for world '" + worldName + "' doesnt exist: " + usersFile.getPath()); + } + + WorldDataHolder tempHolder = new WorldDataHolder(worldName); + + // Map the group object for any mirror + if (mirrorsGroup.containsKey(worldNameLowered)) + tempHolder.setGroupsObject(this.getWorldData(mirrorsGroup.get(worldNameLowered)).getGroupsObject()); + else + tempHolder.loadGroups(groupsFile); + + // Map the user object for any mirror + if (mirrorsUser.containsKey(worldNameLowered)) + tempHolder.setUsersObject(this.getWorldData(mirrorsUser.get(worldNameLowered)).getUsersObject()); + else + tempHolder.loadUsers(usersFile); + + OverloadedWorldHolder thisWorldData = new OverloadedWorldHolder(tempHolder); + + // null the object so we don't keep file handles open where we shouldn't + tempHolder = null; + + // Set the file TimeStamps as it will be default from the initial load. + thisWorldData.setTimeStamps(); + + if (thisWorldData != null) { + GroupManager.logger.finest("Successful load of world " + worldName + "..."); + worldsData.put(worldNameLowered, thisWorldData); + return; + } + + //GroupManager.logger.severe("Failed to load world " + worldName + "..."); + } + } + + /** + * Tells if the such world has been mapped. + * + * It will return true if world is a mirror. + * + * @param worldName + * @return true if world is loaded or mirrored. false if not listed + */ + public boolean isInList(String worldName) { + + if (worldsData.containsKey(worldName.toLowerCase()) || mirrorsGroup.containsKey(worldName.toLowerCase()) || mirrorsUser.containsKey(worldName.toLowerCase())) { + return true; + } + return false; + } + + /** + * Verify if world has it's own file permissions. + * + * @param worldName + * @return true if it has its own holder. false if not. + */ + public boolean hasOwnData(String worldName) { + + if (worldsData.containsKey(worldName.toLowerCase()) && (!mirrorsGroup.containsKey(worldName.toLowerCase()) || !mirrorsUser.containsKey(worldName.toLowerCase()))) { + return true; + } + return false; + } + + /** + * @return the defaultWorld + */ + public OverloadedWorldHolder getDefaultWorld() { + + return getUpdatedWorldData(serverDefaultWorldName); + } + + /** + * Returns all physically loaded worlds which have at least + * one of their own data sets for users or groups. + * + * @return ArrayList of all loaded worlds + */ + public ArrayList allWorldsDataList() { + + ArrayList list = new ArrayList(); + for (OverloadedWorldHolder data : worldsData.values()) { + if ((!list.contains(data)) && (!mirrorsGroup.containsKey(data.getName().toLowerCase()) || !mirrorsUser.containsKey(data.getName().toLowerCase()))) { + + String worldNameLowered = data.getName().toLowerCase(); + String usersMirror = mirrorsUser.get(worldNameLowered); + String groupsMirror = mirrorsGroup.get(worldNameLowered); + + // is users mirrored? + if (usersMirror != null) { + + // If both are mirrored + if (groupsMirror != null) { + + // if the data sources are the same, return the parent + if (usersMirror == groupsMirror) { + if (!list.contains(usersMirror.toLowerCase())) + list.add(worldsData.get(usersMirror.toLowerCase())); + continue; + } + // Both data sources are mirrors, but they are from different parents + // so fall through to add the actual data object. + } + // Groups isn't a mirror so fall through to add this this worlds data source + } + + // users isn't mirrored so we need to add this worlds data source + list.add(data); + } + } + return list; + } } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMGroupEvent.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMGroupEvent.java index fc9b8433b..af3fb6135 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMGroupEvent.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMGroupEvent.java @@ -6,79 +6,82 @@ import org.bukkit.Bukkit; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; - /** * @author ElgarL - * + * */ public class GMGroupEvent extends Event { - /** + /** * */ private static final HandlerList handlers = new HandlerList(); @Override public HandlerList getHandlers() { - return handlers; - } - - public static HandlerList getHandlerList() { - return handlers; - } - ////////////////////////////// + return handlers; + } + + public static HandlerList getHandlerList() { + + return handlers; + } + + ////////////////////////////// protected Group group; - + protected String groupName; - - protected Action action; - - public GMGroupEvent(Group group, Action action) { - super(); - - this.group = group; - this.action = action; - this.groupName = group.getName(); - } - - public GMGroupEvent(String groupName, Action action) { - super(); - - this.groupName = groupName; - this.action = action; - } - - public Action getAction(){ - return this.action; - } - - public Group getGroup() { - return group; - } - - public String getGroupName() { - return groupName; - } - - public enum Action { - GROUP_PERMISSIONS_CHANGED, - GROUP_INHERITANCE_CHANGED, - GROUP_INFO_CHANGED, - GROUP_ADDED, - GROUP_REMOVED, - } - - public void schedule(final GMGroupEvent event) { + + protected Action action; + + public GMGroupEvent(Group group, Action action) { + + super(); + + this.group = group; + this.action = action; + this.groupName = group.getName(); + } + + public GMGroupEvent(String groupName, Action action) { + + super(); + + this.groupName = groupName; + this.action = action; + } + + public Action getAction() { + + return this.action; + } + + public Group getGroup() { + + return group; + } + + public String getGroupName() { + + return groupName; + } + + public enum Action { + GROUP_PERMISSIONS_CHANGED, GROUP_INHERITANCE_CHANGED, GROUP_INFO_CHANGED, GROUP_ADDED, GROUP_REMOVED, + } + + public void schedule(final GMGroupEvent event) { if (Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Bukkit.getPluginManager().getPlugin("GroupManager"), new Runnable() { @Override public void run() { + Bukkit.getServer().getPluginManager().callEvent(event); } }, 1) == -1) GroupManager.logger.warning("Could not schedule GM Event."); - } + } } \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java index 210960876..d11581356 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java @@ -5,57 +5,58 @@ import org.bukkit.Bukkit; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; - /** * @author ElgarL - * + * */ public class GMSystemEvent extends Event { - /** + /** * */ private static final HandlerList handlers = new HandlerList(); @Override public HandlerList getHandlers() { - return handlers; - } - - public static HandlerList getHandlerList() { - return handlers; - } - - ////////////////////////////// - + + return handlers; + } + + public static HandlerList getHandlerList() { + + return handlers; + } + + ////////////////////////////// + protected Action action; - - public GMSystemEvent(Action action) { - super(); - - this.action = action; - } - - public Action getAction(){ - return this.action; - } - - public enum Action { - RELOADED, - SAVED, - DEFAULT_GROUP_CHANGED, - VALIDATE_TOGGLE, - } - - public void schedule(final GMSystemEvent event) { + + public GMSystemEvent(Action action) { + + super(); + + this.action = action; + } + + public Action getAction() { + + return this.action; + } + + public enum Action { + RELOADED, SAVED, DEFAULT_GROUP_CHANGED, VALIDATE_TOGGLE, + } + + public void schedule(final GMSystemEvent event) { if (Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Bukkit.getPluginManager().getPlugin("GroupManager"), new Runnable() { @Override public void run() { + Bukkit.getServer().getPluginManager().callEvent(event); } }, 1) == -1) GroupManager.logger.warning("Could not schedule GM Event."); - } + } } \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMUserEvent.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMUserEvent.java index 206de8c86..361e7d4cc 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMUserEvent.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMUserEvent.java @@ -6,81 +6,82 @@ import org.bukkit.Bukkit; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; - /** * @author ElgarL - * + * */ public class GMUserEvent extends Event { - /** + /** * */ private static final HandlerList handlers = new HandlerList(); @Override public HandlerList getHandlers() { - return handlers; - } - - public static HandlerList getHandlerList() { - return handlers; - } - ////////////////////////////// + return handlers; + } + + public static HandlerList getHandlerList() { + + return handlers; + } + + ////////////////////////////// protected User user; - + protected String userName; - - protected Action action; - - public GMUserEvent(User user, Action action) { - super(); - - this.user = user; - this.action = action; - this.userName = user.getName(); - } - - public GMUserEvent(String userName, Action action) { - super(); - - this.userName = userName; - this.action = action; - } - - public Action getAction(){ - return this.action; - } - - public User getUser() { - return user; - } - - public String getUserName() { - return userName; - } - - public enum Action { - USER_PERMISSIONS_CHANGED, - USER_INHERITANCE_CHANGED, - USER_INFO_CHANGED, - USER_GROUP_CHANGED, - USER_SUBGROUP_CHANGED, - USER_ADDED, - USER_REMOVED, - } - - public void schedule(final GMUserEvent event) { + + protected Action action; + + public GMUserEvent(User user, Action action) { + + super(); + + this.user = user; + this.action = action; + this.userName = user.getName(); + } + + public GMUserEvent(String userName, Action action) { + + super(); + + this.userName = userName; + this.action = action; + } + + public Action getAction() { + + return this.action; + } + + public User getUser() { + + return user; + } + + public String getUserName() { + + return userName; + } + + public enum Action { + USER_PERMISSIONS_CHANGED, USER_INHERITANCE_CHANGED, USER_INFO_CHANGED, USER_GROUP_CHANGED, USER_SUBGROUP_CHANGED, USER_ADDED, USER_REMOVED, + } + + public void schedule(final GMUserEvent event) { if (Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Bukkit.getPluginManager().getPlugin("GroupManager"), new Runnable() { @Override public void run() { + Bukkit.getServer().getPluginManager().callEvent(event); } }, 1) == -1) GroupManager.logger.warning("Could not schedule GM Event."); - } + } } \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java index fd1a9d7ff..f7a7109ab 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMWorldListener.java @@ -6,31 +6,33 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.world.WorldInitEvent; - /** * @author ElgarL * - * Handle new world creation from other plugins - * + * Handle new world creation from other plugins + * */ public class GMWorldListener implements Listener { - + private final GroupManager plugin; public GMWorldListener(GroupManager instance) { + plugin = instance; registerEvents(); } - + private void registerEvents() { - plugin.getServer().getPluginManager().registerEvents(this, plugin); - } - + + plugin.getServer().getPluginManager().registerEvents(this, plugin); + } + @EventHandler(priority = EventPriority.LOWEST) public void onWorldInit(WorldInitEvent event) { - String worldName = event.getWorld().getName(); - - if (GroupManager.isLoaded() && !plugin.getWorldsHolder().isInList(worldName)) { + + String worldName = event.getWorld().getName(); + + if (GroupManager.isLoaded() && !plugin.getWorldsHolder().isInList(worldName)) { GroupManager.logger.info("New world detected..."); GroupManager.logger.info("Creating data for: " + worldName); plugin.getWorldsHolder().setupWorldFolder(worldName); diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GroupManagerEventHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GroupManagerEventHandler.java index 3a4d8d266..5fc555cc4 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GroupManagerEventHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GroupManagerEventHandler.java @@ -3,40 +3,51 @@ package org.anjocaido.groupmanager.events; import org.anjocaido.groupmanager.data.Group; import org.anjocaido.groupmanager.data.User; - /** * @author ElgarL * - * Handles all Event generation. - * + * Handles all Event generation. + * */ public class GroupManagerEventHandler { - + protected static void callEvent(GMGroupEvent event) { + event.schedule(event); } + protected static void callEvent(GMUserEvent event) { + event.schedule(event); } + protected static void callEvent(GMSystemEvent event) { + event.schedule(event); } public static void callEvent(Group group, GMGroupEvent.Action action) { + callEvent(new GMGroupEvent(group, action)); } + public static void callEvent(String groupName, GMGroupEvent.Action action) { + callEvent(new GMGroupEvent(groupName, action)); } - + public static void callEvent(User user, GMUserEvent.Action action) { + callEvent(new GMUserEvent(user, action)); } + public static void callEvent(String userName, GMUserEvent.Action action) { + callEvent(new GMUserEvent(userName, action)); } - + public static void callEvent(GMSystemEvent.Action action) { + callEvent(new GMSystemEvent(action)); } } \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index b40694bb0..2f64e4d99 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java @@ -39,6 +39,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { * @param holder */ public AnjoPermissionsHandler(WorldDataHolder holder) { + ph = holder; } @@ -51,6 +52,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public boolean has(Player player, String permission) { + return permission(player, permission); } @@ -63,6 +65,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public boolean permission(Player player, String permission) { + return checkUserPermission(ph.getUser(player.getName()).updatePlayer(player), permission); } @@ -74,6 +77,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { * @return true if the player has the permission */ public boolean permission(String playerName, String permission) { + return checkUserPermission(ph.getUser(playerName), permission); } @@ -85,6 +89,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public String getGroup(String userName) { + return ph.getUser(userName).getGroup().getName(); } @@ -97,10 +102,11 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public List getAllPlayersPermissions(String userName) { + List perms = new ArrayList(); - + perms.addAll(getAllPlayersPermissions(userName, true)); - + return perms; } @@ -118,33 +124,32 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { // Add the players own permissions. playerPermArray.addAll(populatePerms(ph.getUser(userName).getPermissionList(), includeChildren)); - + ArrayList alreadyProcessed = new ArrayList(); - + // fetch all group permissions for (String group : getGroups(userName)) { // Don't process a group more than once. if (!alreadyProcessed.contains(group)) { alreadyProcessed.add(group); - + Set groupPermArray = new HashSet(); - + if (group.startsWith("g:") && GroupManager.getGlobalGroups().hasGroup(group)) { // GlobalGroups groupPermArray = populatePerms(GroupManager.getGlobalGroups().getGroupsPermissions(group), includeChildren); - + } else { // World Groups groupPermArray = populatePerms(ph.getGroup(group).getPermissionList(), includeChildren); } - + // Add all group permissions, unless negated by earlier permissions. for (String perm : groupPermArray) { boolean negated = (perm.startsWith("-")); // Perm doesn't already exists and there is no negation for it // or It's a negated perm where a normal perm doesn't exists (don't allow inheritance to negate higher perms) - if ((!negated && !playerPermArray.contains(perm) && !playerPermArray.contains("-" + perm)) - || (negated && !playerPermArray.contains(perm.substring(1)) && !playerPermArray.contains("-" + perm))) + if ((!negated && !playerPermArray.contains(perm) && !playerPermArray.contains("-" + perm)) || (negated && !playerPermArray.contains(perm.substring(1)) && !playerPermArray.contains("-" + perm))) playerPermArray.add(perm); } } @@ -154,68 +159,69 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { return playerPermArray; } - - private Set populatePerms (List permsList, boolean includeChildren) { - + + private Set populatePerms(List permsList, boolean includeChildren) { + // Create a new array so it's modifiable. List perms = new ArrayList(permsList); Set permArray = new HashSet(); Boolean allPerms = false; - + // Allow * node to populate ALL permissions to Bukkit. if (perms.contains("*")) { permArray.addAll(GroupManager.BukkitPermissions.getAllRegisteredPermissions(includeChildren)); allPerms = true; perms.remove("*"); } - + for (String perm : perms) { - + + /** + * all permission sets are passed here pre-sorted, alphabetically. + * This means negated nodes will be processed before all permissions + * other than *. + */ + boolean negated = perm.startsWith("-"); + + if (!permArray.contains(perm)) { + permArray.add(perm); + + if ((negated) && (permArray.contains(perm.substring(1)))) + permArray.remove(perm.substring(1)); + /** - * all permission sets are passed here pre-sorted, alphabetically. - * This means negated nodes will be processed before all permissions - * other than *. + * Process child nodes if required, + * or this is a negated node AND we used * to include all + * permissions, + * in which case we need to remove all children of that node. */ - boolean negated = perm.startsWith("-"); - - if (!permArray.contains(perm)) { - permArray.add(perm); - - if ((negated) && (permArray.contains(perm.substring(1)))) - permArray.remove(perm.substring(1)); - - /** - * Process child nodes if required, - * or this is a negated node AND we used * to include all permissions, - * in which case we need to remove all children of that node. - */ - if ((includeChildren) || (negated && allPerms)) { - - Map children = GroupManager.BukkitPermissions.getAllChildren((negated ? perm.substring(1) : perm), new HashSet()); - - if (children != null) { - if (negated) - if (allPerms) { - - // Remove children of negated nodes - for (String child : children.keySet()) - if (children.get(child)) - if (permArray.contains(child)) - permArray.remove(child); - + if ((includeChildren) || (negated && allPerms)) { + + Map children = GroupManager.BukkitPermissions.getAllChildren((negated ? perm.substring(1) : perm), new HashSet()); + + if (children != null) { + if (negated) + if (allPerms) { + + // Remove children of negated nodes + for (String child : children.keySet()) + if (children.get(child)) + if (permArray.contains(child)) + permArray.remove(child); + } else { - + // Add child nodes for (String child : children.keySet()) if (children.get(child)) if ((!permArray.contains(child)) && (!permArray.contains("-" + child))) permArray.add(child); } - } } } + } } - + return permArray; } @@ -236,6 +242,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public boolean inGroup(String name, String group) { + if (hasGroupInInheritance(ph.getUser(name).getGroup(), group)) { return true; } @@ -326,6 +333,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public String getGroupPrefix(String groupName) { + Group g = ph.getGroup(groupName); if (g == null) { return ""; @@ -341,6 +349,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public String getGroupSuffix(String groupName) { + Group g = ph.getGroup(groupName); if (g == null) { return ""; @@ -357,6 +366,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public boolean canGroupBuild(String groupName) { + Group g = ph.getGroup(groupName); if (g == null) { return false; @@ -374,6 +384,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public String getGroupPermissionString(String groupName, String variable) { + Group start = ph.getGroup(groupName); if (start == null) { return null; @@ -395,6 +406,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public int getGroupPermissionInteger(String groupName, String variable) { + Group start = ph.getGroup(groupName); if (start == null) { return -1; @@ -416,6 +428,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public boolean getGroupPermissionBoolean(String group, String variable) { + Group start = ph.getGroup(group); if (start == null) { return false; @@ -437,6 +450,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public double getGroupPermissionDouble(String group, String variable) { + Group start = ph.getGroup(group); if (start == null) { return -1; @@ -457,6 +471,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public String getUserPermissionString(String user, String variable) { + User auser = ph.getUser(user); if (auser == null) { return ""; @@ -473,6 +488,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public int getUserPermissionInteger(String user, String variable) { + User auser = ph.getUser(user); if (auser == null) { return -1; @@ -489,6 +505,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public boolean getUserPermissionBoolean(String user, String variable) { + User auser = ph.getUser(user); if (auser == null) { return false; @@ -505,6 +522,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public double getUserPermissionDouble(String user, String variable) { + User auser = ph.getUser(user); if (auser == null) { return -1; @@ -523,6 +541,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public String getPermissionString(String user, String variable) { + User auser = ph.getUser(user); if (auser == null) { return ""; @@ -562,6 +581,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public int getPermissionInteger(String user, String variable) { + User auser = ph.getUser(user); if (auser == null) { return -1; @@ -601,6 +621,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public boolean getPermissionBoolean(String user, String variable) { + User auser = ph.getUser(user); if (auser == null) { return false; @@ -640,6 +661,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public double getPermissionDouble(String user, String variable) { + User auser = ph.getUser(user); if (auser == null) { return -1.0D; @@ -676,6 +698,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { * @return PermissionCheckResult */ public PermissionCheckResult checkUserOnlyPermission(User user, String permission) { + user.sortPermissions(); PermissionCheckResult result = new PermissionCheckResult(); result.askedPermission = permission; @@ -699,6 +722,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { * @return the node if permission is found. if not found, return null */ public PermissionCheckResult checkGroupOnlyPermission(Group group, String permission) { + group.sortPermissions(); PermissionCheckResult result = new PermissionCheckResult(); result.owner = group; @@ -721,6 +745,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { * @return true if permission was found. false if not, or was negated. */ public boolean checkUserPermission(User user, String permission) { + PermissionCheckResult result = checkFullGMPermission(user, permission, true); if (result.resultType == PermissionCheckResult.Type.EXCEPTION || result.resultType == PermissionCheckResult.Type.FOUND) { return true; @@ -752,6 +777,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { * @return PermissionCheckResult */ public PermissionCheckResult checkFullGMPermission(User user, String targetPermission, Boolean checkBukkit) { + PermissionCheckResult result = new PermissionCheckResult(); result.accessLevel = targetPermission; result.resultType = PermissionCheckResult.Type.NOTFOUND; @@ -813,6 +839,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Deprecated public Group nextGroupWithVariable(Group start, String variable, List alreadyChecked) { + return nextGroupWithVariable(start, variable); } @@ -829,6 +856,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { * @return The group if found. Null if not. */ public Group nextGroupWithVariable(Group start, String targetVariable) { + if (start == null || targetVariable == null) { return null; } @@ -870,6 +898,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Deprecated public boolean searchGroupInInheritance(Group start, String askedGroup, List alreadyChecked) { + return hasGroupInInheritance(start, askedGroup); } @@ -885,6 +914,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { * @return true if it inherits the group. */ public boolean hasGroupInInheritance(Group start, String askedGroup) { + if (start == null || askedGroup == null) { return false; } @@ -920,6 +950,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Deprecated public boolean checkGroupPermissionWithInheritance(Group start, String permission, List alreadyChecked) { + PermissionCheckResult result = checkGroupPermissionWithInheritance(start, permission); if (result.resultType.equals(Type.EXCEPTION) || result.resultType.equals(Type.FOUND)) { return true; @@ -942,6 +973,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { * @return PermissionCheckResult */ public PermissionCheckResult checkGroupPermissionWithInheritance(Group start, String targetPermission) { + if (start == null || targetPermission == null) { return null; } @@ -982,6 +1014,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Deprecated public Group nextGroupWithPermission(Group start, String permission, List alreadyChecked) { + PermissionCheckResult result = checkGroupPermissionWithInheritance(start, permission); if (result.resultType.equals(Type.EXCEPTION) || result.resultType.equals(Type.FOUND)) { return (Group) checkGroupPermissionWithInheritance(start, permission).owner; @@ -1003,6 +1036,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Deprecated public ArrayList listAllGroupsInherited(Group start, ArrayList alreadyChecked) { + return listAllGroupsInherited(start); } @@ -1016,6 +1050,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { * @return the group that passed on test. null if no group passed. */ public ArrayList listAllGroupsInherited(Group start) { + if (start == null) { return null; } @@ -1055,6 +1090,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { * @return PermissionCheckResult.Type */ public PermissionCheckResult.Type comparePermissionString(String userAccessLevel, String fullPermissionName) { + int userAccessLevelLength; if (userAccessLevel == null || fullPermissionName == null || fullPermissionName.length() == 0 || (userAccessLevelLength = userAccessLevel.length()) == 0) { return PermissionCheckResult.Type.NOTFOUND; @@ -1080,12 +1116,9 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { } if (userAccessLevel.charAt(userAccessLevel.length() - 1) == '*') { - return userAccessLevel.regionMatches(true, userAccessLevelOffset, fullPermissionName, fullPermissionNameOffset, userAccessLevelLength - userAccessLevelOffset - 1) ? - result : PermissionCheckResult.Type.NOTFOUND; + return userAccessLevel.regionMatches(true, userAccessLevelOffset, fullPermissionName, fullPermissionNameOffset, userAccessLevelLength - userAccessLevelOffset - 1) ? result : PermissionCheckResult.Type.NOTFOUND; } else { - return userAccessLevel.regionMatches(true, userAccessLevelOffset, fullPermissionName, fullPermissionNameOffset, - Math.max(userAccessLevelLength - userAccessLevelOffset, fullPermissionName.length() - fullPermissionNameOffset)) ? - result : PermissionCheckResult.Type.NOTFOUND; + return userAccessLevel.regionMatches(true, userAccessLevelOffset, fullPermissionName, fullPermissionNameOffset, Math.max(userAccessLevelLength - userAccessLevelOffset, fullPermissionName.length() - fullPermissionNameOffset)) ? result : PermissionCheckResult.Type.NOTFOUND; } } @@ -1099,6 +1132,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @Override public String[] getGroups(String userName) { + ArrayList allGroups = listAllGroupsInherited(ph.getUser(userName).getGroup()); for (Group subg : ph.getUser(userName).subGroupListCopy()) { allGroups.addAll(listAllGroupsInherited(subg)); @@ -1120,6 +1154,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { */ @SuppressWarnings("unused") private Group breadthFirstSearch(Group start, String targerPermission) { + if (start == null || targerPermission == null) { return null; } @@ -1149,11 +1184,13 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { @Override public Group getDefaultGroup() { + return ph.getDefaultGroup(); } @Override public String getInfoString(String entryName, String path, boolean isGroup) { + if (isGroup) { Group data = ph.getGroup(entryName); if (data == null) { @@ -1171,6 +1208,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { @Override public int getInfoInteger(String entryName, String path, boolean isGroup) { + if (isGroup) { Group data = ph.getGroup(entryName); if (data == null) { @@ -1188,6 +1226,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { @Override public double getInfoDouble(String entryName, String path, boolean isGroup) { + if (isGroup) { Group data = ph.getGroup(entryName); if (data == null) { @@ -1206,6 +1245,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { @Override public boolean getInfoBoolean(String entryName, String path, boolean isGroup) { + if (isGroup) { Group data = ph.getGroup(entryName); if (data == null) { @@ -1223,21 +1263,25 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { @Override public void addUserInfo(String name, String path, Object data) { + ph.getUser(name).getVariables().addVar(path, data); } @Override public void removeUserInfo(String name, String path) { + ph.getUser(name).getVariables().removeVar(path); } @Override public void addGroupInfo(String name, String path, Object data) { + ph.getGroup(name).getVariables().addVar(path, data); } @Override public void removeGroupInfo(String name, String path) { + ph.getGroup(name).getVariables().removeVar(path); } } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index 516679544..c366b65bf 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -1,18 +1,19 @@ /* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + */ package org.anjocaido.groupmanager.permissions; @@ -47,7 +48,6 @@ import org.bukkit.permissions.PermissionAttachment; import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.plugin.PluginManager; - /** * * BukkitPermissions overrides to force GM reponses to Superperms @@ -62,11 +62,12 @@ public class BukkitPermissions { protected boolean dumpAllPermissions = true; protected boolean dumpMatchedPermissions = true; private boolean player_join = false; - + /** * @return the player_join */ public boolean isPlayer_join() { + return player_join; } @@ -74,6 +75,7 @@ public class BukkitPermissions { * @param player_join the player_join to set */ public void setPlayer_join(boolean player_join) { + this.player_join = player_join; } @@ -92,6 +94,7 @@ public class BukkitPermissions { } public BukkitPermissions(GroupManager plugin) { + this.plugin = plugin; this.collectPermissions(); this.registerEvents(); @@ -101,35 +104,38 @@ public class BukkitPermissions { } private void registerEvents() { + PluginManager manager = plugin.getServer().getPluginManager(); manager.registerEvents(new PlayerEvents(), plugin); manager.registerEvents(new BukkitEvents(), plugin); } - public void collectPermissions() { + registeredPermissions.clear(); for (Permission perm : Bukkit.getPluginManager().getPermissions()) { - registeredPermissions.put(perm.getName().toLowerCase(), perm); + registeredPermissions.put(perm.getName().toLowerCase(), perm); } - + } public void updatePermissions(Player player) { + this.updatePermissions(player, null); } - /** - * Push all permissions which are registered with GM for this player, on this world to Bukkit + * Push all permissions which are registered with GM for this player, on + * this world to Bukkit * and make it update for the child nodes. * * @param player * @param world */ public void updatePermissions(Player player, String world) { + if (player == null || !GroupManager.isLoaded()) { return; } @@ -155,17 +161,18 @@ public class BukkitPermissions { // Sort the perm list by parent/child, so it will push to superperms correctly. playerPermArray = sort(playerPermArray); - + Boolean value = false; - for (String permission : playerPermArray) { + for (String permission : playerPermArray) { value = (!permission.startsWith("-")); - newPerms.put((value? permission : permission.substring(1)), value); + newPerms.put((value ? permission : permission.substring(1)), value); } /** - * This is put in place until such a time as Bukkit pull 466 is implemented - * https://github.com/Bukkit/Bukkit/pull/466 - */ + * This is put in place until such a time as Bukkit pull 466 is + * implemented + * https://github.com/Bukkit/Bukkit/pull/466 + */ try { // Codename_B source @SuppressWarnings("unchecked") Map orig = (Map) permissions.get(attachment); @@ -182,7 +189,7 @@ public class BukkitPermissions { e.printStackTrace(); } } - + /** * Sort a permission node list by parent/child * @@ -190,20 +197,20 @@ public class BukkitPermissions { * @return List sorted for priority */ private List sort(List permList) { - + List result = new ArrayList(); - + for (String key : permList) { - String a = key.charAt(0) == '-'? key.substring(1):key; + String a = key.charAt(0) == '-' ? key.substring(1) : key; Map allchildren = GroupManager.BukkitPermissions.getAllChildren(a, new HashSet()); if (allchildren != null) { ListIterator itr = result.listIterator(); - - while (itr.hasNext()){ + + while (itr.hasNext()) { String node = (String) itr.next(); - String b = node.charAt(0) == '-'? node.substring(1):node; - + String b = node.charAt(0) == '-' ? node.substring(1) : node; + // Insert the parent node before the child if (allchildren.containsKey(b)) { itr.set(key); @@ -215,11 +222,10 @@ public class BukkitPermissions { if (!result.contains(key)) result.add(key); } - + return result; } - /** * Fetch all permissions which are registered with superperms. * {can include child nodes) @@ -228,13 +234,13 @@ public class BukkitPermissions { * @return List of all permission nodes */ public List getAllRegisteredPermissions(boolean includeChildren) { - + List perms = new ArrayList(); - + for (String key : registeredPermissions.keySet()) { if (!perms.contains(key)) { perms.add(key); - + if (includeChildren) { Map children = getAllChildren(key, new HashSet()); if (children != null) { @@ -244,32 +250,33 @@ public class BukkitPermissions { } } } - + } return perms; } - + /** * Returns a map of ALL child permissions registered with bukkit * null is empty * * @param node - * @param playerPermArray current list of perms to check against for negations + * @param playerPermArray current list of perms to check against for + * negations * @return Map of child permissions */ public Map getAllChildren(String node, Set playerPermArray) { - + LinkedList stack = new LinkedList(); Map alreadyVisited = new HashMap(); stack.push(node); alreadyVisited.put(node, true); - + while (!stack.isEmpty()) { String now = stack.pop(); - + Map children = getChildren(now); - - if ((children != null) && (!playerPermArray.contains("-"+now))) { + + if ((children != null) && (!playerPermArray.contains("-" + now))) { for (String childName : children.keySet()) { if (!alreadyVisited.containsKey(childName)) { stack.push(childName); @@ -279,24 +286,26 @@ public class BukkitPermissions { } } alreadyVisited.remove(node); - if (!alreadyVisited.isEmpty()) return alreadyVisited; - + if (!alreadyVisited.isEmpty()) + return alreadyVisited; + return null; } - + /** - * Returns a map of the child permissions (1 node deep) as registered with Bukkit. + * Returns a map of the child permissions (1 node deep) as registered with + * Bukkit. * null is empty * * @param node * @return Map of child permissions */ public Map getChildren(String node) { - + Permission perm = registeredPermissions.get(node.toLowerCase()); if (perm == null) return null; - + return perm.getChildren(); } @@ -308,6 +317,7 @@ public class BukkitPermissions { * @return List of permissions */ public List listPerms(Player player) { + List perms = new ArrayList(); /* @@ -332,25 +342,28 @@ public class BukkitPermissions { * force Bukkit to update every OnlinePlayers permissions. */ public void updateAllPlayers() { + for (Player player : Bukkit.getServer().getOnlinePlayers()) { updatePermissions(player); } } - + /** * force Bukkit to update this Players permissions. */ public void updatePlayer(Player player) { + if (player != null) this.updatePermissions(player, null); } - + /** * Force remove any attachments * * @param player */ private void removeAttachment(Player player) { + if (attachments.containsKey(player)) { try { player.removeAttachment(attachments.get(player)); @@ -363,15 +376,15 @@ public class BukkitPermissions { attachments.remove(player); } } - + /** * Remove all attachments in case of a restart or reload. */ public void removeAllAttachments() { - + Iterator itr = attachments.keySet().iterator(); - - while (itr.hasNext()){ + + while (itr.hasNext()) { Player player = itr.next(); try { player.removeAttachment(attachments.get(player)); @@ -389,20 +402,21 @@ public class BukkitPermissions { * Player events tracked to cause Superperms updates * * @author ElgarL - * + * */ protected class PlayerEvents implements Listener { @EventHandler(priority = EventPriority.LOWEST) public void onPlayerJoin(PlayerJoinEvent event) { + setPlayer_join(true); Player player = event.getPlayer(); - + /* * Tidy up any lose ends */ removeAttachment(player); - + // force GM to create the player if they are not already listed. if (plugin.getWorldsHolder().getWorldData(player.getWorld().getName()).getUser(player.getName()) != null) { setPlayer_join(false); @@ -410,29 +424,32 @@ public class BukkitPermissions { } setPlayer_join(false); } - + @EventHandler(priority = EventPriority.LOWEST) public void onPlayerChangeWorld(PlayerChangedWorldEvent event) { // has changed worlds + updatePermissions(event.getPlayer(), event.getPlayer().getWorld().getName()); } @EventHandler(priority = EventPriority.LOWEST) public void onPlayerKick(PlayerKickEvent event) { + Player player = event.getPlayer(); - + /* * force remove any attachments as bukkit may not */ removeAttachment(player); } - + @EventHandler(priority = EventPriority.LOWEST) public void onPlayerQuit(PlayerQuitEvent event) { + if (!GroupManager.isLoaded()) return; Player player = event.getPlayer(); - + /* * force remove any attachments as bukkit may not */ @@ -444,6 +461,7 @@ public class BukkitPermissions { @EventHandler(priority = EventPriority.NORMAL) public void onPluginEnable(PluginEnableEvent event) { + if (!GroupManager.isLoaded()) return; @@ -453,6 +471,7 @@ public class BukkitPermissions { @EventHandler(priority = EventPriority.NORMAL) public void onPluginDisable(PluginDisableEvent event) { + collectPermissions(); // updateAllPlayers(); } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/PermissionsReaderInterface.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/PermissionsReaderInterface.java index 3f49757e2..69f098949 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/PermissionsReaderInterface.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/PermissionsReaderInterface.java @@ -12,227 +12,239 @@ import org.bukkit.entity.Player; /** * Made by Nijikokun. Changed by Gabriel Couto - * + * * This class is intended to *read* permissions from a single world. - * + * * @author Nijikokun * @author Gabriel Couto * @author ElgarL */ public abstract class PermissionsReaderInterface { - /** - * - * @param player - * @param string - * @return true if has permission - */ - public abstract boolean has(Player player, String string); - - /** - * - * @param player - * @param string - * @return true if has permission - */ - public abstract boolean permission(Player player, String string); - - /** - * - * @param userName - * @return group name for this player. - */ - public abstract String getGroup(String userName); - - /** - * - * @param userName - * @param groupName - * @return true if in group - */ - public abstract boolean inGroup(String userName, String groupName); - - /** - * - * @param groupName - * @return String of prefix - */ - public abstract String getGroupPrefix(String groupName); - - /** - * - * @param groupName - * @return String of suffix - */ - public abstract String getGroupSuffix(String groupName); - - /** - * - * @param groupName - * @return true if can build - */ - public abstract boolean canGroupBuild(String groupName); - - /** - * - * @param groupName - * @param node - * @return String value - */ - public abstract String getGroupPermissionString(String groupName, String node); - - /** - * - * @param groupName - * @param node - * @return integer value - */ - public abstract int getGroupPermissionInteger(String groupName, String node); - - /** - * - * @param groupName - * @param node - * @return boolean value - */ - public abstract boolean getGroupPermissionBoolean(String groupName, String node); - - /** - * - * @param groupName - * @param node - * @return double value - */ - public abstract double getGroupPermissionDouble(String groupName, String node); - - /** - * - * @param userName - * @param node - * @return String value - */ - public abstract String getUserPermissionString(String userName, String node); - - /** - * - * @param userName - * @param node - * @return integer value - */ - public abstract int getUserPermissionInteger(String userName, String node); - - /** - * - * @param userName - * @param node - * @return boolean value - */ - public abstract boolean getUserPermissionBoolean(String userName, String node); - - /** - * - * @param userName - * @param node - * @return double value - */ - public abstract double getUserPermissionDouble(String userName, String node); - - /** - * - * @param userName - * @param node - * @return String value - */ - public abstract String getPermissionString(String userName, String node); - - /** - * - * @param userName - * @param node - * @return integer value - */ - public abstract int getPermissionInteger(String userName, String node); - - /** - * - * @param userName - * @param node - * @return boolean value - */ - public abstract boolean getPermissionBoolean(String userName, String node); - - /** - * - * @param userName - * @param node - * @return double value - */ - public abstract double getPermissionDouble(String userName, String node); - -///////////////////////////// - /** - * Gets the appropriate prefix for the user. - * This method is a utility method for chat plugins to get the user's prefix - * without having to look at every one of the user's ancestors. - * Returns an empty string if user has no parent groups. - * - * @param user Player's name - * @return Player's prefix - */ - public abstract String getUserPrefix(String user); - - /** - * Gets the appropriate suffix for the user. - * This method is a utility method for chat plugins to get the user's suffix - * without having to look at every one of the user's ancestors. - * Returns an empty string if user has no parent groups. - * - * @param user Player's name - * @return Player's suffix - */ - public abstract String getUserSuffix(String user); - - /** - * Returns the group object representing the default group of the given world. - * This method will return null if the object does not exist or the world has no default group. - * @return Group object representing default world, or null if it doesn't exist or is not defined. - */ - public abstract Group getDefaultGroup(); - - /** - * Gets a array of the names of all parent groups in the same world. - * @param name Target user's name - * @return An array containing the names of all parent groups (including ancestors) that are in the same world - */ - public abstract String[] getGroups(String name); - - public abstract String getInfoString(String entryName, String path, boolean isGroup); - //public abstract String getInfoString(String entryName, String path, boolean isGroup, Comparator comparator); - - public abstract int getInfoInteger(String entryName, String path, boolean isGroup); - //public abstract int getInfoInteger(String entryName, String path, boolean isGroup, Comparator comparator); - - /** - * Gets a double from the Info node without inheritance. - * @param entryName - * @param path - * @param isGroup - * @return -1 if not found - */ - public abstract double getInfoDouble(String entryName, String path, boolean isGroup); - //public abstract double getInfoDouble(String entryName, String path, boolean isGroup, Comparator comparator); - - public abstract boolean getInfoBoolean(String entryName, String path, boolean isGroup); - //public abstract boolean getInfoBoolean(String entryName, String path, boolean isGroup, Comparator comparator); - - public abstract void addUserInfo(String name, String path, Object data); - - public abstract void removeUserInfo(String name, String path); - - public abstract void addGroupInfo(String name, String path, Object data); - - public abstract void removeGroupInfo(String name, String path); -////////////////////////////// + /** + * + * @param player + * @param string + * @return true if has permission + */ + public abstract boolean has(Player player, String string); + + /** + * + * @param player + * @param string + * @return true if has permission + */ + public abstract boolean permission(Player player, String string); + + /** + * + * @param userName + * @return group name for this player. + */ + public abstract String getGroup(String userName); + + /** + * + * @param userName + * @param groupName + * @return true if in group + */ + public abstract boolean inGroup(String userName, String groupName); + + /** + * + * @param groupName + * @return String of prefix + */ + public abstract String getGroupPrefix(String groupName); + + /** + * + * @param groupName + * @return String of suffix + */ + public abstract String getGroupSuffix(String groupName); + + /** + * + * @param groupName + * @return true if can build + */ + public abstract boolean canGroupBuild(String groupName); + + /** + * + * @param groupName + * @param node + * @return String value + */ + public abstract String getGroupPermissionString(String groupName, String node); + + /** + * + * @param groupName + * @param node + * @return integer value + */ + public abstract int getGroupPermissionInteger(String groupName, String node); + + /** + * + * @param groupName + * @param node + * @return boolean value + */ + public abstract boolean getGroupPermissionBoolean(String groupName, String node); + + /** + * + * @param groupName + * @param node + * @return double value + */ + public abstract double getGroupPermissionDouble(String groupName, String node); + + /** + * + * @param userName + * @param node + * @return String value + */ + public abstract String getUserPermissionString(String userName, String node); + + /** + * + * @param userName + * @param node + * @return integer value + */ + public abstract int getUserPermissionInteger(String userName, String node); + + /** + * + * @param userName + * @param node + * @return boolean value + */ + public abstract boolean getUserPermissionBoolean(String userName, String node); + + /** + * + * @param userName + * @param node + * @return double value + */ + public abstract double getUserPermissionDouble(String userName, String node); + + /** + * + * @param userName + * @param node + * @return String value + */ + public abstract String getPermissionString(String userName, String node); + + /** + * + * @param userName + * @param node + * @return integer value + */ + public abstract int getPermissionInteger(String userName, String node); + + /** + * + * @param userName + * @param node + * @return boolean value + */ + public abstract boolean getPermissionBoolean(String userName, String node); + + /** + * + * @param userName + * @param node + * @return double value + */ + public abstract double getPermissionDouble(String userName, String node); + + ///////////////////////////// + /** + * Gets the appropriate prefix for the user. + * This method is a utility method for chat plugins to get the user's prefix + * without having to look at every one of the user's ancestors. + * Returns an empty string if user has no parent groups. + * + * @param user Player's name + * @return Player's prefix + */ + public abstract String getUserPrefix(String user); + + /** + * Gets the appropriate suffix for the user. + * This method is a utility method for chat plugins to get the user's suffix + * without having to look at every one of the user's ancestors. + * Returns an empty string if user has no parent groups. + * + * @param user Player's name + * @return Player's suffix + */ + public abstract String getUserSuffix(String user); + + /** + * Returns the group object representing the default group of the given + * world. + * This method will return null if the object does not exist or the world + * has no default group. + * + * @return Group object representing default world, or null if it doesn't + * exist or is not defined. + */ + public abstract Group getDefaultGroup(); + + /** + * Gets a array of the names of all parent groups in the same world. + * + * @param name Target user's name + * @return An array containing the names of all parent groups (including + * ancestors) that are in the same world + */ + public abstract String[] getGroups(String name); + + public abstract String getInfoString(String entryName, String path, boolean isGroup); + + //public abstract String getInfoString(String entryName, String path, boolean isGroup, Comparator comparator); + + public abstract int getInfoInteger(String entryName, String path, boolean isGroup); + + //public abstract int getInfoInteger(String entryName, String path, boolean isGroup, Comparator comparator); + + /** + * Gets a double from the Info node without inheritance. + * + * @param entryName + * @param path + * @param isGroup + * @return -1 if not found + */ + public abstract double getInfoDouble(String entryName, String path, boolean isGroup); + + //public abstract double getInfoDouble(String entryName, String path, boolean isGroup, Comparator comparator); + + public abstract boolean getInfoBoolean(String entryName, String path, boolean isGroup); + + //public abstract boolean getInfoBoolean(String entryName, String path, boolean isGroup, Comparator comparator); + + public abstract void addUserInfo(String name, String path, Object data); + + public abstract void removeUserInfo(String name, String path); + + public abstract void addGroupInfo(String name, String path, Object data); + + public abstract void removeGroupInfo(String name, String path); + + ////////////////////////////// public abstract List getAllPlayersPermissions(String userName); diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/GMLoggerHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/GMLoggerHandler.java index 87b6806ab..de5348b17 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/GMLoggerHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/GMLoggerHandler.java @@ -9,18 +9,19 @@ import java.util.logging.Level; import java.util.logging.LogRecord; /** - * + * * @author gabrielcouto */ public class GMLoggerHandler extends ConsoleHandler { - @Override - public void publish(LogRecord record) { - String message = "GroupManager - " + record.getLevel() + " - " + record.getMessage(); - if (record.getLevel().equals(Level.SEVERE) || record.getLevel().equals(Level.WARNING)) { - System.err.println(message); - } else { - System.out.println(message); - } - } + @Override + public void publish(LogRecord record) { + + String message = "GroupManager - " + record.getLevel() + " - " + record.getMessage(); + if (record.getLevel().equals(Level.SEVERE) || record.getLevel().equals(Level.WARNING)) { + System.err.println(message); + } else { + System.out.println(message); + } + } } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/GroupManagerPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/GroupManagerPermissions.java index 0262bb33e..f8cef89c7 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/GroupManagerPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/GroupManagerPermissions.java @@ -6,47 +6,10 @@ package org.anjocaido.groupmanager.utils; /** * Just a list of commands for this plugin + * * @author gabrielcouto */ public enum GroupManagerPermissions { - manuadd, - manudel, - manuaddsub, - manudelsub, - mangadd, - mangdel, - manuaddp, - manudelp, - manulistp, - manucheckp, - mangaddp, - mangdelp, - manglistp, - mangcheckp, - mangaddi, - mangdeli, - manuaddv, - manudelv, - manulistv, - manucheckv, - mangaddv, - mangdelv, - manglistv, - mangcheckv, - manwhois, - tempadd, - tempdel, - templist, - tempdelall, - mansave, - manload, - listgroups, - manpromote, - mandemote, - mantogglevalidate, - mantogglesave, - manworld, - manselect, - manclear + manuadd, manudel, manuaddsub, manudelsub, mangadd, mangdel, manuaddp, manudelp, manulistp, manucheckp, mangaddp, mangdelp, manglistp, mangcheckp, mangaddi, mangdeli, manuaddv, manudelv, manulistv, manucheckv, mangaddv, mangdelv, manglistv, mangcheckv, manwhois, tempadd, tempdel, templist, tempdelall, mansave, manload, listgroups, manpromote, mandemote, mantogglevalidate, mantogglesave, manworld, manselect, manclear } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/PermissionCheckResult.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/PermissionCheckResult.java index 88ac48427..eb6633863 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/PermissionCheckResult.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/PermissionCheckResult.java @@ -7,61 +7,61 @@ package org.anjocaido.groupmanager.utils; import org.anjocaido.groupmanager.data.DataUnit; /** - * + * * @author gabrielcouto */ public class PermissionCheckResult { - /** - * It should be the owner of the access level found. - * - * Use instanceof to find the owner type - */ - public DataUnit owner; - /** - * The permission node found in the DataUnit. - */ - public String accessLevel; - /** - * The full name of the permission you are looking for - */ - public String askedPermission; - /** - * The result conclusion of the search. - * It determines if the owner can do, or not. - * - * It even determines if it has an owner. - */ - public Type resultType = Type.NOTFOUND; + /** + * It should be the owner of the access level found. + * + * Use instanceof to find the owner type + */ + public DataUnit owner; + /** + * The permission node found in the DataUnit. + */ + public String accessLevel; + /** + * The full name of the permission you are looking for + */ + public String askedPermission; + /** + * The result conclusion of the search. + * It determines if the owner can do, or not. + * + * It even determines if it has an owner. + */ + public Type resultType = Type.NOTFOUND; - /** - * The type of result the search can give. - */ - public enum Type { + /** + * The type of result the search can give. + */ + public enum Type { - /** - * If found a matching node starting with '+'. - * It means the user CAN do the permission. - */ - EXCEPTION, - /** - * If found a matching node starting with '-'. - * It means the user CANNOT do the permission. - */ - NEGATION, - /** - * If just found a common matching node. - * IT means the user CAN do the permission. - */ - FOUND, - /** - * If no matchin node was found. - * It means the user CANNOT do the permission. - * - * owner field and accessLevel field should not be considered, - * when type is - * NOTFOUND - */ - NOTFOUND - } + /** + * If found a matching node starting with '+'. + * It means the user CAN do the permission. + */ + EXCEPTION, + /** + * If found a matching node starting with '-'. + * It means the user CANNOT do the permission. + */ + NEGATION, + /** + * If just found a common matching node. + * IT means the user CAN do the permission. + */ + FOUND, + /** + * If no matchin node was found. + * It means the user CANNOT do the permission. + * + * owner field and accessLevel field should not be considered, + * when type is + * NOTFOUND + */ + NOTFOUND + } } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/StringPermissionComparator.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/StringPermissionComparator.java index ab2fd605b..5a56cd9fc 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/StringPermissionComparator.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/StringPermissionComparator.java @@ -7,43 +7,46 @@ package org.anjocaido.groupmanager.utils; import java.util.Comparator; /** - * + * * @author gabrielcouto */ public class StringPermissionComparator implements Comparator { - @Override - public int compare(String permA, String permB) { - boolean ap = permA.startsWith("+"); - boolean bp = permB.startsWith("+"); - boolean am = permA.startsWith("-"); - boolean bm = permB.startsWith("-"); - if (ap && bp) { - return 0; - } - if (ap && !bp) { - return -1; - } - if (!ap && bp) { - return 1; - } - if (am && bm) { - return 0; - } - if (am && !bm) { - return -1; - } - if (!am && bm) { - return 1; - } - return permA.compareToIgnoreCase(permB); - } - private static StringPermissionComparator instance; + @Override + public int compare(String permA, String permB) { - public static StringPermissionComparator getInstance() { - if (instance == null) { - instance = new StringPermissionComparator(); - } - return instance; - } + boolean ap = permA.startsWith("+"); + boolean bp = permB.startsWith("+"); + boolean am = permA.startsWith("-"); + boolean bm = permB.startsWith("-"); + if (ap && bp) { + return 0; + } + if (ap && !bp) { + return -1; + } + if (!ap && bp) { + return 1; + } + if (am && bm) { + return 0; + } + if (am && !bm) { + return -1; + } + if (!am && bm) { + return 1; + } + return permA.compareToIgnoreCase(permB); + } + + private static StringPermissionComparator instance; + + public static StringPermissionComparator getInstance() { + + if (instance == null) { + instance = new StringPermissionComparator(); + } + return instance; + } } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/Tasks.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/Tasks.java index 663da1123..d75737c66 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/Tasks.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/Tasks.java @@ -22,13 +22,12 @@ import java.util.List; import org.anjocaido.groupmanager.GroupManager; import org.anjocaido.groupmanager.data.Group; - /** - * + * * @author gabrielcouto */ public abstract class Tasks { - + /** * Gets the exception stack trace as a string. * @@ -36,35 +35,38 @@ public abstract class Tasks { * @return stack trace as a string */ public static String getStackTraceAsString(Exception exception) { + StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); exception.printStackTrace(pw); return sw.toString(); } - public static void copy(InputStream src, File dst) throws IOException { - InputStream in = src; - OutputStream out = new FileOutputStream(dst); - - // Transfer bytes from in to out - byte[] buf = new byte[1024]; - int len; - while ((len = in.read(buf)) > 0) { - out.write(buf, 0, len); - } - out.close(); - try { - in.close(); - } catch (Exception e) { - } - } - - public static void copy(File src, File dst) throws IOException { - InputStream in = new FileInputStream(src); - copy(in, dst); - } - - /** + public static void copy(InputStream src, File dst) throws IOException { + + InputStream in = src; + OutputStream out = new FileOutputStream(dst); + + // Transfer bytes from in to out + byte[] buf = new byte[1024]; + int len; + while ((len = in.read(buf)) > 0) { + out.write(buf, 0, len); + } + out.close(); + try { + in.close(); + } catch (Exception e) { + } + } + + public static void copy(File src, File dst) throws IOException { + + InputStream in = new FileInputStream(src); + copy(in, dst); + } + + /** * Appends a string to a file * * @param data @@ -82,86 +84,92 @@ public abstract class Tasks { out.append(System.getProperty("line.separator")); out.append(data); out.append(System.getProperty("line.separator")); - + out.close(); } - public static void removeOldFiles(GroupManager gm, File folder) { - if (folder.isDirectory()) { - long oldTime = System.currentTimeMillis() - (((long)gm.getGMConfig().getBackupDuration()*60*60)*1000); - for (File olds : folder.listFiles()) { - if (olds.isFile()) { - if (olds.lastModified() < oldTime) { - try { - olds.delete(); - } catch (Exception e) { - } - } - } - } - } - } - - public static String getDateString() { - GregorianCalendar now = new GregorianCalendar(); - String date = ""; - date += now.get(Calendar.DAY_OF_MONTH); - date += "-"; - date += now.get(Calendar.HOUR); - date += "-"; - date += now.get(Calendar.MINUTE); - return date; - } - - public static String getStringListInString(List list) { - if (list == null) { - return ""; - } - String result = ""; - for (int i = 0; i < list.size(); i++) { - result += list.get(i); - if (i < list.size() - 1) { - result += ", "; - } - } - return result; - } - - public static String getStringArrayInString(String[] list) { - if (list == null) { - return ""; - } - String result = ""; - for (int i = 0; i < list.length; i++) { - result += list[i]; - if (i < ((list.length) - 1)) { - result += ", "; - } - } - return result; - } - - public static String getGroupListInString(List list) { - if (list == null) { - return ""; - } - String result = ""; - for (int i = 0; i < list.size(); i++) { - result += list.get(i).getName(); - if (i < list.size() - 1) { - result += ", "; - } - } - return result; - } - - public static String join(String[] arr, String separator) { - if (arr.length == 0) - return ""; - String out = arr[0].toString(); - for (int i = 1; i < arr.length; i++) - out += separator + arr[i]; - return out; - } + public static void removeOldFiles(GroupManager gm, File folder) { + + if (folder.isDirectory()) { + long oldTime = System.currentTimeMillis() - (((long) gm.getGMConfig().getBackupDuration() * 60 * 60) * 1000); + for (File olds : folder.listFiles()) { + if (olds.isFile()) { + if (olds.lastModified() < oldTime) { + try { + olds.delete(); + } catch (Exception e) { + } + } + } + } + } + } + + public static String getDateString() { + + GregorianCalendar now = new GregorianCalendar(); + String date = ""; + date += now.get(Calendar.DAY_OF_MONTH); + date += "-"; + date += now.get(Calendar.HOUR); + date += "-"; + date += now.get(Calendar.MINUTE); + return date; + } + + public static String getStringListInString(List list) { + + if (list == null) { + return ""; + } + String result = ""; + for (int i = 0; i < list.size(); i++) { + result += list.get(i); + if (i < list.size() - 1) { + result += ", "; + } + } + return result; + } + + public static String getStringArrayInString(String[] list) { + + if (list == null) { + return ""; + } + String result = ""; + for (int i = 0; i < list.length; i++) { + result += list[i]; + if (i < ((list.length) - 1)) { + result += ", "; + } + } + return result; + } + + public static String getGroupListInString(List list) { + + if (list == null) { + return ""; + } + String result = ""; + for (int i = 0; i < list.size(); i++) { + result += list.get(i).getName(); + if (i < list.size() - 1) { + result += ", "; + } + } + return result; + } + + public static String join(String[] arr, String separator) { + + if (arr.length == 0) + return ""; + String out = arr[0].toString(); + for (int i = 1; i < arr.length; i++) + out += separator + arr[i]; + return out; + } } -- cgit v1.2.3 From 5b5df254d554f6288a496023abc3a32d6a628ee4 Mon Sep 17 00:00:00 2001 From: ementalo Date: Fri, 13 Apr 2012 14:49:15 +0100 Subject: Don't kill tamed ocelots with killall Test #1921 --- .../src/com/earth2me/essentials/commands/Commandkillall.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java index a455ccc20..d918eeffb 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java @@ -16,6 +16,7 @@ import org.bukkit.entity.HumanEntity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Monster; import org.bukkit.entity.NPC; +import org.bukkit.entity.Ocelot; import org.bukkit.entity.Player; import org.bukkit.entity.Slime; import org.bukkit.entity.Snowman; @@ -121,6 +122,13 @@ public class Commandkillall extends EssentialsCommand continue; } } + if(entity instanceof Ocelot) + { + if (((Ocelot)entity).isTamed()) + { + continue; + } + } if (animals) { if (entity instanceof Animals || entity instanceof NPC || entity instanceof Snowman || entity instanceof WaterMob) -- cgit v1.2.3 From 08bff3ea5f46865907e08cb75c25360c95e8798e Mon Sep 17 00:00:00 2001 From: ElgarL Date: Fri, 13 Apr 2012 14:57:23 +0100 Subject: Stop using our own deprecated methods as we tell others to do. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GroupManager.java | 18 ++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 5549fef17..790821fa1 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -177,4 +177,5 @@ v 2.0: - Expand GlobalGroups.yml and groups.yml to cover the VanishNoPacket plugin. Demonstrating how to negate and add nodes when using the '*' permission with inheritance. - Fix silly nested throw/catch statements. Errors are now correctly generated when reading yml's. - Unregister the worldsHolder as a service on a reload/shutdown instead of the whole plugin. - - Update all code formatting to use tabs for indentation. \ No newline at end of file + - Update all code formatting to use tabs for indentation. + - Stop using our own deprecated methods as we tell others to do. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index b75c2242e..c9c8fcbd5 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -29,7 +29,6 @@ import org.anjocaido.groupmanager.dataholder.worlds.WorldsHolder; import org.anjocaido.groupmanager.events.GMSystemEvent; import org.anjocaido.groupmanager.events.GMWorldListener; import org.anjocaido.groupmanager.events.GroupManagerEventHandler; -import org.anjocaido.groupmanager.events.GMGroupEvent.Action; import org.anjocaido.groupmanager.utils.GMLoggerHandler; import org.anjocaido.groupmanager.utils.PermissionCheckResult; import org.anjocaido.groupmanager.utils.Tasks; @@ -40,15 +39,14 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; import org.bukkit.entity.Player; -import org.bukkit.event.Event; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.ServicePriority; import org.bukkit.plugin.java.JavaPlugin; -@SuppressWarnings("unused") + /** * - * @author gabrielcouto + * @author gabrielcouto, ElgarL */ public class GroupManager extends JavaPlugin { @@ -79,7 +77,6 @@ public class GroupManager extends JavaPlugin { this.validateOnlinePlayer = validateOnlinePlayer; } - private boolean isReady = false; private static boolean isLoaded = false; protected GMConfiguration config; @@ -111,7 +108,8 @@ public class GroupManager extends JavaPlugin { } } - WorldEvents = null; + if (WorldEvents != null) + WorldEvents = null; // Remove all attachments before clearing if (BukkitPermissions != null) { @@ -366,7 +364,7 @@ public class GroupManager extends JavaPlugin { * @param cmd * @param args */ - @SuppressWarnings({ "deprecation" }) + //@SuppressWarnings({ "deprecation" }) @Override public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { @@ -1131,7 +1129,7 @@ public class GroupManager extends JavaPlugin { } // Validating permission - if (permissionHandler.searchGroupInInheritance(auxGroup, auxGroup2.getName(), null)) { + if (permissionHandler.hasGroupInInheritance(auxGroup, auxGroup2.getName())) { sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " already inherits " + auxGroup2.getName() + " (might not be directly)"); return false; } @@ -1170,7 +1168,7 @@ public class GroupManager extends JavaPlugin { } // Validating permission - if (!permissionHandler.searchGroupInInheritance(auxGroup, auxGroup2.getName(), null)) { + if (!permissionHandler.hasGroupInInheritance(auxGroup, auxGroup2.getName())) { sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " does not inherits " + auxGroup2.getName() + "."); return false; } @@ -1461,7 +1459,7 @@ public class GroupManager extends JavaPlugin { return false; } // Validating permission - auxGroup2 = permissionHandler.nextGroupWithVariable(auxGroup, args[1], null); + auxGroup2 = permissionHandler.nextGroupWithVariable(auxGroup, args[1]); if (auxGroup2 == null) { sender.sendMessage(ChatColor.RED + "The group doesn't have access to that variable!"); } -- cgit v1.2.3 From 2f74510cce37c80341a844763675ec4e2a0d6516 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Fri, 13 Apr 2012 15:00:55 +0100 Subject: Code tidy --- .../src/org/anjocaido/groupmanager/GroupManager.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index c9c8fcbd5..747056c04 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -50,7 +50,6 @@ import org.bukkit.plugin.java.JavaPlugin; */ public class GroupManager extends JavaPlugin { - // private File configFile; private File backupFolder; private Runnable commiter; private ScheduledThreadPoolExecutor scheduler; @@ -88,15 +87,15 @@ public class GroupManager extends JavaPlugin { public static final Logger logger = Logger.getLogger(GroupManager.class.getName()); // PERMISSIONS FOR COMMAND BEING LOADED - OverloadedWorldHolder dataHolder = null; - AnjoPermissionsHandler permissionHandler = null; + private OverloadedWorldHolder dataHolder = null; + private AnjoPermissionsHandler permissionHandler = null; @Override public void onDisable() { setLoaded(false); - // Un-register this service. + // Unregister this service. this.getServer().getServicesManager().unregister(this.worldsHolder); disableScheduler(); // Shutdown before we save, so it doesn't interfere. @@ -123,7 +122,7 @@ public class GroupManager extends JavaPlugin { GroupManager.logger.removeHandler(ch); } - // @Override + @Override public void onEnable() { try { @@ -159,9 +158,8 @@ public class GroupManager extends JavaPlugin { enableScheduler(); /* - * Schedule a Bukiit Permissions update for 1 tick later. All - * plugins - * will be loaded by then + * Schedule a Bukkit Permissions update for 1 tick later. + * All plugins will be loaded by then */ if (getServer().getScheduler().scheduleSyncDelayedTask(this, new BukkitPermsUpdateTask(), 1) == -1) { @@ -243,7 +241,6 @@ public class GroupManager extends JavaPlugin { private void prepareFileFields() { - // configFile = new File(this.getDataFolder(), "config.yml"); backupFolder = new File(this.getDataFolder(), "backup"); if (!backupFolder.exists()) { getBackupFolder().mkdirs(); @@ -364,7 +361,6 @@ public class GroupManager extends JavaPlugin { * @param cmd * @param args */ - //@SuppressWarnings({ "deprecation" }) @Override public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) { -- cgit v1.2.3 From 1e30f23ca6bf6bc2fb848088d50092f1ca1b70c2 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Fri, 13 Apr 2012 15:16:08 +0100 Subject: Finally remove all deprecated methods. --- EssentialsGroupManager/src/Changelog.txt | 3 +- .../org/anjocaido/groupmanager/GroupManager.java | 55 ---------- .../src/org/anjocaido/groupmanager/data/User.java | 13 --- .../dataholder/OverloadedWorldHolder.java | 1 - .../dataholder/worlds/WorldsHolder.java | 1 - .../permissions/AnjoPermissionsHandler.java | 113 +-------------------- 6 files changed, 7 insertions(+), 179 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 790821fa1..f900d5aa9 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -178,4 +178,5 @@ v 2.0: - Fix silly nested throw/catch statements. Errors are now correctly generated when reading yml's. - Unregister the worldsHolder as a service on a reload/shutdown instead of the whole plugin. - Update all code formatting to use tabs for indentation. - - Stop using our own deprecated methods as we tell others to do. \ No newline at end of file + - Stop using our own deprecated methods as we tell others to do. + - Finally remove all deprecated methods. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 747056c04..df46b70d0 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -12,7 +12,6 @@ import org.anjocaido.groupmanager.data.Variables; import org.anjocaido.groupmanager.data.User; import org.anjocaido.groupmanager.data.Group; import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; -import org.anjocaido.groupmanager.dataholder.WorldDataHolder; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -295,65 +294,11 @@ public class GroupManager extends JavaPlugin { } } - /** - * Use the WorldsHolder saveChanges directly instead Saves the data on file - */ - @Deprecated - public void commit() { - - if (worldsHolder != null) { - worldsHolder.saveChanges(); - } - } - - /** - * Use worlds holder to reload a specific world Reloads the data - */ - @Deprecated - public void reload() { - - worldsHolder.reloadAll(); - } - public WorldsHolder getWorldsHolder() { return worldsHolder; } - /** - * The handler in the interface created by AnjoCaido - * - * @return AnjoPermissionsHandler - */ - @Deprecated - public AnjoPermissionsHandler getPermissionHandler() { - - return worldsHolder.getDefaultWorld().getPermissionsHandler(); - } - - /** - * A simple interface, for ones that don't want to mess with overloading. - * Yet it is affected by overloading. But seamless. - * - * @return the dataholder with all information - */ - @Deprecated - public WorldDataHolder getData() { - - return worldsHolder.getDefaultWorld(); - } - - /** - * Use this if you want to play with overloading. - * - * @return a dataholder with overloading interface - */ - @Deprecated - public OverloadedWorldHolder getOverloadedClassData() { - - return worldsHolder.getDefaultWorld(); - } - /** * Called when a command registered by this plugin is received. * diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java index 25b3cb3fe..c10658fb0 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java @@ -108,19 +108,6 @@ public class User extends DataUnit implements Cloneable { return group; } - /** - * @param group - * the group to set - */ - @Deprecated - public void setGroup(String group) { - - this.group = group; - flagAsChanged(); - if (GroupManager.isLoaded()) - if (!GroupManager.BukkitPermissions.isPlayer_join()) - GroupManager.BukkitPermissions.updatePlayer(getBukkitPlayer()); - } /** * @param group diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/OverloadedWorldHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/OverloadedWorldHolder.java index c8a3eb3ae..84561b6e5 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/OverloadedWorldHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/OverloadedWorldHolder.java @@ -30,7 +30,6 @@ public class OverloadedWorldHolder extends WorldDataHolder { super(ph.getName()); this.setGroupsFile(ph.getGroupsFile()); this.setUsersFile(ph.getUsersFile()); - //this.setDefaultGroup(ph.getDefaultGroup()); this.groups = ph.groups; this.users = ph.users; } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java index ebacfdfac..37d0a8430 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java @@ -46,7 +46,6 @@ public class WorldsHolder { private Map mirrorsGroup = new HashMap(); private Map mirrorsUser = new HashMap(); - //private OverloadedWorldHolder defaultWorld; private String serverDefaultWorldName; private GroupManager plugin; private File worldsFolder; diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index 2f64e4d99..efad11df4 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java @@ -16,7 +16,6 @@ import org.anjocaido.groupmanager.data.Group; import org.anjocaido.groupmanager.dataholder.WorldDataHolder; import org.anjocaido.groupmanager.data.User; import org.anjocaido.groupmanager.utils.PermissionCheckResult; -import org.anjocaido.groupmanager.utils.PermissionCheckResult.Type; import org.bukkit.entity.Player; /** @@ -27,7 +26,7 @@ import org.bukkit.entity.Player; * * It holds permissions only for one single world. * - * @author gabrielcouto + * @author gabrielcouto, ElgarL */ public class AnjoPermissionsHandler extends PermissionsReaderInterface { @@ -824,35 +823,14 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { return result; } - /** - * Verifies if a given group has a variable. Including it's inheritance. - * - * it redirects to the other method now. This one was deprecated, and will - * be gone in a future release. - * - * @param start - * @param variable - * @param alreadyChecked - * @return returns the closest inherited group with the variable. - * @deprecated use now nextGroupWithVariable(Group start, String - * targetVariable) - */ - @Deprecated - public Group nextGroupWithVariable(Group start, String variable, List alreadyChecked) { - - return nextGroupWithVariable(start, variable); - } - /** * Returns the next group, including inheritance, which contains that * variable name. * * It does Breadth-first search * - * @param start - * the starting group to look for - * @param targetVariable - * the variable name + * @param start the starting group to look for + * @param targetVariable the variable name * @return The group if found. Null if not. */ public Group nextGroupWithVariable(Group start, String targetVariable) { @@ -880,37 +858,14 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { return null; } - /** - * Check if given group inherits another group. - * - * redirected to the other method. this is deprecated now. and will be gone - * in the future releases. - * - * @param start - * The group to start the search. - * @param askedGroup - * Name of the group you're looking for - * @param alreadyChecked - * groups to ignore(pass null on it, please) - * @return true if it inherits the group. - * @deprecated prefer using hasGroupInInheritance(Group start, String - * askedGroup) - */ - @Deprecated - public boolean searchGroupInInheritance(Group start, String askedGroup, List alreadyChecked) { - - return hasGroupInInheritance(start, askedGroup); - } /** * Check if given group inherits another group. * * It does Breadth-first search * - * @param start - * The group to start the search. - * @param askedGroup - * Name of the group you're looking for + * @param start The group to start the search. + * @param askedGroup Name of the group you're looking for * @return true if it inherits the group. */ public boolean hasGroupInInheritance(Group start, String askedGroup) { @@ -938,26 +893,6 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { return false; } - /** - * Check if the group has given permission. Including it's inheritance - * - * @param start - * @param permission - * @param alreadyChecked - * @return true if PermissionCheckResult is EXCEPTION or FOUND - * @deprecated use the other checkGroupPermissionWithInheritance for - * everything - */ - @Deprecated - public boolean checkGroupPermissionWithInheritance(Group start, String permission, List alreadyChecked) { - - PermissionCheckResult result = checkGroupPermissionWithInheritance(start, permission); - if (result.resultType.equals(Type.EXCEPTION) || result.resultType.equals(Type.FOUND)) { - return true; - } - return false; - } - /** * Returns the result of permission check. Including inheritance. If found * anything, the PermissionCheckResult that retuns will include the Group @@ -1002,44 +937,6 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { return result; } - /** - * It uses checkGroupPermissionWithInheritance and cast the owner to Group - * type if result type was EXCEPTION or FOUND. - * - * @param start - * @param permission - * @param alreadyChecked - * @return the group that passed on test. null if no group passed. - * @deprecated use checkGroupPermissionWithInheritance for everything now. - */ - @Deprecated - public Group nextGroupWithPermission(Group start, String permission, List alreadyChecked) { - - PermissionCheckResult result = checkGroupPermissionWithInheritance(start, permission); - if (result.resultType.equals(Type.EXCEPTION) || result.resultType.equals(Type.FOUND)) { - return (Group) checkGroupPermissionWithInheritance(start, permission).owner; - } - return null; - } - - /** - * Return whole list of names of groups in a inheritance chain. Including a - * starting group. - * - * it now redirects to the other method. but get away from this one, it will - * disappear in a future release. - * - * @param start - * @param alreadyChecked - * @return the group that passed on test. null if no group passed. - * @deprecated use the other method with same name, instead - */ - @Deprecated - public ArrayList listAllGroupsInherited(Group start, ArrayList alreadyChecked) { - - return listAllGroupsInherited(start); - } - /** * Return whole list of names of groups in a inheritance chain. Including a * starting group. -- cgit v1.2.3 From 1599a36642014d2b3284288676999a39b417a841 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Fri, 13 Apr 2012 23:56:50 +0100 Subject: Correct formatting in command list. --- .../utils/GroupManagerPermissions.java | 40 +++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/GroupManagerPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/GroupManagerPermissions.java index f8cef89c7..4a7298b9c 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/GroupManagerPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/utils/GroupManagerPermissions.java @@ -11,5 +11,43 @@ package org.anjocaido.groupmanager.utils; */ public enum GroupManagerPermissions { - manuadd, manudel, manuaddsub, manudelsub, mangadd, mangdel, manuaddp, manudelp, manulistp, manucheckp, mangaddp, mangdelp, manglistp, mangcheckp, mangaddi, mangdeli, manuaddv, manudelv, manulistv, manucheckv, mangaddv, mangdelv, manglistv, mangcheckv, manwhois, tempadd, tempdel, templist, tempdelall, mansave, manload, listgroups, manpromote, mandemote, mantogglevalidate, mantogglesave, manworld, manselect, manclear + manuadd, + manudel, + manuaddsub, + manudelsub, + mangadd, + mangdel, + manuaddp, + manudelp, + manulistp, + manucheckp, + mangaddp, + mangdelp, + manglistp, + mangcheckp, + mangaddi, + mangdeli, + manuaddv, + manudelv, + manulistv, + manucheckv, + mangaddv, + mangdelv, + manglistv, + mangcheckv, + manwhois, + tempadd, + tempdel, + templist, + tempdelall, + mansave, + manload, + listgroups, + manpromote, + mandemote, + mantogglevalidate, + mantogglesave, + manworld, + manselect, + manclear } -- cgit v1.2.3 From 8b9ff2c58a14b9fdaaf03941f3fcaefe8313c38d Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 14 Apr 2012 04:13:37 +0100 Subject: Try to speed up teleport events. --- Essentials/src/com/earth2me/essentials/Settings.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 7ee6a7057..c4b19601f 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -384,6 +384,7 @@ public class Settings implements ISettings enabledSigns = _getEnabledSigns(); teleportInvulnerability = _isTeleportInvulnerability(); disableItemPickupWhileAfk = _getDisableItemPickupWhileAfk(); + registerBackInListener = _registerBackInListener(); itemSpawnBl = _getItemSpawnBlacklist(); kits = _getKits(); chatFormats.clear(); @@ -691,11 +692,19 @@ public class Settings implements ISettings return config.getBoolean("world-teleport-permissions", false); } + private boolean registerBackInListener; + @Override public boolean registerBackInListener() + { + return registerBackInListener; + } + + private boolean _registerBackInListener() { return config.getBoolean("register-back-in-listener", false); } + private boolean disableItemPickupWhileAfk; @Override -- cgit v1.2.3 From 45de85dae257e73dc9a041ffe6a02465692a5ce1 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 14 Apr 2012 04:54:01 +0100 Subject: Optimize sign interacts. --- .../src/com/earth2me/essentials/signs/SignPlayerListener.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java b/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java index 561d8dffc..d415ef6a8 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignPlayerListener.java @@ -23,11 +23,10 @@ public class SignPlayerListener implements Listener @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onPlayerInteract(final PlayerInteractEvent event) { - if (ess.getSettings().areSignsDisabled()) + if (ess.getSettings().areSignsDisabled() || event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; } - final Block block = event.getClickedBlock(); if (block == null) { @@ -37,10 +36,6 @@ public class SignPlayerListener implements Listener final int mat = block.getTypeId(); if (mat == Material.SIGN_POST.getId() || mat == Material.WALL_SIGN.getId()) { - if (event.getAction() != Action.RIGHT_CLICK_BLOCK) - { - return; - } final Sign csign = (Sign)block.getState(); for (EssentialsSign sign : ess.getSettings().enabledSigns()) { @@ -61,7 +56,6 @@ public class SignPlayerListener implements Listener { event.setCancelled(true); return; - } } } -- cgit v1.2.3 From 602bd5b0d4eb3123a15ef894574ee236319603b4 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 14 Apr 2012 15:07:10 +1000 Subject: Change some ordering and clean pmd warnings --- .../essentials/EssentialsPlayerListener.java | 39 ++++++++-------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 38243cf76..9a257bd68 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -31,13 +31,11 @@ import org.bukkit.inventory.ItemStack; public class EssentialsPlayerListener implements Listener { private static final Logger LOGGER = Logger.getLogger("Minecraft"); - private final transient Server server; private final transient IEssentials ess; public EssentialsPlayerListener(final IEssentials parent) { this.ess = parent; - this.server = parent.getServer(); } @EventHandler(priority = EventPriority.NORMAL) @@ -217,7 +215,7 @@ public class EssentialsPlayerListener implements Listener return; } - User user = ess.getUser(event.getPlayer()); + final User user = ess.getUser(event.getPlayer()); if (user.isNPC()) { user.setNPC(false); @@ -246,8 +244,8 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerTeleport(final PlayerTeleportEvent event) { - boolean backListener = ess.getSettings().registerBackInListener(); - boolean teleportInvulnerability = ess.getSettings().isTeleportInvulnerability(); + final boolean backListener = ess.getSettings().registerBackInListener(); + final boolean teleportInvulnerability = ess.getSettings().isTeleportInvulnerability(); if (backListener || teleportInvulnerability) { final User user = ess.getUser(event.getPlayer()); @@ -319,19 +317,16 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.MONITOR) public void onPlayerChangedWorld(final PlayerChangedWorldEvent event) { - final User user = ess.getUser(event.getPlayer()); + final User user = ess.getUser(event.getPlayer()); final String newWorld = event.getPlayer().getLocation().getWorld().getName(); user.setDisplayNick(); updateCompass(user); - if (ess.getSettings().getNoGodWorlds().contains(newWorld)) + if (ess.getSettings().getNoGodWorlds().contains(newWorld) && user.isGodModeEnabledRaw()) { - if (user.isGodModeEnabledRaw()) - { - user.sendMessage(_("noGodWorldWarning")); - } + user.sendMessage(_("noGodWorldWarning")); } - - if(!event.getPlayer().getWorld().getName().equals(newWorld)) + + if (!event.getPlayer().getWorld().getName().equals(newWorld)) { user.sendMessage(_("currentWorld", newWorld)); } @@ -343,11 +338,7 @@ public class EssentialsPlayerListener implements Listener switch (event.getAction()) { case RIGHT_CLICK_BLOCK: - if (event.isCancelled()) - { - return; - } - if (event.getClickedBlock().getTypeId() == Material.BED_BLOCK.getId() && ess.getSettings().getUpdateBedAtDaytime()) + if (!event.isCancelled() && event.getClickedBlock().getTypeId() == Material.BED_BLOCK.getId() && ess.getSettings().getUpdateBedAtDaytime()) { event.getPlayer().setBedSpawnLocation(event.getClickedBlock().getLocation()); } @@ -408,14 +399,12 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onPlayerPickupItem(final PlayerPickupItemEvent event) { - if (!ess.getSettings().getDisableItemPickupWhileAfk()) + if (ess.getSettings().getDisableItemPickupWhileAfk()) { - return; - } - final User user = ess.getUser(event.getPlayer()); - if (user.isAfk()) - { - event.setCancelled(true); + if (ess.getUser(event.getPlayer()).isAfk()) + { + event.setCancelled(true); + } } } -- cgit v1.2.3 From 34f5c19f997bd4c5480bacc83ecd674a5bc4cb26 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 14 Apr 2012 15:21:42 +1000 Subject: Add option to disable jails entirely. --- Essentials/src/com/earth2me/essentials/Essentials.java | 18 ++++++++++++++---- .../src/com/earth2me/essentials/IEssentials.java | 2 +- Essentials/src/com/earth2me/essentials/ISettings.java | 2 ++ Essentials/src/com/earth2me/essentials/Settings.java | 6 ++++++ .../earth2me/essentials/metrics/MetricsStarter.java | 3 +++ Essentials/src/config.yml | 5 ++++- 6 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 5a82a9fb1..8a7643b68 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -232,8 +232,11 @@ public class Essentials extends JavaPlugin implements IEssentials pm.registerEvents(worldListener, this); //TODO: Check if this should be here, and not above before reload() - jails = new Jails(this); - confList.add(jails); + if (settings.isJailsEnabled()) + { + jails = new Jails(this); + confList.add(jails); + } pm.registerEvents(tntListener, this); @@ -428,9 +431,16 @@ public class Essentials extends JavaPlugin implements IEssentials } @Override - public IJails getJails() + public IJails getJails() throws UnsupportedOperationException { - return jails; + if (jails == null) + { + throw new UnsupportedOperationException("Jails are not enabled in your configuration"); + } + else + { + return jails; + } } @Override diff --git a/Essentials/src/com/earth2me/essentials/IEssentials.java b/Essentials/src/com/earth2me/essentials/IEssentials.java index 83c2e7325..1b38d0dfe 100644 --- a/Essentials/src/com/earth2me/essentials/IEssentials.java +++ b/Essentials/src/com/earth2me/essentials/IEssentials.java @@ -37,7 +37,7 @@ public interface IEssentials extends Plugin BukkitScheduler getScheduler(); - IJails getJails(); + IJails getJails() throws UnsupportedOperationException; Warps getWarps(); diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index 2c07ccd58..ea0354602 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -173,4 +173,6 @@ public interface ISettings extends IConf long getTeleportInvulnerability(); boolean isTeleportInvulnerability(); + + boolean isJailsEnabled(); } diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index c4b19601f..0e36782be 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -780,4 +780,10 @@ public class Settings implements ISettings { return teleportInvulnerability; } + + @Override + public boolean isJailsEnabled() + { + return config.getBoolean("enable-jails", true); + } } diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index 0ea692cc9..befed005f 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -171,6 +171,9 @@ public class MetricsStarter implements Runnable metrics.start(); + } + catch (UnsupportedOperationException ex) + { } catch (Exception ex) { diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 70433b5b0..3227322a8 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -44,6 +44,9 @@ change-displayname: true # Don't forget to remove the # infront of the line #add-prefix-suffix: false +# Whether or not jails are activated +enable-jails: true + # The delay, in seconds, required between /home, /tp, etc. teleport-cooldown: 0 @@ -584,7 +587,7 @@ 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: '' -- cgit v1.2.3 From 055603b09e9d620ea2c42262461e4f453d0a1689 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 14 Apr 2012 15:57:47 +0100 Subject: Fix null locations in /seen --- Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 1 + Essentials/src/com/earth2me/essentials/commands/Commandseen.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 38243cf76..3e3f2fd91 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -116,6 +116,7 @@ public class EssentialsPlayerListener implements Listener { user.toggleGodModeEnabled(); } + user.setLastLocation(); user.updateActivity(false); user.dispose(); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index 75f04da33..24f1f9c41 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -60,7 +60,9 @@ public class Commandseen extends EssentialsCommand { sender.sendMessage(_("whoisIPAddress", player.getLastLoginAddress())); final Location loc = player.getLastLocation(); - sender.sendMessage(_("whoisLocation", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + if (loc != null) { + sender.sendMessage(_("whoisLocation", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + } } } } -- cgit v1.2.3 From 1bd1665faa4b1ab188f3afee535c7270b7e563bb Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 14 Apr 2012 17:53:33 +0100 Subject: Throw syntax error on /item, if syntax is wrong. --- .../earth2me/essentials/commands/Commanditem.java | 65 ++++++++++++---------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java index 405b8b799..0e35dda71 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java @@ -36,42 +36,47 @@ public class Commanditem extends EssentialsCommand { throw new Exception(_("cantSpawnItem", itemname)); } - - if (args.length > 1 && Integer.parseInt(args[1]) > 0) - { - stack.setAmount(Integer.parseInt(args[1])); - } - else if (ess.getSettings().getDefaultStackSize() > 0) + try { - stack.setAmount(ess.getSettings().getDefaultStackSize()); - } - else if (ess.getSettings().getOversizedStackSize() > 0 && user.isAuthorized("essentials.oversizedstacks")) - { - stack.setAmount(ess.getSettings().getOversizedStackSize()); - } - - if (args.length > 2) - { - for (int i = 2; i < args.length; i++) + if (args.length > 1 && Integer.parseInt(args[1]) > 0) { - final String[] split = args[i].split("[:+',;.]", 2); - if (split.length < 1) - { - continue; - } - final Enchantment enchantment = Commandenchant.getEnchantment(split[0], user); - int level; - if (split.length > 1) - { - level = Integer.parseInt(split[1]); - } - else + stack.setAmount(Integer.parseInt(args[1])); + } + else if (ess.getSettings().getDefaultStackSize() > 0) + { + stack.setAmount(ess.getSettings().getDefaultStackSize()); + } + else if (ess.getSettings().getOversizedStackSize() > 0 && user.isAuthorized("essentials.oversizedstacks")) + { + stack.setAmount(ess.getSettings().getOversizedStackSize()); + } + if (args.length > 2) + { + for (int i = 2; i < args.length; i++) { - level = enchantment.getMaxLevel(); + final String[] split = args[i].split("[:+',;.]", 2); + if (split.length < 1) + { + continue; + } + final Enchantment enchantment = Commandenchant.getEnchantment(split[0], user); + int level; + if (split.length > 1) + { + level = Integer.parseInt(split[1]); + } + else + { + level = enchantment.getMaxLevel(); + } + stack.addEnchantment(enchantment, level); } - stack.addEnchantment(enchantment, level); } } + catch (NumberFormatException e) + { + throw new NotEnoughArgumentsException(); + } if (stack.getType() == Material.AIR) { -- cgit v1.2.3 From d08ea5a65045afa1ce7c0fe4cbad813329ab5421 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 14 Apr 2012 23:18:20 +0100 Subject: Revert "Add option to disable jails entirely." This reverts commit 34f5c19f997bd4c5480bacc83ecd674a5bc4cb26. --- Essentials/src/com/earth2me/essentials/Essentials.java | 18 ++++-------------- .../src/com/earth2me/essentials/IEssentials.java | 2 +- Essentials/src/com/earth2me/essentials/ISettings.java | 2 -- Essentials/src/com/earth2me/essentials/Settings.java | 6 ------ .../earth2me/essentials/metrics/MetricsStarter.java | 3 --- Essentials/src/config.yml | 5 +---- 6 files changed, 6 insertions(+), 30 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 8a7643b68..5a82a9fb1 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -232,11 +232,8 @@ public class Essentials extends JavaPlugin implements IEssentials pm.registerEvents(worldListener, this); //TODO: Check if this should be here, and not above before reload() - if (settings.isJailsEnabled()) - { - jails = new Jails(this); - confList.add(jails); - } + jails = new Jails(this); + confList.add(jails); pm.registerEvents(tntListener, this); @@ -431,16 +428,9 @@ public class Essentials extends JavaPlugin implements IEssentials } @Override - public IJails getJails() throws UnsupportedOperationException + public IJails getJails() { - if (jails == null) - { - throw new UnsupportedOperationException("Jails are not enabled in your configuration"); - } - else - { - return jails; - } + return jails; } @Override diff --git a/Essentials/src/com/earth2me/essentials/IEssentials.java b/Essentials/src/com/earth2me/essentials/IEssentials.java index 1b38d0dfe..83c2e7325 100644 --- a/Essentials/src/com/earth2me/essentials/IEssentials.java +++ b/Essentials/src/com/earth2me/essentials/IEssentials.java @@ -37,7 +37,7 @@ public interface IEssentials extends Plugin BukkitScheduler getScheduler(); - IJails getJails() throws UnsupportedOperationException; + IJails getJails(); Warps getWarps(); diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index ea0354602..2c07ccd58 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -173,6 +173,4 @@ public interface ISettings extends IConf long getTeleportInvulnerability(); boolean isTeleportInvulnerability(); - - boolean isJailsEnabled(); } diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 0e36782be..c4b19601f 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -780,10 +780,4 @@ public class Settings implements ISettings { return teleportInvulnerability; } - - @Override - public boolean isJailsEnabled() - { - return config.getBoolean("enable-jails", true); - } } diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index befed005f..0ea692cc9 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -171,9 +171,6 @@ public class MetricsStarter implements Runnable metrics.start(); - } - catch (UnsupportedOperationException ex) - { } catch (Exception ex) { diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 3227322a8..70433b5b0 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -44,9 +44,6 @@ change-displayname: true # Don't forget to remove the # infront of the line #add-prefix-suffix: false -# Whether or not jails are activated -enable-jails: true - # The delay, in seconds, required between /home, /tp, etc. teleport-cooldown: 0 @@ -587,7 +584,7 @@ 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: '' -- cgit v1.2.3 From 75b7f7ac228e06c42cea3357bb649f8e8fc85f0b Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 15 Apr 2012 15:12:42 +0100 Subject: Fix metrics errors to be... descriptive. --- Essentials/src/com/earth2me/essentials/metrics/Metrics.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/metrics/Metrics.java b/Essentials/src/com/earth2me/essentials/metrics/Metrics.java index e009daa5d..f361e4f50 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/Metrics.java +++ b/Essentials/src/com/earth2me/essentials/metrics/Metrics.java @@ -223,7 +223,7 @@ public class Metrics } catch (IOException e) { - Bukkit.getLogger().log(Level.INFO, "[Metrics] {0}", e.getMessage()); + Bukkit.getLogger().log(Level.INFO, "[Metrics] " + e.getMessage()); } } }, 0, PING_INTERVAL * 1200); @@ -246,12 +246,12 @@ public class Metrics } catch (IOException ex) { - Bukkit.getLogger().log(Level.INFO, "[Metrics] {0}", ex.getMessage()); + Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage()); return true; } catch (InvalidConfigurationException ex) { - Bukkit.getLogger().log(Level.INFO, "[Metrics] {0}", ex.getMessage()); + Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage()); return true; } return configuration.getBoolean("opt-out", false); -- cgit v1.2.3 From 6dc2e965092afc4aea815ff473185831fcaf621c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 15 Apr 2012 22:00:13 +0100 Subject: Few missing default permissions. --- Essentials/src/config.yml | 2 ++ EssentialsGroupManager/src/globalgroups.yml | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 70433b5b0..ad49f43b6 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -107,6 +107,8 @@ player-commands: - balance - balance.others - balancetop + - chat.color + - chat.format - chat.shout - chat.question - clearinventory diff --git a/EssentialsGroupManager/src/globalgroups.yml b/EssentialsGroupManager/src/globalgroups.yml index 101e4d3c5..e8f51f2b1 100644 --- a/EssentialsGroupManager/src/globalgroups.yml +++ b/EssentialsGroupManager/src/globalgroups.yml @@ -118,6 +118,7 @@ groups: - essentials.chat.shout - essentials.chat.question - essentials.compass + - essentials.delhome - essentials.depth - essentials.getpos - essentials.home @@ -175,6 +176,7 @@ groups: - essentials.ext - essentials.fly - essentials.getpos + - essentials.getpos.others - essentials.helpop.recieve - essentials.home.others - essentials.invsee @@ -190,6 +192,7 @@ groups: - essentials.nick.others - essentials.realname - essentials.seen.banreason + - essentials.seen.extra - essentials.setwarp - essentials.signs.create.* - essentials.signs.break.* -- cgit v1.2.3 From d927d047650fdbc53d3993611c91d172397a77c8 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 15 Apr 2012 22:50:55 +0100 Subject: New config option 'cancel-afk-on-move' - Set to false you don't use afk. --- .../essentials/EssentialsPlayerListener.java | 47 ++++++++++++---------- .../src/com/earth2me/essentials/ISettings.java | 10 +++-- .../src/com/earth2me/essentials/Settings.java | 26 ++++++++++-- Essentials/src/config.yml | 5 +++ 4 files changed, 58 insertions(+), 30 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 51649a203..5cd09722a 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -72,37 +72,40 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerMove(final PlayerMoveEvent event) { - if (event.getFrom().getBlockX() == event.getTo().getBlockX() - && event.getFrom().getBlockZ() == event.getTo().getBlockZ() - && event.getFrom().getBlockY() == event.getTo().getBlockY()) + if ((!ess.getSettings().cancelAfkOnMove() && !ess.getSettings().getFreezeAfkPlayers()) + || event.getFrom().getBlockX() == event.getTo().getBlockX() + && event.getFrom().getBlockZ() == event.getTo().getBlockZ() + && event.getFrom().getBlockY() == event.getTo().getBlockY()) { return; } final User user = ess.getUser(event.getPlayer()); - - if (user.isAfk() && ess.getSettings().getFreezeAfkPlayers()) + if (user.isAfk()) { - final Location from = event.getFrom(); - final Location to = event.getTo().clone(); - to.setX(from.getX()); - to.setY(from.getY()); - to.setZ(from.getZ()); - try + if (ess.getSettings().getFreezeAfkPlayers()) { - event.setTo(Util.getSafeDestination(to)); + final Location from = event.getFrom(); + final Location to = event.getTo().clone(); + to.setX(from.getX()); + to.setY(from.getY()); + to.setZ(from.getZ()); + try + { + event.setTo(Util.getSafeDestination(to)); + } + catch (Exception ex) + { + event.setTo(to); + } + return; } - catch (Exception ex) + + final Location afk = user.getAfkPosition(); + if (afk == null || !event.getTo().getWorld().equals(afk.getWorld()) || afk.distanceSquared(event.getTo()) > 9) { - event.setTo(to); + user.updateActivity(true); } - return; - } - - final Location afk = user.getAfkPosition(); - if (afk == null || !event.getTo().getWorld().equals(afk.getWorld()) || afk.distanceSquared(event.getTo()) > 9) - { - user.updateActivity(true); } } @@ -346,7 +349,7 @@ public class EssentialsPlayerListener implements Listener break; case LEFT_CLICK_AIR: case LEFT_CLICK_BLOCK: - if (event.getItem() != null && event.getMaterial() != Material.AIR) + if (event.getItem() != null && event.getItem().getTypeId() != Material.AIR.getId()) { final User user = ess.getUser(event.getPlayer()); if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getTypeId())) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index 2c07ccd58..8eca8f06f 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -127,7 +127,7 @@ public interface ISettings extends IConf boolean removeGodOnDisconnect(); boolean changeDisplayName(); - + boolean changePlayerListName(); boolean isPlayerCommand(String string); @@ -146,6 +146,8 @@ public interface ISettings extends IConf boolean getFreezeAfkPlayers(); + boolean cancelAfkOnMove(); + boolean areDeathMessagesEnabled(); public void setDebug(boolean debug); @@ -165,12 +167,12 @@ public interface ISettings extends IConf EventPriority getRespawnPriority(); long getTpaAcceptCancellation(); - + boolean isMetricsEnabled(); - + void setMetricsEnabled(boolean metricsEnabled); long getTeleportInvulnerability(); - + boolean isTeleportInvulnerability(); } diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index c4b19601f..34a3fec03 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -385,6 +385,8 @@ public class Settings implements ISettings teleportInvulnerability = _isTeleportInvulnerability(); disableItemPickupWhileAfk = _getDisableItemPickupWhileAfk(); registerBackInListener = _registerBackInListener(); + cancelAfkOnMove = _cancelAfkOnMove(); + getFreezeAfkPlayers = _getFreezeAfkPlayers(); itemSpawnBl = _getItemSpawnBlacklist(); kits = _getKits(); chatFormats.clear(); @@ -654,12 +656,30 @@ public class Settings implements ISettings { return config.getLong("auto-afk-kick", -1); } + private boolean getFreezeAfkPlayers; @Override public boolean getFreezeAfkPlayers() + { + return getFreezeAfkPlayers; + } + + private boolean _getFreezeAfkPlayers() { return config.getBoolean("freeze-afk-players", false); } + private boolean cancelAfkOnMove; + + @Override + public boolean cancelAfkOnMove() + { + return cancelAfkOnMove; + } + + private boolean _cancelAfkOnMove() + { + return config.getBoolean("cancel-afk-on-move", true); + } @Override public boolean areDeathMessagesEnabled() @@ -691,20 +711,18 @@ public class Settings implements ISettings { return config.getBoolean("world-teleport-permissions", false); } - private boolean registerBackInListener; - + @Override public boolean registerBackInListener() { return registerBackInListener; } - + private boolean _registerBackInListener() { return config.getBoolean("register-back-in-listener", false); } - private boolean disableItemPickupWhileAfk; @Override diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index ad49f43b6..1ace8de29 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -272,6 +272,11 @@ freeze-afk-players: false # Enable this, when you don't want people idling in mob traps. disable-item-pickup-while-afk: true +# Should we automatically remove afk status when the player moves? +# Player will be removed from afk on chat/command reguardless of this setting. +# Disable this to reduce server lag. +cancel-afk-on-move: true + # You can disable the death messages of minecraft here death-messages: true -- cgit v1.2.3 From a97b3abca32cbca2b0413541fd21c4de7cc9b149 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 15 Apr 2012 23:13:34 +0100 Subject: Minor perf tweak. --- .../src/com/earth2me/essentials/EssentialsPlayerListener.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 5cd09722a..e75ac82d4 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -32,6 +32,8 @@ public class EssentialsPlayerListener implements Listener { private static final Logger LOGGER = Logger.getLogger("Minecraft"); private final transient IEssentials ess; + private static final int AIR = Material.AIR.getId(); + private static final int BED = Material.BED_BLOCK.getId(); public EssentialsPlayerListener(final IEssentials parent) { @@ -342,14 +344,14 @@ public class EssentialsPlayerListener implements Listener switch (event.getAction()) { case RIGHT_CLICK_BLOCK: - if (!event.isCancelled() && event.getClickedBlock().getTypeId() == Material.BED_BLOCK.getId() && ess.getSettings().getUpdateBedAtDaytime()) + if (!event.isCancelled() && event.getClickedBlock().getTypeId() == BED && ess.getSettings().getUpdateBedAtDaytime()) { event.getPlayer().setBedSpawnLocation(event.getClickedBlock().getLocation()); } break; case LEFT_CLICK_AIR: case LEFT_CLICK_BLOCK: - if (event.getItem() != null && event.getItem().getTypeId() != Material.AIR.getId()) + if (event.getItem() != null && event.getItem().getTypeId() != AIR) { final User user = ess.getUser(event.getPlayer()); if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getTypeId())) -- cgit v1.2.3 From 01ba8dbc3f90a3cb7d33d5b91de814ca12ae30ea Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 16 Apr 2012 10:18:18 +0100 Subject: Don't fire entity powertool commands, with our user object. --- .../earth2me/essentials/EssentialsEntityListener.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java index 029288530..829ef0313 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java @@ -32,18 +32,28 @@ public class EssentialsEntityListener implements Listener { final User defender = ess.getUser(eDefend); final User attacker = ess.getUser(eAttack); - if (attacker.hasInvulnerabilityAfterTeleport() || defender.hasInvulnerabilityAfterTeleport()) { + if (attacker.hasInvulnerabilityAfterTeleport() || defender.hasInvulnerabilityAfterTeleport()) + { event.setCancelled(true); } attacker.updateActivity(true); final List commandList = attacker.getPowertool(attacker.getItemInHand()); if (commandList != null && !commandList.isEmpty()) { - for (String command : commandList) + for (final String command : commandList) { if (command != null && !command.isEmpty()) { - attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", defender.getName())); + ess.scheduleSyncDelayedTask( + new Runnable() + { + @Override + public void run() + { + attacker.getServer().dispatchCommand(attacker.getBase(), command.replaceAll("\\{player\\}", defender.getName())); + } + }); + event.setCancelled(true); return; } -- cgit v1.2.3 From 327a57de3c77a4adcc5d6cc75807d6fc3ca1fdaf Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 16 Apr 2012 10:33:51 +0100 Subject: Fixing a few TL issues. --- Essentials/src/messages.properties | 12 ++++++------ Essentials/src/messages_en.properties | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 92e436f0b..2a6e37a3e 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -31,7 +31,7 @@ buildAlert=\u00a7cYou are not permitted to build bukkitFormatChanged=Bukkit version format changed. Version not checked. burnMsg=\u00a77You set {0} on fire for {1} seconds. canTalkAgain=\u00a77You can talk again -cantFindGeoIpDB=Can''t find GeoIP database! +cantFindGeoIpDB=Can't find GeoIP database! cantReadGeoIpDB=Failed to read GeoIP database! cantSpawnItem=\u00a7cYou are not allowed to spawn the item {0} chatTypeLocal=[L] @@ -137,7 +137,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 +invalidHome=Home {0} doesn''t exist invalidMob=Invalid mob type. invalidServer=Invalid server! invalidSignLine=Line {0} on sign is invalid. @@ -162,7 +162,7 @@ jailReleased=\u00a77Player \u00a7e{0}\u00a77 unjailed. jailReleasedPlayerNotify=\u00a77You have been released! jailSentenceExtended=Jail time extend to: {0) jailSet=\u00a77Jail {0} has been set -jumpError=That would hurt your computer''s brain. +jumpError=That would hurt your computer's brain. kickDefault=Kicked from server kickExempt=\u00a7cYou can not kick that person. kill=\u00a77Killed {0}. @@ -234,7 +234,7 @@ noMotd=\u00a7cThere is no message of the day. noNewMail=\u00a77You have no new mail. noPendingRequest=You do not have a pending request. noPerm=\u00a7cYou do not have the \u00a7f{0}\u00a7c permission. -noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob. +noPermToSpawnMob=\u00a7cYou don't have permission to spawn this mob. noPlacePermission=\u00a7cYou do not have permission to place a block near that sign. noPowerTools=You have no power tools assigned. noRules=\u00a7cThere are no rules specified yet. @@ -257,7 +257,7 @@ orderBalances=Ordering balances of {0} users, please wait ... pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. -pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. +pTimeOthersPermission=\u00a7cYou are not authorized to set other players' time. pTimePlayers=These players have their own time: pTimeReset=Player time has been reset for: \u00a7e{0} pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} @@ -277,7 +277,7 @@ playerNotFound=\u00a7cPlayer not found. playerUnmuted=\u00a77You have been unmuted pong=Pong! possibleWorlds=\u00a77Possible worlds are the numbers 0 through {0}. -powerToolAir=Command can''t be attached to air. +powerToolAir=Command can't be attached to air. powerToolAlreadySet=Command \u00a7c{0}\u00a7f is already assigned to {1}. powerToolAttach=\u00a7c{0}\u00a7f command assigned to {1}. powerToolClearAll=All powertool commands have been cleared. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 20e6e6a12..2a6e37a3e 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -31,7 +31,7 @@ buildAlert=\u00a7cYou are not permitted to build bukkitFormatChanged=Bukkit version format changed. Version not checked. burnMsg=\u00a77You set {0} on fire for {1} seconds. canTalkAgain=\u00a77You can talk again -cantFindGeoIpDB=Can''t find GeoIP database! +cantFindGeoIpDB=Can't find GeoIP database! cantReadGeoIpDB=Failed to read GeoIP database! cantSpawnItem=\u00a7cYou are not allowed to spawn the item {0} chatTypeLocal=[L] @@ -137,7 +137,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 +invalidHome=Home {0} doesn''t exist invalidMob=Invalid mob type. invalidServer=Invalid server! invalidSignLine=Line {0} on sign is invalid. @@ -162,7 +162,7 @@ jailReleased=\u00a77Player \u00a7e{0}\u00a77 unjailed. jailReleasedPlayerNotify=\u00a77You have been released! jailSentenceExtended=Jail time extend to: {0) jailSet=\u00a77Jail {0} has been set -jumpError=That would hurt your computer''s brain. +jumpError=That would hurt your computer's brain. kickDefault=Kicked from server kickExempt=\u00a7cYou can not kick that person. kill=\u00a77Killed {0}. @@ -234,7 +234,7 @@ noMotd=\u00a7cThere is no message of the day. noNewMail=\u00a77You have no new mail. noPendingRequest=You do not have a pending request. noPerm=\u00a7cYou do not have the \u00a7f{0}\u00a7c permission. -noPermToSpawnMob=\u00a7cYou don''t have permission to spawn this mob. +noPermToSpawnMob=\u00a7cYou don't have permission to spawn this mob. noPlacePermission=\u00a7cYou do not have permission to place a block near that sign. noPowerTools=You have no power tools assigned. noRules=\u00a7cThere are no rules specified yet. @@ -244,7 +244,7 @@ notAllowedToQuestion=\u00a7cYou are not authorized to use question. notAllowedToShout=\u00a7cYou are not authorized to shout. notEnoughExperience=You do not have enough experience. notEnoughMoney=You do not have sufficient funds. -notRecommendedBukkit=* ! * Bukkit version is not the recommended build for Essentials. +notRecommendedBukkit= * ! * Bukkit version is not the recommended build for Essentials. notSupportedYet=Not supported yet. nothingInHand = \u00a7cYou have nothing in your hand. now=now @@ -257,7 +257,7 @@ orderBalances=Ordering balances of {0} users, please wait ... pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. -pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. +pTimeOthersPermission=\u00a7cYou are not authorized to set other players' time. pTimePlayers=These players have their own time: pTimeReset=Player time has been reset for: \u00a7e{0} pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} @@ -277,7 +277,7 @@ playerNotFound=\u00a7cPlayer not found. playerUnmuted=\u00a77You have been unmuted pong=Pong! possibleWorlds=\u00a77Possible worlds are the numbers 0 through {0}. -powerToolAir=Command can''t be attached to air. +powerToolAir=Command can't be attached to air. powerToolAlreadySet=Command \u00a7c{0}\u00a7f is already assigned to {1}. powerToolAttach=\u00a7c{0}\u00a7f command assigned to {1}. powerToolClearAll=All powertool commands have been cleared. @@ -286,7 +286,7 @@ powerToolListEmpty={0} has no commands assigned. powerToolNoSuchCommandAssigned=Command \u00a7c{0}\u00a7f has not been assigned to {1}. powerToolRemove=Command \u00a7c{0}\u00a7f removed from {1}. powerToolRemoveAll=All commands removed from {0}. -powerToolsDisabled=All of your power tools have been enabled. +powerToolsDisabled=All of your power tools have been disabled. powerToolsEnabled=All of your power tools have been enabled. protectionOwner=\u00a76[EssentialsProtect] Protection owner: {0} questionFormat=\u00a77[Question]\u00a7f {0} @@ -301,7 +301,7 @@ repairNone=There were no items that needing repairing. requestAccepted=\u00a77Teleport request accepted. requestAcceptedFrom=\u00a77{0} accepted your teleport request. requestDenied=\u00a77Teleport request denied. -requestDeniedFrom=\u00a77{0} denied your teleport request +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://dl.bukkit.org/downloads/craftbukkit/ @@ -358,7 +358,7 @@ timeSetPermission=\u00a7cYou are not authorized to set the time. timeWorldCurrent=The current time in {0} is \u00a73{1} timeWorldSet=The time was set to {0} in: \u00a7c{1} tradeCompleted=\u00a77Trade completed. -tradeSignEmpty=The trade sign does not have enough supply left. +tradeSignEmpty=The trade sign has nothing available for you. tradeSignEmptyOwner=There is nothing to collect from this trade sign. treeFailure=\u00a7cTree generation failure. Try again on grass or dirt. treeSpawned=\u00a77Tree spawned. @@ -389,7 +389,7 @@ versionMismatch=Version mismatch! Please update {0} to the same version. versionMismatchAll=Version mismatch! Please update all Essentials jars to the same version. voiceSilenced=\u00a77Your voice has been silenced warpDeleteError=Problem deleting the warp file. -warpListPermission=\u00a7cYou do not have Permission to list that warps. +warpListPermission=\u00a7cYou do not have Permission to list warps. warpNotExist=That warp does not exist. warpOverwrite=\u00a7cYou cannot overwrite that warp. warpSet=\u00a77Warp {0} set. -- cgit v1.2.3 From 8eb7428ad1acd923a3ccf5a6aafc2200a636fc55 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 16 Apr 2012 19:43:53 +1000 Subject: Do we have to remind @khobbits not to code while drunk. Again. --- Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java index 829ef0313..9c8fa0707 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java @@ -62,7 +62,7 @@ public class EssentialsEntityListener implements Listener } else if (eDefend instanceof Animals && eAttack instanceof Player) { - final User player = ess.getUser(eAttack); + final Player player = (Player)eAttack; final ItemStack hand = player.getItemInHand(); if (hand != null && hand.getType() == Material.MILK_BUCKET) { -- cgit v1.2.3 From 6919b52f615178566fbb336ade6cddd4da1f75e3 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 16 Apr 2012 21:42:53 +0100 Subject: Null check, for quick exit. --- .../earth2me/essentials/protect/EssentialsProtectEntityListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index 1868e20c1..7e558eb81 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -194,7 +194,7 @@ public class EssentialsProtectEntityListener implements Listener @EventHandler(priority = EventPriority.HIGHEST) public void onEntityExplode(final EntityExplodeEvent event) { - if (event.isCancelled()) + if (event.isCancelled() || event.getEntity() == null) { return; } -- cgit v1.2.3 From da857895fc2eea8449c98c64719fe1e32f54c80c Mon Sep 17 00:00:00 2001 From: ElgarL Date: Mon, 16 Apr 2012 23:54:33 +0100 Subject: Re-initialize the WorldsHolder on a reload, as un-registering and re-registering a new holder means all plugins have to check for the new service on every quiery. --- EssentialsGroupManager/src/Changelog.txt | 3 +- .../org/anjocaido/groupmanager/GroupManager.java | 96 ++++++++++++++-------- .../dataholder/worlds/WorldsHolder.java | 11 ++- 3 files changed, 72 insertions(+), 38 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index f900d5aa9..fcdc1ed9d 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -179,4 +179,5 @@ v 2.0: - Unregister the worldsHolder as a service on a reload/shutdown instead of the whole plugin. - Update all code formatting to use tabs for indentation. - Stop using our own deprecated methods as we tell others to do. - - Finally remove all deprecated methods. \ No newline at end of file + - Finally remove all deprecated methods. + - Re-initialize the WorldsHolder on a reload, as un-registering and re-registering a new holder means all plugins have to check for the new service on every quiery. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index df46b70d0..3da9666c3 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -56,25 +56,7 @@ public class GroupManager extends JavaPlugin { private Map selectedWorlds = new HashMap(); private WorldsHolder worldsHolder; private boolean validateOnlinePlayer = true; - - private String lastError = ""; - - /** - * @return the validateOnlinePlayer - */ - public boolean isValidateOnlinePlayer() { - - return validateOnlinePlayer; - } - - /** - * @param validateOnlinePlayer the validateOnlinePlayer to set - */ - public void setValidateOnlinePlayer(boolean validateOnlinePlayer) { - - this.validateOnlinePlayer = validateOnlinePlayer; - } - + private static boolean isLoaded = false; protected GMConfiguration config; @@ -89,13 +71,28 @@ public class GroupManager extends JavaPlugin { private OverloadedWorldHolder dataHolder = null; private AnjoPermissionsHandler permissionHandler = null; + private String lastError = ""; + @Override public void onDisable() { + + onDisable(false); + } + + @Override + public void onEnable() { + + onEnable(false); + } + + public void onDisable(boolean restarting) { setLoaded(false); - // Unregister this service. - this.getServer().getServicesManager().unregister(this.worldsHolder); + if (!restarting) { + // Unregister this service if we are shutting down. + this.getServer().getServicesManager().unregister(this.worldsHolder); + } disableScheduler(); // Shutdown before we save, so it doesn't interfere. if (worldsHolder != null) { @@ -118,18 +115,26 @@ public class GroupManager extends JavaPlugin { // EXAMPLE: Custom code, here we just output some info so we can check that all is well PluginDescriptionFile pdfFile = this.getDescription(); System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is disabled!"); - GroupManager.logger.removeHandler(ch); + + if (!restarting) + GroupManager.logger.removeHandler(ch); } - - @Override - public void onEnable() { + + public void onEnable(boolean restarting) { try { + /* + * reset local variables. + */ + overloadedUsers = new HashMap>(); + selectedWorlds = new HashMap(); lastError = ""; - - GroupManager.logger.setUseParentHandlers(false); - ch = new GMLoggerHandler(); - GroupManager.logger.addHandler(ch); + + if (!restarting) { + GroupManager.logger.setUseParentHandlers(false); + ch = new GMLoggerHandler(); + GroupManager.logger.addHandler(ch); + } logger.setLevel(Level.ALL); // Create the backup folder, if it doesn't exist. @@ -138,7 +143,11 @@ public class GroupManager extends JavaPlugin { prepareConfig(); // Load the global groups globalGroups = new GlobalGroups(this); - worldsHolder = new WorldsHolder(this); + + if (!restarting) + worldsHolder = new WorldsHolder(this); + else + worldsHolder.resetWorldsHolder(); PluginDescriptionFile pdfFile = this.getDescription(); if (worldsHolder == null) { @@ -169,7 +178,9 @@ public class GroupManager extends JavaPlugin { System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!"); // Register as a service - this.getServer().getServicesManager().register(WorldsHolder.class, this.worldsHolder, this, ServicePriority.Lowest); + if (!restarting) + this.getServer().getServicesManager().register(WorldsHolder.class, this.worldsHolder, this, ServicePriority.Lowest); + } catch (Exception ex) { /* @@ -222,6 +233,22 @@ public class GroupManager extends JavaPlugin { } } + + /** + * @return the validateOnlinePlayer + */ + public boolean isValidateOnlinePlayer() { + + return validateOnlinePlayer; + } + + /** + * @param validateOnlinePlayer the validateOnlinePlayer to set + */ + public void setValidateOnlinePlayer(boolean validateOnlinePlayer) { + + this.validateOnlinePlayer = validateOnlinePlayer; + } public static boolean isLoaded() { @@ -1633,11 +1660,10 @@ public class GroupManager extends JavaPlugin { */ /* - * Reset the last error as we are attempting a fresh load. + * Attempting a fresh load. */ - lastError = ""; - onDisable(); - onEnable(); + onDisable(true); + onEnable(true); sender.sendMessage("All settings and worlds were reloaded!"); } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java index 37d0a8430..a9ab4befa 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java @@ -57,12 +57,19 @@ public class WorldsHolder { public WorldsHolder(GroupManager plugin) { this.plugin = plugin; + resetWorldsHolder(); + } + + public void resetWorldsHolder() { + + mirrorsGroup = new HashMap(); + mirrorsUser = new HashMap(); + // Setup folders and check files exist for the primary world verifyFirstRun(); initialLoad(); - if (serverDefaultWorldName == null) { + if (serverDefaultWorldName == null) throw new IllegalStateException("There is no default group! OMG!"); - } } private void initialLoad() { -- cgit v1.2.3 From 6d06636bc244e898ee6e1e789973d5cb456b7cf7 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 17 Apr 2012 00:53:57 +0100 Subject: Wrong default value for AFK disable pickup. --- Essentials/src/com/earth2me/essentials/Settings.java | 2 +- Essentials/src/config.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 34a3fec03..5d49c52b8 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -733,7 +733,7 @@ public class Settings implements ISettings private boolean _getDisableItemPickupWhileAfk() { - return config.getBoolean("disable-item-pickup-while-afk", true); + return config.getBoolean("disable-item-pickup-while-afk", false); } @Override diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 1ace8de29..c7c9decb0 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -270,7 +270,7 @@ freeze-afk-players: false # When the player is afk, should he be able to pickup items? # Enable this, when you don't want people idling in mob traps. -disable-item-pickup-while-afk: true +disable-item-pickup-while-afk: false # Should we automatically remove afk status when the player moves? # Player will be removed from afk on chat/command reguardless of this setting. -- cgit v1.2.3 From 4a29dd4c9cf911dc8034d683da6e3bf882ebeee4 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 17 Apr 2012 01:14:07 +0100 Subject: Don't get the Essentials user object when we don't need it. --- .../earth2me/essentials/EssentialsPlayerListener.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index e75ac82d4..f48138e4d 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -296,26 +296,27 @@ public class EssentialsPlayerListener implements Listener }); } } + private final static List COMMANDS = Arrays.asList("msg", "r", "mail", "m", "t", "emsg", "tell", "er", "reply", "ereply", "email"); @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event) { - final User user = ess.getUser(event.getPlayer()); + final Player player = event.getPlayer(); final String cmd = event.getMessage().toLowerCase(Locale.ENGLISH).split(" ")[0].replace("/", "").toLowerCase(Locale.ENGLISH); - final List commands = Arrays.asList("msg", "r", "mail", "m", "t", "emsg", "tell", "er", "reply", "ereply", "email"); - if (commands.contains(cmd)) + if (COMMANDS.contains(cmd)) { - for (Player player : ess.getServer().getOnlinePlayers()) + for (Player onlinePlayer : ess.getServer().getOnlinePlayers()) { - final User spyer = ess.getUser(player); - if (spyer.isSocialSpyEnabled() && !user.equals(spyer)) + final User spyer = ess.getUser(onlinePlayer); + if (spyer.isSocialSpyEnabled() && !player.equals(onlinePlayer)) { - player.sendMessage(user.getDisplayName() + " : " + event.getMessage()); + onlinePlayer.sendMessage(player.getDisplayName() + " : " + event.getMessage()); } } } - if (!cmd.equalsIgnoreCase("afk")) + else if (!cmd.equalsIgnoreCase("afk")) { + final User user = ess.getUser(player); user.updateActivity(true); } } -- cgit v1.2.3 From 6ac8abdac85e85b30aac1e94b4326cc52c41bf39 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Tue, 17 Apr 2012 18:57:11 +0100 Subject: Fix a couple of perms in GlobalGroups --- EssentialsGroupManager/src/globalgroups.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/globalgroups.yml b/EssentialsGroupManager/src/globalgroups.yml index fa8808e00..a08f9600e 100644 --- a/EssentialsGroupManager/src/globalgroups.yml +++ b/EssentialsGroupManager/src/globalgroups.yml @@ -212,13 +212,14 @@ groups: g:towny_default: permissions: - towny.chat.general + - towny.chat.local g:towny_builder: permissions: - towny.town.* - towny.nation.* - - towny.chat.tc - - towny.chat.nc + - towny.chat.town + - towny.chat.nation - towny.wild.build.6 - towny.wild.destroy.6 - towny.wild.destroy.14 -- cgit v1.2.3 From 507ecc47b6c87c4e53282ea3afe78bc44a36b550 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 18 Apr 2012 00:37:44 +0100 Subject: Switch the order of the alt give syntax to follow vanilla order. --- Essentials/src/com/earth2me/essentials/commands/Commandgive.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java index 106efa6e9..21903e98b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java @@ -46,9 +46,9 @@ public class Commandgive extends EssentialsCommand final User giveTo = getPlayer(server, args, 0); if (args.length > 3 && Util.isInt(args[2]) && Util.isInt(args[3])) - { - stack.setDurability(Short.parseShort(args[2])); - stack.setAmount(Integer.parseInt(args[3])); + { + stack.setAmount(Integer.parseInt(args[2])); + stack.setDurability(Short.parseShort(args[3])); } else if (args.length > 2 && Integer.parseInt(args[2]) > 0) { -- cgit v1.2.3 From 8da3b490d912f63737425cd1e191a9e09f88ebc0 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Wed, 18 Apr 2012 01:30:14 +0100 Subject: Slightly widen block break protection on protected signs (still does not block chain breaks). --- .../essentials/signs/SignBlockListener.java | 23 ++++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java index 79e5bf2be..ccd40b214 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignBlockListener.java @@ -57,23 +57,20 @@ public class SignBlockListener implements Listener } } } - else + // prevent any signs be broken by destroying the block they are attached to + if (EssentialsSign.checkIfBlockBreaksSigns(block)) { - // prevent any signs be broken by destroying the block they are attached to - if (EssentialsSign.checkIfBlockBreaksSigns(block)) + LOGGER.log(Level.INFO, "Prevented that a block was broken next to a sign."); + return true; + } + for (EssentialsSign sign : ess.getSettings().enabledSigns()) + { + if (sign.getBlocks().contains(block.getType()) + && !sign.onBlockBreak(block, player, ess)) { - LOGGER.log(Level.INFO, "Prevented that a block was broken next to a sign."); + LOGGER.log(Level.INFO, "A block was protected by a sign."); return true; } - for (EssentialsSign sign : ess.getSettings().enabledSigns()) - { - if (sign.getBlocks().contains(block.getType()) - && !sign.onBlockBreak(block, player, ess)) - { - LOGGER.log(Level.INFO, "A block was protected by a sign."); - return true; - } - } } return false; } -- cgit v1.2.3 From cd7bf5eff2a1daeb9ad792820265c70ff8b3e0dc Mon Sep 17 00:00:00 2001 From: ElgarL Date: Wed, 18 Apr 2012 22:22:35 +0100 Subject: Prevent null perms getting past the GlobalGroups loader. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GlobalGroups.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index fcdc1ed9d..e321c7741 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -180,4 +180,5 @@ v 2.0: - Update all code formatting to use tabs for indentation. - Stop using our own deprecated methods as we tell others to do. - Finally remove all deprecated methods. - - Re-initialize the WorldsHolder on a reload, as un-registering and re-registering a new holder means all plugins have to check for the new service on every quiery. \ No newline at end of file + - Re-initialize the WorldsHolder on a reload, as un-registering and re-registering a new holder means all plugins have to check for the new service on every quiery. + - Prevent null perms getting past the GlobalGroups loader. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java index 647d729e5..04d9e86be 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GlobalGroups.java @@ -159,12 +159,14 @@ public class GlobalGroups { if (element instanceof List) { try { for (String node : (List) element) { - newGroup.addPermission(node); + if ((node != null) && !node.isEmpty()) + newGroup.addPermission(node); } } catch (ClassCastException ex) { throw new IllegalArgumentException("Invalid permission node for global group: " + groupName, ex); } } else if (element instanceof String) { + if ((element != null) && !((String)element).isEmpty()) newGroup.addPermission((String) element); } else throw new IllegalArgumentException("Unknown type of permission node for global group: " + groupName); -- cgit v1.2.3 From 3cc1a462f502e6789e5871130d0d2566b3e99de5 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 20 Apr 2012 22:31:25 +0100 Subject: Remove stack trace cleaning, didn't actually remove unwanted elements. --- Essentials/src/com/earth2me/essentials/Essentials.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 5a82a9fb1..6197f5edd 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -42,6 +42,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Server; import org.bukkit.World; @@ -241,7 +242,7 @@ public class Essentials extends JavaPlugin implements IEssentials getScheduler().scheduleSyncRepeatingTask(this, timer, 1, 100); Economy.setEss(this); execTimer.mark("RegListeners"); - + final MetricsStarter metricsStarter = new MetricsStarter(this); if (metricsStarter.getStart() != null && metricsStarter.getStart() == true) { @@ -304,20 +305,7 @@ public class Essentials extends JavaPlugin implements IEssentials } catch (final Exception ex) { - final ArrayList elements = new ArrayList(Arrays.asList(ex.getStackTrace())); - elements.remove(0); - final ArrayList toRemove = new ArrayList(); - for (final StackTraceElement e : elements) - { - if (e.getClassName().equals("com.earth2me.essentials.Essentials")) - { - toRemove.add(e); - } - } - elements.removeAll(toRemove); - final StackTraceElement[] trace = elements.toArray(new StackTraceElement[elements.size()]); - ex.setStackTrace(trace); - ex.printStackTrace(); + Bukkit.getLogger().log(Level.SEVERE, ex.getMessage(), ex); sender.sendMessage(ChatColor.RED + "An internal error occurred while attempting to perform this command"); return true; } -- cgit v1.2.3 From 4e10470acd507e41c1df334ae4489dc34fd4c308 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 21 Apr 2012 02:32:02 +0100 Subject: Remove unneeded dependency of craftbukkit (Eclipse building) --- EssentialsGroupManager/.classpath | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EssentialsGroupManager/.classpath b/EssentialsGroupManager/.classpath index 61f808b2d..bc8106503 100644 --- a/EssentialsGroupManager/.classpath +++ b/EssentialsGroupManager/.classpath @@ -2,6 +2,6 @@ - + -- cgit v1.2.3 From 3d9022d8fabd336c50b337cf17b41c0d9819fde3 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 21 Apr 2012 02:32:37 +0100 Subject: remove unneeded dependency of craftbukkit --- EssentialsGroupBridge/.classpath | 1 - EssentialsGroupBridge/.project | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/EssentialsGroupBridge/.classpath b/EssentialsGroupBridge/.classpath index 9330eb06e..ebd606dca 100644 --- a/EssentialsGroupBridge/.classpath +++ b/EssentialsGroupBridge/.classpath @@ -3,7 +3,6 @@ - diff --git a/EssentialsGroupBridge/.project b/EssentialsGroupBridge/.project index 0780b7dbb..2ea0b05e1 100644 --- a/EssentialsGroupBridge/.project +++ b/EssentialsGroupBridge/.project @@ -10,6 +10,16 @@ + + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, + + + LaunchConfigHandle + <project>/.externalToolBuilders/GroupBridge.launch + + + org.eclipse.jdt.core.javanature -- cgit v1.2.3 From a21b5fac76958a13fa067bfc452415d3885fc553 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 21 Apr 2012 02:33:13 +0100 Subject: updated classpath (eclipse) for teh whole project --- .classpath | 1 - 1 file changed, 1 deletion(-) diff --git a/.classpath b/.classpath index 0683da590..db361119a 100644 --- a/.classpath +++ b/.classpath @@ -3,6 +3,5 @@ - -- cgit v1.2.3 From a50b74bb3605f3b0ba475727c0ed9416ca754aad Mon Sep 17 00:00:00 2001 From: mdojcar Date: Sat, 21 Apr 2012 09:35:59 +0300 Subject: 0.2 version: optimized by mdojcar (modojcar@seznam.cz) - mirne fixy a trochu jsem preklad vylepsil --- Essentials/src/messages_cs.properties | 164 +++++++++++++++++----------------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index 85364f185..c680e5e90 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -1,60 +1,61 @@ #version: TeamCity # Single quotes have to be doubled: '' # Translations start here -# by: tomasara413 - Tento preklad neni 100% presny to se opravi v dalsich verzich prekladu +# 0.1 version: tomasara413 - Tento preklad neni 100% presny to se opravi v dalsich verzich prekladu +# 0.2 version: optimized by mdojcar (modojcar@seznam.cz) - mirne fixy a trochu jsem preklad vylepsil +# nektere vyrazy jako "Kicknut" jsou v anglickem zneni (zni to mnohem prirozeneji) action=* {0} {1} addedToAccount=\u00a7a{0} byl p\u00f8id\u00e1n na tvuj ucet. addedToOthersAccount=\u00a7a{0} bylo pridano na ucet hrace {1}\u00a7a. Novy obnos: {2} -alertBroke=Zlomeno: +alertBroke=Zniceno: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} na: {3} alertPlaced=Polozeno: alertUsed=Pouzito: -autoAfkKickReason=BYls kopnut pro {0} minut AFK. -backAfterDeath=\u00a77Pouzij prokaz /back pro navraceni do mista umrti. -backUsageMsg=\u00a77Navraceni do puvodni lokace. -backupDisabled=An external backup script has not been configured. +autoAfkKickReason=Byls Kicknut pro {0} minut AFK. +backAfterDeath=\u00a77Zadej príkaz /back pro návrat do místa umrtí. +backUsageMsg=\u00a77Navrácení na puvodní místo. +backupDisabled=Nebyl konfigurovan externi skript! backupFinished=Zaloha ukoncena backupStarted=Probiha zaloha balance=\u00a77Obnos: {0} balanceTop=\u00a77Nejvyssi obnosy ({0}) banExempt=\u00a7cNemuzes zabanovat tohoto hrace. -banIpAddress=\u00a77IP zabanovana -bannedIpsFileError=Chyba pri cteni banned-ips.txt -bannedIpsFileNotFound=Soubor banned-ips.txt nenalezen -bannedPlayersFileError=Chyba pri cteni banned-players.txt -bannedPlayersFileNotFound=Soubor banned-players.txt nenalezen -bigTreeFailure=\u00a7cGenerovani velkeho stromu selhalo. Zopakuj na hline ci trave. +banIpAddress=\u00a77IP byla zabanována! +bannedIpsFileError=Chyba pri cteni souboru banned-ips.txt +bannedIpsFileNotFound=Soubor banned-ips.txt neexistuje! +bannedPlayersFileError=Chyba pri cteni souboru banne neexistuje! +bigTreeFailure=\u00a7cSpawn velkeho stromu selhal. Zopakuj na hline ci trave. bigTreeSuccess= \u00a77Velky strom vygenerovan. blockList=Essentials predavaji tyto prikazy do jin\u00e9ho pluginu: broadcast=[\u00a7cPrenos\u00a7f]\u00a7a {0} buildAlert=\u00a7cNemate opravneni stavet -bukkitFormatChanged=Verze bukkitu je zmnenena. Verze neni kontrolovana. +bukkitFormatChanged=Verze Bukkitu byla zmnenena. Verze neni kontrolována. burnMsg=\u00a77Nastavils {0} do ohne po {1} sekund. -canTalkAgain=\u00a77Ted nemuzes mluvit +canTalkAgain=\u00a77Prave nemuzes psat! cantFindGeoIpDB=Nelze najit GeoIP databazi! cantReadGeoIpDB=Nelze precist GeoIP databazi! -cantSpawnItem=\u00a7cNemas povoleno davat si {0} +cantSpawnItem=\u00a7cNemas povolen item: {0} chatTypeLocal=[L] chatTypeSpy=[Spy] -commandFailed=Prikaz {0} selhal: +commandFailed=Prikaz {0} nemohl byt proveden: commandHelpFailedForPlugin=Chyba pri ziskavani napovedy: {0} commandNotLoaded=\u00a7cPrikaz {0} je nezpravne nacten. compassBearing=\u00a77Lozisko: {0} ({1} stupnu). configFileMoveError=Premistovani config.yml do zalohove lokace selhalo. configFileRenameError=Selhalo prejmenovavani souboru config.yml -connectedPlayers=Pripojeni hraci: +connectedPlayers=Pripojení hraci: connectionFailed=Nepodarilo se otevrit spojeni. cooldownWithMessage=\u00a7cPrestavka: {0} -corruptNodeInConfig=\u00a74Poznamka: vas konfiguracni soubor je poskozeny na {0} radku. +corruptNodeInConfig=\u00a74Poznamka: Konfiguracni soubor je poskozeny na {0} radku. couldNotFindTemplate=Nelze najit sablonu {0} creatingConfigFromTemplate=Vytvari se nastaveni podle sablony: {0} creatingEmptyConfig=Vytvari se prazdne nastaveni: {0} -creative=kreativ +creative=neomezeny currency={0}{1} currentWorld=Current World: {0} day=den days=dny -defaultBanReason=Ban promluvil! +defaultBanReason=Byl jste zabanován adminem! deleteFileError=Nelze smazat soubor: {0} deleteHome=\u00a77Domov {0} byl odstranen. deleteJail=\u00a77Veznice {0} byla odstranena. @@ -66,10 +67,10 @@ dependancyNotFound=[Essentials] Doporucena zavyslost nenalezena, nyni se stahuje depth=\u00a77Jsi na urovni more. depthAboveSea=\u00a77Jsi {0} bloku nad urovni more. depthBelowSea=\u00a77Jsi {0} bloku pod urovni more. -destinationNotSet=Destinace neni nastavena -disableUnlimited=\u00a77Zakazano neomoezene staveni {0} pro {1}. -disabled=Zakazano -disabledToSpawnMob=Spawnovani tohoto zivocicha neni povolane v souboru config.yml. +destinationNotSet=Destinace není nastavena +disableUnlimited=\u00a77Zakázano neomezene staveni {0} pro {1}. +disabled=Zakázáno +disabledToSpawnMob=Spawnovani tohoto moba není dovoleno v config.yml. dontMoveMessage=\u00a77Teleportuje vas za {0}. Nehybejte se. downloadingGeoIp=Stahovani GeoIP databaze ... to muze chvili trvat (zeme: 0.6 MB, mesto: 20MB) duplicatedUserdata=Duplicicitni uzivatelska data: {0} a {1} @@ -90,7 +91,7 @@ extinguishOthers=\u00a77Jsi uhasen {0}. failedToCloseConfig=Selhalo zavirani nastaveni {0} failedToCreateConfig=Selhalo vytvareni nastaveni {0} failedToWriteConfig=Selhalo psani nastaveni {0} -false=falesny +false=Neaktivní feed=\u00a77Tvuj apetit byl zasycen. feedOther=\u00a77Nasytils hrace {0}. fileRenameError=Prejmenovavani souboru {0} selhalo @@ -160,66 +161,66 @@ jailMessage=\u00a7cUdelal jste zlocin, tak si dejte na cas. jailNotExist=Tato veznice neexistuje. jailReleased=\u00a77Hrac \u00a7e{0}\u00a77 propusten. jailReleasedPlayerNotify=\u00a77Byls propusten! -jailSentenceExtended=Cas ve vezeni prodlouzen na: {0) -jailSet=\u00a77Vezeni {0} nastaveno +jailSentenceExtended=Trest prodlouzen na: {0) +jailSet=\u00a77Doba uvezneni hrace {0} nastavena! jumpError=Toto poskodi mozek vaseho pocitace. -kickDefault=Kopnut ze serveru! -kickExempt=\u00a7cNemuzes kopnout tuto osobu. +kickDefault=Byl jste kicknut adminem serveru! +kickExempt=\u00a7cNemuzes kicknout tuto osobu. kill=\u00a77Zabito {0}. kitError2=\u00a7cTato sada neexistuje nebo neni uplne definovana. kitError=\u00a7cToto neni platna sada. -kitErrorHelp=\u00a7cNechybi polozka v konfiguraci? +kitErrorHelp=\u00a7cPravdepodobne chybi polozka v konfiguraci. kitGive=\u00a77Davani sady {0}. kitInvFull=\u00a7cTvuj inventar je plny, umistuji sadu na podlahu. kitTimed=\u00a7cNemuzete pouzit sadu pro jinou {0}. kits=\u00a77Sady: {0} lightningSmited=\u00a77Byls sejmut -lightningUse=\u00a77Sejimani {0} +lightningUse=\u00a77Blesk seslan na {0} listAfkTag = \u00a77[AFK]\u00a7f listAmount = \u00a79Jsou tam \u00a7c{0}\u00a79 vsichni ze maximalniho poctu \u00a7c{1}\u00a79 hracu online. listAmountHidden = \u00a79Jsou tam, \u00a7c{0}\u00a77/{1}\u00a79 vsichni z maximalniho poctu \u00a7c{2}\u00a79 hracu online. listGroupTag={0}\u00a7f: listHiddenTag = \u00a77[HIDDEN]\u00a7f -loadWarpError=Selhalo nacitani warpu {0} +loadWarpError=Selhalo nactení warpu {0} localFormat=Lokalni: <{0}> {1} mailClear=\u00a7cPro oznaceni prectenyh zprav, typ /mail clear mailCleared=\u00a77Schranka vyprazdnena! mailSent=\u00a77Zprava odeslana! -markMailAsRead=\u00a7cPro oznaceni prectenych zprav, typ /mail clear +markMailAsRead=\u00a7cPro oznaceni zpravy za prectenou, zadejte /mail clear markedAsAway=\u00a77Nyni mate ozna\u00e8eno. markedAsNotAway=\u00a77Nyni nemate ozna\u00e8eno. maxHomes=Nelze nastavit vice nez {0} domovu. -mayNotJail=\u00a7cNemuzes zajmout tuto osobu +mayNotJail=\u00a7cNemuzes uveznit tuto osobu me=ja minute=minuta minutes=minuty missingItems=Nemate {0}x {1}. -missingPrefixSuffix=Chybi predpone nebo pripona pro {0} -mobSpawnError=Chyba pri mneneni mob spawneru. -mobSpawnLimit=Mnozstvi zivocichu bylo omezeno na limit serveru +missingPrefixSuffix=Chybi Suffix ci Prefix pro {0} +mobSpawnError=Chyba pri zmnene mob spawneru. +mobSpawnLimit=Mnozstvi mobu bylo omezeno na limit serveru mobSpawnTarget=Cilovy blok musi byt mob spawner. mobsAvailable=\u00a77Zivocichove: {0} moneyRecievedFrom=\u00a7a{0} nebyla prijata {1} moneySentTo=\u00a7a{0} byla odeslana {1} -moneyTaken={0} prevzato z vaseho bankovniho ucty. -month=mesic -months=mesice -moreThanZero=Mnozstvi musi byt vetsi nez 0. +moneyTaken={0} odesláno z vaseho bankovniho uctu. +month=mesíc +months=mesíce +moreThanZero=Mnozství musi byt vetsí nez 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} -muteExempt=\u00a7cZtlumils tohoto hrace. -mutedPlayer=Hrac {0} ztlumen. -mutedPlayerFor=Hrac {0} ztlumen po dobu {1}. +muteExempt=\u00a7cHrac byl umlcen. +mutedPlayer=Hrac {0} umlcen. +mutedPlayerFor=Hrac {0} umlcen na {1}. mutedUserSpeaks={0} se pokusil(a) promluvit, ale je ztiseny(a). nearbyPlayers=Hraci v blizkosti: {0} negativeBalanceError=Uzivatel nesmi mit zaporny obnos. nickChanged=Prezdivka zmnenena. -nickDisplayName=\u00a77Pro povoleni zmnenu nicku bezte do Essentials config. -nickInUse=\u00a7cToto jmeno je pouzivano. +nickDisplayName=\u00a77Pro povoleni zmneny nicku upravte config Essentials. +nickInUse=\u00a7cToto jmeno je uz pouzivano. nickNamesAlpha=\u00a7cPrezdivky musi byt alfanumericke. -nickNoMore=\u00a77UZ nemate prezdivku. -nickOthersPermission=\u00a7cNemate opravneni pro zmnenu nicku ostatnich hracu -nickSet=\u00a77Tvuj nickname je nyni \u00a7c{0} -noAccessCommand=\u00a7cNemate pristup k tomuto prikazu. +nickNoMore=\u00a77Uz nemáte prezdívku. +nickOthersPermission=\u00a7cNemáte opravnení pro zmnenu prezdívky ostatních! +nickSet=\u00a77Tvoje prezdívka je nyní \u00a7c{0} +noAccessCommand=\u00a7cNemáte . noAccessPermission=\u00a7cNemate opravneni pro toto {0}. noBreakBedrock=Nemas povoleno znicit bedrock. noDestroyPermission=\u00a7cNemas opravneni k zniceni {0}. @@ -269,15 +270,15 @@ playerBanned=\u00a7cHrac {0} zabanovan {1} za {2} playerInJail=\u00a7cHrac jiz je uveznen {0}. playerJailed=\u00a77Hrac {0} uveznen. playerJailedFor= \u00a77Hrac {0} uveznen za {1}. -playerKicked=\u00a7cHrac {0} kopnut {1} za {2} -playerMuted=\u00a77Byls ztlumen -playerMutedFor=\u00a77Byls ztlumen za {0} +playerKicked=\u00a7c{0} byl Kicknut hracem {1} za {2} +playerMuted=\u00a77Byls umlcen adminem +playerMutedFor=\u00a77Byls umlcen adminem za {0} playerNeverOnServer=\u00a7cHrac {0} nikdy nebyl na tomto serveru. playerNotFound=\u00a7cHrac nenalezen. -playerUnmuted=\u00a77Byls zesilen. +playerUnmuted=\u00a77Muzes opet psat. pong=Pong! possibleWorlds=\u00a77Mozne svety jsou 0 az {0}. -powerToolAir=Prikaz nemuze byt pouzit do ovzdusi. +powerToolAir=Prikaz nelze pouzit ve vzduchu. powerToolAlreadySet=Prikaz \u00a7c{0}\u00a7f je jiz prirazen k {1}. powerToolAttach=\u00a7c{0}\u00a7f prikaz prirazen k {1}. powerToolClearAll=Vsechny prikazy pro elektricke naradi byli vymazany. @@ -286,40 +287,39 @@ powerToolListEmpty={0} nema prizazene prikazy. powerToolNoSuchCommandAssigned=Prikaz \u00a7c{0}\u00a7f neni prirazen {1}. powerToolRemove=Prikaz \u00a7c{0}\u00a7f odebran od {1}. powerToolRemoveAll=Vsechny prikazy odebrany od {0}. -powerToolsDisabled=Vsechny z tvych elektrickych nastroju jsou vyrazeny. -powerToolsEnabled=Vsechny z tvych elektrickych nastroju jsou povoleny. +powerToolsDisabled=Elektricke nastroje jsou vyrazeny. +powerToolsEnabled=Elektricke nastroje jsou povoleny. protectionOwner=\u00a76[EssentialsProtect] Majitel ochrany: {0} questionFormat=\u00a77[Otazka]\u00a7f {0} -readNextPage=Typ /{0} {1} pro precteni dalsi stranky -reloadAllPlugins=\u00a77Pluginy obnoveny. +readNextPage=Zadejte /{0} {1} pro precteni dalsi stranky +reloadAllPlugins=\u00a77Pluginy byly znovu nacteny. removed=\u00a77Odstraneno {0} entit. -repair=Uspesne si opravil tvuj: \u00a7e{0}. -repairAlreadyFixed=\u00a77Tato vec je jiz opravena. -repairEnchanted=\u00a77Nemas povoleno opravovat okouzlene veci. -repairInvalidType=\u00a7cTuto vec nelze opravit. +repair=Uspesne si opravil svuj: \u00a7e{0}. +repairAlreadyFixed=\u00a77Tenti item je jiz opraven. +repairEnchanted=\u00a77Bohuzel nemuzes opravit Enchanovane itemy. repairNone=Tato vec nepotrebuje opravit. requestAccepted=\u00a77Zadost o teleport prijmuta. requestAcceptedFrom=\u00a77{0} prijmul tvou zadost o teleport. requestDenied=\u00a77Zadost o teleport zamitnuta. -requestDeniedFrom=\u00a77{0} zamitl tvou zadoust o teleport. +requestDeniedFrom=\u00a77{0} zamitl tvou zadost o teleport. requestSent=\u00a77Zadost zaslana hraci {0}\u00a77. -requestTimedOut=\u00a7cZadost o teleport vyprsela +requestTimedOut=\u00a7cZadost o teleport bohuzelvyprsela requiredBukkit= * ! * Potrebujete alespon build {0} CraftBukkitu, stahnete jej z http://dl.bukkit.org/downloads/craftbukkit/ returnPlayerToJailError=Chyba pri navraceni hrace {0} do veznice: {1} second=sekunda seconds=sekundy seenOffline=Hrac {0} je offline, protoze {1} seenOnline=Hrac {0} je online, protoze {1} -serverFull=Server je plny. -serverTotal=Serverova kapacita: {0} -setSpawner=Zmnenils tento mobspawner na {0} spawner +serverFull=Server je bohuzel plny! :( +serverTotal=Pocet slotu: {0} +setSpawner=Zmnenils tento spawner na {0} spawner sheepMalformedColor=Poskozena barva. shoutFormat=\u00a77[Krik]\u00a7f {0} signFormatFail=\u00a74[{0}] signFormatSuccess=\u00a71[{0}] signFormatTemplate=[{0}] -signProtectInvalidLocation=\u00a74Nemas povoleno vytvaret cedule zde. -similarWarpExist=Warp s podobnym nazvem jiz existuje. +signProtectInvalidLocation=\u00a74Nemas povoleno zde vytvaret cedule. +similarWarpExist=Warp se shodnym nazvem jiz existuje. slimeMalformedSize=Poskozena velikost. soloMob=Tento zivocich je rad sam. spawnSet=\u00a77Spawnovaci lokace pro skupinu {0}. @@ -331,19 +331,19 @@ suicideSuccess= \u00a77{0} si vzal svuj vlastni zivot survival=survival takenFromAccount=\u00a7c{0} byli prevzaty z vaseho uctu. takenFromOthersAccount=\u00a7c{0} prevzato z {1}\u00a7c uctu. Novy obnos: {2} -teleportAAll=\u00a77Zadost o teleport byla odeslana vsem hracum... -teleportAll=\u00a77Teleportuji vsechny hrace... +teleportAAll=\u00a77Zadost o teleport byla odeslana celemu serveru... +teleportAll=\u00a77Teleportuji cely server... teleportAtoB=\u00a77{0}\u00a77 te teleportoval k hraci {1}\u00a77. teleportDisabled={0} teleportovani je zakazano. -teleportHereRequest=\u00a7c{0}\u00a7c pozadal(a) aby ses k nim teleportoval(a). +teleportHereRequest=\u00a7c{0}\u00a7c pozadal(a) aby ses k nemu teleportoval(a). teleportNewPlayerError=Selhal teleport k novemu hraci -teleportRequest=\u00a7c{0}\u00a7c Pozadal(a) aby byl(a) teleportovan(a) k vam. +teleportRequest=\u00a7c{0}\u00a7c pozadal(a), aby se k vám mohl(a) teleportovat. teleportRequestTimeoutInfo=\u00a77Tato zadost vyprsi po {0} sekundach. teleportTop=\u00a77Teleportuji te nahoru. teleportationCommencing=\u00a77Zahajuje se telepotovani... teleportationDisabled=\u00a77Teleportace zakazany. teleportationEnabled=\u00a77Teleportace povoleny. -teleporting=\u00a77Teleportovani... +teleporting=\u00a77Probíhá telepování... teleportingPortal=\u00a77Teleportace prez portal. tempBanned=Docasne zabanovan na serveru pro {0} tempbanExempt=\u00a77Nemuzete docasne zabanovat tohoto hrace. @@ -362,7 +362,7 @@ tradeSignEmpty=Obchodni znaceni pro vas nema nic k dispozici. tradeSignEmptyOwner=Doslo zbozi, odstrante obchodni znaceni. treeFailure=\u00a7cGenerace stromu selhala. Zopakujte na hline nebo trave. treeSpawned=\u00a77Strom spawnut. -true=pravdivy +true=Ano typeTpaccept=\u00a77Pro teleport, typ \u00a7c/tpaccept\u00a77. typeTpdeny=\u00a77Pro zamitnuti zadosti, typ \u00a7c/tpdeny\u00a77. typeWorldName=\u00a77Take muzete zadat nazev konkretniho sveta. @@ -402,14 +402,14 @@ weatherStormFor=\u00a77Nastavils bourku ve {0} po dobu {1} sekund weatherSun=\u00a77Nastavils slunecno ve {0} weatherSunFor=\u00a77Nastavils slunecno ve {0} po dobu {1} sekund whoisBanned=\u00a79 - Zabanovani hraci: {0} -whoisExp=\u00a79 - Exp: {0} (Level {1}) +whoisExp=\u00a79 - Exp Uroven: {0} (Level {1}) whoisGamemode=\u00a79 - Mod hry: {0} -whoisGeoLocation=\u00a79 - Lokace: {0} -whoisGod=\u00a79 - Bozsky mode: {0} +whoisGeoLocation=\u00a79 - Místo: {0} +whoisGod=\u00a79 - Godmode: {0} whoisHealth=\u00a79 - Zdravi: {0}/20 whoisIPAddress=\u00a79 - IP Adresy: {0} whoisIs={0} je {1} -whoisJail=\u00a79 - Veznice: {0} +whoisJail=\u00a79 - Vezeni: {0} whoisLocation=\u00a79 - Lokace: ({0}, {1}, {2}, {3}) whoisMoney=\u00a79 - Penize: {0} whoisOP=\u00a79 - OP: {0} @@ -420,5 +420,5 @@ worthMeta=\u00a77Stack z {0} metadat {1} hodnoty \u00a7c{2}\u00a77 ({3} vec(i) v worthSet=Informacni hodnota nastavena year=rok years=roky -youAreHealed=\u00a77Byls uzdraven. -youHaveNewMail=\u00a7cMas {0} zprav!\u00a7f Typ \u00a77/mail read\u00a7f pro zabrazeni tvych zprav. +youAreHealed=\u00a77Byly ti doplneny zivoty! +youHaveNewMail=\u00a7cMas {0} zprav!\u00a7f Typ \u00a77/mail read\u00a7f pro zabrazeni tvych zprav. \ No newline at end of file -- cgit v1.2.3 From fc7689354f3dea2614f248a1f82eb740b6a4fb9f Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 21 Apr 2012 16:58:22 +0100 Subject: Fix forgetting sub groups on a manload. --- EssentialsGroupManager/src/Changelog.txt | 3 +- .../org/anjocaido/groupmanager/GroupManager.java | 48 +++++++++++++++++++--- .../dataholder/worlds/WorldsHolder.java | 1 + .../permissions/BukkitPermissions.java | 9 +++- 4 files changed, 52 insertions(+), 9 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index e321c7741..c3ec8ccc1 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -181,4 +181,5 @@ v 2.0: - Stop using our own deprecated methods as we tell others to do. - Finally remove all deprecated methods. - Re-initialize the WorldsHolder on a reload, as un-registering and re-registering a new holder means all plugins have to check for the new service on every quiery. - - Prevent null perms getting past the GlobalGroups loader. \ No newline at end of file + - Prevent null perms getting past the GlobalGroups loader. + - Fix forgetting sub groups on a manload. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 3da9666c3..0571db4b6 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -103,13 +103,20 @@ public class GroupManager extends JavaPlugin { } } - if (WorldEvents != null) - WorldEvents = null; + // Remove all attachments before clearing if (BukkitPermissions != null) { BukkitPermissions.removeAllAttachments(); + } + + if (!restarting) { + + if (WorldEvents != null) + WorldEvents = null; + BukkitPermissions = null; + } // EXAMPLE: Custom code, here we just output some info so we can check that all is well @@ -130,6 +137,9 @@ public class GroupManager extends JavaPlugin { selectedWorlds = new HashMap(); lastError = ""; + /* + * Setup our logger if we are not restarting. + */ if (!restarting) { GroupManager.logger.setUseParentHandlers(false); ch = new GMLoggerHandler(); @@ -144,11 +154,17 @@ public class GroupManager extends JavaPlugin { // Load the global groups globalGroups = new GlobalGroups(this); + /* + * Configure the worlds holder. + */ if (!restarting) worldsHolder = new WorldsHolder(this); else worldsHolder.resetWorldsHolder(); + /* + * This should NEVER happen. No idea why it's still here. + */ PluginDescriptionFile pdfFile = this.getDescription(); if (worldsHolder == null) { GroupManager.logger.severe("Can't enable " + pdfFile.getName() + " version " + pdfFile.getVersion() + ", bad loading!"); @@ -156,13 +172,30 @@ public class GroupManager extends JavaPlugin { throw new IllegalStateException("An error ocurred while loading GroupManager"); } - // Set a few defaults (reloads) + /* + * Prevent our registered events from triggering + * updates as we are not fully loaded. + */ setLoaded(false); - // Initialize the world listener and bukkit permissions to handle events. - WorldEvents = new GMWorldListener(this); - BukkitPermissions = new BukkitPermissions(this); + /* + * Initialize the world listener and bukkit permissions + * to handle events if this is a fresh start + * + * else + * + * Reset bukkit perms. + */ + if (!restarting) { + WorldEvents = new GMWorldListener(this); + BukkitPermissions = new BukkitPermissions(this); + } else { + BukkitPermissions.reset(); + } + /* + * Start the scheduler for data saving. + */ enableScheduler(); /* @@ -172,6 +205,9 @@ public class GroupManager extends JavaPlugin { if (getServer().getScheduler().scheduleSyncDelayedTask(this, new BukkitPermsUpdateTask(), 1) == -1) { GroupManager.logger.severe("Could not schedule superperms Update."); + /* + * Flag that we are now loaded and should start processing events. + */ setLoaded(true); } diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java index a9ab4befa..27a7d9a59 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java @@ -62,6 +62,7 @@ public class WorldsHolder { public void resetWorldsHolder() { + worldsData = new HashMap(); mirrorsGroup = new HashMap(); mirrorsUser = new HashMap(); diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java index c366b65bf..e8322c391 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/BukkitPermissions.java @@ -96,12 +96,17 @@ public class BukkitPermissions { public BukkitPermissions(GroupManager plugin) { this.plugin = plugin; - this.collectPermissions(); + this.reset(); this.registerEvents(); - this.updateAllPlayers(); + GroupManager.logger.info("Superperms support enabled."); } + + public void reset() { + this.collectPermissions(); + this.updateAllPlayers(); + } private void registerEvents() { -- cgit v1.2.3 From 06247732da564876d97de99aa706fd7e823c0df9 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sun, 22 Apr 2012 12:12:50 +0100 Subject: Allow 'manucheckp' to notify when superperms reports false but it is really negated. --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/GroupManager.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index c3ec8ccc1..4a3c232be 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -182,4 +182,5 @@ v 2.0: - Finally remove all deprecated methods. - Re-initialize the WorldsHolder on a reload, as un-registering and re-registering a new holder means all plugins have to check for the new service on every quiery. - Prevent null perms getting past the GlobalGroups loader. - - Fix forgetting sub groups on a manload. \ No newline at end of file + - Fix forgetting sub groups on a manload. + - Allow 'manucheckp' to notify when superperms reports false but it is really negated. \ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index 0571db4b6..5f357641a 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -921,7 +921,7 @@ public class GroupManager extends JavaPlugin { // superperms if (targetPlayer != null) { - sender.sendMessage(ChatColor.YELLOW + "SuperPerms reports Node: " + targetPlayer.hasPermission(args[1])); + sender.sendMessage(ChatColor.YELLOW + "SuperPerms reports Node: " + targetPlayer.hasPermission(args[1]) + ((!targetPlayer.hasPermission(args[1]) && targetPlayer.isPermissionSet(args[1])) ? " (Negated)": "")); } return true; -- cgit v1.2.3 From 9d398b1d2e6f7c4a27aeac3b64faeafeb1f5572e Mon Sep 17 00:00:00 2001 From: ementalo Date: Mon, 23 Apr 2012 23:46:53 +0100 Subject: New permission essentials.invsee.preventmodify. People with this permission cannot have their inventories modified by invsee --- Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index f48138e4d..ef2be0f33 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -421,7 +421,9 @@ public class EssentialsPlayerListener implements Listener if (event.getView().getTopInventory().getType() == InventoryType.PLAYER) { final User user = ess.getUser(event.getWhoClicked()); - if (user.isInvSee() && !user.isAuthorized("essentials.invsee.modify")) + final User invOwner = ess.getUser(event.getView().getPlayer()); + if (user.isInvSee() && !user.isAuthorized("essentials.invsee.modify") + || invOwner.isAuthorized("essentials.invsee.preventmodify")) { event.setCancelled(true); } -- cgit v1.2.3 From de541f6654db760e4a8a4f9addfbda668d2fa815 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 18 Apr 2012 07:33:37 +1000 Subject: Use a quick (and working comparer) --- Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index ef2be0f33..81f0e0219 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -14,7 +14,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.Server; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -104,7 +103,7 @@ public class EssentialsPlayerListener implements Listener } final Location afk = user.getAfkPosition(); - if (afk == null || !event.getTo().getWorld().equals(afk.getWorld()) || afk.distanceSquared(event.getTo()) > 9) + if (afk == null || event.getTo().getWorld() != afk.getWorld() || afk.distanceSquared(event.getTo()) > 9) { user.updateActivity(true); } -- cgit v1.2.3 From 18b5405c763f304a01d0c8f1fda2efb54d64857a Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 24 Apr 2012 17:47:27 +1000 Subject: Add message to sender when all players kicked, addresses issue #1968 --- Essentials/src/com/earth2me/essentials/commands/Commandkickall.java | 1 + Essentials/src/messages.properties | 1 + 2 files changed, 2 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java index 6d97b6af9..4722b7d68 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java @@ -27,5 +27,6 @@ public class Commandkickall extends EssentialsCommand onlinePlayer.kickPlayer(args.length > 0 ? getFinalArg(args, 0) : _("kickDefault")); } } + sender.sendMessage(_("kickedAll")); } } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 2a6e37a3e..73ce00bee 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -163,6 +163,7 @@ jailReleasedPlayerNotify=\u00a77You have been released! jailSentenceExtended=Jail time extend to: {0) jailSet=\u00a77Jail {0} has been set jumpError=That would hurt your computer's brain. +kickedAll=\u00a7cKicked all players from server kickDefault=Kicked from server kickExempt=\u00a7cYou can not kick that person. kill=\u00a77Killed {0}. -- cgit v1.2.3 From 27102d1c38334df49a9b791a3af83ec39fc309d0 Mon Sep 17 00:00:00 2001 From: ementalo Date: Tue, 24 Apr 2012 10:24:08 +0100 Subject: Adding the kickedAll TL key the the rest of the files --- Essentials/src/messages_cs.properties | 47 ++++++++++++++++++----------------- Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_it.properties | 1 + Essentials/src/messages_nl.properties | 1 + Essentials/src/messages_pl.properties | 1 + Essentials/src/messages_pt.properties | 1 + 10 files changed, 33 insertions(+), 23 deletions(-) diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index c680e5e90..430d268e7 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -12,15 +12,15 @@ alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} na: {3} alertPlaced=Polozeno: alertUsed=Pouzito: autoAfkKickReason=Byls Kicknut pro {0} minut AFK. -backAfterDeath=\u00a77Zadej príkaz /back pro návrat do místa umrtí. -backUsageMsg=\u00a77Navrácení na puvodní místo. +backAfterDeath=\u00a77Zadej pr\u00c3\u00adkaz /back pro n\u00c3\u00a1vrat do m\u00c3\u00adsta umrt\u00c3\u00ad. +backUsageMsg=\u00a77Navr\u00c3\u00a1cen\u00c3\u00ad na puvodn\u00c3\u00ad m\u00c3\u00adsto. backupDisabled=Nebyl konfigurovan externi skript! backupFinished=Zaloha ukoncena backupStarted=Probiha zaloha balance=\u00a77Obnos: {0} balanceTop=\u00a77Nejvyssi obnosy ({0}) banExempt=\u00a7cNemuzes zabanovat tohoto hrace. -banIpAddress=\u00a77IP byla zabanována! +banIpAddress=\u00a77IP byla zabanov\u00c3\u00a1na! bannedIpsFileError=Chyba pri cteni souboru banned-ips.txt bannedIpsFileNotFound=Soubor banned-ips.txt neexistuje! bannedPlayersFileError=Chyba pri cteni souboru banne neexistuje! @@ -29,7 +29,7 @@ bigTreeSuccess= \u00a77Velky strom vygenerovan. blockList=Essentials predavaji tyto prikazy do jin\u00e9ho pluginu: broadcast=[\u00a7cPrenos\u00a7f]\u00a7a {0} buildAlert=\u00a7cNemate opravneni stavet -bukkitFormatChanged=Verze Bukkitu byla zmnenena. Verze neni kontrolována. +bukkitFormatChanged=Verze Bukkitu byla zmnenena. Verze neni kontrolov\u00c3\u00a1na. burnMsg=\u00a77Nastavils {0} do ohne po {1} sekund. canTalkAgain=\u00a77Prave nemuzes psat! cantFindGeoIpDB=Nelze najit GeoIP databazi! @@ -43,7 +43,7 @@ commandNotLoaded=\u00a7cPrikaz {0} je nezpravne nacten. compassBearing=\u00a77Lozisko: {0} ({1} stupnu). configFileMoveError=Premistovani config.yml do zalohove lokace selhalo. configFileRenameError=Selhalo prejmenovavani souboru config.yml -connectedPlayers=Pripojení hraci: +connectedPlayers=Pripojen\u00c3\u00ad hraci: connectionFailed=Nepodarilo se otevrit spojeni. cooldownWithMessage=\u00a7cPrestavka: {0} corruptNodeInConfig=\u00a74Poznamka: Konfiguracni soubor je poskozeny na {0} radku. @@ -55,7 +55,7 @@ currency={0}{1} currentWorld=Current World: {0} day=den days=dny -defaultBanReason=Byl jste zabanován adminem! +defaultBanReason=Byl jste zabanov\u00c3\u00a1n adminem! deleteFileError=Nelze smazat soubor: {0} deleteHome=\u00a77Domov {0} byl odstranen. deleteJail=\u00a77Veznice {0} byla odstranena. @@ -67,10 +67,10 @@ dependancyNotFound=[Essentials] Doporucena zavyslost nenalezena, nyni se stahuje depth=\u00a77Jsi na urovni more. depthAboveSea=\u00a77Jsi {0} bloku nad urovni more. depthBelowSea=\u00a77Jsi {0} bloku pod urovni more. -destinationNotSet=Destinace není nastavena -disableUnlimited=\u00a77Zakázano neomezene staveni {0} pro {1}. -disabled=Zakázáno -disabledToSpawnMob=Spawnovani tohoto moba není dovoleno v config.yml. +destinationNotSet=Destinace nen\u00c3\u00ad nastavena +disableUnlimited=\u00a77Zak\u00c3\u00a1zano neomezene staveni {0} pro {1}. +disabled=Zak\u00c3\u00a1z\u00c3\u00a1no +disabledToSpawnMob=Spawnovani tohoto moba nen\u00c3\u00ad dovoleno v config.yml. dontMoveMessage=\u00a77Teleportuje vas za {0}. Nehybejte se. downloadingGeoIp=Stahovani GeoIP databaze ... to muze chvili trvat (zeme: 0.6 MB, mesto: 20MB) duplicatedUserdata=Duplicicitni uzivatelska data: {0} a {1} @@ -91,7 +91,7 @@ extinguishOthers=\u00a77Jsi uhasen {0}. failedToCloseConfig=Selhalo zavirani nastaveni {0} failedToCreateConfig=Selhalo vytvareni nastaveni {0} failedToWriteConfig=Selhalo psani nastaveni {0} -false=Neaktivní +false=Neaktivn\u00c3\u00ad feed=\u00a77Tvuj apetit byl zasycen. feedOther=\u00a77Nasytils hrace {0}. fileRenameError=Prejmenovavani souboru {0} selhalo @@ -164,6 +164,7 @@ jailReleasedPlayerNotify=\u00a77Byls propusten! jailSentenceExtended=Trest prodlouzen na: {0) jailSet=\u00a77Doba uvezneni hrace {0} nastavena! jumpError=Toto poskodi mozek vaseho pocitace. +kickedAll=\u00a7cKicked all players from server kickDefault=Byl jste kicknut adminem serveru! kickExempt=\u00a7cNemuzes kicknout tuto osobu. kill=\u00a77Zabito {0}. @@ -181,7 +182,7 @@ listAmount = \u00a79Jsou tam \u00a7c{0}\u00a79 vsichni ze maximalniho poctu \u00 listAmountHidden = \u00a79Jsou tam, \u00a7c{0}\u00a77/{1}\u00a79 vsichni z maximalniho poctu \u00a7c{2}\u00a79 hracu online. listGroupTag={0}\u00a7f: listHiddenTag = \u00a77[HIDDEN]\u00a7f -loadWarpError=Selhalo nactení warpu {0} +loadWarpError=Selhalo nacten\u00c3\u00ad warpu {0} localFormat=Lokalni: <{0}> {1} mailClear=\u00a7cPro oznaceni prectenyh zprav, typ /mail clear mailCleared=\u00a77Schranka vyprazdnena! @@ -202,10 +203,10 @@ mobSpawnTarget=Cilovy blok musi byt mob spawner. mobsAvailable=\u00a77Zivocichove: {0} moneyRecievedFrom=\u00a7a{0} nebyla prijata {1} moneySentTo=\u00a7a{0} byla odeslana {1} -moneyTaken={0} odesláno z vaseho bankovniho uctu. -month=mesíc -months=mesíce -moreThanZero=Mnozství musi byt vetsí nez 0. +moneyTaken={0} odesl\u00c3\u00a1no z vaseho bankovniho uctu. +month=mes\u00c3\u00adc +months=mes\u00c3\u00adce +moreThanZero=Mnozstv\u00c3\u00ad musi byt vets\u00c3\u00ad nez 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} muteExempt=\u00a7cHrac byl umlcen. mutedPlayer=Hrac {0} umlcen. @@ -217,10 +218,10 @@ nickChanged=Prezdivka zmnenena. nickDisplayName=\u00a77Pro povoleni zmneny nicku upravte config Essentials. nickInUse=\u00a7cToto jmeno je uz pouzivano. nickNamesAlpha=\u00a7cPrezdivky musi byt alfanumericke. -nickNoMore=\u00a77Uz nemáte prezdívku. -nickOthersPermission=\u00a7cNemáte opravnení pro zmnenu prezdívky ostatních! -nickSet=\u00a77Tvoje prezdívka je nyní \u00a7c{0} -noAccessCommand=\u00a7cNemáte . +nickNoMore=\u00a77Uz nem\u00c3\u00a1te prezd\u00c3\u00advku. +nickOthersPermission=\u00a7cNem\u00c3\u00a1te opravnen\u00c3\u00ad pro zmnenu prezd\u00c3\u00advky ostatn\u00c3\u00adch! +nickSet=\u00a77Tvoje prezd\u00c3\u00advka je nyn\u00c3\u00ad \u00a7c{0} +noAccessCommand=\u00a7cNem\u00c3\u00a1te . noAccessPermission=\u00a7cNemate opravneni pro toto {0}. noBreakBedrock=Nemas povoleno znicit bedrock. noDestroyPermission=\u00a7cNemas opravneni k zniceni {0}. @@ -337,13 +338,13 @@ teleportAtoB=\u00a77{0}\u00a77 te teleportoval k hraci {1}\u00a77. teleportDisabled={0} teleportovani je zakazano. teleportHereRequest=\u00a7c{0}\u00a7c pozadal(a) aby ses k nemu teleportoval(a). teleportNewPlayerError=Selhal teleport k novemu hraci -teleportRequest=\u00a7c{0}\u00a7c pozadal(a), aby se k vám mohl(a) teleportovat. +teleportRequest=\u00a7c{0}\u00a7c pozadal(a), aby se k v\u00c3\u00a1m mohl(a) teleportovat. teleportRequestTimeoutInfo=\u00a77Tato zadost vyprsi po {0} sekundach. teleportTop=\u00a77Teleportuji te nahoru. teleportationCommencing=\u00a77Zahajuje se telepotovani... teleportationDisabled=\u00a77Teleportace zakazany. teleportationEnabled=\u00a77Teleportace povoleny. -teleporting=\u00a77Probíhá telepování... +teleporting=\u00a77Prob\u00c3\u00adh\u00c3\u00a1 telepov\u00c3\u00a1n\u00c3\u00ad... teleportingPortal=\u00a77Teleportace prez portal. tempBanned=Docasne zabanovan na serveru pro {0} tempbanExempt=\u00a77Nemuzete docasne zabanovat tohoto hrace. @@ -404,7 +405,7 @@ weatherSunFor=\u00a77Nastavils slunecno ve {0} po dobu {1} sekund whoisBanned=\u00a79 - Zabanovani hraci: {0} whoisExp=\u00a79 - Exp Uroven: {0} (Level {1}) whoisGamemode=\u00a79 - Mod hry: {0} -whoisGeoLocation=\u00a79 - Místo: {0} +whoisGeoLocation=\u00a79 - M\u00c3\u00adsto: {0} whoisGod=\u00a79 - Godmode: {0} whoisHealth=\u00a79 - Zdravi: {0}/20 whoisIPAddress=\u00a79 - IP Adresy: {0} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index a76027543..a88863528 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -163,6 +163,7 @@ jailReleasedPlayerNotify=\u00a77Du er blevet befriet fra f\u00c3\u00a6nglset! jailSentenceExtended=F\u00c3\u00a6ngselsdom forl\u00c3\u00a6nget til: {0) jailSet=\u00a77F\u00e6ngsel {0} er blevet sat. jumpError=Dette vil skade din computer''s hjerne. +kickedAll=\u00a7cKicked all players from server kickDefault=Kicked fra serveren. kickExempt=\u00a77Du kan ikke kicke denne spiller. kill=\u00a77dr\u00e6bte {0}. diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index b03c91067..6ac0e1809 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -163,6 +163,7 @@ jailReleasedPlayerNotify=\u00a77Du wurdest freigelassen! jailSentenceExtended=Gef\u00e4ngnisszeit erweitert auf: {0) jailSet=\u00a77Gef\u00e4ngnis {0} wurde erstellt. jumpError=Das w\u00fcrde deinen Computer \u00fcberlasten. +kickedAll=\u00a7cKicked all players from server kickDefault=Vom Server geworfen kickExempt=\u00a7cDu kannst diesen Spieler nicht rauswerfen. kill=\u00a77{0} get\u00f6tet. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 2a6e37a3e..73ce00bee 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -163,6 +163,7 @@ jailReleasedPlayerNotify=\u00a77You have been released! jailSentenceExtended=Jail time extend to: {0) jailSet=\u00a77Jail {0} has been set jumpError=That would hurt your computer's brain. +kickedAll=\u00a7cKicked all players from server kickDefault=Kicked from server kickExempt=\u00a7cYou can not kick that person. kill=\u00a77Killed {0}. diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index c0f15256b..4469b284f 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -163,6 +163,7 @@ jailReleasedPlayerNotify=\u00a77 Has sido liberado!! jailSentenceExtended=El tiempo en la carcel se alarga hasta: {0) jailSet=\u00a77Carcel {0} ha sido puesta jumpError=Eso es demasiado para tu ordenador! +kickedAll=\u00a7cKicked all players from server kickDefault=Echado del servidor. kickExempt=\u00a7cNo puedes echar a esa persona. kill=\u00a77ha matado a {0}. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index a7946d3e2..235b22479 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -163,6 +163,7 @@ jailReleasedPlayerNotify=\u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9 ! jailSentenceExtended=Dur\u00e9e d''emprisonnement rallong\u00e9e de : {0) jailSet=\u00a77La prison {0} a \u00e9t\u00e9 cr\u00e9\u00e9. jumpError=\u00c7a aurait pu faire mal au cerveau de votre ordinateur. +kickedAll=\u00a7cKicked all players from server kickDefault=\u00c9ject\u00e9 du serveur kickExempt=\u00a77Vous ne pouvez pas \u00e9jecter ce joueur. kill=\u00a77Tu\u00e9 {0}. diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties index c27366cea..1eaf84e6d 100644 --- a/Essentials/src/messages_it.properties +++ b/Essentials/src/messages_it.properties @@ -163,6 +163,7 @@ jailReleasedPlayerNotify=\u00a77Sei stato scarcerato! jailSentenceExtended=Tempo di incarcerazione aumentato di: {0) jailSet=\u00a77{0} e'' ora una prigione. jumpError=Cosi'' facendo danneggerai la cpu. +kickedAll=\u00a7cKicked all players from server kickDefault=Kickato dal server kickExempt=\u00a7cNon puoi kickare questo player. kill=\u00a77Ucciso {0}. diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index ac80cca70..c0ac8c4d5 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -163,6 +163,7 @@ jailReleasedPlayerNotify=\u00a77You have been released! jailSentenceExtended=Jail time extend to: {0) jailSet=\u00a77Gevangenis {0} is ingesteld jumpError=Dat zou je computers hersenen beschadigen. +kickedAll=\u00a7cKicked all players from server kickDefault=Gekicked van de server kickExempt=\u00a77Je kunt die speler niet schoppen. kill=\u00a77Jij doodde {0}. diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties index e4666cdda..58a5171c4 100644 --- a/Essentials/src/messages_pl.properties +++ b/Essentials/src/messages_pl.properties @@ -163,6 +163,7 @@ jailReleasedPlayerNotify=\u00a77Zostales zwolniony! jailSentenceExtended=Czas pobyty w wiezieniu zwiekszony do: {0) jailSet=\u00a77Zostalo stworzone wiezienie \u0093{0}\u0094. jumpError=That would hurt your computer''s brain. +kickedAll=\u00a7cKicked all players from server kickDefault=Zostales wyproszony z serwera. kickExempt=\u00a7cNie mozesz wyprosic tej osoby. kill=\u00a77Zabito {0}. diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties index 4f3de9c36..d12876d1a 100644 --- a/Essentials/src/messages_pt.properties +++ b/Essentials/src/messages_pt.properties @@ -163,6 +163,7 @@ jailReleasedPlayerNotify=\u00a77Voc\u00ea foi solto! jailSentenceExtended=Tempo de prisao estendido para: {0) jailSet=\u00a77Cela {0} foi definida jumpError=Isso prejudica o c\u00e9rebro do seu computador. +kickedAll=\u00a7cKicked all players from server kickDefault=Kickado do servidor. kickExempt=\u00a7cVoc\u00ea nao pode kickar esta pessoa. kill=\u00a77Assassinado {0}. -- cgit v1.2.3 From 9ca820d45e715ffa20e7e7f951f54f7401f1de2f Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 24 Apr 2012 20:30:31 +1000 Subject: Small cleanup of things --- .../essentials/EssentialsEntityListener.java | 6 +-- .../essentials/EssentialsPlayerListener.java | 2 +- Essentials/src/com/earth2me/essentials/IUser.java | 2 - Essentials/src/com/earth2me/essentials/User.java | 2 + .../src/com/earth2me/essentials/UserData.java | 7 ++- .../essentials/craftbukkit/OfflineBedLocation.java | 52 ---------------------- .../src/com/earth2me/essentials/user/UserBase.java | 7 +-- 7 files changed, 10 insertions(+), 68 deletions(-) delete mode 100644 Essentials/src/com/earth2me/essentials/craftbukkit/OfflineBedLocation.java diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java index 9c8fa0707..ef0dba753 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java @@ -3,7 +3,7 @@ package com.earth2me.essentials; import static com.earth2me.essentials.I18n._; import java.util.List; import org.bukkit.Material; -import org.bukkit.entity.Animals; +import org.bukkit.entity.Ageable; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -60,13 +60,13 @@ public class EssentialsEntityListener implements Listener } } } - else if (eDefend instanceof Animals && eAttack instanceof Player) + else if (eDefend instanceof Ageable && eAttack instanceof Player) { final Player player = (Player)eAttack; final ItemStack hand = player.getItemInHand(); if (hand != null && hand.getType() == Material.MILK_BUCKET) { - ((Animals)eDefend).setAge(-24000); + ((Ageable)eDefend).setBaby(); hand.setType(Material.BUCKET); player.setItemInHand(hand); player.updateInventory(); diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 81f0e0219..71a6beb54 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -421,7 +421,7 @@ public class EssentialsPlayerListener implements Listener { final User user = ess.getUser(event.getWhoClicked()); final User invOwner = ess.getUser(event.getView().getPlayer()); - if (user.isInvSee() && !user.isAuthorized("essentials.invsee.modify") + if (user.isInvSee() && !user.isAuthorized("essentials.invsee.modify") || invOwner.isAuthorized("essentials.invsee.preventmodify")) { event.setCancelled(true); diff --git a/Essentials/src/com/earth2me/essentials/IUser.java b/Essentials/src/com/earth2me/essentials/IUser.java index df5401886..bfa9ed146 100644 --- a/Essentials/src/com/earth2me/essentials/IUser.java +++ b/Essentials/src/com/earth2me/essentials/IUser.java @@ -1,10 +1,8 @@ package com.earth2me.essentials; import com.earth2me.essentials.commands.IEssentialsCommand; -import java.net.InetSocketAddress; import org.bukkit.Location; import org.bukkit.entity.Player; -import org.bukkit.inventory.PlayerInventory; /** diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index a8149e773..6f3023fbe 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -164,6 +164,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser } } + @Override public boolean canAfford(final double cost) { return canAfford(cost, true); @@ -578,6 +579,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser return super.isGodModeEnabled(); } + @Override public String getGroup() { return ess.getPermissionsHandler().getGroup(base); diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index abf338470..5686e0439 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -3,9 +3,7 @@ package com.earth2me.essentials; import static com.earth2me.essentials.I18n._; import java.io.File; import java.util.*; -import java.util.logging.Logger; import org.bukkit.Location; -import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -14,7 +12,6 @@ public abstract class UserData extends PlayerExtension implements IConf { protected final transient IEssentials ess; private final EssentialsConf config; - private static final Logger logger = Logger.getLogger("Minecraft"); protected UserData(Player base, IEssentials ess) { @@ -149,7 +146,7 @@ public abstract class UserData extends PlayerExtension implements IConf public List getHomes() { - return new ArrayList(homes.keySet()); + return new ArrayList(homes.keySet()); } public void setHome(String name, Location loc) @@ -254,11 +251,13 @@ public abstract class UserData extends PlayerExtension implements IConf config.save(); } + @SuppressWarnings("unchecked") public List getPowertool(ItemStack stack) { return (List)powertools.get("" + stack.getTypeId()); } + @SuppressWarnings("unchecked") public List getPowertool(int id) { return (List)powertools.get("" + id); diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/OfflineBedLocation.java b/Essentials/src/com/earth2me/essentials/craftbukkit/OfflineBedLocation.java deleted file mode 100644 index 3ddfd20b5..000000000 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/OfflineBedLocation.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.earth2me.essentials.craftbukkit; - -import com.earth2me.essentials.IEssentials; -import java.util.logging.Level; -import java.util.logging.Logger; -import net.minecraft.server.NBTTagCompound; -import net.minecraft.server.WorldNBTStorage; -import org.bukkit.Location; -import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.craftbukkit.CraftWorld; - - -public class OfflineBedLocation -{ - public static Location getBedLocation(final String playername, final IEssentials ess) - { - try - { - final CraftServer cserver = (CraftServer)ess.getServer(); - if (cserver == null) - { - return null; - } - final WorldNBTStorage wnbtStorage = (WorldNBTStorage)cserver.getHandle().playerFileData; - if (wnbtStorage == null) - { - return null; - } - final NBTTagCompound playerStorage = wnbtStorage.getPlayerData(playername); - if (playerStorage == null) - { - return null; - } - - if (playerStorage.hasKey("SpawnX") && playerStorage.hasKey("SpawnY") && playerStorage.hasKey("SpawnZ")) - { - String spawnWorld = playerStorage.getString("SpawnWorld"); - if ("".equals(spawnWorld)) - { - spawnWorld = cserver.getWorlds().get(0).getName(); - } - return new Location(cserver.getWorld(spawnWorld), playerStorage.getInt("SpawnX"), playerStorage.getInt("SpawnY"), playerStorage.getInt("SpawnZ")); - } - return null; - } - catch (Throwable ex) - { - Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex); - return null; - } - } -} diff --git a/Essentials/src/com/earth2me/essentials/user/UserBase.java b/Essentials/src/com/earth2me/essentials/user/UserBase.java index 9dda2f950..587ed084b 100644 --- a/Essentials/src/com/earth2me/essentials/user/UserBase.java +++ b/Essentials/src/com/earth2me/essentials/user/UserBase.java @@ -1,7 +1,6 @@ package com.earth2me.essentials.user; import com.earth2me.essentials.IEssentials; -import com.earth2me.essentials.craftbukkit.OfflineBedLocation; import com.earth2me.essentials.storage.AsyncStorageObjectHolder; import java.io.File; import lombok.Delegate; @@ -97,11 +96,7 @@ public abstract class UserBase extends AsyncStorageObjectHolder implem @Override public Location getBedSpawnLocation() { - if (isOnlineUser()) { - return base.getBedSpawnLocation(); - } else { - return OfflineBedLocation.getBedLocation(base.getName(), ess); - } + return base.getBedSpawnLocation(); } @Override -- cgit v1.2.3 From 1524a06ac673a04bb092abf0b3879ee6d37fef7b Mon Sep 17 00:00:00 2001 From: ementalo Date: Tue, 24 Apr 2012 12:29:24 +0100 Subject: Updated czech language, thanks tommymortago --- Essentials/src/messages_cs.properties | 711 +++++++++++++++++----------------- 1 file changed, 356 insertions(+), 355 deletions(-) diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index 430d268e7..21d1d6e97 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -4,422 +4,423 @@ # 0.1 version: tomasara413 - Tento preklad neni 100% presny to se opravi v dalsich verzich prekladu # 0.2 version: optimized by mdojcar (modojcar@seznam.cz) - mirne fixy a trochu jsem preklad vylepsil # nektere vyrazy jako "Kicknut" jsou v anglickem zneni (zni to mnohem prirozeneji) +# 0.3 tommymortago - Pro upravy kontaktujte na skype: tomasperzl/ Korektura: Sejsel action=* {0} {1} -addedToAccount=\u00a7a{0} byl p\u00f8id\u00e1n na tvuj ucet. -addedToOthersAccount=\u00a7a{0} bylo pridano na ucet hrace {1}\u00a7a. Novy obnos: {2} -alertBroke=Zniceno: -alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} na: {3} -alertPlaced=Polozeno: -alertUsed=Pouzito: -autoAfkKickReason=Byls Kicknut pro {0} minut AFK. -backAfterDeath=\u00a77Zadej pr\u00c3\u00adkaz /back pro n\u00c3\u00a1vrat do m\u00c3\u00adsta umrt\u00c3\u00ad. -backUsageMsg=\u00a77Navr\u00c3\u00a1cen\u00c3\u00ad na puvodn\u00c3\u00ad m\u00c3\u00adsto. -backupDisabled=Nebyl konfigurovan externi skript! -backupFinished=Zaloha ukoncena +addedToAccount=\u00a7a{0} bylo pripsano na tvuj ucet. +addedToOthersAccount=\u00a7a{0} bylo pripsano na {1}\u00a7a ucet. Nova hodnota: {2} +alertBroke=zniceno: +alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} v: {3} +alertPlaced=polozeno: +alertUsed=pouzito: +autoAfkKickReason=Byl jsi vyhozen za neaktivitu delsi nez {0} minut. +backAfterDeath=\u00a77Pouzij /back, aby ses vratil na misto sve smrti. +backUsageMsg=\u00a77Vracis se na svou minulou pozici. +backupDisabled=Externi zalohovaci script neni nastaven. +backupFinished=Zaloha dokoncena backupStarted=Probiha zaloha -balance=\u00a77Obnos: {0} -balanceTop=\u00a77Nejvyssi obnosy ({0}) +balance=\u00a77Ucet: {0} +balanceTop=\u00a77Nejbohatsi hraci ({0}) banExempt=\u00a7cNemuzes zabanovat tohoto hrace. -banIpAddress=\u00a77IP byla zabanov\u00c3\u00a1na! -bannedIpsFileError=Chyba pri cteni souboru banned-ips.txt -bannedIpsFileNotFound=Soubor banned-ips.txt neexistuje! -bannedPlayersFileError=Chyba pri cteni souboru banne neexistuje! -bigTreeFailure=\u00a7cSpawn velkeho stromu selhal. Zopakuj na hline ci trave. -bigTreeSuccess= \u00a77Velky strom vygenerovan. -blockList=Essentials predavaji tyto prikazy do jin\u00e9ho pluginu: -broadcast=[\u00a7cPrenos\u00a7f]\u00a7a {0} -buildAlert=\u00a7cNemate opravneni stavet -bukkitFormatChanged=Verze Bukkitu byla zmnenena. Verze neni kontrolov\u00c3\u00a1na. -burnMsg=\u00a77Nastavils {0} do ohne po {1} sekund. -canTalkAgain=\u00a77Prave nemuzes psat! -cantFindGeoIpDB=Nelze najit GeoIP databazi! -cantReadGeoIpDB=Nelze precist GeoIP databazi! -cantSpawnItem=\u00a7cNemas povolen item: {0} +banIpAddress=\u00a77IP Adresa byla zabanovana +bannedIpsFileError=Chyba pri nacitani banned-ips.txt +bannedIpsFileNotFound=Soubor banned-ips.txt nebyl nazen. +bannedPlayersFileError=Chyba pri nacitani banned-players.txt +bannedPlayersFileNotFound=Soubor banned-players.txt nebyl nalezen +bigTreeFailure=\u00a7cProblem pri vytvareni velkeho stromu. Zkuste znovu na trave nebo hline. +bigTreeSuccess= \u00a77Velky strom vytvoren. +blockList=Essentials prenechal nasledujici prikazy jinemu pluginu: +broadcast=[\u00a7cSdeleni\u00a7f]\u00a7a {0} +buildAlert=\u00a7cNemas dovoleno stavet. +bukkitFormatChanged=Format kontroly verze Bukkitu zmenen. Verze nebyla zkontrolovana. +burnMsg=\u00a77Zapalil jsi {0} na dobu {1} sekund. +canTalkAgain=\u00a77Muzes opet mluvit. +cantFindGeoIpDB=Nemohu najit GeoIP databazi! +cantReadGeoIpDB=Nemohu precist GeoIP databazi! +cantSpawnItem=\u00a7cNejsi dovoleny spawnout item: {0} chatTypeLocal=[L] chatTypeSpy=[Spy] -commandFailed=Prikaz {0} nemohl byt proveden: -commandHelpFailedForPlugin=Chyba pri ziskavani napovedy: {0} -commandNotLoaded=\u00a7cPrikaz {0} je nezpravne nacten. -compassBearing=\u00a77Lozisko: {0} ({1} stupnu). -configFileMoveError=Premistovani config.yml do zalohove lokace selhalo. -configFileRenameError=Selhalo prejmenovavani souboru config.yml -connectedPlayers=Pripojen\u00c3\u00ad hraci: -connectionFailed=Nepodarilo se otevrit spojeni. -cooldownWithMessage=\u00a7cPrestavka: {0} -corruptNodeInConfig=\u00a74Poznamka: Konfiguracni soubor je poskozeny na {0} radku. -couldNotFindTemplate=Nelze najit sablonu {0} -creatingConfigFromTemplate=Vytvari se nastaveni podle sablony: {0} -creatingEmptyConfig=Vytvari se prazdne nastaveni: {0} -creative=neomezeny +commandFailed=Prikaz {0} selhal. +commandHelpFailedForPlugin=Chyba pri ziskavani pomoci: {0} +commandNotLoaded=\u00a7cPrikaz {0} je nespravne nacteny. +compassBearing=\u00a77Zmena orientace: {0} ({1} stupnu). +configFileMoveError=Chyba pri presouvani config.yml do slozky se zalohou. +configFileRenameError=Chyba pri pokusu o prejmenovani docasneho souboru na config.yml +connectedPlayers=Pripojeni hraci: +connectionFailed=Pokus o otevreni spojeni selhal. +cooldownWithMessage=\u00a7cOdpocet: {0} +corruptNodeInConfig=\u00a74Pozor: Vas konfiguracni soubor ma chybnou {0} poznamku. +couldNotFindTemplate=Nemohu naleznout sablonu: {0} +creatingConfigFromTemplate=Vytvarim config ze sablony: {0} +creatingEmptyConfig=Vytvarim prazdny config: {0} +creative=creative currency={0}{1} -currentWorld=Current World: {0} day=den days=dny -defaultBanReason=Byl jste zabanov\u00c3\u00a1n adminem! -deleteFileError=Nelze smazat soubor: {0} -deleteHome=\u00a77Domov {0} byl odstranen. -deleteJail=\u00a77Veznice {0} byla odstranena. -deleteWarp=\u00a77Warp {0} byl odstranen. -deniedAccessCommand={0} byl odepren pristup k prikazu. -dependancyDownloaded=[Essentials] Zavyslost {0} uspesne stazena. -dependancyException=[Essentials] Chyba pri stahovani zavyslosti -dependancyNotFound=[Essentials] Doporucena zavyslost nenalezena, nyni se stahuje. +defaultBanReason=Banovaci kladivo promluvilo! +deleteFileError=Nemohu smazat soubor: {0} +deleteHome=\u00a77Domov {0} byl uspesne odstranen. +deleteJail=\u00a77Jail {0} byl uspesne odstranen. +deleteWarp=\u00a77Warp {0} byl uspesne odstranen. +deniedAccessCommand=Hraci {0} byl zablokovan prikaz. +dependancyDownloaded=[Essentials] Zavislost {0} uspesne stazena. +dependancyException=[Essentials] Nastala chyba pri pokusu o stazeni zavilosti. +dependancyNotFound=[Essentials] Pozadovana zavilost nenalezena, stahuji nyni. depth=\u00a77Jsi na urovni more. -depthAboveSea=\u00a77Jsi {0} bloku nad urovni more. -depthBelowSea=\u00a77Jsi {0} bloku pod urovni more. -destinationNotSet=Destinace nen\u00c3\u00ad nastavena -disableUnlimited=\u00a77Zak\u00c3\u00a1zano neomezene staveni {0} pro {1}. -disabled=Zak\u00c3\u00a1z\u00c3\u00a1no -disabledToSpawnMob=Spawnovani tohoto moba nen\u00c3\u00ad dovoleno v config.yml. -dontMoveMessage=\u00a77Teleportuje vas za {0}. Nehybejte se. -downloadingGeoIp=Stahovani GeoIP databaze ... to muze chvili trvat (zeme: 0.6 MB, mesto: 20MB) -duplicatedUserdata=Duplicicitni uzivatelska data: {0} a {1} -enableUnlimited=\u00a77Davani neomezeneho mnozstvi {0} hraci {1}. -enabled=Povoleno -enchantmentApplied = \u00a77Kouzlo {0} bylo aplikovano na predmnet ve vasi ruce. -enchantmentNotFound = \u00a7cKouzlo nenalezeno -enchantmentPerm = \u00a7cNemate opravneni pro {0} -enchantmentRemoved = \u00a77Kouzlo {0} bylo odstraneno z predmnetu ve vasi ruce. -enchantments = \u00a77Kouzla: {0} +depthAboveSea=\u00a77Jsi {0} kostek nad urovni more. +depthBelowSea=\u00a77Jsi {0} kostek pod urovni more. +destinationNotSet=Destinace neni nastavena. +disableUnlimited=\u00a77Zablokovano neomezene pokladani {0} hraci {1}. +disabled=zablokovano +disabledToSpawnMob=Spawnuti tohoto moba je zakazno v configuracnim souboru. +dontMoveMessage=\u00a77Teleport bude zahajen za {0}. Nehybej se. +downloadingGeoIp=Stahuji GeoIP databazi ... muze to chvilku trvat (staty: 0.6 MB, mesta: 20MB) +duplicatedUserdata=Duplikovane data hrace: {0} and {1} +enableUnlimited=\u00a77Davam neomezene mnozstvi {0} hraci {1}. +enabled=povoleno +enchantmentApplied = \u00a77Enchant {0} byl aplikovan na tvuj nastroj v ruce. +enchantmentNotFound = \u00a7cTento enchant neexistuje +enchantmentPerm = \u00a7cNemas opravneni na enchant: {0} +enchantmentRemoved = \u00a77Enchant {0} byl odstranen z tveho nastroje v ruce. +enchantments = \u00a77Enchantmenty: {0} errorCallingCommand=Chyba pri volani prikazu /{0} errorWithMessage=\u00a7cChyba: {0} -essentialsHelp1=Soubor je poskozeny a Essentials ho nemuzou otevrit. Essentials jsou nyni neaktivni. Jesli soubor neumite opravit sami, bezte na http://tiny.cc/EssentialsChat -essentialsHelp2=Soubor je poskozeny a Essentials ho nemuzou otevrit. Essentials jsou nyni neaktivni. Jesli soubor neumite opravit sami, zadejte prikaz /essentialshelp ve hre nebo bezte na http://tiny.cc/EssentialsChat -essentialsReload=\u00a77Essentials Reloaded {0} -extinguish=\u00a77Uhaste se sam. -extinguishOthers=\u00a77Jsi uhasen {0}. -failedToCloseConfig=Selhalo zavirani nastaveni {0} -failedToCreateConfig=Selhalo vytvareni nastaveni {0} -failedToWriteConfig=Selhalo psani nastaveni {0} -false=Neaktivn\u00c3\u00ad -feed=\u00a77Tvuj apetit byl zasycen. -feedOther=\u00a77Nasytils hrace {0}. -fileRenameError=Prejmenovavani souboru {0} selhalo -flyMode=\u00a77Set fly mode {0} for {1}. -foreverAlone=\u00a7cNeni nikdo kdo by vam mohl odpovedet. +essentialsHelp1=Soubor je poskozen a Essentials jej nemuze otevrit. Essentials jsou zablokovany. Pokud nemuzete soubor opravit sami, navstivte http://tiny.cc/EssentialsChat +essentialsHelp2=Soubor je poskozen a Essentials jej nemuze otevrit. Essentials jsou zablokovany. Pokud nemuzete soubor opravit sami, pak napiste /essentialshelp ve hre nebo navstivte http://tiny.cc/EssentialsChat +essentialsReload=\u00a77Essentials znovu nacteny. {0} +extinguish=\u00a77Uhasil ses. +extinguishOthers=\u00a77Uhasil jsi hrace {0}. +failedToCloseConfig=Chyba pri uzavreni configu {0} +failedToCreateConfig=Chyba pri vytvoreni configu {0} +failedToWriteConfig=Chyba pri zapisovani do configu {0} +false=nepravda +feed=\u00a77Nasytil jsi se. +feedOther=\u00a77Nasytil jsi hrace {0}. +fileRenameError=Prejmenovani souboru {0} selhalo. +flyMode=\u00a77Povolil jsi letani hraci {0} na {1}. +foreverAlone=\u00a7cNemas komu odepsat. freedMemory=Uvolneno {0} MB. -gameMode=\u00a77Nastavil herni mod {0} hraci {1}. +gameMode=\u00a77Nastavil jsi herni mod z {0} na {1}. gcchunks= chunky, gcentities= entity gcfree=Volna pamet: {0} MB -gcmax=Maximalni pamet: {0} MB -gctotal=Pouzita pamet: {0} MB -geoIpUrlEmpty=GeoIP stahovaci URL je prazdna. -geoIpUrlInvalid=GeoIP stahovaci URL je chybna. -geoipJoinFormat=Hrac {0} pochazi z {1} -godDisabledFor=Zakazan pro {0} -godEnabledFor=Povolan pro {0} -godMode=\u00a77Bozsky mod {0}. -haveBeenReleased=\u00a77Byls propusten -heal=\u00a77Byls uzdraven. -healOther=\u00a77Uzdraveno {0}. -helpConsole=Pro zobrazeni napovedy pro konzoli, typ ?. -helpFrom=\u00a77Commands from {0}: +gcmax=Dostupna pamet: {0} MB +gctotal=Vyuzita pamet: {0} MB +geoIpUrlEmpty=Odkaz na stazeni GeoIP je prazdny. +geoIpUrlInvalid=Odkaz na stazeni GeoIP je chybny. +geoipJoinFormat=Hrac {0} prichazi z {1} +godDisabledFor=zakazan pro {0} +godEnabledFor=povolen pro {0} +godMode=\u00a77God mode {0}. +haveBeenReleased=\u00a77Byl jsi uvolnen +heal=\u00a77Byl jsi uzdraven. +healOther=\u00a77Uzdravil jsi hrace {0}. +helpConsole=Pokud chces videt napovedu z konzole, napis ?. +helpFrom=\u00a77Prikazy od{0}: helpLine=\u00a76/{0}\u00a7f: {1} -helpMatching=\u00a77Commands matching "{0}": +helpMatching=\u00a77Prikazy odpovidajici "{0}": helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Strana \u00a7c{0}\u00a7f z \u00a7c{1}\u00a7f: -helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1} +helpPlugin=\u00a74{0}\u00a7f: Napoveda pluginu: /help {1} holeInFloor=Dira v podlaze homeSet=\u00a77Domov nastaven. -homeSetToBed=\u00a77Tvuj domov je nyni nastaven v tve posteli. -homes=Domy: {0} +homeSetToBed=\u00a77Tvuj domov je nastaven na tuto postel. +homes=Domovy: {0} hour=hodina hours=hodiny -ignorePlayer=Nyni ignorujes hrace {0}. -illegalDate=Nelegalni format dat. -infoChapter=Vyberte kapitolu: -infoChapterPages=Kapitol {0}, strana \u00a7c{1}\u00a7f z \u00a7c{2}\u00a7f: -infoFileDoesNotExist=Soubor info.txt neexistuje. Vytvarim jeden pro tebe. +ignorePlayer=Odted jsi zacal ignorovat hrace {0}. +illegalDate=Nespravny format data. +infoChapter=Vyberte kapitolu: +infoChapterPages=Kapitola {0}, strana \u00a7c{1}\u00a7f z \u00a7c{2}\u00a7f: +infoFileDoesNotExist=Soubor info.txt neexistuje. Vytvarim novy. infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Strana \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- infoUnknownChapter=Neznama kapitola. -invBigger=Ostatni uzivatelske zasoby jsou vyssi nez vase. +invBigger=Inventar druheho hrace je vetsi nez tvuj. invRestored=Tvuj inventar byl obnoven. -invSee=Ty prohlizis inventar hrace {0}. -invSeeHelp=Pouzij prikaz /invsee pro obnoveni tveho inventare. +invSee=Nyni mas inventar hrace {0}. +invSeeHelp=Pouzij znovu /invsee aby jsi mel zpatky svuj inventar. invalidCharge=\u00a7cNeplatny poplatek. -invalidHome=Dum {0} neexistuje -invalidMob=Neplatny typ zivocicha. -invalidServer=Neplatny server! -invalidSignLine=Linka {0} na cedulce je neplatna. -invalidWorld=\u00a7cNeplatny svet. -inventoryCleared=\u00a77Inventar vymazan. +invalidHome=Domov {0} neexistuje. +invalidMob=Nespravny typ moba. +invalidServer=Nespravny server! +invalidSignLine=Radek {0} je chybne vyplnen. +invalidWorld=\u00a7cNespravny svet! +inventoryCleared=\u00a77Inventar smazan. inventoryClearedOthers=\u00a77Inventar hrace \u00a7c{0}\u00a77 vymazan. is=je -itemCannotBeSold=Tuto vec nelze prodat hraci. -itemMustBeStacked=Vec musi byt prodavana v stacich. Mnozstvi 2s, dvou stacku, atd. -itemNotEnough1=\u00a7cNem\u00e1te dostatek t\u00e9to v\u00ecdi k prodeji. -itemNotEnough2=\u00a77Pokud chcete prodat vsechny sv\u00e9 polozky tohoto tipu typ, /sell jmeno veci -itemNotEnough3=\u00a77/sell jmeno veci -1 proda jednu vec tohoto typu. -itemSellAir=Opravdu se snazis prodat vzduch? Vem vec do ruky. -itemSold=\u00a77Prodano za \u00a7c{0} \u00a77({1} {2} v {3} kazdem) -itemSoldConsole={0} prodan {1} pro \u00a77{2} \u00a77({3} veci na {4} kazdem) -itemSpawn=\u00a77Davani {0} {1} -itemsCsvNotLoaded=Nelze nacist items.csv. -jailAlreadyIncarcerated=\u00a7cOsoba je jiz uveznena: {0} -jailMessage=\u00a7cUdelal jste zlocin, tak si dejte na cas. -jailNotExist=Tato veznice neexistuje. -jailReleased=\u00a77Hrac \u00a7e{0}\u00a77 propusten. -jailReleasedPlayerNotify=\u00a77Byls propusten! -jailSentenceExtended=Trest prodlouzen na: {0) -jailSet=\u00a77Doba uvezneni hrace {0} nastavena! -jumpError=Toto poskodi mozek vaseho pocitace. -kickedAll=\u00a7cKicked all players from server -kickDefault=Byl jste kicknut adminem serveru! -kickExempt=\u00a7cNemuzes kicknout tuto osobu. -kill=\u00a77Zabito {0}. -kitError2=\u00a7cTato sada neexistuje nebo neni uplne definovana. -kitError=\u00a7cToto neni platna sada. -kitErrorHelp=\u00a7cPravdepodobne chybi polozka v konfiguraci. -kitGive=\u00a77Davani sady {0}. -kitInvFull=\u00a7cTvuj inventar je plny, umistuji sadu na podlahu. -kitTimed=\u00a7cNemuzete pouzit sadu pro jinou {0}. -kits=\u00a77Sady: {0} -lightningSmited=\u00a77Byls sejmut -lightningUse=\u00a77Blesk seslan na {0} +itemCannotBeSold=Tento item nelze prodat serveru. +itemMustBeStacked=Itemy musi byt vymeneny ve stacku. +itemNotEnough1=\u00a7cNemas dostatek tohoto itemu, aby jsi jej mohl prodat. +itemNotEnough2=\u00a77Pokud jsi chtel prodat vsechny itemy tohoto typu, pouzij /sell nazevitemu +itemNotEnough3=\u00a77/sell nazevnitemu -1 proda vse ale pouze jeden item atd. +itemSellAir=Vazne jsi se pokusil prodat Vzduch? Vezmi si neco do ruky. +itemSold=\u00a77Prodal za \u00a7c{0} \u00a77({1} {2} za cenu {3} kus) +itemSoldConsole={0} Prodal {1} za \u00a77{2} \u00a77({3} za cenu {4} kus) +itemSpawn=\u00a77Davam {0} {1} +itemsCsvNotLoaded=Nelze nacist soubor items.csv. +jailAlreadyIncarcerated=\u00a7cTento hrace ja jiz uveznen: {0} +jailMessage=\u00a7cPorusil jsi pravidla, ted si to odsedis! +jailNotExist=Toto vezeni neexistuje. +jailReleased=\u00a77Hrac \u00a7e{0}\u00a77 byl propusten na svobodu. +jailReleasedPlayerNotify=\u00a77Byl jsi propusten na svobodu! +jailSentenceExtended=Cas ve vezeni prodlouzen na: {0) +jailSet=\u00a77Vezeni {0} bylo vytvoreno. +jumpError=Tohle by tvuj procesor nemusel rozdychat. +kickDefault=Vyhozen ze serveru +kickExempt=\u00a7cNemuzes vyhodit tuhle osobu. +kill=\u00a77Zabit {0}. +kitError2=\u00a7cTento kit neexistuje, nebo je chybne definovan. +kitError=\u00a7cNejsou zadne validni kity. +kitErrorHelp=\u00a7cPravdepodobne item nema vyplnene mnozstvi v configu? +kitGive=\u00a77Davam kit {0}. +kitInvFull=\u00a7cMel jsi plny inventar, obsah kitu je na zemi. +kitTimed=\u00a7cNemuzes pouzit tento kit po dalsich {0}. +kits=\u00a77Kity: {0} +lightningSmited=\u00a77Byl jsi zasazen bleskem. +lightningUse=\u00a77Zasadil jsi bleskem hrace {0} listAfkTag = \u00a77[AFK]\u00a7f -listAmount = \u00a79Jsou tam \u00a7c{0}\u00a79 vsichni ze maximalniho poctu \u00a7c{1}\u00a79 hracu online. -listAmountHidden = \u00a79Jsou tam, \u00a7c{0}\u00a77/{1}\u00a79 vsichni z maximalniho poctu \u00a7c{2}\u00a79 hracu online. -listGroupTag={0}\u00a7f: +listAmount = \u00a79Je tu \u00a7c{0}\u00a79 z maxima \u00a7c{1}\u00a79 hracu online. +listAmountHidden = \u00a79Je tu \u00a7c{0}\u00a77/{1}\u00a79 z maxima \u00a7c{2}\u00a79 hracu online. +listGroupTag={0}\u00a7f: listHiddenTag = \u00a77[HIDDEN]\u00a7f -loadWarpError=Selhalo nacten\u00c3\u00ad warpu {0} -localFormat=Lokalni: <{0}> {1} -mailClear=\u00a7cPro oznaceni prectenyh zprav, typ /mail clear -mailCleared=\u00a77Schranka vyprazdnena! -mailSent=\u00a77Zprava odeslana! -markMailAsRead=\u00a7cPro oznaceni zpravy za prectenou, zadejte /mail clear -markedAsAway=\u00a77Nyni mate ozna\u00e8eno. -markedAsNotAway=\u00a77Nyni nemate ozna\u00e8eno. -maxHomes=Nelze nastavit vice nez {0} domovu. -mayNotJail=\u00a7cNemuzes uveznit tuto osobu +loadWarpError=Chyba pri nacitani warpu: {0} +localFormat=Jazyk: <{0}> {1} +mailClear=\u00a7cPokud chces vymazat mail, napis /mail clear. +mailCleared=\u00a77Mail vymazan! +mailSent=\u00a77Mail odeslan! +markMailAsRead=\u00a7cPokud chces mail oznacit jako precteny, napis /mail clear +markedAsAway=\u00a77Jsi oznacen jako "Pryc". +markedAsNotAway=\u00a77Jiz nejsi oznacen jako "Pryc". +maxHomes=Nemuzes si nastavit vice nez {0} domovu. +mayNotJail=\u00a7cNesmis uveznit tuto postavu me=ja minute=minuta minutes=minuty -missingItems=Nemate {0}x {1}. -missingPrefixSuffix=Chybi Suffix ci Prefix pro {0} -mobSpawnError=Chyba pri zmnene mob spawneru. -mobSpawnLimit=Mnozstvi mobu bylo omezeno na limit serveru -mobSpawnTarget=Cilovy blok musi byt mob spawner. -mobsAvailable=\u00a77Zivocichove: {0} -moneyRecievedFrom=\u00a7a{0} nebyla prijata {1} -moneySentTo=\u00a7a{0} byla odeslana {1} -moneyTaken={0} odesl\u00c3\u00a1no z vaseho bankovniho uctu. -month=mes\u00c3\u00adc -months=mes\u00c3\u00adce -moreThanZero=Mnozstv\u00c3\u00ad musi byt vets\u00c3\u00ad nez 0. +missingItems=Nemas {0}x {1}. +missingPrefixSuffix=Chybi prefix nebo suffix pro {0} +mobSpawnError=Chyba pri pokusu o zmenu mob spawneru. +mobSpawnLimit=Pocet mobu limitovan serverem. +mobSpawnTarget=Musis se divat na spawner. +mobsAvailable=\u00a77Mobove: {0} +moneyRecievedFrom=\u00a7a{0} jsi obdrzel od hrace {1} +moneySentTo=\u00a7a{0} bylo odeslano hraci: {1} +moneyTaken={0} bylo odebrano z tveho uctu. +month=mesic +months=mesice +moreThanZero=Mnozstvi musi byt vetsi nez 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} -muteExempt=\u00a7cHrac byl umlcen. -mutedPlayer=Hrac {0} umlcen. -mutedPlayerFor=Hrac {0} umlcen na {1}. -mutedUserSpeaks={0} se pokusil(a) promluvit, ale je ztiseny(a). -nearbyPlayers=Hraci v blizkosti: {0} -negativeBalanceError=Uzivatel nesmi mit zaporny obnos. -nickChanged=Prezdivka zmnenena. -nickDisplayName=\u00a77Pro povoleni zmneny nicku upravte config Essentials. -nickInUse=\u00a7cToto jmeno je uz pouzivano. -nickNamesAlpha=\u00a7cPrezdivky musi byt alfanumericke. -nickNoMore=\u00a77Uz nem\u00c3\u00a1te prezd\u00c3\u00advku. -nickOthersPermission=\u00a7cNem\u00c3\u00a1te opravnen\u00c3\u00ad pro zmnenu prezd\u00c3\u00advky ostatn\u00c3\u00adch! -nickSet=\u00a77Tvoje prezd\u00c3\u00advka je nyn\u00c3\u00ad \u00a7c{0} -noAccessCommand=\u00a7cNem\u00c3\u00a1te . -noAccessPermission=\u00a7cNemate opravneni pro toto {0}. -noBreakBedrock=Nemas povoleno znicit bedrock. -noDestroyPermission=\u00a7cNemas opravneni k zniceni {0}. -noGodWorldWarning=\u00a7cVarovani! Bozsky mod neni povolen v tomto svete. -noHelpFound=\u00a7cZadne odpovidajici prikazy. -noHomeSet=Nemas nastaveny domov. -noHomeSetPlayer=Tento hrac nema nastaveny domov. -noKitPermission=\u00a7cBudete potrebovat \u00a7c{0}\u00a7c opravneni pro pouzivani teto sady. -noKits=\u00a77Neni zadna dostupna sada -noMail=Nemate zadne nove zpravy -noMotd=\u00a7cNeexistuje zadna zprava ze dne. -noNewMail=\u00a77Nemas zadne nove zpravy. -noPendingRequest=Nemate cekajici zadost. -noPerm=\u00a7cNemate \u00a7f{0}\u00a7c opravneni. -noPermToSpawnMob=\u00a7cNemate opravneni pro spawnuti tohoto zivocicha. -noPlacePermission=\u00a7cNemate opravneni k polozeni tohoto bloku u teto cedulky. -noPowerTools=Nemate zadne pohonene nastroje. -noRules=\u00a7cNejsou zadna specificka pravidla. -noWarpsDefined=Zadny warp nedefinovan +muteExempt=\u00a7cTohoto hrace nemuzes umlcet. +mutedPlayer=Hrac {0} byl umlcen. +mutedPlayerFor=Hrac {0} umlcen za {1}. +mutedUserSpeaks={0} se pokusil promluvit, ale je umlcen. +nearbyPlayers=Hraci v okoli: {0} +negativeBalanceError=Hrac nemuze mit zapornou hodnotu uctu. +nickChanged=Nickname zmenen. +nickDisplayName=\u00a77Musis nejdrive povolit change-displayname v Essentials configu. +nickInUse=\u00a7cTento nick jiz nekdo ma. +nickNamesAlpha=\u00a7cNick musi byt alfanumericky. +nickNoMore=\u00a77Uz nemas zadny nick. +nickOthersPermission=\u00a7cNemas opravneni menit ostatnim nick. +nickSet=\u00a77Nyni mas nickname: \u00a7c{0} +noAccessCommand=\u00a7cNemas povoleni na tento prikaz. +noAccessPermission=\u00a7cNemas povoleni k tomuto {0}. +noBreakBedrock=Nemas opravneni nicit bedrock. +noDestroyPermission=\u00a7cNemas povoleni nicit ten {0}. +noGodWorldWarning=\u00a7cVarovani! God-mode je v tomto svete zakazan. +noHelpFound=\u00a7cZadne shodujici prikazy. +noHomeSet=Nemas nastaveny zadny domov. +noHomeSetPlayer=Hrac nema nastaveny zadny domov. +noKitPermission=\u00a7cPotrebujes \u00a7c{0}\u00a7c permission, aby jsi mohl pouzit tento kit. +noKits=\u00a77Nejsou zadne dostupne kity. +noMail=Nemas zadny mail. +noMotd=\u00a7cNeni zadna zprava dne. +noNewMail=\u00a77Nemas zadny novy mail. +noPendingRequest=Nemas zadne neuzavrene zadosti. +noPerm=\u00a7cNemas \u00a7f{0}\u00a7c permici. +noPermToSpawnMob=\u00a7cNemas povoleni k spawnovani mobu. +noPlacePermission=\u00a7cNemas povoleni pokladat nebo nicit cokoliv blizko teto cedule. +noPowerTools=Nemas zadny mocny nastroj. +noRules=\u00a7cNejsou nastaveny zadne pravidla. +noWarpsDefined=Nejsou nastaveny zadne warpy. none=zadny -notAllowedToQuestion=\u00a7cNejste opravneni pouzivat otazku. -notAllowedToShout=\u00a7cNemate opravneni kricet. -notEnoughExperience=Nemate dostatek skusenosti. -notEnoughMoney=Nemate dostatek financnich prostredku. -notRecommendedBukkit= * ! * Verze bukkitu neni doporucena pro Essentials. -notSupportedYet=Zatim nepodporovany. -nothingInHand = \u00a7cNemate nic v ruce. +notAllowedToQuestion=\u00a7cNejsi opravnen pouzit otazku. +notAllowedToShout=\u00a7cNejsi opravnen pouzit kriceni. +notEnoughExperience=Nemas dostatek zkusenosti. +notEnoughMoney=Nemas dostatecny financni obnos. +notRecommendedBukkit=* ! * Verze bukkitu neni doporucena pro Essentials. +notSupportedYet=Jeste neni podporovano. +nothingInHand = \u00a7cNedrzis nic v ruce. now=nyni -nuke=Muze na ne prset smrt? -numberRequired=Cislo tam jde, hloupe. +nuke=Prsi na tebe smrt :) +numberRequired=Hlupaku, musis vyplnit cislo. onlyDayNight=/time podporuje pouze day/night. -onlyPlayers=Pouzivat mohou pouze hraci ve hre {0}. +onlyPlayers=Pouze hraci ve hre mohou pouzit: {0}. onlySunStorm=/weather podporuje pouze sun/storm. -orderBalances=Razeni obnosu {0} uzivatelu, prosim cekejte ... -pTimeCurrent=\u00a7e{0}\u00a7f cas je {1}. -pTimeCurrentFixed=\u00a7e{0}\u00a7f cas je opraven na {1}. -pTimeNormal=\u00a7e{0}''s\u00a7f cas je normalni a server odpovida. -pTimeOthersPermission=\u00a7cNejste dostatecne opravnen nastavit cas ostatnim hracum. -pTimePlayers=Tito hraci maji svuj vlastni cas: -pTimeReset=Cas hracu byl obnoven pro: \u00a7e{0} -pTimeSet=Cas hracu je nastaven na \u00a73{0}\u00a7f pro: \u00a7e{1} -pTimeSetFixed=Cas hracu je opraven na \u00a73{0}\u00a7f pro: \u00a7e{1} -parseError=Chyba pri analize {0} na radku {1} -pendingTeleportCancelled=\u00a7cZadost o teleport byla zrusena. -permissionsError=Ztracene Permissions/GroupManager; chatove predpony/pripony jsou nyni mimo provoz. -playerBanned=\u00a7cHrac {0} zabanovan {1} za {2} -playerInJail=\u00a7cHrac jiz je uveznen {0}. -playerJailed=\u00a77Hrac {0} uveznen. +orderBalances=Usporadavam bohatstvi {0} hracu, prosim vydrz ... +pTimeCurrent=\u00a7eCas hrace u00a7f je {1}. //??? +pTimeCurrentFixed=\u00a7eCas hrace {0} u00a7f je nastaven na {1}. +pTimeNormal=\u00a7eCas hrace {0}\u00a7f je normalni a souhlasi s casem serveru. +pTimeOthersPermission=\u00a7cNejsi opravnen menit cizim hracum cas. +pTimePlayers=Tihle hraci maji nastaveny svuj cas: +pTimeReset=Cas hrace byl obnoven za: \u00a7e{0} +pTimeSet=Cas hrace je nastaven na \u00a73{0}\u00a7f za: \u00a7e{1} +pTimeSetFixed=Cas hrace je fixne nastaven na \u00a73{0}\u00a7f za: \u00a7e{1} +parseError=Chyba pri parsovani {0} na radku {1} +pendingTeleportCancelled=\u00a7cNevyresena zadost o teleportaci byla zrusena. +permissionsError=Chybi Permissions/GroupManager; prefixy/suffixy v chatu budou zablokovany. +playerBanned=\u00a7cAdmin {0} zabanoval {1} za {2} +playerInJail=\u00a7cHrac je jiz uveznen {0}. +playerJailed=\u00a77Hrac {0} byl uveznen. playerJailedFor= \u00a77Hrac {0} uveznen za {1}. -playerKicked=\u00a7c{0} byl Kicknut hracem {1} za {2} -playerMuted=\u00a77Byls umlcen adminem -playerMutedFor=\u00a77Byls umlcen adminem za {0} -playerNeverOnServer=\u00a7cHrac {0} nikdy nebyl na tomto serveru. +playerKicked=\u00a7cAdmin {0} vyhodil {1} za {2} +playerMuted=\u00a77Byl jsi umlcen. +playerMutedFor=\u00a77Byl jsi umlcen za {0} +playerNeverOnServer=\u00a7cHrac {0} nebyl nikdy na serveru. playerNotFound=\u00a7cHrac nenalezen. -playerUnmuted=\u00a77Muzes opet psat. +playerUnmuted=\u00a77Byl jsi odmlcen. pong=Pong! -possibleWorlds=\u00a77Mozne svety jsou 0 az {0}. -powerToolAir=Prikaz nelze pouzit ve vzduchu. -powerToolAlreadySet=Prikaz \u00a7c{0}\u00a7f je jiz prirazen k {1}. -powerToolAttach=\u00a7c{0}\u00a7f prikaz prirazen k {1}. -powerToolClearAll=Vsechny prikazy pro elektricke naradi byli vymazany. -powerToolList={1} ma nasledujici prikazy: \u00a7c{0}\u00a7f. -powerToolListEmpty={0} nema prizazene prikazy. -powerToolNoSuchCommandAssigned=Prikaz \u00a7c{0}\u00a7f neni prirazen {1}. -powerToolRemove=Prikaz \u00a7c{0}\u00a7f odebran od {1}. -powerToolRemoveAll=Vsechny prikazy odebrany od {0}. -powerToolsDisabled=Elektricke nastroje jsou vyrazeny. -powerToolsEnabled=Elektricke nastroje jsou povoleny. +possibleWorlds=\u00a77Mozne svety jsou cisla 0 az {0}. +powerToolAir=Prikaz nemuze byt spojen se vzduchem. +powerToolAlreadySet=Prikaz \u00a7c{0}\u00a7f je jiz spojen s {1}. +powerToolAttach=\u00a7c{0}\u00a7f prikaz pripsan k {1}. +powerToolClearAll=Vsechny mocne nastroje byli smazany. +powerToolList=Hrac {1} ma tyto prikazy: \u00a7c{0}\u00a7f. +powerToolListEmpty={0} nema pripsany zadne prikazy. +powerToolNoSuchCommandAssigned=Prikaz \u00a7c{0}\u00a7f nebyl pripsan k {1}. +powerToolRemove=Prikaz \u00a7c{0}\u00a7f odstranen z {1}. +powerToolRemoveAll=Vsechny prikazy zruseny od {0}. +powerToolsDisabled=Vsechny tve mocne nastroje byli zablokovany. +powerToolsEnabled=Vsechny tve mocne nastroje byli povoleny. protectionOwner=\u00a76[EssentialsProtect] Majitel ochrany: {0} questionFormat=\u00a77[Otazka]\u00a7f {0} -readNextPage=Zadejte /{0} {1} pro precteni dalsi stranky -reloadAllPlugins=\u00a77Pluginy byly znovu nacteny. -removed=\u00a77Odstraneno {0} entit. -repair=Uspesne si opravil svuj: \u00a7e{0}. -repairAlreadyFixed=\u00a77Tenti item je jiz opraven. -repairEnchanted=\u00a77Bohuzel nemuzes opravit Enchanovane itemy. -repairNone=Tato vec nepotrebuje opravit. -requestAccepted=\u00a77Zadost o teleport prijmuta. -requestAcceptedFrom=\u00a77{0} prijmul tvou zadost o teleport. +readNextPage=Napis /{0} {1} pro precteni dalsi stranky. +reloadAllPlugins=\u00a77Znovu nacteny vsechny pluginy. +removed=\u00a77Odstraneno {0} entitit. +repair=Uspesne jsi opravil svuj nastroj: \u00a7e{0}. +repairAlreadyFixed=\u00a77Tento item nepotrebuje opravu. +repairEnchanted=\u00a77Nemas opravneni opravovat enchantovane itemy. +repairInvalidType=\u00a7cTento item nemuze byt opraven. +repairNone=Nemas zadne itemy, ktere potrebuji opravit. +requestAccepted=\u00a77Zadost o teleport prijata. +requestAcceptedFrom=\u00a77{0} prijal tvou zadost o teleport. requestDenied=\u00a77Zadost o teleport zamitnuta. -requestDeniedFrom=\u00a77{0} zamitl tvou zadost o teleport. -requestSent=\u00a77Zadost zaslana hraci {0}\u00a77. -requestTimedOut=\u00a7cZadost o teleport bohuzelvyprsela -requiredBukkit= * ! * Potrebujete alespon build {0} CraftBukkitu, stahnete jej z http://dl.bukkit.org/downloads/craftbukkit/ -returnPlayerToJailError=Chyba pri navraceni hrace {0} do veznice: {1} +requestDeniedFrom=\u00a77{0} odmitl tvou zadost o teleport. +requestSent=\u00a77Zadost odeslana hraci {0}\u00a77. +requestTimedOut=\u00a7cZadost o teleportaci vyprsela. +requiredBukkit= * ! * Potrebujete minimalne verzi {0} Bukkitu, stahnete si ji z http://dl.bukkit.org/downloads/craftbukkit/ +returnPlayerToJailError=Nastala chyba pri pokusu navraceni hrace {0} do vezeni: {1} second=sekunda seconds=sekundy -seenOffline=Hrac {0} je offline, protoze {1} -seenOnline=Hrac {0} je online, protoze {1} -serverFull=Server je bohuzel plny! :( -serverTotal=Pocet slotu: {0} -setSpawner=Zmnenils tento spawner na {0} spawner -sheepMalformedColor=Poskozena barva. -shoutFormat=\u00a77[Krik]\u00a7f {0} +seenOffline=Hrac {0} je offline od {1} +seenOnline=Hrac {0} je online od {1} +serverFull=Server je plny +serverTotal=Maximum serveru: {0} +setSpawner=Zmenil jsi spawner na: {0} +sheepMalformedColor=Deformovana barva. +shoutFormat=\u00a77[Shout]\u00a7f {0} signFormatFail=\u00a74[{0}] signFormatSuccess=\u00a71[{0}] signFormatTemplate=[{0}] -signProtectInvalidLocation=\u00a74Nemas povoleno zde vytvaret cedule. -similarWarpExist=Warp se shodnym nazvem jiz existuje. -slimeMalformedSize=Poskozena velikost. -soloMob=Tento zivocich je rad sam. -spawnSet=\u00a77Spawnovaci lokace pro skupinu {0}. +signProtectInvalidLocation=\u00a74Nemas opravneni vytvaret zde cedule. +similarWarpExist=Warp s podobnym nebo stejnym jmenem jiz existuje. +slimeMalformedSize=Zdeformovana velikost. +soloMob=Tento mob ma rad, kdyz je sam. +spawnSet=\u00a77Spawn-lokace nastavena pro skupinu: {0}. spawned=spawnut -sudoExempt=Nemuzete sudo tohoto uzivatele -sudoRun=Nuti {0} pro beh: /{1} {2} -suicideMessage=\u00a77Zbohem kruty svete... -suicideSuccess= \u00a77{0} si vzal svuj vlastni zivot +sudoExempt=Nemuzes ovladat tohoto hrace +sudoRun=Nutis hrace {0} k behu: /{1} {2} +suicideMessage=\u00a77Sbohem kruty svete... +suicideSuccess= \u00a77{0} si vzal svuj zivot survival=survival -takenFromAccount=\u00a7c{0} byli prevzaty z vaseho uctu. -takenFromOthersAccount=\u00a7c{0} prevzato z {1}\u00a7c uctu. Novy obnos: {2} -teleportAAll=\u00a77Zadost o teleport byla odeslana celemu serveru... -teleportAll=\u00a77Teleportuji cely server... -teleportAtoB=\u00a77{0}\u00a77 te teleportoval k hraci {1}\u00a77. -teleportDisabled={0} teleportovani je zakazano. -teleportHereRequest=\u00a7c{0}\u00a7c pozadal(a) aby ses k nemu teleportoval(a). -teleportNewPlayerError=Selhal teleport k novemu hraci -teleportRequest=\u00a7c{0}\u00a7c pozadal(a), aby se k v\u00c3\u00a1m mohl(a) teleportovat. -teleportRequestTimeoutInfo=\u00a77Tato zadost vyprsi po {0} sekundach. -teleportTop=\u00a77Teleportuji te nahoru. -teleportationCommencing=\u00a77Zahajuje se telepotovani... -teleportationDisabled=\u00a77Teleportace zakazany. -teleportationEnabled=\u00a77Teleportace povoleny. -teleporting=\u00a77Prob\u00c3\u00adh\u00c3\u00a1 telepov\u00c3\u00a1n\u00c3\u00ad... -teleportingPortal=\u00a77Teleportace prez portal. -tempBanned=Docasne zabanovan na serveru pro {0} -tempbanExempt=\u00a77Nemuzete docasne zabanovat tohoto hrace. -thunder=Ty si nastavil {0} pocasi ve svete -thunderDuration=Ty si nastavil {0} pocasi na tvem svete po dobu {1} sekund. -timeBeforeHeal=Cas do dalsiho vyleceni: {0} -timeBeforeTeleport=Cas do dalsi teleportace: {0} +takenFromAccount=\u00a7c{0} bylo odecteno z tveho uctu. +takenFromOthersAccount=\u00a7c{0} bylo odebrano z {1}\u00a7c uctu. Nova hodnota: {2} +teleportAAll=\u00a77Zadost o teleportaci odeslana vsem hracum... +teleportAll=\u00a77Teleportuji vÅ¡echny hrace... +teleportAtoB=\u00a77{0}\u00a77 vas teleportoval k {1}\u00a77. +teleportDisabled={0} mas teleportaci zablokovanou. +teleportHereRequest=\u00a7c{0}\u00a7c vas pozadal aby jste se warpnul k nemu. +teleportNewPlayerError=Teleportace noveho hrace selhala +teleportRequest=\u00a7c{0}\u00a7c se chce teleportovat k tobe. +teleportRequestTimeoutInfo=\u00a77Tato zadost vyprsi za {0} sekund. +teleportTop=\u00a77Teleportuji na vrch. +teleportationCommencing=\u00a77Teleportace zahajena... +teleportationDisabled=\u00a77Teleportace zakazana. +teleportationEnabled=\u00a77Teleportace povolena. +teleporting=\u00a77Teleportuji... +teleportingPortal=\u00a77Teleportuji pres portal. +tempBanned=Docasne zabanovany na dobu {0} +tempbanExempt=\u00a77Nemel by jsi docasne zabanovat tohoto hrace. +thunder= Nastavil jsi {0} bouri ve tvem svete. +thunderDuration=Nastavil jsi {0} bouri ve svete po {1} sekund. +timeBeforeHeal=Potrebny cas pro dalsi uzdraveni: {0} +timeBeforeTeleport=Potrebny cas pro dalsi teleport: {0} timeFormat=\u00a73{0}\u00a7f nebo \u00a73{1}\u00a7f nebo \u00a73{2}\u00a7f timePattern=(?:([0-9]+)\\s*y[a-z]*[,\\s]*)?(?:([0-9]+)\\s*mo[a-z]*[,\\s]*)?(?:([0-9]+)\\s*w[a-z]*[,\\s]*)?(?:([0-9]+)\\s*d[a-z]*[,\\s]*)?(?:([0-9]+)\\s*h[a-z]*[,\\s]*)?(?:([0-9]+)\\s*m[a-z]*[,\\s]*)?(?:([0-9]+)\\s*(?:s[a-z]*)?)? timeSet=Cas nastaven ve vsech svetech. -timeSetPermission=\u00a7cNejte autorizovan k nastavovani casu. -timeWorldCurrent=Aktualni cas v {0} je \u00a73{1} -timeWorldSet=cas nastaven na {0} ve: \u00a7c{1} -tradeCompleted=\u00a77Obchod dokoncen. -tradeSignEmpty=Obchodni znaceni pro vas nema nic k dispozici. -tradeSignEmptyOwner=Doslo zbozi, odstrante obchodni znaceni. -treeFailure=\u00a7cGenerace stromu selhala. Zopakujte na hline nebo trave. -treeSpawned=\u00a77Strom spawnut. -true=Ano -typeTpaccept=\u00a77Pro teleport, typ \u00a7c/tpaccept\u00a77. -typeTpdeny=\u00a77Pro zamitnuti zadosti, typ \u00a7c/tpdeny\u00a77. -typeWorldName=\u00a77Take muzete zadat nazev konkretniho sveta. -unableToSpawnMob=Udblokujte spawnovani tohoto zivocicha. -unbannedIP=IP odbanovana. +timeSetPermission=\u00a7cNejsi autorizovany ke zmene casu. +timeWorldCurrent=Ve svete {0} je prave \u00a73{1} +timeWorldSet=Cas byl nastaven na {0} ve: \u00a7c{1} +tradeCompleted=\u00a77Vymena kompletni. +tradeSignEmpty=Tato cedule jiz nema dostupny material na vymenu. +tradeSignEmptyOwner=Na teto ceduli dosel material. +treeFailure=\u00a7cNepodarilo se vytvorit strom. Zkus to znovu na trave nebo hline. +treeSpawned=\u00a77Strom vytvoren. +true=pravda +typeTpaccept=\u00a77Pro prijmuti zadosti napis \u00a7c/tpaccept\u00a77. +typeTpdeny=\u00a77Pokud chces odmitnout zadost napis \u00a7c/tpdeny\u00a77. +typeWorldName=\u00a77Muzes take napsat specificky nazev sveta. +unableToSpawnMob=Nemozne spawnout moba. +unbannedIP=Unbanovana IP adresa. unbannedPlayer=Hrac odbanovan. -unignorePlayer=Jiz nejste ignorovan hracem {0}. -unknownItemId=Neplatna identifikace veci: {0} -unknownItemInList=Neplatna vec {0} v {1} listu. -unknownItemName=Neplatne jmeno veci: {0} -unlimitedItemPermission=\u00a7cZadne opravneni k neomezenym vecem {0}. -unlimitedItems=Neomezene veci: -unmutedPlayer=Hrac {0} zesilen. -upgradingFilesError=Chyba pri aktualizaci souboru +unignorePlayer=Prestal jsi ignorovat hrace {0}. +unknownItemId=Nezname ID itemu: {0} +unknownItemInList=Neznamy item {0} v {1} seznamu. +unknownItemName=Neznamy nazev itemu: {0} +unlimitedItemPermission=\u00a7cNemas opravneni pro neomezeny item: {0}. +unlimitedItems=Neomezene itemy: +unmutedPlayer=Hrac {0} byl umlcen. +upgradingFilesError=Chyba pri updatovani souboru. userDoesNotExist=Uzivatel {0} neexistuje. -userIsAway={0} je pric od klavesnice -userIsNotAway={0} je zpet u klavesnice -userJailed=\u00a77Byls uveznen -userUsedPortal={0} pouzij existujici portal k vychodu. -userdataMoveBackError=Nepodarilo se presunout userdata/{0}.tmp do userdata/{1} -userdataMoveError=Nepodarilo se presunout userdata/{0} do userdata/{1}.tmp -usingTempFolderForTesting=Pouzit docasne slozky pro testovani: -versionMismatch=Verze je zastarala! Prosim aktualizujte {0} na nejnovejsi verzi. -versionMismatchAll=Verze je zastarala! Prosim aktualizujte vsechny Essentials jar soubory na nejnovejsi verzi. -voiceSilenced=\u00a77Vas hlas byl umlcen -warpDeleteError=Problem pri odstranovani warp souboru. -warpListPermission=\u00a7cNemate dostatecna opravneni pro zobrazeni listu warpu. +userIsAway={0} je AFK. +userIsNotAway={0} se vratil. +userJailed=\u00a77Byl jsi uveznen. +userUsedPortal={0} pouzil portal pro vychod. +userdataMoveBackError=Chyba pri pokusu o presun userdata/{0}.tmp do userdata/{1} +userdataMoveError=Chyba pri pokusu o presun userdata/{0} do userdata/{1}.tmp +usingTempFolderForTesting=Pouzivam docasnou slozku pro testovani: +versionMismatch=Chyba verzi! Prosim updatuj {0} na stejnou verzi. +versionMismatchAll=Chyba verzi! Prosim, updatuj vsechny Essentials .jar na stejnou verzi. +voiceSilenced=\u00a77Byl jsi ztisen. +warpDeleteError=Vyskytl se problem pri mazani warpu. +warpListPermission=\u00a7cNemas opravneni listovat warpami. warpNotExist=Tento warp neexistuje. -warpOverwrite=\u00a7cNemuzete prepsat tento warp. -warpSet=\u00a77Warp {0} nastaven. -warpUsePermission=\u00a7cNemate dostatecna opravneni k pouziti warpu. -warpingTo=\u00a77Warpuju te do {0}. +warpOverwrite=\u00a7cNemuzes prepsat tento warp. +warpSet=\u00a77Warp {0} vytvoren. +warpUsePermission=\u00a7cNemas opravneni pouzit tento warp. +warpingTo=\u00a77Warpuji te do {0}. warps=Warpy: {0} -warpsCount=\u00a77Jsou tam {0} warpy. Ukazovani stran {1} ze {2}. -weatherStorm=\u00a77Nastavils bourku ve {0} -weatherStormFor=\u00a77Nastavils bourku ve {0} po dobu {1} sekund -weatherSun=\u00a77Nastavils slunecno ve {0} -weatherSunFor=\u00a77Nastavils slunecno ve {0} po dobu {1} sekund -whoisBanned=\u00a79 - Zabanovani hraci: {0} -whoisExp=\u00a79 - Exp Uroven: {0} (Level {1}) -whoisGamemode=\u00a79 - Mod hry: {0} -whoisGeoLocation=\u00a79 - M\u00c3\u00adsto: {0} -whoisGod=\u00a79 - Godmode: {0} +warpsCount=\u00a77Mame zde {0} warpu. Strana {1} z {2}. +weatherStorm=\u00a77Nastavil jsi bourku v {0} +weatherStormFor=\u00a77Nastavil jsi bourku v {0} na {1} sekund. +weatherSun=\u00a77Nastavil jsi slunecne pocasi v {0} +weatherSunFor=\u00a77Nastavil jsi slunecne pocasi v {0} na {1} sekund +whoisBanned=\u00a79 - Zabanovan: {0} +whoisExp=\u00a79 - Exp: {0} (Uroven {1}) +whoisGamemode=\u00a79 - Herni mod: {0} +whoisGeoLocation=\u00a79 - Puvod: {0} +whoisGod=\u00a79 - God mode: {0} whoisHealth=\u00a79 - Zdravi: {0}/20 -whoisIPAddress=\u00a79 - IP Adresy: {0} +whoisIPAddress=\u00a79 - IP Adresa: {0} whoisIs={0} je {1} -whoisJail=\u00a79 - Vezeni: {0} -whoisLocation=\u00a79 - Lokace: ({0}, {1}, {2}, {3}) +whoisJail=\u00a79 - Jail: {0} +whoisLocation=\u00a79 - Pozice: ({0}, {1}, {2}, {3}) whoisMoney=\u00a79 - Penize: {0} whoisOP=\u00a79 - OP: {0} -whoisStatusAvailable=\u00a79 - Status: Dostupny -whoisStatusAway=\u00a79 - Status: \u00a7cAway\u00a7f -worth=\u00a77Stack z {0} hodnoty \u00a7c{1}\u00a77 ({2} vec(i) v {3} kazde) -worthMeta=\u00a77Stack z {0} metadat {1} hodnoty \u00a7c{2}\u00a77 ({3} vec(i) v {4} kazde) -worthSet=Informacni hodnota nastavena +whoisStatusAvailable=\u00a79 - Status: Pritomny +whoisStatusAway=\u00a79 - Status: \u00a7cPryc\u00a7f +worth=\u00a77Stack {0} ceny \u00a7c{1}\u00a77 ({2} kus(u) za {3} kus) +worthMeta=\u00a77Stack {0} s metadaty {1} ceny \u00a7c{2}\u00a77 ({3} kus(u) za {4} kus) +worthSet=Hodnota ceny nastavena year=rok years=roky -youAreHealed=\u00a77Byly ti doplneny zivoty! -youHaveNewMail=\u00a7cMas {0} zprav!\u00a7f Typ \u00a77/mail read\u00a7f pro zabrazeni tvych zprav. \ No newline at end of file +youAreHealed=\u00a77Byl jsi uzdraven. +youHaveNewMail=\u00a7cMas {0} zprav!\u00a7f Napis \u00a77/mail read\u00a7f aby jsi si precetl sve zpravy. -- cgit v1.2.3 From 8d00da9e98c8263ad2002fec3f6adb15129cc95f Mon Sep 17 00:00:00 2001 From: Iaccidentally Date: Tue, 24 Apr 2012 14:57:56 -0300 Subject: Necrodoom's update to items.csv --- Essentials/src/items.csv | 601 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 596 insertions(+), 5 deletions(-) diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index 2e1a331de..57f1f10e0 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -1,5 +1,5 @@ #version: TeamCity -# If you change this file, it will not be automatically updated after the next release. +#If you change this file, it will not be automatically updated after the next release, #item,id,metadata stone,1,0 sstone,1,0 @@ -564,6 +564,8 @@ sandstone,24,0 sastone,24,0 csandstone,24,1 csastone,24,1 +creepsandstone,24,1 +creepsastone,24,1 creepersandstone,24,1 creepersastone,24,1 hieroglyphicsandstone,24,1 @@ -619,7 +621,8 @@ pistonstickbase,29,7 pistonstick,29,7 pistonsbase,29,7 pistons,29,7 -psticky,29,7 +psticky,, +pstick,29,7 spiderweb,30,0 sweb,30,0 web,30,0 @@ -1428,9 +1431,17 @@ jailbarsblock,101,0 jailbarsb,101,0 jailbars,101,0 glasspane,102,0 +glassp,102,0 +paneglass,102,0 +pglass,102,0 flatglass,102,0 +fglass,102,0 skinnyglass,102,0 +sglass,102,0 glassflat,102,0 +glassf,102,0 +glassskinny,102,0 +glasss,102,0 melon,103,0 watermelon,103,0 greenmelon,103,0 @@ -1451,8 +1462,13 @@ stemgreenmelon,105,0 vines,106,0 vine,106,0 greenvines,106,0 +greenvine,106,0 gardenvines,106,0 +gardenvine,106,0 vinesgreen,106,0 +vinegreen,106,0 +vinesgarden,106,0 +vinegarden,106,0 fencegate,107,0 woodenfence,107,0 woodenfencegate,107,0 @@ -2450,7 +2466,7 @@ zombieflesh,367,0 rottenmeat,367,0 zombiemeat,367,0 badflesh,367,0 -poisenflesh,367,0 +poisonflesh,367,0 zombieremains,367,0 enderpearl,368,0 pearl,368,0 @@ -2479,8 +2495,17 @@ goldpebble,371,0 gball,371,0 gpebble,371,0 pigzombienugget,371,0 +pigznugget,371,0 +pzombienugget,371,0 +pznugget,371,0 pigzombieball,371,0 +pigzball,371,0 +pzombieball,371,0 +pzball,371,0 pigzombiepebble,371,0 +pigzpebble,371,0 +pzombiepebble,371,0 +pzpebble,371,0 netherstalk,372,0 deathstalk,372,0 hellstalk,372,0 @@ -2497,6 +2522,23 @@ gvase,374,0 vase,374,0 glassvase,374,0 emptypotion,374,0 +emptymixture,374,0 +emptypotions,374,0 +emptyglassbottle,374,0 +emptybottle,374,0 +emptygbottle,374,0 +emptygvase,374,0 +emptyvase,374,0 +emptyglassvase,374,0 +epotion,374,0 +emixture,374,0 +epotions,374,0 +eglassbottle,374,0 +ebottle,374,0 +egbottle,374,0 +egvase,374,0 +evase,374,0 +eglassvase,374,0 spidereye,375,0 eyeofspider,375,0 spiderseye,375,0 @@ -2556,32 +2598,84 @@ shiningmelon,382,0 gmelon,382,0 smelon,382,0 creeperegg,383,50 +eggcreeper,383,50 skeletonegg,383,51 +eggskeleton,383,51 spideregg,383,52 +eggspider,383,52 giantegg,383,53 +egggiant,383,53 zombieegg,383,54 +eggzombie,383,54 slimeegg,383,55 +eggslime,383,55 ghastegg,383,56 +eggghast,383,56 zombiepigmanegg,383,57 +zpigmanegg,383,57 pigmanegg,383,57 +zombiepmanegg,383,57 +zpmanegg,383,57 +zombiepigmegg,383,57 +zpigmegg,383,57 +zombiepigegg,383,57 +zpigegg,383,57 +zombiepmegg,383,57 +zombiepegg,383,57 +eggzombiepigman,383,57 +eggzpigman,383,57 +eggpigman,383,57 +eggzombiepman,383,57 +eggzpman,383,57 +eggzombiepigm,383,57 +eggzpigm,383,57 +eggzombiepig,383,57 +eggzpig,383,57 +eggzombiepm,383,57 +eggzombiep,383,57 endermanegg,383,58 +eggenderman,383,58 cavespideregg,383,59 -silverfishegg,383,60 +cavespideregg,383,59 +eggsilverfish,383,60 blazeegg,383,61 +eggblaze,383,61 lavaslimeegg,383,62 -magmacubeegg,383,63 +lavacubeegg,383,62 +magmacubeegg,383,62 +magmaslimeegg,383,62 +egglavaslime,383,62 +egglavacube,383,62 +eggmagmacube,383,62 +eggmagmaslime,383,62 pigegg,383,90 +eggpig,383,90 sheepegg,383,91 +eggsheep,383,91 cowegg,383,92 +eggcow,383,92 chickenegg,383,93 +eggchicken,383,93 squidegg,383,94 +eggsquid,383,94 wolfegg,383,95 +eggwolf,383,95 mooshroomegg,383,96 mushroomcowegg,383,96 +eggmooshroom,383,96 +eggmushroomcow,383,96 snowgolemegg,383,97 +sgolemegg,383,97 +eggsnowgolem,383,97 +eggsgolem,383,97 ocelotegg,383,98 +eggocelot,383,98 irongolemegg,383,99 +igolemegg,383,99 +eggirongolem,383,99 +eggigolem,383,99 villageregg,383,120 +eggvillager,383,120 bottleofenchanting,384,0 enchantingbottle,384,0 expbottle,384,0 @@ -2591,48 +2685,545 @@ fireball,385,0 grenade,385,0 goldmusicrecord,2256,0 goldmusicdisk,2256,0 +goldmusicdisc,2256,0 goldmusiccd,2256,0 +13musicrecord,2256,0 +13musicdisk,2256,0 +13musicdisc,2256,0 +13musiccd,2256,0 gomusicrecord,2256,0 gomusicdisk,2256,0 +gomusicdisc,2256,0 gomusiccd,2256,0 goldmrecord,2256,0 goldmdisk,2256,0 +goldmdisc,2256,0 goldmcd,2256,0 +13mrecord,2256,0 +13mdisk,2256,0 +13mdisc,2256,0 +13mcd,2256,0 gomrecord,2256,0 gomdisk,2256,0 +gomdisc,2256,0 gomcd,2256,0 goldrecord,2256,0 golddisk,2256,0 +golddisc,2256,0 goldcd,2256,0 +13record,2256,0 +13disk,2256,0 +13disc,2256,0 +13cd,2256,0 gorecord,2256,0 godisk,2256,0 +godisc,2256,0 gocd,2256,0 record1,2256,0 +disk1,2256,0 +disc1,2256,0 +cd1,2256,0 +1record,2256,0 +1disk,2256,0 +1disc,2256,0 +1cd,2256,0 greenmusicrecord,2257,0 greenmusicdisk,2257,0 +greenmusicdisc,2257,0 greenmusiccd,2257,0 +catmusicrecord,2257,0 +catmusicdisk,2257,0 +catmusicdisc,2257,0 +catmusiccd,2257,0 grmusicrecord,2257,0 grmusicdisk,2257,0 +grmusicdisc,2257,0 grmusiccd,2257,0 greenmrecord,2257,0 greenmdisk,2257,0 +greenmdisc,2257,0 greenmcd,2257,0 +catmrecord,2257,0 +catmdisk,2257,0 +catmdisc,2257,0 +catmcd,2257,0 grmrecord,2257,0 grmdisk,2257,0 +grmdisc,2257,0 grmcd,2257,0 greenrecord,2257,0 greendisk,2257,0 +greendisc,2257,0 greencd,2257,0 +catrecord,2257,0 +catdisk,2257,0 +catdisc,2257,0 +catcd,2257,0 grrecord,2257,0 grdisk,2257,0 +grdisc,2257,0 grcd,2257,0 record2,2257,0 +disk2,2257,0 +disc2,2257,0 +cd2,2257,0 +2record,2257,0 +2disk,2257,0 +2disc,2257,0 +2cd,2257,0 +orangemusicrecord,2258,0 +orangemusicdisk,2258,0 +orangemusicdisc,2258,0 +orangemusiccd,2258,0 +blocksmusicrecord,2258,0 +blocksmusicdisk,2258,0 +blocksmusicdisc,2258,0 +blocksmusiccd,2258,0 +ormusicrecord,2258,0 +ormusicdisk,2258,0 +ormusicdisc,2258,0 +ormusiccd,2258,0 +orangemrecord,2258,0 +orangemdisk,2258,0 +orangemdisc,2258,0 +orangemcd,2258,0 +blocksmrecord,2258,0 +blocksmdisk,2258,0 +blocksmdisc,2258,0 +blocksmcd,2258,0 +ormrecord,2258,0 +ormdisk,2258,0 +ormdisc,2258,0 +ormcd,2258,0 +orangerecord,2258,0 +orangedisk,2258,0 +orangedisc,2258,0 +orangecd,2258,0 +blocksrecord,2258,0 +blocksdisk,2258,0 +blocksdisc,2258,0 +blockscd,2258,0 +orrecord,2258,0 +ordisk,2258,0 +ordisc,2258,0 +orcd,2258,0 record3,2258,0 +disk3,2258,0 +disc3,2258,0 +cd3,2258,0 +3record,2258,0 +3disk,2258,0 +3disc,2258,0 +3cd,2258,0 +redmusicrecord,2259,0 +redmusicdisk,2259,0 +redmusicdisc,2259,0 +redmusiccd,2259,0 +chripmusicrecord,2259,0 +chripmusicdisk,2259,0 +chripmusicdisc,2259,0 +chripmusiccd,2259,0 +remusicrecord,2259,0 +remusicdisk,2259,0 +remusicdisc,2259,0 +remusiccd,2259,0 +redmrecord,2259,0 +redmdisk,2259,0 +redmdisc,2259,0 +redmcd,2259,0 +chripmrecord,2259,0 +chripmdisk,2259,0 +chripmdisc,2259,0 +chripmcd,2259,0 +remrecord,2259,0 +remdisk,2259,0 +remdisc,2259,0 +remcd,2259,0 +redrecord,2259,0 +reddisk,2259,0 +reddisc,2259,0 +redcd,2259,0 +chriprecord,2259,0 +chripdisk,2259,0 +chripdisc,2259,0 +chripcd,2259,0 +rerecord,2259,0 +redisk,2259,0 +redisc,2259,0 +recd,2259,0 record4,2259,0 +disk4,2259,0 +disc4,2259,0 +cd4,2259,0 +4record,2259,0 +4disk,2259,0 +4disc,2259,0 +4cd,2259,0 +lightgreenmusicrecord,2260,0 +lightgreenmusicdisk,2260,0 +lightgreenmusicdisc,2260,0 +lightgreenmusiccd,2260,0 +lgreenmusicrecord,2260,0 +lgreenmusicdisk,2260,0 +lgreenmusicdisc,2260,0 +lgreenmusiccd,2260,0 +lightgrmusicrecord,2260,0 +lightgrmusicdisk,2260,0 +lightgrmusicdisc,2260,0 +lightgrmusiccd,2260,0 +farmusicrecord,2260,0 +farmusicdisk,2260,0 +farmusicdisc,2260,0 +farmusiccd,2260,0 +lgrmusicrecord,2260,0 +lgrmusicdisk,2260,0 +lgrmusicdisc,2260,0 +lgrmusiccd,2260,0 +lightgreenmrecord,2260,0 +lightgreenmdisk,2260,0 +lightgreenmdisc,2260,0 +lightgreenmcd,2260,0 +lgreenmrecord,2260,0 +lgreenmdisk,2260,0 +lgreenmdisc,2260,0 +lgreenmcd,2260,0 +lightgrmrecord,2260,0 +lightgrmdisk,2260,0 +lightgrmdisc,2260,0 +lightgrmcd,2260,0 +farmrecord,2260,0 +farmdisk,2260,0 +farmdisc,2260,0 +farmcd,2260,0 +lgrmrecord,2260,0 +lgrmdisk,2260,0 +lgrmdisc,2260,0 +lgrmcd,2260,0 +lightgreenrecord,2260,0 +lightgreendisk,2260,0 +lightgreendisc,2260,0 +lightgreencd,2260,0 +lgreenrecord,2260,0 +lgreendisk,2260,0 +lgreendisc,2260,0 +lgreencd,2260,0 +lightgrrecord,2260,0 +lightgrdisk,2260,0 +lightgrdisc,2260,0 +lightgrcd,2260,0 +farrecord,2260,0 +fardisk,2260,0 +fardisc,2260,0 +farcd,2260,0 +lgrrecord,2260,0 +lgrdisk,2260,0 +lgrdisc,2260,0 +lgrcd,2260,0 record5,2260,0 +disk5,2260,0 +disc5,2260,0 +cd5,2260,0 +5record,2260,0 +5disk,2260,0 +5disc,2260,0 +5cs,2260,0 +purplemusicrecord,2261,0 +purplemusicdisk,2261,0 +purplemusicdisc,2261,0 +purplemusiccd,2261,0 +mallmusicrecord,2261,0 +mallmusicdisk,2261,0 +mallmusicdisc,2261,0 +mallmusiccd,2261,0 +pumusicrecord,2261,0 +pumusicdisk,2261,0 +pumusicdisc,2261,0 +pumusiccd,2261,0 +purplemrecord,2261,0 +purplemdisk,2261,0 +purplemdisc,2261,0 +purplemcd,2261,0 +mallmrecord,2261,0 +mallmdisk,2261,0 +mallmdisc,2261,0 +mallmcd,2261,0 +pumrecord,2261,0 +pumdisk,2261,0 +pumdisc,2261,0 +pumcd,2261,0 +purplerecord,2261,0 +purpledisk,2261,0 +purpledisc,2261,0 +purplecd,2261,0 +mallrecord,2261,0 +malldisk,2261,0 +malldisc,2261,0 +mallcd,2261,0 +purecord,2261,0 +pudisk,2261,0 +pudisc,2261,0 +pucd,2261,0 record6,2261,0 +disk6,2261,0 +disc6,2261,0 +cd6,2261,0 +6record,2261,0 +6disk,2261,0 +6disc,2261,0 +6cd,2261,0 +pinkmusicrecord,2262,0 +pinkmusicdisk,2262,0 +pinkmusicdisc,2262,0 +pinkmusiccd,2262,0 +mellohimusicrecord,2262,0 +mellohimusicdisk,2262,0 +mellohimusicdisc,2262,0 +mellohimusiccd,2262,0 +pimusicrecord,2262,0 +pimusicdisk,2262,0 +pimusicdisc,2262,0 +pimusiccd,2262,0 +pinkmrecord,2262,0 +pinkmdisk,2262,0 +pinkmdisc,2262,0 +pinkmcd,2262,0 +mellohimrecord,2262,0 +mellohimdisk,2262,0 +mellohimdisc,2262,0 +mellohimcd,2262,0 +pimrecord,2262,0 +pimdisk,2262,0 +pimdisc,2262,0 +pimcd,2262,0 +pinkrecord,2262,0 +pinkdisk,2262,0 +pinkdisc,2262,0 +pinkcd,2262,0 +mellohirecord,2262,0 +mellohidisk,2262,0 +mellohidisc,2262,0 +mellohicd,2262,0 +pirecord,2262,0 +pidisk,2262,0 +pidisc,2262,0 +picd,2262,0 record7,2262,0 +disk7,2262,0 +disc7,2262,0 +cd7,2262,0 +7record,2262,0 +7disk,2262,0 +7disc,2262,0 +7cd,2262,0 +blackmusicrecord,2263,0 +blackmusicdisk,2263,0 +blackmusicdisc,2263,0 +blackmusiccd,2263,0 +stalmusicrecord,2263,0 +stalmusicdisk,2263,0 +stalmusicdisc,2263,0 +stalmusiccd,2263,0 +blmusicrecord,2263,0 +blmusicdisk,2263,0 +blmusicdisc,2263,0 +blmusiccd,2263,0 +blackmrecord,2263,0 +blackmdisk,2263,0 +blackmdisc,2263,0 +blackmcd,2263,0 +stalmrecord,2263,0 +stalmdisk,2263,0 +stalmdisc,2263,0 +stalmcd,2263,0 +blmrecord,2263,0 +blmdisk,2263,0 +blmdisc,2263,0 +blmcd,2263,0 +blackrecord,2263,0 +blackdisk,2263,0 +blackdisc,2263,0 +blackcd,2263,0 +stalrecord,2263,0 +staldisk,2263,0 +staldisc,2263,0 +stalcd,2263,0 +blrecord,2263,0 +bldisk,2263,0 +bldisc,2263,0 +blcd,2263,0 record8,2263,0 +disk8,2263,0 +disc8,2263,0 +cd8,2263,0 +8record,2263,0 +8disk,2263,0 +8disc,2263,0 +8cd,2263,0 +whitemusicrecord,2264,0 +whitemusicdisk,2264,0 +whitemusicdisc,2264,0 +whitemusiccd,2264,0 +stradmusicrecord,2264,0 +stradmusicdisk,2264,0 +stradmusicdisc,2264,0 +stradmusiccd,2264,0 +whmusicrecord,2264,0 +whmusicdisk,2264,0 +whmusicdisc,2264,0 +whmusiccd,2264,0 +whitemrecord,2264,0 +whitemdisk,2264,0 +whitemdisc,2264,0 +whitemcd,2264,0 +stradmrecord,2264,0 +stradmdisk,2264,0 +stradmdisc,2264,0 +stradmcd,2264,0 +whmrecord,2264,0 +whmdisk,2264,0 +whmdisc,2264,0 +whmcd,2264,0 +whiterecord,2264,0 +whitedisk,2264,0 +whitedisc,2264,0 +whitecd,2264,0 +stradrecord,2264,0 +straddisk,2264,0 +straddisc,2264,0 +stradcd,2264,0 +whrecord,2264,0 +whdisk,2264,0 +whdisc,2264,0 +whcd,2264,0 record9,2264,0 +disk9,2264,0 +disc9,2264,0 +cd9,2264,0 +9record,2264,0 +9disk,2264,0 +9disc,2264,0 +9cd,2264,0 +darkgreenmusicrecord,2265,0 +darkgreenmusicdisk,2265,0 +darkgreenmusicdisc,2265,0 +darkgreenmusiccd,2265,0 +dgreenmusicrecord,2265,0 +dgreenmusicdisk,2265,0 +dgreenmusicdisc,2265,0 +dgreenmusiccd,2265,0 +darkgrmusicrecord,2265,0 +darkgrmusicdisk,2265,0 +darkgrmusicdisc,2265,0 +darkgrmusiccd,2265,0 +wardmusicrecord,2265,0 +wardmusicdisk,2265,0 +wardmusicdisc,2265,0 +wardmusiccd,2265,0 +dgrmusicrecord,2265,0 +dgrmusicdisk,2265,0 +dgrmusicdisc,2265,0 +dgrmusiccd,2265,0 +darkgreenmrecord,2265,0 +darkgreenmdisk,2265,0 +darkgreenmdisc,2265,0 +darkgreenmcd,2265,0 +dgreenmrecord,2265,0 +dgreenmdisk,2265,0 +dgreenmdisc,2265,0 +dgreenmcd,2265,0 +darkgrmrecord,2265,0 +darkgrmdisk,2265,0 +darkgrmdisc,2265,0 +darkgrmcd,2265,0 +wardmrecord,2265,0 +wardmdisk,2265,0 +wardmdisc,2265,0 +wardmcd,2265,0 +dgrmrecord,2265,0 +dgrmdisk,2265,0 +dgrmdisc,2265,0 +dgrmcd,2265,0 +darkgreenrecord,2265,0 +darkgreendisk,2265,0 +darkgreendisc,2265,0 +darkgreencd,2265,0 +dgreenrecord,2265,0 +dgreendisk,2265,0 +dgreendisc,2265,0 +dgreencd,2265,0 +darkgrrecord,2265,0 +darkgrdisk,2265,0 +darkgrdisc,2265,0 +darkgrcd,2265,0 +wardrecord,2265,0 +warddisk,2265,0 +warddisc,2265,0 +wardcd,2265,0 +dgrrecord,2265,0 +dgrdisk,2265,0 +dgrdisc,2265,0 +dgrcd,2265,0 record10,2265,0 +disk10,2265,0 +disc10,2265,0 +cd10,2265,0 +10record,2265,0 +10disk,2265,0 +10disc,2265,0 +10cs,2265,0 +crackedmusicrecord,2266,0 +crackedmusicdisk,2266,0 +crackedmusicdisc,2266,0 +crackedmusiccd,2266,0 +crackmusicrecord,2266,0 +crackmusicdisk,2266,0 +crackmusicdisc,2266,0 +crackmusiccd,2266,0 +11musicrecord,2266,0 +11musicdisk,2266,0 +11musicdisc,2266,0 +11musiccd,2266,0 +cmusicrecord,2266,0 +cmusicdisk,2266,0 +cmusicdisc,2266,0 +cmusiccd,2266,0 +crackedmrecord,2266,0 +crackedmdisk,2266,0 +crackedmdisc,2266,0 +crackedmcd,2266,0 +crackmrecord,2266,0 +crackmdisk,2266,0 +crackmdisc,2266,0 +crackmcd,2266,0 +11mrecord,2266,0 +11mdisk,2266,0 +11mdisc,2266,0 +11mcd,2266,0 +cmrecord,2266,0 +cmdisk,2266,0 +cmdisc,2266,0 +cmcd,2266,0 +crackedrecord,2266,0 +crackeddisk,2266,0 +crackeddisc,2266,0 +crackedcd,2266,0 +crackrecord,2266,0 +crackdisk,2266,0 +crackdisc,2266,0 +crackcd,2266,0 +11record,2266,0 +11disk,2266,0 +11disc,2266,0 +11cd,2266,0 +crecord,2266,0 +cdisk,2266,0 +cdisc,2266,0 +ccd,2266,0 record11,2266,0 +disk11,2266,0 +disc11,2266,0 +cd11,2266,0 +11record,2264,0 +11disk,2264,0 +11disc,2264,0 +11cd,2264,0 \ No newline at end of file -- cgit v1.2.3 From 0668c4214e406cebf40264d6f1307ca2323b2d9b Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 24 Apr 2012 21:48:28 +0300 Subject: Fix items.csv --- Essentials/src/items.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index 57f1f10e0..38f74eb1c 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -621,7 +621,6 @@ pistonstickbase,29,7 pistonstick,29,7 pistonsbase,29,7 pistons,29,7 -psticky,, pstick,29,7 spiderweb,30,0 sweb,30,0 @@ -2636,7 +2635,8 @@ eggzombiep,383,57 endermanegg,383,58 eggenderman,383,58 cavespideregg,383,59 -cavespideregg,383,59 +eggcavespider,383,59 +silverfishegg,383,60 eggsilverfish,383,60 blazeegg,383,61 eggblaze,383,61 -- cgit v1.2.3 From 6d1e2dd10eb38ad4ad582a633f80e1e8443174c9 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 25 Apr 2012 17:01:45 +1000 Subject: /me crashes ementalo's face for making the client crash. --- Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 71a6beb54..4fb192293 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -420,9 +420,7 @@ public class EssentialsPlayerListener implements Listener if (event.getView().getTopInventory().getType() == InventoryType.PLAYER) { final User user = ess.getUser(event.getWhoClicked()); - final User invOwner = ess.getUser(event.getView().getPlayer()); - if (user.isInvSee() && !user.isAuthorized("essentials.invsee.modify") - || invOwner.isAuthorized("essentials.invsee.preventmodify")) + if (user.isInvSee() && !user.isAuthorized("essentials.invsee.modify")) { event.setCancelled(true); } -- cgit v1.2.3 From e37b1946f552ae6a4dd6c6d66c4664cb382ac415 Mon Sep 17 00:00:00 2001 From: ementalo Date: Wed, 25 Apr 2012 11:27:18 +0100 Subject: Latest items.csv by necrodoom --- Essentials/src/items.csv | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index 38f74eb1c..7f20e1048 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -621,6 +621,7 @@ pistonstickbase,29,7 pistonstick,29,7 pistonsbase,29,7 pistons,29,7 +psticky,29,7 pstick,29,7 spiderweb,30,0 sweb,30,0 @@ -1060,9 +1061,13 @@ fire,51,0 flame,51,0 flames,51,0 mobspawner,52,0 +mobcage,52,0 monsterspawner,52,0 +monstercage,52,0 mspawner,52,0 +mcage,52,0 spawner,52,0 +cage,52,0 woodenstairs,53,0 woodstairs,53,0 wstairs,53,0 @@ -1490,6 +1495,8 @@ cementstairs,109,0 cementbstairs,109,0 greybrickstairs,109,0 greybstairs,109,0 +purplegrass,110,0 +pinkgrass,110,0 mycel,110,0 mycelium,110,0 swampgrass,110,0 @@ -2487,6 +2494,7 @@ ghosttear,370,0 ghostdrop,370,0 gtear,370,0 gdrop,370,0 +tear,370,0 goldnugget,371,0 gnugget,371,0 goldball,371,0 @@ -2520,18 +2528,12 @@ gbottle,374,0 gvase,374,0 vase,374,0 glassvase,374,0 -emptypotion,374,0 -emptymixture,374,0 -emptypotions,374,0 emptyglassbottle,374,0 emptybottle,374,0 emptygbottle,374,0 emptygvase,374,0 emptyvase,374,0 emptyglassvase,374,0 -epotion,374,0 -emixture,374,0 -epotions,374,0 eglassbottle,374,0 ebottle,374,0 egbottle,374,0 @@ -2583,11 +2585,13 @@ icauldronitem,380,0 scauldronitem,380,0 eyeofender,381,0 endereye,381,0 +enderpearl,381,0 evilendereye,381,0 evileyeofender,381,0 evilenderpearl,381,0 eeye,381,0 eofender,381,0 +epearl,381,0 speckledmelon,382,0 goldmelon,382,0 sparklymelon,382,0 @@ -2634,8 +2638,8 @@ eggzombiepm,383,57 eggzombiep,383,57 endermanegg,383,58 eggenderman,383,58 -cavespideregg,383,59 eggcavespider,383,59 +cavespideregg,383,59 silverfishegg,383,60 eggsilverfish,383,60 blazeegg,383,61 @@ -3211,10 +3215,6 @@ crackrecord,2266,0 crackdisk,2266,0 crackdisc,2266,0 crackcd,2266,0 -11record,2266,0 -11disk,2266,0 -11disc,2266,0 -11cd,2266,0 crecord,2266,0 cdisk,2266,0 cdisc,2266,0 @@ -3223,7 +3223,7 @@ record11,2266,0 disk11,2266,0 disc11,2266,0 cd11,2266,0 -11record,2264,0 -11disk,2264,0 -11disc,2264,0 -11cd,2264,0 \ No newline at end of file +11record,2266,0 +11disk,2266,0 +11disc,2266,0 +11cd,2266,0 \ No newline at end of file -- cgit v1.2.3 From 95e6db679775d7ecb95ece8192b350f4c87169cb Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 26 Apr 2012 10:41:24 +0200 Subject: Revert "New config option 'cancel-afk-on-move' - Set to false you don't use afk." -- This should fix afk mode. This reverts commit d927d047650fdbc53d3993611c91d172397a77c8. Conflicts: Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java --- .../essentials/EssentialsPlayerListener.java | 45 ++++++++++------------ .../src/com/earth2me/essentials/ISettings.java | 10 ++--- .../src/com/earth2me/essentials/Settings.java | 26 ++----------- Essentials/src/config.yml | 5 --- 4 files changed, 29 insertions(+), 57 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 4fb192293..b062d6ed4 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -73,40 +73,37 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerMove(final PlayerMoveEvent event) { - if ((!ess.getSettings().cancelAfkOnMove() && !ess.getSettings().getFreezeAfkPlayers()) - || event.getFrom().getBlockX() == event.getTo().getBlockX() - && event.getFrom().getBlockZ() == event.getTo().getBlockZ() - && event.getFrom().getBlockY() == event.getTo().getBlockY()) + if (event.getFrom().getBlockX() == event.getTo().getBlockX() + && event.getFrom().getBlockZ() == event.getTo().getBlockZ() + && event.getFrom().getBlockY() == event.getTo().getBlockY()) { return; } final User user = ess.getUser(event.getPlayer()); - if (user.isAfk()) + + if (user.isAfk() && ess.getSettings().getFreezeAfkPlayers()) { - if (ess.getSettings().getFreezeAfkPlayers()) + final Location from = event.getFrom(); + final Location to = event.getTo().clone(); + to.setX(from.getX()); + to.setY(from.getY()); + to.setZ(from.getZ()); + try { - final Location from = event.getFrom(); - final Location to = event.getTo().clone(); - to.setX(from.getX()); - to.setY(from.getY()); - to.setZ(from.getZ()); - try - { - event.setTo(Util.getSafeDestination(to)); - } - catch (Exception ex) - { - event.setTo(to); - } - return; + event.setTo(Util.getSafeDestination(to)); } - - final Location afk = user.getAfkPosition(); - if (afk == null || event.getTo().getWorld() != afk.getWorld() || afk.distanceSquared(event.getTo()) > 9) + catch (Exception ex) { - user.updateActivity(true); + event.setTo(to); } + return; + } + + final Location afk = user.getAfkPosition(); + if (afk == null || !event.getTo().getWorld().equals(afk.getWorld()) || afk.distanceSquared(event.getTo()) > 9) + { + user.updateActivity(true); } } diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index 8eca8f06f..2c07ccd58 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -127,7 +127,7 @@ public interface ISettings extends IConf boolean removeGodOnDisconnect(); boolean changeDisplayName(); - + boolean changePlayerListName(); boolean isPlayerCommand(String string); @@ -146,8 +146,6 @@ public interface ISettings extends IConf boolean getFreezeAfkPlayers(); - boolean cancelAfkOnMove(); - boolean areDeathMessagesEnabled(); public void setDebug(boolean debug); @@ -167,12 +165,12 @@ public interface ISettings extends IConf EventPriority getRespawnPriority(); long getTpaAcceptCancellation(); - + boolean isMetricsEnabled(); - + void setMetricsEnabled(boolean metricsEnabled); long getTeleportInvulnerability(); - + boolean isTeleportInvulnerability(); } diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 5d49c52b8..281280122 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -385,8 +385,6 @@ public class Settings implements ISettings teleportInvulnerability = _isTeleportInvulnerability(); disableItemPickupWhileAfk = _getDisableItemPickupWhileAfk(); registerBackInListener = _registerBackInListener(); - cancelAfkOnMove = _cancelAfkOnMove(); - getFreezeAfkPlayers = _getFreezeAfkPlayers(); itemSpawnBl = _getItemSpawnBlacklist(); kits = _getKits(); chatFormats.clear(); @@ -656,30 +654,12 @@ public class Settings implements ISettings { return config.getLong("auto-afk-kick", -1); } - private boolean getFreezeAfkPlayers; @Override public boolean getFreezeAfkPlayers() - { - return getFreezeAfkPlayers; - } - - private boolean _getFreezeAfkPlayers() { return config.getBoolean("freeze-afk-players", false); } - private boolean cancelAfkOnMove; - - @Override - public boolean cancelAfkOnMove() - { - return cancelAfkOnMove; - } - - private boolean _cancelAfkOnMove() - { - return config.getBoolean("cancel-afk-on-move", true); - } @Override public boolean areDeathMessagesEnabled() @@ -711,18 +691,20 @@ public class Settings implements ISettings { return config.getBoolean("world-teleport-permissions", false); } - private boolean registerBackInListener; + private boolean registerBackInListener; + @Override public boolean registerBackInListener() { return registerBackInListener; } - + private boolean _registerBackInListener() { return config.getBoolean("register-back-in-listener", false); } + private boolean disableItemPickupWhileAfk; @Override diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index c7c9decb0..e8378f77e 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -272,11 +272,6 @@ freeze-afk-players: false # Enable this, when you don't want people idling in mob traps. disable-item-pickup-while-afk: false -# Should we automatically remove afk status when the player moves? -# Player will be removed from afk on chat/command reguardless of this setting. -# Disable this to reduce server lag. -cancel-afk-on-move: true - # You can disable the death messages of minecraft here death-messages: true -- cgit v1.2.3 From 705efc60024167002b2ecf7114d5fae9dcca6c05 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 5 May 2012 20:01:18 +1000 Subject: We can't damage and kill, so we will just kill to make everyone happy, and the event pointless. --- Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java b/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java index 50933c8f5..ab5643953 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java @@ -3,7 +3,6 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import org.bukkit.Server; -import org.bukkit.event.entity.EntityDamageEvent; public class Commandsuicide extends EssentialsCommand @@ -16,9 +15,6 @@ public class Commandsuicide extends EssentialsCommand @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - EntityDamageEvent ede = new EntityDamageEvent(user.getBase(), EntityDamageEvent.DamageCause.SUICIDE, 1000); - server.getPluginManager().callEvent(ede); - user.damage(1000); user.setHealth(0); user.sendMessage(_("suicideMessage")); user.setDisplayNick(); -- cgit v1.2.3 From d3397279f6a6555c878edc5acf3a4943c3578334 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 6 May 2012 16:09:47 +0100 Subject: Revert "We can't damage and kill, so we will just kill to make everyone happy, and the event pointless." This reverts commit 705efc60024167002b2ecf7114d5fae9dcca6c05. Also fix kill to do the same. --- Essentials/src/com/earth2me/essentials/commands/Commandkill.java | 5 ++--- Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkill.java b/Essentials/src/com/earth2me/essentials/commands/Commandkill.java index 566cb69d5..77994f156 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkill.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkill.java @@ -24,15 +24,14 @@ public class Commandkill extends EssentialsCommand for (Player matchPlayer : server.matchPlayer(args[0])) { - final EntityDamageEvent ede = new EntityDamageEvent(matchPlayer, sender instanceof Player && ((Player)sender).getName().equals(matchPlayer.getName()) ? EntityDamageEvent.DamageCause.SUICIDE : EntityDamageEvent.DamageCause.CUSTOM, 1000); + final EntityDamageEvent ede = new EntityDamageEvent(matchPlayer, sender instanceof Player && ((Player)sender).getName().equals(matchPlayer.getName()) ? EntityDamageEvent.DamageCause.SUICIDE : EntityDamageEvent.DamageCause.CUSTOM, Short.MAX_VALUE); server.getPluginManager().callEvent(ede); if (ede.isCancelled() && !sender.hasPermission("essentials.kill.force")) { continue; } - matchPlayer.damage(1000); - matchPlayer.setHealth(0); + matchPlayer.damage(Short.MAX_VALUE); sender.sendMessage(_("kill", matchPlayer.getDisplayName())); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java b/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java index ab5643953..84c9fc489 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import org.bukkit.Server; +import org.bukkit.event.entity.EntityDamageEvent; public class Commandsuicide extends EssentialsCommand @@ -15,7 +16,9 @@ public class Commandsuicide extends EssentialsCommand @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - user.setHealth(0); + EntityDamageEvent ede = new EntityDamageEvent(user.getBase(), EntityDamageEvent.DamageCause.SUICIDE, Short.MAX_VALUE); + server.getPluginManager().callEvent(ede); + user.damage(Short.MAX_VALUE); user.sendMessage(_("suicideMessage")); user.setDisplayNick(); ess.broadcastMessage(user,_("suicideSuccess", user.getDisplayName())); -- cgit v1.2.3 From 0fbe2da9cb1a937e52b0086ee6f59c27933cd194 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 6 May 2012 16:11:16 +0100 Subject: Add whisper to social spy trigger list. --- Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index b062d6ed4..589c1eb38 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -292,7 +292,7 @@ public class EssentialsPlayerListener implements Listener }); } } - private final static List COMMANDS = Arrays.asList("msg", "r", "mail", "m", "t", "emsg", "tell", "er", "reply", "ereply", "email"); + private final static List COMMANDS = Arrays.asList("msg", "r", "mail", "m", "t", "whisper", "emsg", "tell", "er", "reply", "ereply", "email"); @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event) -- cgit v1.2.3 From d9e15729fd9fcce20984ffc64327c944e3c39514 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 6 May 2012 23:30:55 +0100 Subject: Revert "/me crashes ementalo's face for making the client crash." This reverts commit 6d1e2dd10eb38ad4ad582a633f80e1e8443174c9. And fix the original bug. --- Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 589c1eb38..1b4f461c4 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -417,7 +417,9 @@ public class EssentialsPlayerListener implements Listener if (event.getView().getTopInventory().getType() == InventoryType.PLAYER) { final User user = ess.getUser(event.getWhoClicked()); - if (user.isInvSee() && !user.isAuthorized("essentials.invsee.modify")) + final User invOwner = ess.getUser(event.getView().getPlayer()); + if (user.isInvSee() && (!user.isAuthorized("essentials.invsee.modify") + || invOwner.isAuthorized("essentials.invsee.preventmodify"))) { event.setCancelled(true); } -- cgit v1.2.3 From 78cd64c388a0f6c259d0d119d03db43613ee47f7 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 6 May 2012 23:38:04 +0100 Subject: Revert "Revert "New config option 'cancel-afk-on-move' - Set to false you don't use afk." -- This should fix afk mode." This reverts commit 95e6db679775d7ecb95ece8192b350f4c87169cb. Another attempt at adding 'cancel-afk-on-move' toggle. --- .../essentials/EssentialsPlayerListener.java | 11 +++++---- .../src/com/earth2me/essentials/ISettings.java | 10 +++++---- .../src/com/earth2me/essentials/Settings.java | 26 ++++++++++++++++++---- Essentials/src/config.yml | 5 +++++ 4 files changed, 38 insertions(+), 14 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 1b4f461c4..a2082238d 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -73,15 +73,15 @@ public class EssentialsPlayerListener implements Listener @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onPlayerMove(final PlayerMoveEvent event) { - if (event.getFrom().getBlockX() == event.getTo().getBlockX() - && event.getFrom().getBlockZ() == event.getTo().getBlockZ() - && event.getFrom().getBlockY() == event.getTo().getBlockY()) + if ((!ess.getSettings().cancelAfkOnMove() && !ess.getSettings().getFreezeAfkPlayers()) + || event.getFrom().getBlockX() == event.getTo().getBlockX() + && event.getFrom().getBlockZ() == event.getTo().getBlockZ() + && event.getFrom().getBlockY() == event.getTo().getBlockY()) { return; } final User user = ess.getUser(event.getPlayer()); - if (user.isAfk() && ess.getSettings().getFreezeAfkPlayers()) { final Location from = event.getFrom(); @@ -99,7 +99,6 @@ public class EssentialsPlayerListener implements Listener } return; } - final Location afk = user.getAfkPosition(); if (afk == null || !event.getTo().getWorld().equals(afk.getWorld()) || afk.distanceSquared(event.getTo()) > 9) { @@ -419,7 +418,7 @@ public class EssentialsPlayerListener implements Listener final User user = ess.getUser(event.getWhoClicked()); final User invOwner = ess.getUser(event.getView().getPlayer()); if (user.isInvSee() && (!user.isAuthorized("essentials.invsee.modify") - || invOwner.isAuthorized("essentials.invsee.preventmodify"))) + || invOwner.isAuthorized("essentials.invsee.preventmodify"))) { event.setCancelled(true); } diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index 2c07ccd58..8eca8f06f 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -127,7 +127,7 @@ public interface ISettings extends IConf boolean removeGodOnDisconnect(); boolean changeDisplayName(); - + boolean changePlayerListName(); boolean isPlayerCommand(String string); @@ -146,6 +146,8 @@ public interface ISettings extends IConf boolean getFreezeAfkPlayers(); + boolean cancelAfkOnMove(); + boolean areDeathMessagesEnabled(); public void setDebug(boolean debug); @@ -165,12 +167,12 @@ public interface ISettings extends IConf EventPriority getRespawnPriority(); long getTpaAcceptCancellation(); - + boolean isMetricsEnabled(); - + void setMetricsEnabled(boolean metricsEnabled); long getTeleportInvulnerability(); - + boolean isTeleportInvulnerability(); } diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 281280122..5d49c52b8 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -385,6 +385,8 @@ public class Settings implements ISettings teleportInvulnerability = _isTeleportInvulnerability(); disableItemPickupWhileAfk = _getDisableItemPickupWhileAfk(); registerBackInListener = _registerBackInListener(); + cancelAfkOnMove = _cancelAfkOnMove(); + getFreezeAfkPlayers = _getFreezeAfkPlayers(); itemSpawnBl = _getItemSpawnBlacklist(); kits = _getKits(); chatFormats.clear(); @@ -654,12 +656,30 @@ public class Settings implements ISettings { return config.getLong("auto-afk-kick", -1); } + private boolean getFreezeAfkPlayers; @Override public boolean getFreezeAfkPlayers() + { + return getFreezeAfkPlayers; + } + + private boolean _getFreezeAfkPlayers() { return config.getBoolean("freeze-afk-players", false); } + private boolean cancelAfkOnMove; + + @Override + public boolean cancelAfkOnMove() + { + return cancelAfkOnMove; + } + + private boolean _cancelAfkOnMove() + { + return config.getBoolean("cancel-afk-on-move", true); + } @Override public boolean areDeathMessagesEnabled() @@ -691,20 +711,18 @@ public class Settings implements ISettings { return config.getBoolean("world-teleport-permissions", false); } - private boolean registerBackInListener; - + @Override public boolean registerBackInListener() { return registerBackInListener; } - + private boolean _registerBackInListener() { return config.getBoolean("register-back-in-listener", false); } - private boolean disableItemPickupWhileAfk; @Override diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index e8378f77e..c7c9decb0 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -272,6 +272,11 @@ freeze-afk-players: false # Enable this, when you don't want people idling in mob traps. disable-item-pickup-while-afk: false +# Should we automatically remove afk status when the player moves? +# Player will be removed from afk on chat/command reguardless of this setting. +# Disable this to reduce server lag. +cancel-afk-on-move: true + # You can disable the death messages of minecraft here death-messages: true -- cgit v1.2.3 From 9b731cc39c450c200c2c9a5c08492b54758d1344 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 7 May 2012 00:05:02 +0100 Subject: Update home count to include the bed home if set, this does not prevent people from setting a bed home if they are at max. --- Essentials/src/com/earth2me/essentials/UserData.java | 12 ++++++++++++ .../src/com/earth2me/essentials/commands/Commandsethome.java | 8 +++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 5686e0439..533b58acf 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._; import java.io.File; import java.util.*; import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -149,6 +150,17 @@ public abstract class UserData extends PlayerExtension implements IConf return new ArrayList(homes.keySet()); } + public int getHomeCount() + { + int count = getHomes().size(); + Location bed = getBedSpawnLocation(); + if (bed != null && bed.getBlock().getType() == Material.BED_BLOCK) + { + count++; + } + return count; + } + public void setHome(String name, Location loc) { //Invalid names will corrupt the yaml diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java index d59ac4a31..a4bdb08ad 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java @@ -29,10 +29,11 @@ public class Commandsethome extends EssentialsCommand { if (user.isAuthorized("essentials.sethome.multiple")) { - if ("bed".equals(args[0].toLowerCase(Locale.ENGLISH))) { + if ("bed".equals(args[0].toLowerCase(Locale.ENGLISH))) + { throw new NotEnoughArgumentsException(); } - if ((user.isAuthorized("essentials.sethome.multiple.unlimited")) || (user.getHomes().size() < ess.getSettings().getHomeLimit(user)) + if ((user.isAuthorized("essentials.sethome.multiple.unlimited")) || (user.getHomeCount() < ess.getSettings().getHomeLimit(user)) || (user.getHomes().contains(args[0].toLowerCase(Locale.ENGLISH)))) { user.setHome(args[0].toLowerCase(Locale.ENGLISH)); @@ -66,7 +67,8 @@ public class Commandsethome extends EssentialsCommand { name = "home"; } - if ("bed".equals(name.toLowerCase(Locale.ENGLISH))) { + if ("bed".equals(name.toLowerCase(Locale.ENGLISH))) + { throw new NotEnoughArgumentsException(); } usersHome.setHome(name, user.getLocation()); -- cgit v1.2.3 From deca5e5e73c7ba1cc331121d4a4e44f037d08b40 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 7 May 2012 00:08:01 +0100 Subject: Home confirmation when using a bed. --- Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index a2082238d..4cb1d2e9e 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -342,7 +342,9 @@ public class EssentialsPlayerListener implements Listener case RIGHT_CLICK_BLOCK: if (!event.isCancelled() && event.getClickedBlock().getTypeId() == BED && ess.getSettings().getUpdateBedAtDaytime()) { - event.getPlayer().setBedSpawnLocation(event.getClickedBlock().getLocation()); + Player player = event.getPlayer(); + player.setBedSpawnLocation(event.getClickedBlock().getLocation()); + player.sendMessage(_("homeSet", player.getLocation().getWorld().getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ())); } break; case LEFT_CLICK_AIR: -- cgit v1.2.3 From 8d6b864b5b3e90a09d26b1fd3b5ae6455b772f63 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 7 May 2012 00:16:45 +0100 Subject: Revert "Update home count..." This reverts commit 9b731cc39c450c200c2c9a5c08492b54758d1344. On second thought, this would just lead to inconsistency.... --- Essentials/src/com/earth2me/essentials/UserData.java | 12 ------------ .../src/com/earth2me/essentials/commands/Commandsethome.java | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 533b58acf..5686e0439 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -4,7 +4,6 @@ import static com.earth2me.essentials.I18n._; import java.io.File; import java.util.*; import org.bukkit.Location; -import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -150,17 +149,6 @@ public abstract class UserData extends PlayerExtension implements IConf return new ArrayList(homes.keySet()); } - public int getHomeCount() - { - int count = getHomes().size(); - Location bed = getBedSpawnLocation(); - if (bed != null && bed.getBlock().getType() == Material.BED_BLOCK) - { - count++; - } - return count; - } - public void setHome(String name, Location loc) { //Invalid names will corrupt the yaml diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java index a4bdb08ad..f622094d2 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java @@ -33,7 +33,7 @@ public class Commandsethome extends EssentialsCommand { throw new NotEnoughArgumentsException(); } - if ((user.isAuthorized("essentials.sethome.multiple.unlimited")) || (user.getHomeCount() < ess.getSettings().getHomeLimit(user)) + if ((user.isAuthorized("essentials.sethome.multiple.unlimited")) || (user.getHomes().size() < ess.getSettings().getHomeLimit(user)) || (user.getHomes().contains(args[0].toLowerCase(Locale.ENGLISH)))) { user.setHome(args[0].toLowerCase(Locale.ENGLISH)); -- cgit v1.2.3 From a48f6c8c30ed3ebb1a79982158c155e013286e7d Mon Sep 17 00:00:00 2001 From: KHobbits Date: Mon, 7 May 2012 00:30:09 +0100 Subject: Force 3 letters before matching players for /god /gamemode and /fly --- Essentials/src/com/earth2me/essentials/commands/Commandfly.java | 2 +- Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java | 2 +- Essentials/src/com/earth2me/essentials/commands/Commandgod.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java index 526fc090d..22e3c4eea 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java @@ -30,7 +30,7 @@ public class Commandfly extends EssentialsCommand @Override protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - if (args.length > 0 && !args[0].trim().isEmpty() && user.isAuthorized("essentials.fly.others")) + if (args.length > 0 && args[0].trim().length() > 2 && user.isAuthorized("essentials.fly.others")) { flyOtherPlayers(server, user, args[0]); return; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java index aad79d616..5fdc69d68 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java @@ -30,7 +30,7 @@ public class Commandgamemode extends EssentialsCommand @Override protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - if (args.length > 0 && !args[0].trim().isEmpty() && user.isAuthorized("essentials.gamemode.others")) + if (args.length > 0 && args[0].trim().length() > 2 && user.isAuthorized("essentials.gamemode.others")) { gamemodeOtherPlayers(server, user, args); return; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgod.java b/Essentials/src/com/earth2me/essentials/commands/Commandgod.java index 4d5bd424b..6e611d869 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgod.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgod.java @@ -28,7 +28,7 @@ public class Commandgod extends EssentialsCommand @Override protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - if (args.length > 0 && !args[0].trim().isEmpty() && user.isAuthorized("essentials.god.others")) + if (args.length > 0 && args[0].trim().length() > 2 && user.isAuthorized("essentials.god.others")) { godOtherPlayers(server, user, args[0]); return; -- cgit v1.2.3 From 5020f6b990e0657406d1677bd88ef4bb905dce6e Mon Sep 17 00:00:00 2001 From: kukelekuuk00 Date: Sun, 13 May 2012 13:44:41 +0200 Subject: Added an /exp command that shows the amount of exp you have and how much you need for the next level. Permissions are essentials.exp and essentials.exp.needed --- .../earth2me/essentials/commands/Commandexp.java | 39 ++++++++++++++++++++++ Essentials/src/messages.properties | 2 ++ Essentials/src/plugin.yml | 4 +++ 3 files changed, 45 insertions(+) create mode 100644 Essentials/src/com/earth2me/essentials/commands/Commandexp.java diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java new file mode 100644 index 000000000..15efc02f7 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java @@ -0,0 +1,39 @@ +package com.earth2me.essentials.commands; + +import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; +import com.earth2me.essentials.craftbukkit.SetExpFix; +import org.bukkit.Server; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + + +public class Commandexp extends EssentialsCommand +{ + public Commandexp() + { + super("exp"); + } + + @Override + public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args)throws Exception + { + for (Player onlinePlayer : server.getOnlinePlayers()) + { + final User user = ess.getUser(onlinePlayer); + { + if (user.isAuthorized("essentials.exp.needed")) + { + int totalexp = SetExpFix.getTotalExperience(user); + int expleft = (int)Util.roundDouble(((((3.5 * user.getLevel()) + 6.7) - (totalexp - ((1.75 *(user.getLevel() * user.getLevel())) + (5.00 * user.getLevel())))) + 1)); + sender.sendMessage(_("expneeded", SetExpFix.getTotalExperience(user),"" + expleft)); + } + else if (user.isAuthorized("essentials.exp")) + { + sender.sendMessage(_("exp", SetExpFix.getTotalExperience(user))); + } + } + } + } +} diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 73ce00bee..21390d893 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -85,6 +85,8 @@ errorWithMessage=\u00a7cError: {0} essentialsHelp1=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat essentialsReload=\u00a77Essentials Reloaded {0} +exp=\u00a79You have \u00a7c{0} \u00a79exp. +expneeded=\u00a79You have \u00a7c{0} \u00a79exp and you need \u00a7c{1} more to level up. extinguish=\u00a77You extinguished yourself. extinguishOthers=\u00a77You extinguished {0}. failedToCloseConfig=Failed to close config {0} diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 3e1dc52c0..6b1e8a038 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -90,6 +90,10 @@ commands: essentials: description: Reloads essentials. usage: / + exp: + description: States how much exp you have. + usage: / + aliases: [eexp] ext: description: Extinguish players. usage: / [player] -- cgit v1.2.3 From fee3d7c0d362443a6bbfe83773df740caed2c49d Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 13 May 2012 18:58:50 +0100 Subject: Try to trim long displaynicks instead of blankly refusing to show them. Will try trimming prefixes and dropping suffixes before trimming nicknames. --- Essentials/src/com/earth2me/essentials/User.java | 67 +++++++++++++----------- Essentials/src/com/earth2me/essentials/Util.java | 9 ++++ 2 files changed, 44 insertions(+), 32 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 6f3023fbe..14660d8b8 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -263,75 +263,78 @@ public class User extends UserData implements Comparable, IReplyTo, IUser return teleportRequestHere; } - public String getNick(final boolean addprefixsuffix) + public String getNick(final boolean longnick) { - final StringBuilder nickname = new StringBuilder(); + final StringBuilder prefix = new StringBuilder(); + String nickname; + String suffix = "§f"; final String nick = getNickname(); if (ess.getSettings().isCommandDisabled("nick") || nick == null || nick.isEmpty() || nick.equals(getName())) { - nickname.append(getName()); + nickname = getName(); } else { - nickname.append(ess.getSettings().getNicknamePrefix()).append(nick); + nickname = ess.getSettings().getNicknamePrefix() + nick; } - if (addprefixsuffix && isOp()) + if (isOp()) { try { final String opPrefix = ess.getSettings().getOperatorColor().toString(); if (opPrefix.length() > 0) { - nickname.insert(0, opPrefix); - nickname.append("§f"); + prefix.insert(0, opPrefix); } } catch (Exception e) { } } - if (addprefixsuffix && ess.getSettings().addPrefixSuffix()) + + if (ess.getSettings().addPrefixSuffix()) { if (!ess.getSettings().disablePrefix()) { - final String prefix = ess.getPermissionsHandler().getPrefix(base).replace('&', '§'); - nickname.insert(0, prefix); + final String ptext = ess.getPermissionsHandler().getPrefix(base).replace('&', '§'); + prefix.insert(0, ptext); } if (!ess.getSettings().disableSuffix()) { - final String suffix = ess.getPermissionsHandler().getSuffix(base).replace('&', '§'); - nickname.append(suffix); - if (suffix.length() < 2 || suffix.charAt(suffix.length() - 2) != '§') - { - nickname.append("§f"); - } - } - else - { - nickname.append("§f"); + final String stext = ess.getPermissionsHandler().getSuffix(base).replace('&', '§'); + suffix = stext + "§f"; + suffix = suffix.replace("§f§f", "§f"); } } - - return nickname.toString(); + final String strPrefix = prefix.toString(); + String output = strPrefix + nickname + suffix; + if (!longnick && output.length() > 16) + { + output = strPrefix + nickname; + } + if (!longnick && output.length() > 16) + { + output = Util.lastCode(strPrefix) + nickname; + } + if (!longnick && output.length() > 16) + { + output = Util.lastCode(strPrefix) + nickname.substring(0, 14); + } + if (output.charAt(output.length() - 1) == '§') { + output = output.substring(0, output.length() - 1); + } + return output; } public void setDisplayNick() { if (base.isOnline() && ess.getSettings().changeDisplayName()) { - String name = getNick(true); - setDisplayName(name); - if (name.length() > 16) - { - name = getNick(false); - } - if (name.length() > 16) - { - name = Util.stripFormat(name); - } + setDisplayName(getNick(true)); if (ess.getSettings().changePlayerListName()) { + String name = getNick(false); try { setPlayerListName(name); diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index 73817f645..112477ecb 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -510,6 +510,15 @@ public class Util } return buf.toString(); } + + public static String lastCode(final String input) { + int pos = input.lastIndexOf("§"); + if (pos == -1 || (pos + 1) == input.length()) { + return ""; + } + return input.substring(pos, pos + 2); + } + private static transient final Pattern URL_PATTERN = Pattern.compile("((?:(?:https?)://)?[\\w-_\\.]{2,})\\.([a-z]{2,3}(?:/\\S+)?)"); private static transient final Pattern VANILLA_PATTERN = Pattern.compile("\u00A7+[0-9A-FK-ORa-fk-or]"); private static transient final Pattern REPLACE_PATTERN = Pattern.compile("&([0-9a-fk-or])"); -- cgit v1.2.3 From 16fc88b50cef6547c0ff4c40d292defffe49890e Mon Sep 17 00:00:00 2001 From: kukelekuuk00 Date: Mon, 14 May 2012 11:36:44 +0200 Subject: new command /exp [set|give|player] [player] [amount] perms are essentials.exp, essentials.exp.others, essentials.exp.set, essentials.exp.set.others, essentials.exp.give and essentials.exp.give.others --- .../earth2me/essentials/commands/Commandexp.java | 56 ++++++++++++++++++++-- Essentials/src/messages.properties | 8 +++- Essentials/src/plugin.yml | 4 +- 3 files changed, 59 insertions(+), 9 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java index 15efc02f7..8c2f428dd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java @@ -8,7 +8,6 @@ import org.bukkit.Server; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; - public class Commandexp extends EssentialsCommand { public Commandexp() @@ -23,16 +22,63 @@ public class Commandexp extends EssentialsCommand { final User user = ess.getUser(onlinePlayer); { - if (user.isAuthorized("essentials.exp.needed")) + if (args.length < 1 && user.isAuthorized("essentials.exp")) { int totalexp = SetExpFix.getTotalExperience(user); int expleft = (int)Util.roundDouble(((((3.5 * user.getLevel()) + 6.7) - (totalexp - ((1.75 *(user.getLevel() * user.getLevel())) + (5.00 * user.getLevel())))) + 1)); - sender.sendMessage(_("expneeded", SetExpFix.getTotalExperience(user),"" + expleft)); + sender.sendMessage(_("exp", SetExpFix.getTotalExperience(user), expleft)); } - else if (user.isAuthorized("essentials.exp")) + if (args.length == 1 && user.isAuthorized("essentials.exp.others")) { - sender.sendMessage(_("exp", SetExpFix.getTotalExperience(user))); + for (Player p : server.matchPlayer(args[0])) + { + User player = getPlayer(server, args, 1); + int totalexp = SetExpFix.getTotalExperience(user); + int expleft = (int)Util.roundDouble(((((3.5 * user.getLevel()) + 6.7) - (totalexp - ((1.75 *(user.getLevel() * user.getLevel())) + (5.00 * user.getLevel())))) + 1)); + sender.sendMessage(_("expothers", player.getDisplayName(), SetExpFix.getTotalExperience(p), expleft)); + } } + if(args.length >= 1) + if (args[0].equalsIgnoreCase("set")) + { + if (args.length >= 2) + for (Player p : server.matchPlayer(args[1])) + if ((args.length == 3) && (user.isAuthorized("essentials.exp.set.others"))) + { + User player = getPlayer(server, args, 1); + int exp = Integer.parseInt(args[2]); + SetExpFix.setTotalExperience(p, exp); + sender.sendMessage(_("expsetothers", player.getDisplayName(), exp)); + } + else if ((args.length == 2) && (user.isAuthorized("essentials.exp.set"))) + { + int exp = Integer.parseInt(args[1]); + SetExpFix.setTotalExperience(user, exp); + sender.sendMessage(_("expset", exp)); + } + + + } + else if (args[0].equalsIgnoreCase("give")) + { + if (args.length >= 2) + for (Player p : server.matchPlayer(args[1])) + if ((args.length == 3) && (user.isAuthorized("essentials.exp.give.others"))) + { + User player = getPlayer(server, args, 1); + int amount = Integer.parseInt(args[2]); + p.giveExp(amount); + sender.sendMessage(_("expgiveothers", player.getDisplayName(), amount)); + } + else if ((args.length == 2) && (user.isAuthorized("essentials.exp.give"))) + { + int amount = Integer.parseInt(args[1]); + user.giveExp(amount); + sender.sendMessage(_("expgive", amount)); + } + + } + } } } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 21390d893..dec026c52 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -85,8 +85,12 @@ errorWithMessage=\u00a7cError: {0} essentialsHelp1=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat essentialsReload=\u00a77Essentials Reloaded {0} -exp=\u00a79You have \u00a7c{0} \u00a79exp. -expneeded=\u00a79You have \u00a7c{0} \u00a79exp and you need \u00a7c{1} more to level up. +exp=\u00a77You have \u00a7c{0} \u00a77exp and you need \u00a7c{1}\u00a77 more exp to level up. +expgive=\u00a77You have given yourself {0}\u00a77 exp. +expgiveothers=\u00a77You have given \u00a7c{0} {1}\u00a77 exp. +expothers=\u00a7c{0}\u00a77 has \u00a7c{1} \u00a77exp and needs \u00a7c{2} \u00a77more exp to level up. +expset=\u00a77You now have \u00a7c{0} \u00a77exp. +expsetothers=\u00a7c{0} \u00a77now has \u00a7c{1} \u00a77exp. extinguish=\u00a77You extinguished yourself. extinguishOthers=\u00a77You extinguished {0}. failedToCloseConfig=Failed to close config {0} diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 6b1e8a038..de5dfb81f 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -91,8 +91,8 @@ commands: description: Reloads essentials. usage: / exp: - description: States how much exp you have. - usage: / + description: States how much exp you have and how much you need to level up. + usage: / [player|set|give] [playername] [amount] aliases: [eexp] ext: description: Extinguish players. -- cgit v1.2.3 From 9846362836f32d80c2d52beee729b12f9b47fdd7 Mon Sep 17 00:00:00 2001 From: kukelekuuk00 Date: Mon, 14 May 2012 11:43:57 +0200 Subject: small description change --- Essentials/src/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index de5dfb81f..da0a82ee5 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -91,7 +91,7 @@ commands: description: Reloads essentials. usage: / exp: - description: States how much exp you have and how much you need to level up. + description: give, set or look at a players exp. usage: / [player|set|give] [playername] [amount] aliases: [eexp] ext: -- cgit v1.2.3 From 1247401a5ff10b19e734b70f2d24ada2473f82ca Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 17 May 2012 20:25:02 +1000 Subject: Add a LagMeter (ticks per second) to the /gc command. This command can now be accessed with /lag as well. Also added a simple /vanish command, with the extra node essentials.vanish.see If you require a more advanced vanish solution checkout VanishNoPacket from mbaxter. --- .../src/com/earth2me/essentials/Essentials.java | 16 ++++++++ .../src/com/earth2me/essentials/IEssentials.java | 1 + .../src/com/earth2me/essentials/LagMeter.java | 44 ++++++++++++++++++++++ Essentials/src/com/earth2me/essentials/User.java | 11 ++++++ .../earth2me/essentials/commands/Commandgc.java | 16 ++++++++ .../essentials/commands/Commandvanish.java | 40 ++++++++++++++++++++ Essentials/src/messages.properties | 4 ++ Essentials/src/plugin.yml | 8 +++- 8 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 Essentials/src/com/earth2me/essentials/LagMeter.java create mode 100644 Essentials/src/com/earth2me/essentials/commands/Commandvanish.java diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 6197f5edd..11ee95511 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -84,6 +84,7 @@ public class Essentials extends JavaPlugin implements IEssentials private transient ExecuteTimer execTimer; private transient I18n i18n; private transient Metrics metrics; + private transient LagMeter lagMeter; @Override public ISettings getSettings() @@ -240,6 +241,10 @@ public class Essentials extends JavaPlugin implements IEssentials final EssentialsTimer timer = new EssentialsTimer(this); getScheduler().scheduleSyncRepeatingTask(this, timer, 1, 100); + + lagMeter = new LagMeter(); + getScheduler().scheduleSyncRepeatingTask(this, lagMeter, 0, 40); + Economy.setEss(this); execTimer.mark("RegListeners"); @@ -264,6 +269,13 @@ public class Essentials extends JavaPlugin implements IEssentials @Override public void onDisable() { + for (Player p : getServer().getOnlinePlayers()) + { + if (getUser(p).isVanished()) + { + p.sendMessage(ChatColor.RED + _("unvanishedReload")); + } + } i18n.onDisable(); Economy.setEss(null); Trade.closeLog(); @@ -614,6 +626,10 @@ public class Essentials extends JavaPlugin implements IEssentials return i18n; } + public LagMeter getLagMeter() + { + return lagMeter; + } private static class EssentialsWorldListener implements Listener, Runnable { diff --git a/Essentials/src/com/earth2me/essentials/IEssentials.java b/Essentials/src/com/earth2me/essentials/IEssentials.java index 83c2e7325..85fc8165c 100644 --- a/Essentials/src/com/earth2me/essentials/IEssentials.java +++ b/Essentials/src/com/earth2me/essentials/IEssentials.java @@ -71,4 +71,5 @@ public interface IEssentials extends Plugin void setMetrics(Metrics metrics); + LagMeter getLagMeter(); } diff --git a/Essentials/src/com/earth2me/essentials/LagMeter.java b/Essentials/src/com/earth2me/essentials/LagMeter.java new file mode 100644 index 000000000..1c50755b8 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/LagMeter.java @@ -0,0 +1,44 @@ +package com.earth2me.essentials; + +import java.util.LinkedList; + + +public class LagMeter implements Runnable +{ + private transient long lastPoll = System.currentTimeMillis() - 3000; + private final transient LinkedList history = new LinkedList(); + + @Override + public void run() + { + long now = System.currentTimeMillis(); + long timeSpent = (now - lastPoll) / 1000; + if (timeSpent == 0) + { + timeSpent = 1; + } + if (history.size() > 10) + { + history.remove(); + } + float tps = 40f / timeSpent; + if (tps <= 20) + { + history.add(tps); + } + lastPoll = now; + } + + public float getAverageTPS() + { + float avg = 0; + for (Float f : history) + { + if (f != null) + { + avg += f; + } + } + return avg / history.size(); + } +} diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 14660d8b8..c6ce3a569 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -17,6 +17,7 @@ public class User extends UserData implements Comparable, IReplyTo, IUser private CommandSender replyTo = null; private transient User teleportRequester; private transient boolean teleportRequestHere; + private transient boolean vanished; private transient final Teleport teleport; private transient long teleportRequestTime; private transient long lastOnlineActivity; @@ -640,4 +641,14 @@ public class User extends UserData implements Comparable, IReplyTo, IUser { return teleportInvulnerabilityTimestamp != 0 && teleportInvulnerabilityTimestamp >= System.currentTimeMillis(); } + + public boolean isVanished() + { + return vanished; + } + + public void toggleVanished() + { + vanished = !vanished; + } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java index 9429bc5a8..46f6999bd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java @@ -1,6 +1,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; +import org.bukkit.ChatColor; import org.bukkit.Server; import org.bukkit.World; import org.bukkit.command.CommandSender; @@ -16,6 +17,21 @@ public class Commandgc extends EssentialsCommand @Override protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { + float tps = ess.getLagMeter().getAverageTPS(); + ChatColor color; + if (tps >= 18) + { + color = ChatColor.GREEN; + } + else if (tps >= 15) + { + color = ChatColor.YELLOW; + } + else + { + color = ChatColor.RED; + } + sender.sendMessage(_("tps", "" + color + tps)); sender.sendMessage(_("gcmax", (Runtime.getRuntime().maxMemory() / 1024 / 1024))); sender.sendMessage(_("gctotal", (Runtime.getRuntime().totalMemory() / 1024 / 1024))); sender.sendMessage(_("gcfree", (Runtime.getRuntime().freeMemory() / 1024 / 1024))); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java new file mode 100644 index 000000000..96cf95e36 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java @@ -0,0 +1,40 @@ +package com.earth2me.essentials.commands; + +import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.User; +import org.bukkit.ChatColor; +import org.bukkit.Server; +import org.bukkit.entity.Player; + + +public class Commandvanish extends EssentialsCommand +{ + public Commandvanish() + { + super("vanish"); + } + + @Override + protected void run(Server server, User user, String commandLabel, String[] args) throws Exception + { + if (user.isVanished()) + { + for (Player p : server.getOnlinePlayers()) + { + p.showPlayer(user); + } + user.sendMessage(ChatColor.GREEN + _("vanished")); + } + else + { + for (Player p : server.getOnlinePlayers()) + { + if (!ess.getUser(p).isAuthorized("essentials.vanish.see")) + { + p.hidePlayer(user); + } + user.sendMessage(ChatColor.GREEN + _("unvanished")); + } + } + } +} diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 73ce00bee..11ed0d74b 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -364,6 +364,7 @@ tradeSignEmptyOwner=There is nothing to collect from this trade sign. treeFailure=\u00a7cTree generation failure. Try again on grass or dirt. treeSpawned=\u00a77Tree spawned. true=true +tps=Current TPS = {0} typeTpaccept=\u00a77To teleport, type \u00a7c/tpaccept\u00a77. typeTpdeny=\u00a77To deny this request, type \u00a7c/tpdeny\u00a77. typeWorldName=\u00a77You can also type the name of a specific world. @@ -377,6 +378,8 @@ unknownItemName=Unknown item name: {0} unlimitedItemPermission=\u00a7cNo permission for unlimited item {0}. unlimitedItems=Unlimited items: unmutedPlayer=Player {0} unmuted. +unvanished=You are once again visible. +unvanishedReload=A reload has forced you to become visible. upgradingFilesError=Error while upgrading the files userDoesNotExist=The user {0} does not exist. userIsAway={0} is now AFK @@ -386,6 +389,7 @@ userUsedPortal={0} used an existing exit portal. userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp usingTempFolderForTesting=Using temp folder for testing: +vanished=You have now been vanished. versionMismatch=Version mismatch! Please update {0} to the same version. versionMismatchAll=Version mismatch! Please update all Essentials jars to the same version. voiceSilenced=\u00a77Your voice has been silenced diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 3e1dc52c0..d9d4179be 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -119,9 +119,9 @@ commands: usage: / [player] aliases: [coords,egetpos,position,eposition,whereami,ewhereami] gc: - description: Reports garbage collection info; useful to developers. + description: Reports garbage collection and tick info; useful to developers. usage: / - aliases: [mem,memory,egc,emem,ememory] + aliases: [elag,lag,mem,memory,egc,emem,ememory] give: description: Give a player an item. usage: / [amount ...] @@ -405,6 +405,10 @@ commands: description: Allows the unlimited placing of items. usage: / [player] aliases: [eunlimited,ul,unl,eul,eunl] + vanish: + description: Hide yourself from other players. + usage: / + aliases: [evanish] warp: description: List all warps or warp to the specified location. usage: / [player] -- cgit v1.2.3 From 3eac027ddb165adc05eeebeed36727a0d837d938 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 17 May 2012 20:33:40 +1000 Subject: There is no need to start a second task to measure lag, it can in fact be measured with enough precision from the exisitng one. --- .../src/com/earth2me/essentials/Essentials.java | 12 +++--- .../com/earth2me/essentials/EssentialsTimer.java | 31 +++++++++++++++ .../src/com/earth2me/essentials/IEssentials.java | 2 +- .../src/com/earth2me/essentials/LagMeter.java | 44 ---------------------- .../earth2me/essentials/commands/Commandgc.java | 2 +- 5 files changed, 38 insertions(+), 53 deletions(-) delete mode 100644 Essentials/src/com/earth2me/essentials/LagMeter.java diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 11ee95511..fe1edb4e5 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -84,7 +84,7 @@ public class Essentials extends JavaPlugin implements IEssentials private transient ExecuteTimer execTimer; private transient I18n i18n; private transient Metrics metrics; - private transient LagMeter lagMeter; + private transient EssentialsTimer timer; @Override public ISettings getSettings() @@ -239,12 +239,9 @@ public class Essentials extends JavaPlugin implements IEssentials pm.registerEvents(tntListener, this); - final EssentialsTimer timer = new EssentialsTimer(this); + timer = new EssentialsTimer(this); getScheduler().scheduleSyncRepeatingTask(this, timer, 1, 100); - lagMeter = new LagMeter(); - getScheduler().scheduleSyncRepeatingTask(this, lagMeter, 0, 40); - Economy.setEss(this); execTimer.mark("RegListeners"); @@ -626,9 +623,10 @@ public class Essentials extends JavaPlugin implements IEssentials return i18n; } - public LagMeter getLagMeter() + @Override + public EssentialsTimer getTimer() { - return lagMeter; + return timer; } private static class EssentialsWorldListener implements Listener, Runnable diff --git a/Essentials/src/com/earth2me/essentials/EssentialsTimer.java b/Essentials/src/com/earth2me/essentials/EssentialsTimer.java index 18f980a62..0d97c2792 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsTimer.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsTimer.java @@ -2,6 +2,7 @@ package com.earth2me.essentials; import java.util.HashSet; import java.util.Iterator; +import java.util.LinkedList; import java.util.Set; import java.util.logging.Level; import org.bukkit.entity.Player; @@ -11,6 +12,8 @@ public class EssentialsTimer implements Runnable { private final transient IEssentials ess; private final transient Set onlineUsers = new HashSet(); + private transient long lastPoll = System.currentTimeMillis() - 3000; + private final transient LinkedList history = new LinkedList(); EssentialsTimer(final IEssentials ess) { @@ -21,6 +24,21 @@ public class EssentialsTimer implements Runnable public void run() { final long currentTime = System.currentTimeMillis(); + long timeSpent = (currentTime - lastPoll) / 1000; + if (timeSpent == 0) + { + timeSpent = 1; + } + if (history.size() > 10) + { + history.remove(); + } + float tps = 100f / timeSpent; + if (tps <= 20) + { + history.add(tps); + } + lastPoll = currentTime; for (Player player : ess.getServer().getOnlinePlayers()) { try @@ -51,4 +69,17 @@ public class EssentialsTimer implements Runnable user.resetInvulnerabilityAfterTeleport(); } } + + public float getAverageTPS() + { + float avg = 0; + for (Float f : history) + { + if (f != null) + { + avg += f; + } + } + return avg / history.size(); + } } diff --git a/Essentials/src/com/earth2me/essentials/IEssentials.java b/Essentials/src/com/earth2me/essentials/IEssentials.java index 85fc8165c..6e1887b87 100644 --- a/Essentials/src/com/earth2me/essentials/IEssentials.java +++ b/Essentials/src/com/earth2me/essentials/IEssentials.java @@ -71,5 +71,5 @@ public interface IEssentials extends Plugin void setMetrics(Metrics metrics); - LagMeter getLagMeter(); + EssentialsTimer getTimer(); } diff --git a/Essentials/src/com/earth2me/essentials/LagMeter.java b/Essentials/src/com/earth2me/essentials/LagMeter.java deleted file mode 100644 index 1c50755b8..000000000 --- a/Essentials/src/com/earth2me/essentials/LagMeter.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.earth2me.essentials; - -import java.util.LinkedList; - - -public class LagMeter implements Runnable -{ - private transient long lastPoll = System.currentTimeMillis() - 3000; - private final transient LinkedList history = new LinkedList(); - - @Override - public void run() - { - long now = System.currentTimeMillis(); - long timeSpent = (now - lastPoll) / 1000; - if (timeSpent == 0) - { - timeSpent = 1; - } - if (history.size() > 10) - { - history.remove(); - } - float tps = 40f / timeSpent; - if (tps <= 20) - { - history.add(tps); - } - lastPoll = now; - } - - public float getAverageTPS() - { - float avg = 0; - for (Float f : history) - { - if (f != null) - { - avg += f; - } - } - return avg / history.size(); - } -} diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java index 46f6999bd..d9b08b50f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java @@ -17,7 +17,7 @@ public class Commandgc extends EssentialsCommand @Override protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { - float tps = ess.getLagMeter().getAverageTPS(); + float tps = ess.getTimer().getAverageTPS(); ChatColor color; if (tps >= 18) { -- cgit v1.2.3 From 853d7cb6689c459c0ef8e6c3155d58208f8ec987 Mon Sep 17 00:00:00 2001 From: kukelekuuk00 Date: Thu, 17 May 2012 14:39:40 +0200 Subject: Fixes made, added /exp fix [playername] this fixes negative exp. --- .../earth2me/essentials/commands/Commandexp.java | 154 ++++++++++++++------- Essentials/src/messages.properties | 9 +- Essentials/src/plugin.yml | 2 +- 3 files changed, 110 insertions(+), 55 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java index 8c2f428dd..fddcdca09 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java @@ -5,7 +5,6 @@ import com.earth2me.essentials.User; import com.earth2me.essentials.Util; import com.earth2me.essentials.craftbukkit.SetExpFix; import org.bukkit.Server; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class Commandexp extends EssentialsCommand @@ -16,70 +15,119 @@ public class Commandexp extends EssentialsCommand } @Override - public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args)throws Exception + public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - for (Player onlinePlayer : server.getOnlinePlayers()) + if (args.length == 0) + { + if (user.isAuthorized("essentials.exp")) + { + int totalexp = SetExpFix.getTotalExperience(user); + int expleft = (int)Util.roundDouble(((((3.5 * user.getLevel()) + 6.7) - (totalexp - ((1.75 * (user.getLevel() * user.getLevel())) + (5.00 * user.getLevel())))) + 1)); + user.sendMessage(_("exp", totalexp, expleft)); + } + } + else if (args.length > 0) { - final User user = ess.getUser(onlinePlayer); + if (args[0].equalsIgnoreCase("set")) { - if (args.length < 1 && user.isAuthorized("essentials.exp")) + if (args.length > 1) { - int totalexp = SetExpFix.getTotalExperience(user); - int expleft = (int)Util.roundDouble(((((3.5 * user.getLevel()) + 6.7) - (totalexp - ((1.75 *(user.getLevel() * user.getLevel())) + (5.00 * user.getLevel())))) + 1)); - sender.sendMessage(_("exp", SetExpFix.getTotalExperience(user), expleft)); + for (Player p : server.matchPlayer(args[1])) + { + if ((args.length == 3) && (args[1].trim().length() > 2) && (user.isAuthorized("essentials.exp.set.others"))) + { + User player = getPlayer(server, args, 1); + int amount = Integer.parseInt(args[2]); + SetExpFix.setTotalExperience(p, amount); + user.sendMessage(_("expsetothers", player.getDisplayName(), amount)); + p.sendMessage(_("expsetothersreceive", amount)); + } + } + if ((args.length == 2) && (user.isAuthorized("essentials.exp.set"))) + { + int amount = Integer.parseInt(args[1]); + SetExpFix.setTotalExperience(user, amount); + user.sendMessage(_("expset", amount)); + } + } + } + if (args[0].equalsIgnoreCase("give")) + { + if (args.length > 1) + { + for (Player p : server.matchPlayer(args[1])) + { + if ((args.length == 3) && (args[1].trim().length() > 2) && (user.isAuthorized("essentials.exp.give.others"))) + { + User player = getPlayer(server, args, 1); + int amount = Integer.parseInt(args[2]); + p.giveExp(amount); + user.sendMessage(_("expgiveothers", player.getDisplayName(), amount)); + p.sendMessage (_("expgiveothersreceive", amount)); + } + } + if ((args.length == 2) && (user.isAuthorized("essentials.exp.give"))) + { + int amount = Integer.parseInt(args[1]); + user.giveExp(amount); + user.sendMessage(_("expgive", amount)); + } + } - if (args.length == 1 && user.isAuthorized("essentials.exp.others")) + } + if (args[0].equalsIgnoreCase("player")) + { + if (args.length > 1) { - for (Player p : server.matchPlayer(args[0])) + for (Player p : server.matchPlayer(args[1])) { - User player = getPlayer(server, args, 1); - int totalexp = SetExpFix.getTotalExperience(user); - int expleft = (int)Util.roundDouble(((((3.5 * user.getLevel()) + 6.7) - (totalexp - ((1.75 *(user.getLevel() * user.getLevel())) + (5.00 * user.getLevel())))) + 1)); - sender.sendMessage(_("expothers", player.getDisplayName(), SetExpFix.getTotalExperience(p), expleft)); + if ((args.length == 2) && (args[1].trim().length() > 2) && (user.isAuthorized("essentials.exp.others"))) + { + User player = getPlayer(server, args, 1); + int totalexp = SetExpFix.getTotalExperience(p); + int expleft = (int)Util.roundDouble(((((3.5 * p.getLevel()) + 6.7) - (totalexp - ((1.75 * (player.getLevel() * player.getLevel())) + (5.00 * player.getLevel())))) + 1)); + user.sendMessage(_("expothers", player.getDisplayName(), SetExpFix.getTotalExperience(p), expleft)); + } } } - if(args.length >= 1) - if (args[0].equalsIgnoreCase("set")) + } + if (args[0].equalsIgnoreCase("fix")) + { + { if ((args.length == 1) && (user.isAuthorized("essentials.exp.fix"))) { - if (args.length >= 2) - for (Player p : server.matchPlayer(args[1])) - if ((args.length == 3) && (user.isAuthorized("essentials.exp.set.others"))) - { - User player = getPlayer(server, args, 1); - int exp = Integer.parseInt(args[2]); - SetExpFix.setTotalExperience(p, exp); - sender.sendMessage(_("expsetothers", player.getDisplayName(), exp)); - } - else if ((args.length == 2) && (user.isAuthorized("essentials.exp.set"))) - { - int exp = Integer.parseInt(args[1]); - SetExpFix.setTotalExperience(user, exp); - sender.sendMessage(_("expset", exp)); - } - - + if (SetExpFix.getTotalExperience(user) < 0) + { + user.sendMessage(_("expfix")); + user.setExp(0); + user.setLevel(0); + user.setTotalExperience(0); + } + else if (SetExpFix.getTotalExperience(user) >= 0) + { + user.sendMessage(_("expfixfalse")); + } } - else if (args[0].equalsIgnoreCase("give")) + else if ((args.length == 2) && (user.isAuthorized("essentials.exp.fix.others"))) { - if (args.length >= 2) - for (Player p : server.matchPlayer(args[1])) - if ((args.length == 3) && (user.isAuthorized("essentials.exp.give.others"))) - { - User player = getPlayer(server, args, 1); - int amount = Integer.parseInt(args[2]); - p.giveExp(amount); - sender.sendMessage(_("expgiveothers", player.getDisplayName(), amount)); - } - else if ((args.length == 2) && (user.isAuthorized("essentials.exp.give"))) - { - int amount = Integer.parseInt(args[1]); - user.giveExp(amount); - sender.sendMessage(_("expgive", amount)); - } - + for (Player p : server.matchPlayer(args[1])) + { + if (SetExpFix.getTotalExperience(p) < 0) + { + + user.sendMessage(_("expfixothers", p.getDisplayName())); + p.setExp(0); + p.setLevel(0); + p.setTotalExperience(0); + p.sendMessage(_("expfixothersreceive")); + } + else if (SetExpFix.getTotalExperience(p) >= 0) + { + user.sendMessage(_("expfixothersfalse", p.getDisplayName())); + } + } } - + } } - } - } + } + } } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index dec026c52..9f18dbdac 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -86,11 +86,18 @@ essentialsHelp1=The file is broken and Essentials can't open it. Essentials is n essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat essentialsReload=\u00a77Essentials Reloaded {0} exp=\u00a77You have \u00a7c{0} \u00a77exp and you need \u00a7c{1}\u00a77 more exp to level up. -expgive=\u00a77You have given yourself {0}\u00a77 exp. +expfix=\u00a77You have negative exp; fixing it. +expfixfalse=\u00a77You do not have negative exp. +expfixothers=\u00a7c{0} \u00a77has negative exp; fixing it. +expfixothersreceive=\u00a77Your no longer have negative exp. +expfixothersfalse=\u00a7c{0} \u00a77does not have negative exp. +expgive=\u00a77You have given yourself \u00a7c{0}\u00a77 exp. expgiveothers=\u00a77You have given \u00a7c{0} {1}\u00a77 exp. +expgiveothersreceive=\u00a77You have received \u00a7c{0}\u00a77 exp. expothers=\u00a7c{0}\u00a77 has \u00a7c{1} \u00a77exp and needs \u00a7c{2} \u00a77more exp to level up. expset=\u00a77You now have \u00a7c{0} \u00a77exp. expsetothers=\u00a7c{0} \u00a77now has \u00a7c{1} \u00a77exp. +expsetothersreceive=\u00a77You now have \u00a7c{0} \u00a77exp. extinguish=\u00a77You extinguished yourself. extinguishOthers=\u00a77You extinguished {0}. failedToCloseConfig=Failed to close config {0} diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index da0a82ee5..84d255abd 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -92,7 +92,7 @@ commands: usage: / exp: description: give, set or look at a players exp. - usage: / [player|set|give] [playername] [amount] + usage: / [player|set|give|fix] [playername] [amount] aliases: [eexp] ext: description: Extinguish players. -- cgit v1.2.3 From bc798977b5db9d42800aadbd0a062c019866d8da Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 19 May 2012 17:41:52 +0100 Subject: Strip invalid chars from kit names This may possibly block some kits from working that previous worked, if the kit name contained unusual letters --- Essentials/src/com/earth2me/essentials/UserData.java | 2 +- Essentials/src/com/earth2me/essentials/commands/Commandkit.java | 4 ++-- Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 5686e0439..c994eeed5 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -594,7 +594,7 @@ public abstract class UserData extends PlayerExtension implements IConf public void setBanReason(String reason) { - config.setProperty("ban.reason", reason); + config.setProperty("ban.reason", Util.sanitizeString(reason)); config.save(); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java index 514a5acca..a545adf60 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java @@ -25,12 +25,12 @@ public class Commandkit extends EssentialsCommand else if (args.length > 1 && user.isAuthorized("essentials.kit.others")) { final User userTo = getPlayer(server, args, 1, true); - final String kitName = args[0].toLowerCase(Locale.ENGLISH); + final String kitName = Util.sanitizeString(args[0].toLowerCase(Locale.ENGLISH)); giveKit(userTo, user, kitName); } else { - final String kitName = args[0].toLowerCase(Locale.ENGLISH); + final String kitName = Util.sanitizeString(args[0].toLowerCase(Locale.ENGLISH)); giveKit(user, user, kitName); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java index 8ed298303..877da4d26 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; import org.bukkit.Server; @@ -20,7 +21,7 @@ public class Commandsetjail extends EssentialsCommand throw new NotEnoughArgumentsException(); } ess.getJails().setJail(args[0], user.getLocation()); - user.sendMessage(_("jailSet", args[0])); + user.sendMessage(_("jailSet", Util.sanitizeString(args[0]))); } } -- cgit v1.2.3 From 711426fe69bd91f363cc4062157fdac970337430 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 19 May 2012 20:35:36 +0100 Subject: Update CraftBukkit: 1.2.5-R2.0 - 2190 Update Bukkit: 1.2.5-R2.0 - 1459 --- .../earth2me/essentials/craftbukkit/FakeWorld.java | 36 +++++++++++++++++++++ lib/bukkit.jar | Bin 4717318 -> 4717196 bytes lib/craftbukkit.jar | Bin 11101992 -> 11202128 bytes 3 files changed, 36 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java index fee9d41e3..ce617fcd5 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java @@ -633,4 +633,40 @@ public class FakeWorld implements World { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public int getMonsterSpawnLimit() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMonsterSpawnLimit(int arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getAnimalSpawnLimit() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAnimalSpawnLimit(int arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getWaterAnimalSpawnLimit() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setWaterAnimalSpawnLimit(int arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff --git a/lib/bukkit.jar b/lib/bukkit.jar index 54f4c9ede..924971ca1 100644 Binary files a/lib/bukkit.jar and b/lib/bukkit.jar differ diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar index c3a206bb1..fc8f79df0 100644 Binary files a/lib/craftbukkit.jar and b/lib/craftbukkit.jar differ -- cgit v1.2.3 From 051af644a7e73c327fc44a182281068f405dde11 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 19 May 2012 21:52:54 +0100 Subject: Exp command cleanup --- .../earth2me/essentials/commands/Commandexp.java | 165 +++++++++------------ Essentials/src/messages.properties | 15 +- Essentials/src/messages_cs.properties | 4 +- Essentials/src/plugin.yml | 7 +- 4 files changed, 77 insertions(+), 114 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java index fddcdca09..2ca0ec1b5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java @@ -7,6 +7,7 @@ import com.earth2me.essentials.craftbukkit.SetExpFix; import org.bukkit.Server; import org.bukkit.entity.Player; + public class Commandexp extends EssentialsCommand { public Commandexp() @@ -14,120 +15,90 @@ public class Commandexp extends EssentialsCommand super("exp"); } + private void showExp(final User user, final User target) + { + final int totalExp = SetExpFix.getTotalExperience(target); + final int expLeft = (int)Util.roundDouble(((((3.5 * target.getLevel()) + 6.7) - (totalExp - ((1.75 * (target.getLevel() * target.getLevel())) + (5.00 * target.getLevel())))) + 1)); + user.sendMessage(_("exp", target.getDisplayName(), SetExpFix.getTotalExperience(target), target.getLevel(), expLeft)); + } + + private void setExp(final User user, final User target, final String strAmount, final boolean give) + { + Long amount = Long.parseLong(strAmount); + if (give) + { + amount += SetExpFix.getTotalExperience(target); + } + if (amount > Integer.MAX_VALUE) { + amount = (long)Integer.MAX_VALUE; + } + SetExpFix.setTotalExperience(target, amount.intValue()); + user.sendMessage(_("expset", target.getDisplayName(), amount)); + } + @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length == 0) - { - if (user.isAuthorized("essentials.exp")) - { - int totalexp = SetExpFix.getTotalExperience(user); - int expleft = (int)Util.roundDouble(((((3.5 * user.getLevel()) + 6.7) - (totalexp - ((1.75 * (user.getLevel() * user.getLevel())) + (5.00 * user.getLevel())))) + 1)); - user.sendMessage(_("exp", totalexp, expleft)); - } + { + showExp(user, user); + return; } - else if (args.length > 0) + if (args[0].equalsIgnoreCase("set") && user.isAuthorized("essentials.exp.set")) { - if (args[0].equalsIgnoreCase("set")) + if (args.length == 3) { - if (args.length > 1) + Boolean foundUser = false; + for (Player matchPlayer : server.matchPlayer(args[1])) { - for (Player p : server.matchPlayer(args[1])) - { - if ((args.length == 3) && (args[1].trim().length() > 2) && (user.isAuthorized("essentials.exp.set.others"))) - { - User player = getPlayer(server, args, 1); - int amount = Integer.parseInt(args[2]); - SetExpFix.setTotalExperience(p, amount); - user.sendMessage(_("expsetothers", player.getDisplayName(), amount)); - p.sendMessage(_("expsetothersreceive", amount)); - } - } - if ((args.length == 2) && (user.isAuthorized("essentials.exp.set"))) - { - int amount = Integer.parseInt(args[1]); - SetExpFix.setTotalExperience(user, amount); - user.sendMessage(_("expset", amount)); - } + User target = ess.getUser(matchPlayer); + setExp(user, target, args[2], false); + foundUser = true; } - } - if (args[0].equalsIgnoreCase("give")) - { - if (args.length > 1) + if (foundUser == false) { - for (Player p : server.matchPlayer(args[1])) - { - if ((args.length == 3) && (args[1].trim().length() > 2) && (user.isAuthorized("essentials.exp.give.others"))) - { - User player = getPlayer(server, args, 1); - int amount = Integer.parseInt(args[2]); - p.giveExp(amount); - user.sendMessage(_("expgiveothers", player.getDisplayName(), amount)); - p.sendMessage (_("expgiveothersreceive", amount)); - } - } - if ((args.length == 2) && (user.isAuthorized("essentials.exp.give"))) - { - int amount = Integer.parseInt(args[1]); - user.giveExp(amount); - user.sendMessage(_("expgive", amount)); - } - + throw new NoSuchFieldException(_("playerNotFound")); } + return; } - if (args[0].equalsIgnoreCase("player")) + setExp(user, user, args[1], false); + } + else if (args[0].equalsIgnoreCase("give") && user.isAuthorized("essentials.exp.give")) + { + if (args.length == 3) { - if (args.length > 1) + Boolean foundUser = false; + for (Player matchPlayer : server.matchPlayer(args[1])) { - for (Player p : server.matchPlayer(args[1])) - { - if ((args.length == 2) && (args[1].trim().length() > 2) && (user.isAuthorized("essentials.exp.others"))) - { - User player = getPlayer(server, args, 1); - int totalexp = SetExpFix.getTotalExperience(p); - int expleft = (int)Util.roundDouble(((((3.5 * p.getLevel()) + 6.7) - (totalexp - ((1.75 * (player.getLevel() * player.getLevel())) + (5.00 * player.getLevel())))) + 1)); - user.sendMessage(_("expothers", player.getDisplayName(), SetExpFix.getTotalExperience(p), expleft)); - } - } + User target = ess.getUser(matchPlayer); + setExp(user, target, args[2], true); + foundUser = true; } + if (foundUser == false) + { + throw new NoSuchFieldException(_("playerNotFound")); + } + return; + } + setExp(user, user, args[1], true); + } + else + { + String search = args[0].trim(); + if (args.length == 2) + { + search = args[1].trim(); } - if (args[0].equalsIgnoreCase("fix")) + if (search.equalsIgnoreCase("show") || !user.isAuthorized("essentials.exp.others")) { - { if ((args.length == 1) && (user.isAuthorized("essentials.exp.fix"))) - { - if (SetExpFix.getTotalExperience(user) < 0) - { - user.sendMessage(_("expfix")); - user.setExp(0); - user.setLevel(0); - user.setTotalExperience(0); - } - else if (SetExpFix.getTotalExperience(user) >= 0) - { - user.sendMessage(_("expfixfalse")); - } - } - else if ((args.length == 2) && (user.isAuthorized("essentials.exp.fix.others"))) - { - for (Player p : server.matchPlayer(args[1])) - { - if (SetExpFix.getTotalExperience(p) < 0) - { - - user.sendMessage(_("expfixothers", p.getDisplayName())); - p.setExp(0); - p.setLevel(0); - p.setTotalExperience(0); - p.sendMessage(_("expfixothersreceive")); - } - else if (SetExpFix.getTotalExperience(p) >= 0) - { - user.sendMessage(_("expfixothersfalse", p.getDisplayName())); - } - } - } - } + showExp(user, user); + return; + } + for (Player matchPlayer : server.matchPlayer(search)) + { + User target = ess.getUser(matchPlayer); + showExp(user, target); } } - } + } } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 9c2182c10..317fe6dc4 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -85,19 +85,8 @@ errorWithMessage=\u00a7cError: {0} essentialsHelp1=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat essentialsReload=\u00a77Essentials Reloaded {0} -exp=\u00a77You have \u00a7c{0} \u00a77exp and you need \u00a7c{1}\u00a77 more exp to level up. -expfix=\u00a77You have negative exp; fixing it. -expfixfalse=\u00a77You do not have negative exp. -expfixothers=\u00a7c{0} \u00a77has negative exp; fixing it. -expfixothersreceive=\u00a77Your no longer have negative exp. -expfixothersfalse=\u00a7c{0} \u00a77does not have negative exp. -expgive=\u00a77You have given yourself \u00a7c{0}\u00a77 exp. -expgiveothers=\u00a77You have given \u00a7c{0} {1}\u00a77 exp. -expgiveothersreceive=\u00a77You have received \u00a7c{0}\u00a77 exp. -expothers=\u00a7c{0}\u00a77 has \u00a7c{1} \u00a77exp and needs \u00a7c{2} \u00a77more exp to level up. -expset=\u00a77You now have \u00a7c{0} \u00a77exp. -expsetothers=\u00a7c{0} \u00a77now has \u00a7c{1} \u00a77exp. -expsetothersreceive=\u00a77You now have \u00a7c{0} \u00a77exp. +exp=\u00a7c{0}\u00a77 has \u00a7c{1} \u00a77exp (level {2}) and needs \u00a7c{3} \u00a77more exp to level up. +expset=\u00a7c{0} \u00a77now has \u00a7c{1} \u00a77exp. extinguish=\u00a77You extinguished yourself. extinguishOthers=\u00a77You extinguished {0}. failedToCloseConfig=Failed to close config {0} diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index 21d1d6e97..7a43b559d 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -334,7 +334,7 @@ survival=survival takenFromAccount=\u00a7c{0} bylo odecteno z tveho uctu. takenFromOthersAccount=\u00a7c{0} bylo odebrano z {1}\u00a7c uctu. Nova hodnota: {2} teleportAAll=\u00a77Zadost o teleportaci odeslana vsem hracum... -teleportAll=\u00a77Teleportuji vÅ¡echny hrace... +teleportAll=\u00a77Teleportuji v\u00c5\u00a1echny hrace... teleportAtoB=\u00a77{0}\u00a77 vas teleportoval k {1}\u00a77. teleportDisabled={0} mas teleportaci zablokovanou. teleportHereRequest=\u00a7c{0}\u00a7c vas pozadal aby jste se warpnul k nemu. @@ -424,3 +424,5 @@ year=rok years=roky youAreHealed=\u00a77Byl jsi uzdraven. youHaveNewMail=\u00a7cMas {0} zprav!\u00a7f Napis \u00a77/mail read\u00a7f aby jsi si precetl sve zpravy. +currentWorld=Current World: {0} +kickedAll=\u00a7cKicked all players from server diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 10ef00494..f778ab4dc 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -90,10 +90,11 @@ commands: essentials: description: Reloads essentials. usage: / + aliases: [ess] exp: - description: give, set or look at a players exp. - usage: / [player|set|give|fix] [playername] [amount] - aliases: [eexp] + description: Give, set or look at a players exp. + usage: / [show|set|give|fix] [playername [amount]] + aliases: [eexp,xp] ext: description: Extinguish players. usage: / [player] -- cgit v1.2.3 From 32fa834f3f27288a5c272bda0a931e4f391dcaaa Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 19 May 2012 22:02:42 +0100 Subject: Forgot to update plugin syntax. Added missing perm checks. --- .../earth2me/essentials/commands/Commandexp.java | 50 +++++++++++----------- Essentials/src/messages.properties | 4 +- Essentials/src/plugin.yml | 2 +- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java index 2ca0ec1b5..22976ff92 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java @@ -15,38 +15,16 @@ public class Commandexp extends EssentialsCommand super("exp"); } - private void showExp(final User user, final User target) - { - final int totalExp = SetExpFix.getTotalExperience(target); - final int expLeft = (int)Util.roundDouble(((((3.5 * target.getLevel()) + 6.7) - (totalExp - ((1.75 * (target.getLevel() * target.getLevel())) + (5.00 * target.getLevel())))) + 1)); - user.sendMessage(_("exp", target.getDisplayName(), SetExpFix.getTotalExperience(target), target.getLevel(), expLeft)); - } - - private void setExp(final User user, final User target, final String strAmount, final boolean give) - { - Long amount = Long.parseLong(strAmount); - if (give) - { - amount += SetExpFix.getTotalExperience(target); - } - if (amount > Integer.MAX_VALUE) { - amount = (long)Integer.MAX_VALUE; - } - SetExpFix.setTotalExperience(target, amount.intValue()); - user.sendMessage(_("expset", target.getDisplayName(), amount)); - } - @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length == 0) { showExp(user, user); - return; } - if (args[0].equalsIgnoreCase("set") && user.isAuthorized("essentials.exp.set")) + else if (args[0].equalsIgnoreCase("set") && user.isAuthorized("essentials.exp.set")) { - if (args.length == 3) + if (args.length == 3 && user.isAuthorized("essentials.exp.set.others")) { Boolean foundUser = false; for (Player matchPlayer : server.matchPlayer(args[1])) @@ -65,7 +43,7 @@ public class Commandexp extends EssentialsCommand } else if (args[0].equalsIgnoreCase("give") && user.isAuthorized("essentials.exp.give")) { - if (args.length == 3) + if (args.length == 3 && user.isAuthorized("essentials.exp.give.others")) { Boolean foundUser = false; for (Player matchPlayer : server.matchPlayer(args[1])) @@ -101,4 +79,26 @@ public class Commandexp extends EssentialsCommand } } } + + private void showExp(final User user, final User target) + { + final int totalExp = SetExpFix.getTotalExperience(target); + final int expLeft = (int)Util.roundDouble(((((3.5 * target.getLevel()) + 6.7) - (totalExp - ((1.75 * (target.getLevel() * target.getLevel())) + (5.00 * target.getLevel())))) + 1)); + user.sendMessage(_("exp", target.getDisplayName(), SetExpFix.getTotalExperience(target), target.getLevel(), expLeft)); + } + + private void setExp(final User user, final User target, final String strAmount, final boolean give) + { + Long amount = Long.parseLong(strAmount); + if (give) + { + amount += SetExpFix.getTotalExperience(target); + } + if (amount > Integer.MAX_VALUE) + { + amount = (long)Integer.MAX_VALUE; + } + SetExpFix.setTotalExperience(target, amount.intValue()); + user.sendMessage(_("expSet", target.getDisplayName(), amount)); + } } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 317fe6dc4..0e941cc58 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -85,8 +85,8 @@ errorWithMessage=\u00a7cError: {0} essentialsHelp1=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat essentialsReload=\u00a77Essentials Reloaded {0} -exp=\u00a7c{0}\u00a77 has \u00a7c{1} \u00a77exp (level {2}) and needs \u00a7c{3} \u00a77more exp to level up. -expset=\u00a7c{0} \u00a77now has \u00a7c{1} \u00a77exp. +exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up. +expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp. extinguish=\u00a77You extinguished yourself. extinguishOthers=\u00a77You extinguished {0}. failedToCloseConfig=Failed to close config {0} diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index f778ab4dc..bfa7ee602 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -93,7 +93,7 @@ commands: aliases: [ess] exp: description: Give, set or look at a players exp. - usage: / [show|set|give|fix] [playername [amount]] + usage: / [show|set|give] [playername [amount]] aliases: [eexp,xp] ext: description: Extinguish players. -- cgit v1.2.3 From 1c0838aa5dcead2d3564c84ce45a2f7736e8b736 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 19 May 2012 22:19:24 +0100 Subject: Fixing unit tests. --- .../test/com/earth2me/essentials/FakeServer.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Essentials/test/com/earth2me/essentials/FakeServer.java b/Essentials/test/com/earth2me/essentials/FakeServer.java index 63d03a5f9..53763b8ca 100644 --- a/Essentials/test/com/earth2me/essentials/FakeServer.java +++ b/Essentials/test/com/earth2me/essentials/FakeServer.java @@ -723,4 +723,22 @@ public class FakeServer implements Server { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public int getMonsterSpawnLimit() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getAnimalSpawnLimit() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getWaterAnimalSpawnLimit() + { + throw new UnsupportedOperationException("Not supported yet."); + } } -- cgit v1.2.3 From faa3a5e027e555a7b7221c290e522e228b4af916 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 20 May 2012 23:58:03 +0100 Subject: Make /home and /back obey the world perm system. This will prevent players from moving between words using virtually all essentials commands. ATM /warp is excepted, because we already have per warp permissions. Ess3 may see warp permissions altered to: essentials.warp.. --- .../src/com/earth2me/essentials/commands/Commandback.java | 5 +++++ .../src/com/earth2me/essentials/commands/Commandhome.java | 14 ++++++++++++-- Essentials/src/config.yml | 3 ++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandback.java b/Essentials/src/com/earth2me/essentials/commands/Commandback.java index 2ad39ceea..d2ed98e69 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandback.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandback.java @@ -16,6 +16,11 @@ public class Commandback extends EssentialsCommand @Override protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { + if (user.getWorld() != user.getLastLocation().getWorld() && ess.getSettings().isWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + user.getLastLocation().getWorld().getName())) + { + throw new Exception(_("noPerm", "essentials.world." + user.getLastLocation().getWorld().getName())); + } final Trade charge = new Trade(this.getName(), ess); charge.isAffordableFor(user); user.sendMessage(_("backUsageMsg")); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java index f14422efd..bc59f4c2b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java @@ -54,7 +54,7 @@ public class Commandhome extends EssentialsCommand throw new NoChargeException(); } } - user.getTeleport().home(player, homeName.toLowerCase(Locale.ENGLISH), charge); + goHome(user, player, homeName.toLowerCase(Locale.ENGLISH), charge); } catch (NotEnoughArgumentsException e) { @@ -80,7 +80,7 @@ public class Commandhome extends EssentialsCommand } else if (homes.size() == 1 && player.equals(user)) { - user.getTeleport().home(player, homes.get(0), charge); + goHome(user, player, homes.get(0), charge); } else { @@ -93,4 +93,14 @@ public class Commandhome extends EssentialsCommand } throw new NoChargeException(); } + + private void goHome(final User user, final User player, final String home, final Trade charge) throws Exception + { + if (user.getWorld() != player.getHome(home).getWorld() && ess.getSettings().isWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + player.getHome(home).getWorld().getName())) + { + throw new Exception(_("noPerm", "essentials.world." + player.getHome(home).getWorld().getName())); + } + user.getTeleport().home(player, home, charge); + } } diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index c7c9decb0..06ca57ad5 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -284,7 +284,8 @@ death-messages: true no-god-in-worlds: # - world_nether -# Set to true to enable per-world permissions for teleporting with /world, /tp ,/tpa and /tpo. +# Set to true to enable per-world permissions for teleporting between worlds with essentials commands +# This applies to /world, /home, /back, /tp[a|o][here|all], but not warps. # Give someone permission to teleport to a world with essentials.world. world-teleport-permissions: false -- cgit v1.2.3 From cab40d7893db8d43841180ac1ed3769d0ab502b9 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 21 May 2012 15:13:01 +1000 Subject: Keep track of vanished players and tweak lag meter. --- Essentials/src/com/earth2me/essentials/Essentials.java | 9 ++++++++- .../src/com/earth2me/essentials/EssentialsPlayerListener.java | 9 +++++++++ Essentials/src/com/earth2me/essentials/EssentialsTimer.java | 2 +- Essentials/src/com/earth2me/essentials/IEssentials.java | 3 +++ Essentials/src/com/earth2me/essentials/User.java | 8 ++++++++ .../src/com/earth2me/essentials/commands/Commandvanish.java | 1 + 6 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index fe1edb4e5..60045464b 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -85,6 +85,7 @@ public class Essentials extends JavaPlugin implements IEssentials private transient I18n i18n; private transient Metrics metrics; private transient EssentialsTimer timer; + private transient List vanishedPlayers = new ArrayList(); @Override public ISettings getSettings() @@ -240,7 +241,7 @@ public class Essentials extends JavaPlugin implements IEssentials pm.registerEvents(tntListener, this); timer = new EssentialsTimer(this); - getScheduler().scheduleSyncRepeatingTask(this, timer, 1, 100); + getScheduler().scheduleSyncRepeatingTask(this, timer, 100, 100); Economy.setEss(this); execTimer.mark("RegListeners"); @@ -629,6 +630,12 @@ public class Essentials extends JavaPlugin implements IEssentials return timer; } + @Override + public List getVanishedPlayers() + { + return vanishedPlayers; + } + private static class EssentialsWorldListener implements Listener, Runnable { private transient final IEssentials ess; diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 4cb1d2e9e..551833fc0 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -114,6 +114,7 @@ public class EssentialsPlayerListener implements Listener { user.toggleGodModeEnabled(); } + ess.getVanishedPlayers().remove(user.getName()); user.setLastLocation(); user.updateActivity(false); user.dispose(); @@ -141,6 +142,14 @@ public class EssentialsPlayerListener implements Listener user.setLastLogin(System.currentTimeMillis()); user.updateActivity(false); + for (String p : ess.getVanishedPlayers()) + { + if (!user.isAuthorized("essentials.vanish.see")) + { + user.hidePlayer(ess.getUser(p)); + } + } + if (user.isAuthorized("essentials.sleepingignored")) { user.setSleepingIgnored(true); diff --git a/Essentials/src/com/earth2me/essentials/EssentialsTimer.java b/Essentials/src/com/earth2me/essentials/EssentialsTimer.java index 0d97c2792..95cf77521 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsTimer.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsTimer.java @@ -12,7 +12,7 @@ public class EssentialsTimer implements Runnable { private final transient IEssentials ess; private final transient Set onlineUsers = new HashSet(); - private transient long lastPoll = System.currentTimeMillis() - 3000; + private transient long lastPoll = System.currentTimeMillis(); private final transient LinkedList history = new LinkedList(); EssentialsTimer(final IEssentials ess) diff --git a/Essentials/src/com/earth2me/essentials/IEssentials.java b/Essentials/src/com/earth2me/essentials/IEssentials.java index 6e1887b87..f12798db3 100644 --- a/Essentials/src/com/earth2me/essentials/IEssentials.java +++ b/Essentials/src/com/earth2me/essentials/IEssentials.java @@ -4,6 +4,7 @@ import com.earth2me.essentials.api.IJails; import com.earth2me.essentials.metrics.Metrics; import com.earth2me.essentials.perm.PermissionsHandler; import com.earth2me.essentials.register.payment.Methods; +import java.util.List; import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -72,4 +73,6 @@ public interface IEssentials extends Plugin void setMetrics(Metrics metrics); EssentialsTimer getTimer(); + + List getVanishedPlayers(); } diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index c6ce3a569..f9206206a 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -650,5 +650,13 @@ public class User extends UserData implements Comparable, IReplyTo, IUser public void toggleVanished() { vanished = !vanished; + if (vanished) + { + ess.getVanishedPlayers().add(getName()); + } + else + { + ess.getVanishedPlayers().remove(getName()); + } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java index 96cf95e36..2c14f60ef 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java @@ -36,5 +36,6 @@ public class Commandvanish extends EssentialsCommand user.sendMessage(ChatColor.GREEN + _("unvanished")); } } + user.toggleVanished(); } } -- cgit v1.2.3 From 56fccb96453e9e96d5a8e2f1dcc6e8c83b14cd13 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 22 May 2012 00:39:23 +0100 Subject: Patch null error in /home after recent update. --- Essentials/src/com/earth2me/essentials/Teleport.java | 9 ++------- .../src/com/earth2me/essentials/commands/Commandhome.java | 14 ++++++++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java index 9c21ffc6d..9d05f9368 100644 --- a/Essentials/src/com/earth2me/essentials/Teleport.java +++ b/Essentials/src/com/earth2me/essentials/Teleport.java @@ -277,14 +277,9 @@ public class Teleport implements Runnable, ITeleport { now(new Target(user.getLastLocation()), TeleportCause.COMMAND); } - - public void home(IUser user, String home, Trade chargeFor) throws Exception + + public void home(Location loc, Trade chargeFor) throws Exception { - final Location loc = user.getHome(home); - if (loc == null) - { - throw new NotEnoughArgumentsException(); - } teleport(new Target(loc), chargeFor, TeleportCause.COMMAND); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java index bc59f4c2b..4a28565ee 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java @@ -1,6 +1,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.Teleport; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; @@ -96,11 +97,16 @@ public class Commandhome extends EssentialsCommand private void goHome(final User user, final User player, final String home, final Trade charge) throws Exception { - if (user.getWorld() != player.getHome(home).getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + player.getHome(home).getWorld().getName())) + final Location loc = player.getHome(home); + if (loc == null) { - throw new Exception(_("noPerm", "essentials.world." + player.getHome(home).getWorld().getName())); + throw new NotEnoughArgumentsException(); } - user.getTeleport().home(player, home, charge); + if (user.getWorld() != loc.getWorld() && ess.getSettings().isWorldTeleportPermissions() + && !user.isAuthorized("essentials.world." + loc.getWorld().getName())) + { + throw new Exception(_("noPerm", "essentials.world." + loc.getWorld().getName())); + } + user.getTeleport().home(loc, charge); } } -- cgit v1.2.3 From fa58503c9f561a388f9cf1b1cc11f4b6de74c7e2 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 22 May 2012 00:41:03 +0100 Subject: Code tidy. --- Essentials/src/com/earth2me/essentials/Teleport.java | 5 ++--- Essentials/src/com/earth2me/essentials/commands/Commandhome.java | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java index 9d05f9368..6569a1689 100644 --- a/Essentials/src/com/earth2me/essentials/Teleport.java +++ b/Essentials/src/com/earth2me/essentials/Teleport.java @@ -2,7 +2,6 @@ package com.earth2me.essentials; import com.earth2me.essentials.api.ITeleport; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.commands.NotEnoughArgumentsException; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.logging.Logger; @@ -190,7 +189,7 @@ public class Teleport implements Runnable, ITeleport { cancel(false); } - + public void teleport(Location loc, Trade chargeFor) throws Exception { teleport(new Target(loc), chargeFor, TeleportCause.PLUGIN); @@ -277,7 +276,7 @@ public class Teleport implements Runnable, ITeleport { now(new Target(user.getLastLocation()), TeleportCause.COMMAND); } - + public void home(Location loc, Trade chargeFor) throws Exception { teleport(new Target(loc), chargeFor, TeleportCause.COMMAND); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java index 4a28565ee..d838411cf 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java @@ -1,7 +1,6 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.Teleport; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; @@ -107,6 +106,6 @@ public class Commandhome extends EssentialsCommand { throw new Exception(_("noPerm", "essentials.world." + loc.getWorld().getName())); } - user.getTeleport().home(loc, charge); + user.getTeleport().home(loc, charge); } } -- cgit v1.2.3 From 5eeaeaee5dff57851a5f05993038d3fb28497950 Mon Sep 17 00:00:00 2001 From: ementalo Date: Tue, 22 May 2012 01:29:47 +0100 Subject: Adding new config setting login-attack-delay. Set this in seconds for a delay before players can attack each other after logging on. Use permission "essentials.pvpdelay.exempt" to bypass this restriction --- .../com/earth2me/essentials/EssentialsEntityListener.java | 10 +++++++++- Essentials/src/com/earth2me/essentials/ISettings.java | 2 ++ Essentials/src/com/earth2me/essentials/Settings.java | 14 +++++++++++++- Essentials/src/config.yml | 3 +++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java index ef0dba753..2f92cfd52 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java @@ -9,8 +9,8 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; import org.bukkit.event.entity.*; +import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; import org.bukkit.inventory.ItemStack; @@ -32,10 +32,18 @@ public class EssentialsEntityListener implements Listener { final User defender = ess.getUser(eDefend); final User attacker = ess.getUser(eAttack); + + if (!attacker.isAuthorized("essentials.pvpdelay.exempt") && + System.currentTimeMillis() < (attacker.getLastLogin() + ess.getSettings().getLoginAttackDelay())) + { + event.setCancelled(true); + } + if (attacker.hasInvulnerabilityAfterTeleport() || defender.hasInvulnerabilityAfterTeleport()) { event.setCancelled(true); } + attacker.updateActivity(true); final List commandList = attacker.getPowertool(attacker.getItemInHand()); if (commandList != null && !commandList.isEmpty()) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index 8eca8f06f..41b50dcca 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -175,4 +175,6 @@ public interface ISettings extends IConf long getTeleportInvulnerability(); boolean isTeleportInvulnerability(); + + long getLoginAttackDelay(); } diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 5d49c52b8..70970a347 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -792,10 +792,22 @@ public class Settings implements ISettings { return (config.getLong("teleport-invulnerability", 0) > 0); } - + @Override public boolean isTeleportInvulnerability() { return teleportInvulnerability; } + + private long _loginAttackDelay() + { + return config.getLong("login-attack-delay", 0) * 1000; + } + + @Override + public long getLoginAttackDelay() + { + return _loginAttackDelay(); + } + } diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 06ca57ad5..18bec5ca2 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -308,6 +308,9 @@ repair-enchanted: true #If you set this to true any plugin that uses teleport will have the previous location registered. register-back-in-listener: false +#Delay to wait before people can cause attack damage after logging in +login-attack-delay: 0 + ############################################################ # +------------------------------------------------------+ # # | EssentialsHome | # -- cgit v1.2.3 From 74f0babc7d364809132a01f73e59eba46a0899a4 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 22 May 2012 17:54:19 +0100 Subject: Separate toggle for world teleports using homes. --- Essentials/src/com/earth2me/essentials/ISettings.java | 2 ++ Essentials/src/com/earth2me/essentials/Settings.java | 6 ++++++ Essentials/src/com/earth2me/essentials/commands/Commandhome.java | 2 +- Essentials/src/config.yml | 7 ++++++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/ISettings.java b/Essentials/src/com/earth2me/essentials/ISettings.java index 8eca8f06f..c179aee0f 100644 --- a/Essentials/src/com/earth2me/essentials/ISettings.java +++ b/Essentials/src/com/earth2me/essentials/ISettings.java @@ -159,6 +159,8 @@ public interface ISettings extends IConf boolean getRepairEnchanted(); boolean isWorldTeleportPermissions(); + + boolean isWorldHomePermissions(); boolean registerBackInListener(); diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 5d49c52b8..ff3ec12aa 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -711,6 +711,12 @@ public class Settings implements ISettings { return config.getBoolean("world-teleport-permissions", false); } + + @Override + public boolean isWorldHomePermissions() + { + return config.getBoolean("world-home-permissions", false); + } private boolean registerBackInListener; @Override diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java index d838411cf..2c91a06c9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java @@ -101,7 +101,7 @@ public class Commandhome extends EssentialsCommand { throw new NotEnoughArgumentsException(); } - if (user.getWorld() != loc.getWorld() && ess.getSettings().isWorldTeleportPermissions() + if (user.getWorld() != loc.getWorld() && ess.getSettings().isWorldHomePermissions() && !user.isAuthorized("essentials.world." + loc.getWorld().getName())) { throw new Exception(_("noPerm", "essentials.world." + loc.getWorld().getName())); diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 06ca57ad5..0ec761956 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -285,7 +285,7 @@ no-god-in-worlds: # - world_nether # Set to true to enable per-world permissions for teleporting between worlds with essentials commands -# This applies to /world, /home, /back, /tp[a|o][here|all], but not warps. +# This applies to /world, /back, /tp[a|o][here|all], but not warps. # Give someone permission to teleport to a world with essentials.world. world-teleport-permissions: false @@ -320,6 +320,11 @@ spawn-if-no-home: true # Allows people to set their bed at daytime update-bed-at-daytime: true +# Set to true to enable per-world permissions for using homes to teleport between worlds +# This applies to the /home only. +# Give someone permission to teleport to a world with essentials.world. +world-home-permissions: false + # 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 -- cgit v1.2.3 From 7f5f6b6ac9a8b6c9ba6986d61a8c502e85f8c8ee Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 22 May 2012 21:02:28 +0100 Subject: Tidy up PVP attack delay. --- .../src/com/earth2me/essentials/EssentialsEntityListener.java | 10 +++++----- Essentials/src/com/earth2me/essentials/Settings.java | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java index 2f92cfd52..9b11f0a24 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java @@ -32,18 +32,18 @@ public class EssentialsEntityListener implements Listener { final User defender = ess.getUser(eDefend); final User attacker = ess.getUser(eAttack); - - if (!attacker.isAuthorized("essentials.pvpdelay.exempt") && - System.currentTimeMillis() < (attacker.getLastLogin() + ess.getSettings().getLoginAttackDelay())) + + if (ess.getSettings().getLoginAttackDelay() > 0 && !attacker.isAuthorized("essentials.pvpdelay.exempt") + && (System.currentTimeMillis() < (attacker.getLastLogin() + ess.getSettings().getLoginAttackDelay()))) { event.setCancelled(true); } - + if (attacker.hasInvulnerabilityAfterTeleport() || defender.hasInvulnerabilityAfterTeleport()) { event.setCancelled(true); } - + attacker.updateActivity(true); final List commandList = attacker.getPowertool(attacker.getItemInHand()); if (commandList != null && !commandList.isEmpty()) diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index bcb19c380..b1352b6c3 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -388,6 +388,7 @@ public class Settings implements ISettings cancelAfkOnMove = _cancelAfkOnMove(); getFreezeAfkPlayers = _getFreezeAfkPlayers(); itemSpawnBl = _getItemSpawnBlacklist(); + loginAttackDelay = _loginAttackDelay(); kits = _getKits(); chatFormats.clear(); } @@ -805,6 +806,8 @@ public class Settings implements ISettings return teleportInvulnerability; } + private long loginAttackDelay; + private long _loginAttackDelay() { return config.getLong("login-attack-delay", 0) * 1000; @@ -813,7 +816,7 @@ public class Settings implements ISettings @Override public long getLoginAttackDelay() { - return _loginAttackDelay(); + return loginAttackDelay; } } -- cgit v1.2.3 From 409f33797338c6c18f0f2949bbbf40314e1527b4 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 26 May 2012 14:45:40 +1000 Subject: Client side note blocks don't play it seems (reverse-merged from commit 0b60d4efe2fed324131e083f6d4168256d943588) --- Essentials/src/com/earth2me/essentials/commands/Commandessentials.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index 6b248f6d5..ca746c5a8 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -125,7 +125,7 @@ public class Commandessentials extends EssentialsCommand if (loc.getBlock().getTypeId() == 0) { noteBlocks.put(player, loc.getBlock()); - player.sendBlockChange(loc, Material.NOTE_BLOCK, (byte)0); + loc.getBlock().setType(Material.NOTE_BLOCK); } } taskid = ess.scheduleSyncRepeatingTask(new Runnable() -- cgit v1.2.3 From 0559b935e94fd8cc3305fa48f98244136aed7377 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 27 May 2012 17:24:49 +1000 Subject: Add new command /hat and update translate keys as well as fix colour codes. --- .../src/com/earth2me/essentials/Essentials.java | 2 +- .../earth2me/essentials/commands/Commandhat.java | 36 ++++++++++++++++++++++ .../earth2me/essentials/commands/Commandmail.java | 1 - .../essentials/commands/Commandvanish.java | 4 +-- Essentials/src/messages.properties | 8 +++-- Essentials/src/messages_cs.properties | 8 +++++ Essentials/src/messages_da.properties | 8 +++++ Essentials/src/messages_de.properties | 8 +++++ Essentials/src/messages_en.properties | 8 +++++ Essentials/src/messages_es.properties | 8 +++++ Essentials/src/messages_fr.properties | 8 +++++ Essentials/src/messages_it.properties | 8 +++++ Essentials/src/messages_nl.properties | 8 +++++ Essentials/src/messages_pl.properties | 8 +++++ Essentials/src/messages_pt.properties | 8 +++++ Essentials/src/plugin.yml | 4 +++ 16 files changed, 128 insertions(+), 7 deletions(-) create mode 100644 Essentials/src/com/earth2me/essentials/commands/Commandhat.java diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 60045464b..5b6236c30 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -271,7 +271,7 @@ public class Essentials extends JavaPlugin implements IEssentials { if (getUser(p).isVanished()) { - p.sendMessage(ChatColor.RED + _("unvanishedReload")); + p.sendMessage(_("unvanishedReload")); } } i18n.onDisable(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhat.java b/Essentials/src/com/earth2me/essentials/commands/Commandhat.java new file mode 100644 index 000000000..24d464275 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhat.java @@ -0,0 +1,36 @@ +package com.earth2me.essentials.commands; + +import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.User; +import org.bukkit.Material; +import org.bukkit.Server; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.PlayerInventory; + + +public class Commandhat extends EssentialsCommand +{ + public Commandhat() + { + super("hat"); + } + + @Override + protected void run(Server server, User user, String commandLabel, String[] args) throws Exception + { + if (user.getItemInHand().getType() != Material.AIR) + { + final ItemStack hand = user.getItemInHand(); + final PlayerInventory inv = user.getInventory(); + final ItemStack head = inv.getHelmet(); + inv.removeItem(hand); + inv.setHelmet(hand); + inv.setItemInHand(head); + user.sendMessage(_("hatPlaced")); + } + else + { + user.sendMessage(_("hatFail")); + } + } +} diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java index fa4643875..7a2dad1b1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java @@ -4,7 +4,6 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; import java.util.List; -import org.bukkit.ChatColor; import org.bukkit.Server; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java index 2c14f60ef..b55bd76a4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java @@ -23,7 +23,7 @@ public class Commandvanish extends EssentialsCommand { p.showPlayer(user); } - user.sendMessage(ChatColor.GREEN + _("vanished")); + user.sendMessage(_("vanished")); } else { @@ -33,7 +33,7 @@ public class Commandvanish extends EssentialsCommand { p.hidePlayer(user); } - user.sendMessage(ChatColor.GREEN + _("unvanished")); + user.sendMessage(_("unvanished")); } } user.toggleVanished(); diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 0e941cc58..84f4734e6 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -111,6 +111,8 @@ geoipJoinFormat=Player {0} comes from {1} godDisabledFor=disabled for {0} godEnabledFor=enabled for {0} godMode=\u00a77God mode {0}. +hatPlaced=\u00a7eEnjoy your new hat! +hatFail=\u00a7cYou must have something to wear in your hand. haveBeenReleased=\u00a77You have been released heal=\u00a77You have been healed. healOther=\u00a77Healed {0}. @@ -380,8 +382,8 @@ unknownItemName=Unknown item name: {0} unlimitedItemPermission=\u00a7cNo permission for unlimited item {0}. unlimitedItems=Unlimited items: unmutedPlayer=Player {0} unmuted. -unvanished=You are once again visible. -unvanishedReload=A reload has forced you to become visible. +unvanished=\u00a7aYou are once again visible. +unvanishedReload=\u00a7cA reload has forced you to become visible. upgradingFilesError=Error while upgrading the files userDoesNotExist=The user {0} does not exist. userIsAway={0} is now AFK @@ -391,7 +393,7 @@ userUsedPortal={0} used an existing exit portal. userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp usingTempFolderForTesting=Using temp folder for testing: -vanished=You have now been vanished. +vanished=\u00a7aYou have now been vanished. versionMismatch=Version mismatch! Please update {0} to the same version. versionMismatchAll=Version mismatch! Please update all Essentials jars to the same version. voiceSilenced=\u00a77Your voice has been silenced diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index 7a43b559d..dc64cb5e1 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -426,3 +426,11 @@ youAreHealed=\u00a77Byl jsi uzdraven. youHaveNewMail=\u00a7cMas {0} zprav!\u00a7f Napis \u00a77/mail read\u00a7f aby jsi si precetl sve zpravy. currentWorld=Current World: {0} kickedAll=\u00a7cKicked all players from server +exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up. +expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp. +unvanished=\u00a7aYou are once again visible. +unvanishedReload=\u00a7cA reload has forced you to become visible. +vanished=\u00a7aYou have now been vanished. +tps=Current TPS = {0} +hatPlaced=\u00a7eEnjoy your new hat! +hatFail=\u00a7cYou must have something to wear in your hand. diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index a88863528..076e5a956 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -423,3 +423,11 @@ year=\u00e5r years=\u00e5r youAreHealed=\u00a77Du er blevet healed. Halleluja! youHaveNewMail=\u00a7cDu har {0} flaskeposter!\u00a7f Type \u00a77/mail read for at se din flaskepost. +exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up. +expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp. +unvanished=\u00a7aYou are once again visible. +unvanishedReload=\u00a7cA reload has forced you to become visible. +vanished=\u00a7aYou have now been vanished. +tps=Current TPS = {0} +hatPlaced=\u00a7eEnjoy your new hat! +hatFail=\u00a7cYou must have something to wear in your hand. diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 6ac0e1809..6aa916542 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -423,3 +423,11 @@ year=Jahr years=Jahre youAreHealed=\u00a77Du wurdest geheilt. youHaveNewMail=\u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen. +exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up. +expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp. +unvanished=\u00a7aYou are once again visible. +unvanishedReload=\u00a7cA reload has forced you to become visible. +vanished=\u00a7aYou have now been vanished. +tps=Current TPS = {0} +hatPlaced=\u00a7eEnjoy your new hat! +hatFail=\u00a7cYou must have something to wear in your hand. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 73ce00bee..84f4734e6 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -85,6 +85,8 @@ errorWithMessage=\u00a7cError: {0} essentialsHelp1=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat essentialsHelp2=The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat essentialsReload=\u00a77Essentials Reloaded {0} +exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up. +expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp. extinguish=\u00a77You extinguished yourself. extinguishOthers=\u00a77You extinguished {0}. failedToCloseConfig=Failed to close config {0} @@ -109,6 +111,8 @@ geoipJoinFormat=Player {0} comes from {1} godDisabledFor=disabled for {0} godEnabledFor=enabled for {0} godMode=\u00a77God mode {0}. +hatPlaced=\u00a7eEnjoy your new hat! +hatFail=\u00a7cYou must have something to wear in your hand. haveBeenReleased=\u00a77You have been released heal=\u00a77You have been healed. healOther=\u00a77Healed {0}. @@ -364,6 +368,7 @@ tradeSignEmptyOwner=There is nothing to collect from this trade sign. treeFailure=\u00a7cTree generation failure. Try again on grass or dirt. treeSpawned=\u00a77Tree spawned. true=true +tps=Current TPS = {0} typeTpaccept=\u00a77To teleport, type \u00a7c/tpaccept\u00a77. typeTpdeny=\u00a77To deny this request, type \u00a7c/tpdeny\u00a77. typeWorldName=\u00a77You can also type the name of a specific world. @@ -377,6 +382,8 @@ unknownItemName=Unknown item name: {0} unlimitedItemPermission=\u00a7cNo permission for unlimited item {0}. unlimitedItems=Unlimited items: unmutedPlayer=Player {0} unmuted. +unvanished=\u00a7aYou are once again visible. +unvanishedReload=\u00a7cA reload has forced you to become visible. upgradingFilesError=Error while upgrading the files userDoesNotExist=The user {0} does not exist. userIsAway={0} is now AFK @@ -386,6 +393,7 @@ userUsedPortal={0} used an existing exit portal. userdataMoveBackError=Failed to move userdata/{0}.tmp to userdata/{1} userdataMoveError=Failed to move userdata/{0} to userdata/{1}.tmp usingTempFolderForTesting=Using temp folder for testing: +vanished=\u00a7aYou have now been vanished. versionMismatch=Version mismatch! Please update {0} to the same version. versionMismatchAll=Version mismatch! Please update all Essentials jars to the same version. voiceSilenced=\u00a77Your voice has been silenced diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 4469b284f..aa735be29 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -423,3 +423,11 @@ year=año years=años youAreHealed=\u00a77Has sido curado. youHaveNewMail=\u00a7cTienes {0} mensajes!\u00a7f Pon \u00a77/mail read\u00a7f para ver tus emails no leidos!. +exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up. +expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp. +unvanished=\u00a7aYou are once again visible. +unvanishedReload=\u00a7cA reload has forced you to become visible. +vanished=\u00a7aYou have now been vanished. +tps=Current TPS = {0} +hatPlaced=\u00a7eEnjoy your new hat! +hatFail=\u00a7cYou must have something to wear in your hand. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 235b22479..9be26fa00 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -423,3 +423,11 @@ year=ann\u00e9e years=ann\u00e9es youAreHealed=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9. youHaveNewMail=\u00a7cVous avez {0} messages ! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier. +exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up. +expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp. +unvanished=\u00a7aYou are once again visible. +unvanishedReload=\u00a7cA reload has forced you to become visible. +vanished=\u00a7aYou have now been vanished. +tps=Current TPS = {0} +hatPlaced=\u00a7eEnjoy your new hat! +hatFail=\u00a7cYou must have something to wear in your hand. diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties index 1eaf84e6d..0bf67362e 100644 --- a/Essentials/src/messages_it.properties +++ b/Essentials/src/messages_it.properties @@ -423,3 +423,11 @@ year=anno years=anni youAreHealed=\u00a77Sei stato curato. youHaveNewMail=\u00a7cHai {0} messaggi!\u00a7f digita \u00a77/mail read\u00a7f per consultare la tua mail. +exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up. +expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp. +unvanished=\u00a7aYou are once again visible. +unvanishedReload=\u00a7cA reload has forced you to become visible. +vanished=\u00a7aYou have now been vanished. +tps=Current TPS = {0} +hatPlaced=\u00a7eEnjoy your new hat! +hatFail=\u00a7cYou must have something to wear in your hand. diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index c0ac8c4d5..7a6827d2f 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -423,3 +423,11 @@ year=jaar years=jaren youAreHealed=\u00a77Je bent genezen. youHaveNewMail=\u00a7cJe hebt {0} berichten!\u00a7f Type \u00a77/mail read\u00a7f om je berichten te bekijken. +expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp. +exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up. +unvanished=\u00a7aYou are once again visible. +unvanishedReload=\u00a7cA reload has forced you to become visible. +vanished=\u00a7aYou have now been vanished. +tps=Current TPS = {0} +hatPlaced=\u00a7eEnjoy your new hat! +hatFail=\u00a7cYou must have something to wear in your hand. diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties index 58a5171c4..b7740ac12 100644 --- a/Essentials/src/messages_pl.properties +++ b/Essentials/src/messages_pl.properties @@ -423,3 +423,11 @@ year=rok years=lat youAreHealed=\u00a77Zostales/las uleczony/na. youHaveNewMail=\u00a7cMasz {0} wiadomosci!\u00a7f napisz \u00a77/mail read\u00a7f aby je przeczytac. +exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up. +expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp. +unvanished=\u00a7aYou are once again visible. +unvanishedReload=\u00a7cA reload has forced you to become visible. +vanished=\u00a7aYou have now been vanished. +tps=Current TPS = {0} +hatPlaced=\u00a7eEnjoy your new hat! +hatFail=\u00a7cYou must have something to wear in your hand. diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties index d12876d1a..9e91d1aa3 100644 --- a/Essentials/src/messages_pt.properties +++ b/Essentials/src/messages_pt.properties @@ -423,3 +423,11 @@ year=ano years=anos youAreHealed=\u00a77Voc\u00ea foi curado. youHaveNewMail=\u00a7cVoc\u00ea tem {0} mensagens!\u00a7f Digite \u00a77/mail read\u00a7f para ver seu email. +exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up. +expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp. +unvanished=\u00a7aYou are once again visible. +unvanishedReload=\u00a7cA reload has forced you to become visible. +vanished=\u00a7aYou have now been vanished. +tps=Current TPS = {0} +hatPlaced=\u00a7eEnjoy your new hat! +hatFail=\u00a7cYou must have something to wear in your hand. diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index bfa7ee602..8cacc0c11 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -135,6 +135,10 @@ commands: description: Enables your godly powers. usage: / [player] aliases: [tgm,godmode,egod,etgm,egodmode] + hat: + description: Get some cool new headgear + usage: / + aliases: [ehat] heal: description: Heals you or the given player. usage: / [player] -- cgit v1.2.3 From 45c1e347b0698318ebd3772c540a9a52b6509daf Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 27 May 2012 17:36:04 +1000 Subject: Don't allow armor to be used as a hat. --- .../com/earth2me/essentials/commands/Commandhat.java | 17 +++++++++++------ Essentials/src/messages.properties | 1 + Essentials/src/messages_cs.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_it.properties | 1 + Essentials/src/messages_nl.properties | 1 + Essentials/src/messages_pl.properties | 1 + Essentials/src/messages_pt.properties | 1 + 12 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhat.java b/Essentials/src/com/earth2me/essentials/commands/Commandhat.java index 24d464275..ed82fd16d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhat.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhat.java @@ -21,12 +21,17 @@ public class Commandhat extends EssentialsCommand if (user.getItemInHand().getType() != Material.AIR) { final ItemStack hand = user.getItemInHand(); - final PlayerInventory inv = user.getInventory(); - final ItemStack head = inv.getHelmet(); - inv.removeItem(hand); - inv.setHelmet(hand); - inv.setItemInHand(head); - user.sendMessage(_("hatPlaced")); + if (hand.getType().getMaxDurability() == 0) + { + final PlayerInventory inv = user.getInventory(); + final ItemStack head = inv.getHelmet(); + inv.removeItem(hand); + inv.setHelmet(hand); + inv.setItemInHand(head); + user.sendMessage(_("hatPlaced")); + } else { + user.sendMessage(_("hatArmor")); + } } else { diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 84f4734e6..ea765213f 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -431,3 +431,4 @@ year=year years=years youAreHealed=\u00a77You have been healed. youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail. +hatArmor=\u00a7cError, you cannot use armor as a hat! diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index dc64cb5e1..0265dab23 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -434,3 +434,4 @@ vanished=\u00a7aYou have now been vanished. tps=Current TPS = {0} hatPlaced=\u00a7eEnjoy your new hat! hatFail=\u00a7cYou must have something to wear in your hand. +hatArmor=\u00a7cError, you cannot use armor as a hat! diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 076e5a956..380f04ced 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished. tps=Current TPS = {0} hatPlaced=\u00a7eEnjoy your new hat! hatFail=\u00a7cYou must have something to wear in your hand. +hatArmor=\u00a7cError, you cannot use armor as a hat! diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 6aa916542..5558ab978 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished. tps=Current TPS = {0} hatPlaced=\u00a7eEnjoy your new hat! hatFail=\u00a7cYou must have something to wear in your hand. +hatArmor=\u00a7cError, you cannot use armor as a hat! diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 84f4734e6..ea765213f 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -431,3 +431,4 @@ year=year years=years youAreHealed=\u00a77You have been healed. youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail. +hatArmor=\u00a7cError, you cannot use armor as a hat! diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index aa735be29..56016f96e 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished. tps=Current TPS = {0} hatPlaced=\u00a7eEnjoy your new hat! hatFail=\u00a7cYou must have something to wear in your hand. +hatArmor=\u00a7cError, you cannot use armor as a hat! diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 9be26fa00..a101355ba 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished. tps=Current TPS = {0} hatPlaced=\u00a7eEnjoy your new hat! hatFail=\u00a7cYou must have something to wear in your hand. +hatArmor=\u00a7cError, you cannot use armor as a hat! diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties index 0bf67362e..19659a76a 100644 --- a/Essentials/src/messages_it.properties +++ b/Essentials/src/messages_it.properties @@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished. tps=Current TPS = {0} hatPlaced=\u00a7eEnjoy your new hat! hatFail=\u00a7cYou must have something to wear in your hand. +hatArmor=\u00a7cError, you cannot use armor as a hat! diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 7a6827d2f..17aa50829 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished. tps=Current TPS = {0} hatPlaced=\u00a7eEnjoy your new hat! hatFail=\u00a7cYou must have something to wear in your hand. +hatArmor=\u00a7cError, you cannot use armor as a hat! diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties index b7740ac12..1ca936863 100644 --- a/Essentials/src/messages_pl.properties +++ b/Essentials/src/messages_pl.properties @@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished. tps=Current TPS = {0} hatPlaced=\u00a7eEnjoy your new hat! hatFail=\u00a7cYou must have something to wear in your hand. +hatArmor=\u00a7cError, you cannot use armor as a hat! diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties index 9e91d1aa3..2a6260f1c 100644 --- a/Essentials/src/messages_pt.properties +++ b/Essentials/src/messages_pt.properties @@ -431,3 +431,4 @@ vanished=\u00a7aYou have now been vanished. tps=Current TPS = {0} hatPlaced=\u00a7eEnjoy your new hat! hatFail=\u00a7cYou must have something to wear in your hand. +hatArmor=\u00a7cError, you cannot use armor as a hat! -- cgit v1.2.3 From a8af0a92593a6a9f5b23e782c147e237521738a1 Mon Sep 17 00:00:00 2001 From: ementalo Date: Tue, 29 May 2012 22:06:04 +0100 Subject: 2.9 to 3.0 merge --- .../src/com/earth2me/essentials/Essentials.java | 86 +- .../com/earth2me/essentials/EssentialsTimer.java | 1 + Essentials/src/com/earth2me/essentials/Jails.java | 148 +-- Essentials/src/com/earth2me/essentials/Kits.java | 14 + .../src/com/earth2me/essentials/Teleport.java | 3 +- .../com/earth2me/essentials/api/IEssentials.java | 13 +- .../src/com/earth2me/essentials/api/ITeleport.java | 2 +- .../src/com/earth2me/essentials/api/IUser.java | 8 + .../earth2me/essentials/commands/Commandback.java | 13 +- .../essentials/commands/Commandbackup.java | 4 +- .../earth2me/essentials/commands/Commandban.java | 2 +- .../essentials/commands/Commandessentials.java | 1 - .../earth2me/essentials/commands/Commandexp.java | 18 +- .../earth2me/essentials/commands/Commandfly.java | 16 +- .../essentials/commands/Commandgamemode.java | 6 +- .../essentials/commands/Commandgetpos.java | 1 + .../earth2me/essentials/commands/Commandgive.java | 4 +- .../earth2me/essentials/commands/Commandhat.java | 10 +- .../earth2me/essentials/commands/Commandhelp.java | 14 +- .../earth2me/essentials/commands/Commandhome.java | 8 +- .../essentials/commands/Commandinvsee.java | 6 +- .../earth2me/essentials/commands/Commanditem.java | 18 +- .../earth2me/essentials/commands/Commandkit.java | 17 +- .../essentials/commands/Commandspawner.java | 2 +- .../earth2me/essentials/commands/Commandtime.java | 4 +- .../earth2me/essentials/commands/Commandtpo.java | 6 +- .../earth2me/essentials/commands/Commandtppos.java | 4 +- .../essentials/commands/Commandvanish.java | 11 +- .../essentials/commands/WarpNotFoundException.java | 1 + .../earth2me/essentials/economy/MoneyHolder.java | 14 + .../earth2me/essentials/economy/WorthHolder.java | 14 + .../essentials/listener/TntExplodeListener.java | 1 - .../essentials/metrics/MetricsListener.java | 6 +- .../essentials/metrics/MetricsStarter.java | 2 +- .../com/earth2me/essentials/ranks/GMGroups.java | 2 +- .../earth2me/essentials/ranks/RanksStorage.java | 14 +- .../com/earth2me/essentials/ranks/VaultGroups.java | 2 +- .../com/earth2me/essentials/settings/General.java | 42 + .../essentials/settings/SettingsHolder.java | 12 + .../earth2me/essentials/settings/SpawnsHolder.java | 13 + .../earth2me/essentials/settings/WarpHolder.java | 13 + .../earth2me/essentials/settings/WorldOptions.java | 4 +- .../storage/AbstractDelayedYamlFileReader.java | 7 +- .../earth2me/essentials/user/IOfflinePlayer.java | 2 + .../src/com/earth2me/essentials/user/User.java | 1138 +++++++++++++++++++- .../src/com/earth2me/essentials/utils/Util.java | 102 +- .../essentials/chat/EssentialsChatPlayer.java | 1 + pom.xml | 2 +- 48 files changed, 1601 insertions(+), 231 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index dc63d3020..13197aad7 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -17,34 +17,25 @@ */ package com.earth2me.essentials; -import com.earth2me.essentials.economy.Trade; -import com.earth2me.essentials.commands.EssentialsCommandHandler; -import com.earth2me.essentials.utils.ExecuteTimer; -import com.earth2me.essentials.economy.WorthHolder; -import com.earth2me.essentials.economy.Economy; -import com.earth2me.essentials.backup.Backup; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.*; -import com.earth2me.essentials.listener.*; +import com.earth2me.essentials.backup.Backup; +import com.earth2me.essentials.commands.EssentialsCommandHandler; +import com.earth2me.essentials.economy.Economy; +import com.earth2me.essentials.economy.Trade; +import com.earth2me.essentials.economy.WorthHolder; import com.earth2me.essentials.economy.register.Methods; +import com.earth2me.essentials.listener.*; +import com.earth2me.essentials.metrics.Metrics; +import com.earth2me.essentials.metrics.MetricsListener; +import com.earth2me.essentials.metrics.MetricsStarter; import com.earth2me.essentials.ranks.RanksStorage; import com.earth2me.essentials.settings.SettingsHolder; import com.earth2me.essentials.settings.SpawnsHolder; +import com.earth2me.essentials.user.IOfflinePlayer; +import com.earth2me.essentials.user.User; import com.earth2me.essentials.user.UserMap; -import com.earth2me.essentials.api.Economy; -import com.earth2me.essentials.api.IJails; -import com.earth2me.essentials.commands.EssentialsCommand; -import com.earth2me.essentials.commands.IEssentialsCommand; -import com.earth2me.essentials.commands.NoChargeException; -import com.earth2me.essentials.commands.NotEnoughArgumentsException; -import com.earth2me.essentials.metrics.Metrics; -import com.earth2me.essentials.metrics.MetricsListener; -import com.earth2me.essentials.metrics.MetricsStarter; -import com.earth2me.essentials.perm.PermissionsHandler; -import com.earth2me.essentials.register.payment.Methods; -import com.earth2me.essentials.signs.SignBlockListener; -import com.earth2me.essentials.signs.SignEntityListener; -import com.earth2me.essentials.signs.SignPlayerListener; +import com.earth2me.essentials.utils.ExecuteTimer; import java.io.File; import java.io.FileReader; import java.io.IOException; @@ -54,6 +45,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; +import lombok.Getter; import org.bukkit.Server; import org.bukkit.World; import org.bukkit.command.Command; @@ -95,7 +87,9 @@ public class Essentials extends JavaPlugin implements IEssentials private transient Economy economy; public transient boolean testing; private transient Metrics metrics; + @Getter private transient EssentialsTimer timer; + @Getter private transient List vanishedPlayers = new ArrayList(); @Override @@ -256,7 +250,7 @@ public class Essentials extends JavaPlugin implements IEssentials final MetricsStarter metricsStarter = new MetricsStarter(this); if (metricsStarter.getStart() != null && metricsStarter.getStart() == true) { - getScheduler().scheduleAsyncDelayedTask(this, metricsStarter, 1); + getServer().getScheduler().scheduleAsyncDelayedTask(this, metricsStarter, 1); } else if (metricsStarter.getStart() != null && metricsStarter.getStart() == false) { @@ -345,8 +339,52 @@ public class Essentials extends JavaPlugin implements IEssentials { this.metrics = metrics; } - + @Override + public IUser getUser(final Object base) + { + if (base instanceof Player) + { + return getUser((Player)base); + } + if (base instanceof String) + { + final IUser user = userMap.getUser((String)base); + if (user != null && user.getBase() instanceof IOfflinePlayer) + { + ((IOfflinePlayer)user.getBase()).setName((String)base); + } + return user; + } + return null; + } + + private IUser getUser(final T base) + { + if (base == null) + { + return null; + } + + if (base instanceof IUser) + { + return (IUser)base; + } + IUser user = userMap.getUser(base.getName()); + + if (user == null) + { + user = new User(base, this); + } + else + { + //todo - fix this + user.update(base); + } + return user; + } + + /*@Override public IUser getUser(final Player player) { return userMap.getUser(player); @@ -357,7 +395,7 @@ public class Essentials extends JavaPlugin implements IEssentials { return userMap.getUser(playerName); } - +*/ @Override public World getWorld(final String name) { diff --git a/Essentials/src/com/earth2me/essentials/EssentialsTimer.java b/Essentials/src/com/earth2me/essentials/EssentialsTimer.java index 34aecddc0..6874c069c 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsTimer.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsTimer.java @@ -9,6 +9,7 @@ import com.earth2me.essentials.user.UserData.TimestampType; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; +import java.util.List; import java.util.Set; import java.util.logging.Level; import org.bukkit.entity.Player; diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java index 53bef54c4..b23e1bb10 100644 --- a/Essentials/src/com/earth2me/essentials/Jails.java +++ b/Essentials/src/com/earth2me/essentials/Jails.java @@ -240,112 +240,114 @@ public class Jails extends AsyncStorageObjectHolder implements IKits { + + public Kits(final IEssentials ess) { super(ess, com.earth2me.essentials.settings.Kits.class); @@ -87,4 +89,16 @@ public class Kits extends AsyncStorageObjectHolder getVanishedPlayers(); + + EssentialsTimer getTimer(); } diff --git a/Essentials/src/com/earth2me/essentials/api/ITeleport.java b/Essentials/src/com/earth2me/essentials/api/ITeleport.java index 3a5f25f78..16c05a917 100644 --- a/Essentials/src/com/earth2me/essentials/api/ITeleport.java +++ b/Essentials/src/com/earth2me/essentials/api/ITeleport.java @@ -18,7 +18,7 @@ public interface ITeleport void teleport(Entity entity, Trade chargeFor, TeleportCause cause) throws Exception; - void home(IUser player, String toLowerCase, Trade charge) throws Exception; + void home(Location loc, Trade chargeFor) throws Exception; void respawn(Trade charge, TeleportCause teleportCause) throws Exception; diff --git a/Essentials/src/com/earth2me/essentials/api/IUser.java b/Essentials/src/com/earth2me/essentials/api/IUser.java index 091b141df..6d225bce6 100644 --- a/Essentials/src/com/earth2me/essentials/api/IUser.java +++ b/Essentials/src/com/earth2me/essentials/api/IUser.java @@ -49,6 +49,8 @@ public interface IUser extends Player, IStorageObjectHolder, IReload, void updateActivity(boolean broadcast); void updateDisplayName(); + + void setDisplayNick(); boolean checkJailTimeout(long currentTime); @@ -107,4 +109,10 @@ public interface IUser extends Player, IStorageObjectHolder, IReload, public void updateMoneyCache(double userMoney); public boolean canAfford(double amount, boolean b); + + boolean isVanished(); + + void resetInvulnerabilityAfterTeleport(); + + void toggleVanished(); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandback.java b/Essentials/src/com/earth2me/essentials/commands/Commandback.java index e2c1b266a..2b112ffa9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandback.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandback.java @@ -1,8 +1,9 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.economy.Trade; import com.earth2me.essentials.api.IUser; +import com.earth2me.essentials.economy.Trade; +import com.earth2me.essentials.permissions.WorldPermissions; public class Commandback extends EssentialsCommand @@ -10,12 +11,14 @@ public class Commandback extends EssentialsCommand @Override protected void run(final IUser user, final String commandLabel, final String[] args) throws Exception { - if (user.getWorld() != user.getLastLocation().getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + user.getLastLocation().getWorld().getName())) + final String worldName = user.getData().getLastLocation().getWorldName(); + if (user.getWorld() != user.getData().getLastLocation().getBukkitLocation().getWorld() && ess.getSettings().getData().getGeneral().isWorldTeleportPermissions() + && WorldPermissions.getPermission(worldName)) { - throw new Exception(_("noPerm", "essentials.world." + user.getLastLocation().getWorld().getName())); + throw new Exception(_("noPerm", "essentials.world." + worldName)); } - final Trade charge = new Trade(this.getName(), ess); + //tod - verify + final Trade charge = new Trade(this.toString(), ess); charge.isAffordableFor(user); user.sendMessage(_("backUsageMsg")); user.getTeleport().back(charge); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java index c00a0d435..e620fa52d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java @@ -10,12 +10,12 @@ public class Commandbackup extends EssentialsCommand @Override protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { - final Backup backup = ess.getBackup(); + final IBackup backup = ess.getBackup(); if (backup == null) { throw new Exception(_("backupDisabled")); } - final String command = ess.getSettings().getBackupCommand(); + final String command = ess.getSettings().getData().getCommands().getBackupCommand(); if (command == null || "".equals(command) || "save-all".equalsIgnoreCase(command)) { throw new Exception(_("backupDisabled")); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java index 88c605f4e..d9d080441 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java @@ -50,7 +50,7 @@ public class Commandban extends EssentialsCommand else { banReason = _("defaultBanReason"); - user.setBanReason(""); + user.getData().getBan().setReason(""); } user.setBanned(true); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index e2668e562..72aa66e99 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -197,5 +197,4 @@ public class Commandessentials extends EssentialsCommand { sender.sendMessage("Unable to modify 'plugins/PluginMetrics/config.yml': " + ex.getMessage()); } - } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java index 22976ff92..d0306d76f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java @@ -1,26 +1,22 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.User; -import com.earth2me.essentials.Util; +import com.earth2me.essentials.user.User; +import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.craftbukkit.SetExpFix; -import org.bukkit.Server; +import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class Commandexp extends EssentialsCommand { - public Commandexp() - { - super("exp"); - } - + //todo - fix this @Override - public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception + public void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { - if (args.length == 0) + if (args.length == 0 && sender instanceof Player) { - showExp(user, user); + showExp((User)sender, (User)sender); } else if (args[0].equalsIgnoreCase("set") && user.isAuthorized("essentials.exp.set")) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java index 22e3c4eea..46ae31a16 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java @@ -1,9 +1,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.User; -import java.util.Locale; -import org.bukkit.GameMode; +import com.earth2me.essentials.api.IUser; import org.bukkit.Server; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -11,13 +9,8 @@ import org.bukkit.entity.Player; public class Commandfly extends EssentialsCommand { - public Commandfly() - { - super("fly"); - } - @Override - protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { @@ -28,8 +21,9 @@ public class Commandfly extends EssentialsCommand } @Override - protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception + protected void run(final IUser user, final String commandLabel, final String[] args) throws Exception { + //todo permissions if (args.length > 0 && args[0].trim().length() > 2 && user.isAuthorized("essentials.fly.others")) { flyOtherPlayers(server, user, args[0]); @@ -47,7 +41,7 @@ public class Commandfly extends EssentialsCommand { for (Player matchPlayer : server.matchPlayer(name)) { - final User player = ess.getUser(matchPlayer); + final IUser player = ess.getUser(matchPlayer); if (player.isHidden()) { continue; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java index 72153265e..83a2577d6 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java @@ -19,7 +19,7 @@ public class Commandgamemode extends EssentialsCommand throw new NotEnoughArgumentsException(); } - gamemodeOtherPlayers(sender, args[0]); + gamemodeOtherPlayers(sender, args); } @Override @@ -27,7 +27,7 @@ public class Commandgamemode extends EssentialsCommand { if (args.length > 0 && !args[0].trim().isEmpty() && Permissions.GAMEMODE_OTHERS.isAuthorized(user)) { - gamemodeOtherPlayers(user, args[0]); + gamemodeOtherPlayers(user, args); return; } @@ -35,7 +35,7 @@ public class Commandgamemode extends EssentialsCommand user.sendMessage(_("gameMode", _(user.getGameMode().toString().toLowerCase(Locale.ENGLISH)), user.getDisplayName())); } - private void gamemodeOtherPlayers(final CommandSender sender, final String name) + private void gamemodeOtherPlayers(final CommandSender sender, final String args[]) { for (Player matchPlayer : server.matchPlayer(args[0])) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java b/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java index dfccdd31c..3ffce7595 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java @@ -13,6 +13,7 @@ public class Commandgetpos extends EssentialsCommand { if (args.length > 0 && Permissions.GETPOS_OTHERS.isAuthorized(user)) { + //todo permissions final IUser otherUser = getPlayer(args, 0); if (!otherUser.isHidden() || user.isAuthorized("essentials.list.hidden")) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java index aea29cbf3..f0f0380ac 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java @@ -1,9 +1,9 @@ package com.earth2me.essentials.commands; +import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.permissions.GivePermissions; -import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.Util; +import com.earth2me.essentials.utils.Util; import java.util.Locale; import org.bukkit.ChatColor; import org.bukkit.Material; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhat.java b/Essentials/src/com/earth2me/essentials/commands/Commandhat.java index ed82fd16d..7be212373 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhat.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhat.java @@ -1,22 +1,16 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.User; +import com.earth2me.essentials.api.IUser; import org.bukkit.Material; -import org.bukkit.Server; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; public class Commandhat extends EssentialsCommand { - public Commandhat() - { - super("hat"); - } - @Override - protected void run(Server server, User user, String commandLabel, String[] args) throws Exception + protected void run(IUser user, String commandLabel, String[] args) throws Exception { if (user.getItemInHand().getType() != Material.AIR) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java index e6fb2e2eb..b9989ddd5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java @@ -1,16 +1,14 @@ package com.earth2me.essentials.commands; -import com.earth2me.essentials.utils.textreader.TextInput; -import com.earth2me.essentials.utils.textreader.IText; -import com.earth2me.essentials.utils.textreader.TextPager; -import com.earth2me.essentials.utils.textreader.HelpInput; -import com.earth2me.essentials.utils.textreader.KeywordReplacer; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.textreader.*; +import com.earth2me.essentials.utils.Util; +import com.earth2me.essentials.utils.textreader.HelpInput; +import com.earth2me.essentials.utils.textreader.IText; +import com.earth2me.essentials.utils.textreader.KeywordReplacer; +import com.earth2me.essentials.utils.textreader.TextInput; +import com.earth2me.essentials.utils.textreader.TextPager; import java.util.Locale; -import org.bukkit.Server; import org.bukkit.command.CommandSender; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java index 27e93d39e..645e8fd8b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java @@ -1,10 +1,10 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.economy.Trade; -import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; +import com.earth2me.essentials.economy.Trade; import com.earth2me.essentials.permissions.Permissions; +import com.earth2me.essentials.utils.Util; import java.util.List; import java.util.Locale; import org.bukkit.Location; @@ -89,14 +89,14 @@ public class Commandhome extends EssentialsCommand throw new NoChargeException(); } - private void goHome(final User user, final User player, final String home, final Trade charge) throws Exception + private void goHome(final IUser user, final IUser player, final String home, final Trade charge) throws Exception { final Location loc = player.getHome(home); if (loc == null) { throw new NotEnoughArgumentsException(); } - if (user.getWorld() != loc.getWorld() && ess.getSettings().isWorldHomePermissions() + if (user.getWorld() != loc.getWorld() && ess.getSettings().getData().getGeneral().isWorldHomePermissions() && !user.isAuthorized("essentials.world." + loc.getWorld().getName())) { throw new Exception(_("noPerm", "essentials.world." + loc.getWorld().getName())); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java b/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java index fd6a6a167..349caaf63 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandinvsee.java @@ -1,10 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.user.Inventory; -import java.util.Arrays; -import org.bukkit.inventory.ItemStack; public class Commandinvsee extends EssentialsCommand @@ -16,7 +12,7 @@ public class Commandinvsee extends EssentialsCommand { throw new NotEnoughArgumentsException(); } - final User invUser = getPlayer(server, args, 0); + final IUser invUser = getPlayer(args, 0); user.setInvSee(true); user.openInventory(invUser.getInventory()); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java index 1ea96ff60..bf955fbb5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java @@ -25,25 +25,21 @@ public class Commanditem extends EssentialsCommand { throw new Exception(_("cantSpawnItem", itemname)); } + try { - stack.setAmount(Integer.parseInt(args[1])); - } - - if (args.length > 2) - { - for (int i = 2; i < args.length; i++) + if (args.length > 1 && Integer.parseInt(args[1]) > 0) { stack.setAmount(Integer.parseInt(args[1])); } - else if (ess.getSettings().getDefaultStackSize() > 0) + else if (ess.getSettings().getData().getGeneral().getDefaultStacksize() > 0) { - stack.setAmount(ess.getSettings().getDefaultStackSize()); + stack.setAmount(ess.getSettings().getData().getGeneral().getDefaultStacksize()); } - else if (ess.getSettings().getOversizedStackSize() > 0 && user.isAuthorized("essentials.oversizedstacks")) + else if (ess.getSettings().getData().getGeneral().getOversizedStacksize()> 0 && user.isAuthorized("essentials.oversizedstacks")) { - stack.setAmount(ess.getSettings().getOversizedStackSize()); - } + stack.setAmount(ess.getSettings().getData().getGeneral().getOversizedStacksize()); + } if (args.length > 2) { for (int i = 2; i < args.length; i++) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java index bab73b196..2d71302b7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java @@ -7,7 +7,9 @@ import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.permissions.KitPermissions; import com.earth2me.essentials.settings.Kit; import java.util.Collection; +import java.util.List; import java.util.Locale; +import java.util.Map; import org.bukkit.command.CommandSender; @@ -38,7 +40,7 @@ public class Commandkit extends EssentialsCommand } else if (args.length > 1 && user.isAuthorized("essentials.kit.others")) { - final User userTo = getPlayer(server, args, 1, true); + final IUser userTo = getPlayer(args, 1, true); final String kitName = Util.sanitizeString(args[0].toLowerCase(Locale.ENGLISH)); giveKit(userTo, user, kitName); } @@ -50,7 +52,7 @@ public class Commandkit extends EssentialsCommand } @Override - public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception + public void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 2) { @@ -59,14 +61,13 @@ public class Commandkit extends EssentialsCommand } else { - final User userTo = getPlayer(server, args, 1, true); + final IUser userTo = getPlayer(args, 1, true); final String kitName = args[0].toLowerCase(Locale.ENGLISH); final Kit kit = ess.getKits().getKit(kitName); + final List items = Kit.getItems(userTo, kit); + Kit.expandItems(ess,userTo,items); - if (!KitPermissions.getPermission(kitName).isAuthorized(user)) - { - throw new Exception(_("noKitPermission", "essentials.kit." + kitName)); - } + //TODO: Check kit delay sender.sendMessage(_("kitGive", kitName)); @@ -86,7 +87,7 @@ public class Commandkit extends EssentialsCommand } } - private void giveKit(User userTo, User userFrom, String kitName) throws Exception + private void giveKit(IUser userTo, IUser userFrom, String kitName) throws Exception { final Map kit = ess.getSettings().getKit(kitName); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java index c68290c65..96670fa94 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java @@ -39,7 +39,7 @@ public class Commandspawner extends EssentialsCommand { throw new Exception(_("invalidMob")); } - if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH))) + if (ess.getSettings().getData().getGeneral().getPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH))) { throw new Exception(_("disabledToSpawnMob")); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java index 9b28f5d6c..35ba8dedc 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java @@ -1,10 +1,10 @@ package com.earth2me.essentials.commands; -import com.earth2me.essentials.utils.DescParseTickFormat; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.permissions.Permissions; -import com.earth2me.essentials.Util; +import com.earth2me.essentials.utils.DescParseTickFormat; +import com.earth2me.essentials.utils.Util; import java.util.*; import org.bukkit.World; import org.bukkit.command.CommandSender; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java index 56041fc3e..931f50202 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java @@ -17,7 +17,7 @@ public class Commandtpo extends EssentialsCommand throw new NotEnoughArgumentsException(); case 1: - final User player = getPlayer(server, args, 0, true); + final IUser player = getPlayer(args, 0, true); if (!player.isOnline() || (player.isHidden() && !user.isAuthorized("essentials.teleport.hidden"))) { throw new NoSuchFieldException(_("playerNotFound")); @@ -37,8 +37,8 @@ public class Commandtpo extends EssentialsCommand throw new Exception(_("noPerm", "essentials.tp.others")); } user.sendMessage(_("teleporting")); - final User target = getPlayer(server, args, 0, true); - final User toPlayer = getPlayer(server, args, 1, true); + final IUser target = getPlayer(args, 0, true); + final IUser toPlayer = getPlayer(args, 1, true); if (!target.isOnline() || !toPlayer.isOnline() || ((target.isHidden() || toPlayer.isHidden()) && !user.isAuthorized("essentials.teleport.hidden"))) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java index ca50a068d..80daf2b16 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java @@ -38,14 +38,14 @@ public class Commandtppos extends EssentialsCommand } @Override - public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception + public void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 4) { throw new NotEnoughArgumentsException(); } - User user = ess.getUser(server.getPlayer(args[0])); + IUser user = ess.getUser(server.getPlayer(args[0])); final int x = Integer.parseInt(args[1]); final int y = Integer.parseInt(args[2]); final int z = Integer.parseInt(args[3]); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java index b55bd76a4..032631056 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java @@ -1,21 +1,14 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.User; -import org.bukkit.ChatColor; -import org.bukkit.Server; +import com.earth2me.essentials.api.IUser; import org.bukkit.entity.Player; public class Commandvanish extends EssentialsCommand { - public Commandvanish() - { - super("vanish"); - } - @Override - protected void run(Server server, User user, String commandLabel, String[] args) throws Exception + protected void run(IUser user, String commandLabel, String[] args) throws Exception { if (user.isVanished()) { diff --git a/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java b/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java index c5b592c2a..c2e9c5c44 100644 --- a/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java +++ b/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java @@ -1,4 +1,5 @@ package com.earth2me.essentials.commands; +import static com.earth2me.essentials.I18n._; public class WarpNotFoundException extends Exception diff --git a/Essentials/src/com/earth2me/essentials/economy/MoneyHolder.java b/Essentials/src/com/earth2me/essentials/economy/MoneyHolder.java index 179e09210..cdde3506e 100644 --- a/Essentials/src/com/earth2me/essentials/economy/MoneyHolder.java +++ b/Essentials/src/com/earth2me/essentials/economy/MoneyHolder.java @@ -8,6 +8,20 @@ import java.io.IOException; public class MoneyHolder extends AsyncStorageObjectHolder { + + @Override + public void finishRead() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void finishWrite() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public MoneyHolder(IEssentials ess) { super(ess, Money.class); diff --git a/Essentials/src/com/earth2me/essentials/economy/WorthHolder.java b/Essentials/src/com/earth2me/essentials/economy/WorthHolder.java index 598c22c4c..499b92bac 100644 --- a/Essentials/src/com/earth2me/essentials/economy/WorthHolder.java +++ b/Essentials/src/com/earth2me/essentials/economy/WorthHolder.java @@ -15,6 +15,20 @@ import org.bukkit.material.MaterialData; public class WorthHolder extends AsyncStorageObjectHolder implements IWorth { + + @Override + public void finishRead() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void finishWrite() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public WorthHolder(final IEssentials ess) { super(ess, com.earth2me.essentials.economy.Worth.class); diff --git a/Essentials/src/com/earth2me/essentials/listener/TntExplodeListener.java b/Essentials/src/com/earth2me/essentials/listener/TntExplodeListener.java index 4710187f1..778469605 100644 --- a/Essentials/src/com/earth2me/essentials/listener/TntExplodeListener.java +++ b/Essentials/src/com/earth2me/essentials/listener/TntExplodeListener.java @@ -1,7 +1,6 @@ package com.earth2me.essentials.listener; import com.earth2me.essentials.api.IEssentials; -import com.earth2me.essentials.craftbukkit.FakeExplosion; import java.util.concurrent.atomic.AtomicBoolean; import org.bukkit.entity.LivingEntity; import org.bukkit.event.EventHandler; diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsListener.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsListener.java index 4af8f9173..5c71e54f9 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsListener.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsListener.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.metrics; -import com.earth2me.essentials.IEssentials; -import com.earth2me.essentials.User; +import com.earth2me.essentials.api.IEssentials; +import com.earth2me.essentials.api.IUser; import java.util.logging.Level; import org.bukkit.Server; import org.bukkit.entity.Player; @@ -27,7 +27,7 @@ public class MetricsListener implements Listener @EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(final PlayerJoinEvent event) { - final User player = ess.getUser(event.getPlayer()); + final IUser player = ess.getUser(event.getPlayer()); if (ess.getSettings().isMetricsEnabled() == false && (player.isAuthorized("essentials.essentials") || player.isAuthorized("bukkit.broadcast.admin"))) { player.sendMessage("PluginMetrics collects minimal statistic data, starting in about 5 minutes."); diff --git a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java index 0ea692cc9..867b9e876 100644 --- a/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java +++ b/Essentials/src/com/earth2me/essentials/metrics/MetricsStarter.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.metrics; -import com.earth2me.essentials.IEssentials; +import com.earth2me.essentials.api.IEssentials; import com.earth2me.essentials.metrics.Metrics.Graph; import com.earth2me.essentials.metrics.Metrics.Plotter; import com.earth2me.essentials.register.payment.Method; diff --git a/Essentials/src/com/earth2me/essentials/ranks/GMGroups.java b/Essentials/src/com/earth2me/essentials/ranks/GMGroups.java index 244ff8410..512df1e0d 100644 --- a/Essentials/src/com/earth2me/essentials/ranks/GMGroups.java +++ b/Essentials/src/com/earth2me/essentials/ranks/GMGroups.java @@ -91,7 +91,7 @@ public class GMGroups implements IRanks { public MessageFormat getChatFormat(final IUser player) { String format = getRawChatFormat(player); - format = Util.replaceColor(format); + format = Util.replaceFormat(format); format = format.replace("{DISPLAYNAME}", "%1$s"); format = format.replace("{GROUP}", "{0}"); format = format.replace("{MESSAGE}", "%2$s"); diff --git a/Essentials/src/com/earth2me/essentials/ranks/RanksStorage.java b/Essentials/src/com/earth2me/essentials/ranks/RanksStorage.java index 7f6e5dd84..85658863b 100644 --- a/Essentials/src/com/earth2me/essentials/ranks/RanksStorage.java +++ b/Essentials/src/com/earth2me/essentials/ranks/RanksStorage.java @@ -19,6 +19,18 @@ import lombok.Cleanup; public class RanksStorage extends AsyncStorageObjectHolder implements IRanks { + + @Override + public void finishRead() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void finishWrite() + { + throw new UnsupportedOperationException("Not supported yet."); + } public RanksStorage(final IEssentials ess) { super(ess, Ranks.class); @@ -143,7 +155,7 @@ public class RanksStorage extends AsyncStorageObjectHolder implements IRa public MessageFormat getChatFormat(final IUser player) { String format = getRawChatFormat(player); - format = Util.replaceColor(format); + format = Util.replaceFormat(format); format = format.replace("{DISPLAYNAME}", "%1$s"); format = format.replace("{GROUP}", "{0}"); format = format.replace("{MESSAGE}", "%2$s"); diff --git a/Essentials/src/com/earth2me/essentials/ranks/VaultGroups.java b/Essentials/src/com/earth2me/essentials/ranks/VaultGroups.java index 1d94b6089..36c9742cf 100644 --- a/Essentials/src/com/earth2me/essentials/ranks/VaultGroups.java +++ b/Essentials/src/com/earth2me/essentials/ranks/VaultGroups.java @@ -72,7 +72,7 @@ public class VaultGroups implements IRanks public MessageFormat getChatFormat(final IUser player) { String format = getRawChatFormat(player); - format = Util.replaceColor(format); + format = Util.replaceFormat(format); format = format.replace("{DISPLAYNAME}", "%1$s"); format = format.replace("{GROUP}", "{0}"); format = format.replace("{MESSAGE}", "%2$s"); diff --git a/Essentials/src/com/earth2me/essentials/settings/General.java b/Essentials/src/com/earth2me/essentials/settings/General.java index 85238977f..033a6ce31 100644 --- a/Essentials/src/com/earth2me/essentials/settings/General.java +++ b/Essentials/src/com/earth2me/essentials/settings/General.java @@ -2,6 +2,8 @@ package com.earth2me.essentials.settings; import com.earth2me.essentials.storage.Comment; import com.earth2me.essentials.storage.StorageObject; +import java.util.HashMap; +import java.util.Map; import lombok.Data; import lombok.EqualsAndHashCode; @@ -17,6 +19,8 @@ public class General implements StorageObject @Comment("Turn this on, if you want to see more error messages, if something goes wrong.") private boolean debug = false; @Comment( + + { "Set the locale here, if you want to change the language of Essentials.", "If this is not set, Essentials will use the language of your computer.", @@ -24,6 +28,8 @@ public class General implements StorageObject }) private String locale; @Comment( + + { "The number of items given, if the quantity parameter is left out in /item or /give.", "If this number is below 1, the maximum stack size size is given. If oversized stacks", @@ -31,6 +37,8 @@ public class General implements StorageObject }) private int defaultStacksize = -1; @Comment( + + { "Oversized stacks are stacks that ignore the normal max stacksize.", "They can be obtained using /give and /item, if the player has essentials.oversizedstacks permission.", @@ -44,6 +52,8 @@ public class General implements StorageObject FILE, GROUPMANAGER, VAULT } @Comment( + + { "Sets the place where group options should be stored:", " FILE: Options are stored inside groups.yml in the Essentials folder", @@ -51,4 +61,36 @@ public class General implements StorageObject " VAULT: Options are stored using a permissions plugin supported by Vault" }) private GroupStorage groupStorage = GroupStorage.FILE; + @Comment( + + { + "The delay, in seconds, a player can't be attacked by other players after he has been teleported by a command", + "This will also prevent that the player can attack other players" + }) + private long teleportInvulnerability = 0; + + public long getTeleportInvulnerability() + { + return teleportInvulnerability * 1000; + } + + @Comment( + { + "Set to true to enable per-world permissions for teleporting between worlds with essentials commands", + "This applies to /world, /back, /tp[a|o][here|all], but not warps.", + "Give someone permission to teleport to a world with essentials.world." + }) + private boolean worldTeleportPermissions = false; + + @Comment("Prevent creatures spawning") + private Map creatureSpawn = new HashMap(); + + public boolean getPreventSpawn(String creatureName) + { + if (creatureSpawn == null) + { + return false; + } + return creatureSpawn.get(creatureName); + } } diff --git a/Essentials/src/com/earth2me/essentials/settings/SettingsHolder.java b/Essentials/src/com/earth2me/essentials/settings/SettingsHolder.java index 434d9b922..56aecf378 100644 --- a/Essentials/src/com/earth2me/essentials/settings/SettingsHolder.java +++ b/Essentials/src/com/earth2me/essentials/settings/SettingsHolder.java @@ -9,6 +9,18 @@ import java.util.concurrent.atomic.AtomicBoolean; public class SettingsHolder extends AsyncStorageObjectHolder implements ISettings { + + @Override + public void finishRead() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void finishWrite() + { + throw new UnsupportedOperationException("Not supported yet."); + } private final transient AtomicBoolean debug = new AtomicBoolean(false); public SettingsHolder(final IEssentials ess) { diff --git a/Essentials/src/com/earth2me/essentials/settings/SpawnsHolder.java b/Essentials/src/com/earth2me/essentials/settings/SpawnsHolder.java index 19c9198da..c2dc0def2 100644 --- a/Essentials/src/com/earth2me/essentials/settings/SpawnsHolder.java +++ b/Essentials/src/com/earth2me/essentials/settings/SpawnsHolder.java @@ -29,6 +29,19 @@ import org.bukkit.plugin.EventExecutor; public class SpawnsHolder extends AsyncStorageObjectHolder implements IEssentialsModule { + + @Override + public void finishRead() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void finishWrite() + { + throw new UnsupportedOperationException("Not supported yet."); + } + public SpawnsHolder(final IEssentials ess) { super(ess, Spawns.class); diff --git a/Essentials/src/com/earth2me/essentials/settings/WarpHolder.java b/Essentials/src/com/earth2me/essentials/settings/WarpHolder.java index b6a9f2879..a2facb824 100644 --- a/Essentials/src/com/earth2me/essentials/settings/WarpHolder.java +++ b/Essentials/src/com/earth2me/essentials/settings/WarpHolder.java @@ -10,6 +10,19 @@ import java.io.IOException; public class WarpHolder extends AsyncStorageObjectHolder implements IWarp { + + @Override + public void finishRead() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void finishWrite() + { + throw new UnsupportedOperationException("Not supported yet."); + } + private final String name; public WarpHolder(String name, IEssentials ess) diff --git a/Essentials/src/com/earth2me/essentials/settings/WorldOptions.java b/Essentials/src/com/earth2me/essentials/settings/WorldOptions.java index 33271b460..95228684b 100644 --- a/Essentials/src/com/earth2me/essentials/settings/WorldOptions.java +++ b/Essentials/src/com/earth2me/essentials/settings/WorldOptions.java @@ -5,10 +5,12 @@ import com.earth2me.essentials.storage.StorageObject; import lombok.Data; import lombok.EqualsAndHashCode; + @Data @EqualsAndHashCode(callSuper = false) public class WorldOptions implements StorageObject { @Comment("Disables godmode for all players if they teleport to this world.") - private boolean godmode = true; + private boolean godmode = true; + } diff --git a/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java b/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java index e7a93e7fe..037fa4292 100644 --- a/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java +++ b/Essentials/src/com/earth2me/essentials/storage/AbstractDelayedYamlFileReader.java @@ -9,11 +9,11 @@ import java.io.IOException; import java.util.concurrent.locks.ReentrantLock; import java.util.logging.Level; import org.bukkit.Bukkit; -import org.bukkit.plugin.Plugin; public abstract class AbstractDelayedYamlFileReader implements Runnable { + private final transient Class clazz; protected final transient IEssentials plugin; private final transient ReentrantLock lock = new ReentrantLock(); @@ -41,10 +41,11 @@ public abstract class AbstractDelayedYamlFileReader imp @Override public void run() { + File file = null; lock.lock(); try { - final File file = onStart(); + file = onStart(); try { final FileReader reader = new FileReader(file); @@ -81,7 +82,7 @@ public abstract class AbstractDelayedYamlFileReader imp } catch (IOException ex) { - onException(); + onException(ex); if (plugin.getSettings() == null || plugin.getSettings().isDebug()) { Bukkit.getLogger().log(Level.INFO, "File not found: " + file.toString()); diff --git a/Essentials/src/com/earth2me/essentials/user/IOfflinePlayer.java b/Essentials/src/com/earth2me/essentials/user/IOfflinePlayer.java index 65304e76a..18667c8ca 100644 --- a/Essentials/src/com/earth2me/essentials/user/IOfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/user/IOfflinePlayer.java @@ -15,4 +15,6 @@ public interface IOfflinePlayer void setBanned(boolean bln); boolean hasPermission(Permission perm); + + void setName(final String name); } \ No newline at end of file diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index 59319fb20..e181ac1e3 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -1,35 +1,74 @@ package com.earth2me.essentials.user; -import com.earth2me.essentials.api.ChargeException; import com.earth2me.essentials.Console; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.Teleport; -import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.*; import com.earth2me.essentials.craftbukkit.InventoryWorkaround; -import com.earth2me.essentials.permissions.Permissions; import com.earth2me.essentials.economy.register.Method; +import com.earth2me.essentials.permissions.Permissions; import com.earth2me.essentials.utils.DateUtil; +import com.earth2me.essentials.utils.Util; +import java.net.InetSocketAddress; import java.util.Calendar; +import java.util.Collection; import java.util.GregorianCalendar; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.logging.Level; import java.util.logging.Logger; import lombok.Cleanup; import lombok.Getter; import lombok.Setter; +import org.bukkit.Achievement; import org.bukkit.Bukkit; +import org.bukkit.Effect; +import org.bukkit.EntityEffect; +import org.bukkit.GameMode; +import org.bukkit.Instrument; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.Note; import org.bukkit.OfflinePlayer; +import org.bukkit.Server; +import org.bukkit.Statistic; +import org.bukkit.World; +import org.bukkit.block.Block; import org.bukkit.command.CommandSender; +import org.bukkit.conversations.Conversation; +import org.bukkit.conversations.ConversationAbandonedEvent; +import org.bukkit.entity.Arrow; +import org.bukkit.entity.Egg; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; +import org.bukkit.entity.Projectile; +import org.bukkit.entity.Snowball; +import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryView; +import org.bukkit.inventory.InventoryView.Property; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.PlayerInventory; +import org.bukkit.map.MapView; +import org.bukkit.metadata.MetadataValue; +import org.bukkit.permissions.Permission; +import org.bukkit.permissions.PermissionAttachment; +import org.bukkit.permissions.PermissionAttachmentInfo; +import org.bukkit.plugin.Plugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.util.Vector; public class User extends UserBase implements IUser { + private CommandSender replyTo = null; @Getter private transient IUser teleportRequester; @@ -46,6 +85,10 @@ public class User extends UserBase implements IUser @Getter @Setter private boolean hidden = false; + @Getter + private transient boolean vanished; + @Getter + private boolean invSee = false; private transient Location afkPosition; private static final Logger logger = Bukkit.getLogger(); private AtomicBoolean gotMailInfo = new AtomicBoolean(false); @@ -60,8 +103,8 @@ public class User extends UserBase implements IUser { super(offlinePlayer, ess); teleport = new Teleport(this, ess); - } - + } + public void example() { // Cleanup will call close at the end of the function @@ -687,24 +730,1099 @@ public class User extends UserBase implements IUser return cost <= mon; } + @Override public void updateMoneyCache(double userMoney) { if (super.getMoney() != userMoney) { super.setMoney(userMoney); } } + @Override public boolean canAfford(double amount, boolean b) { return true; + } + private transient long teleportInvulnerabilityTimestamp = 0; + + public void enableInvulnerabilityAfterTeleport() + { + @Cleanup + final ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + + final long time = settings.getData().getGeneral().getTeleportInvulnerability(); + if (time > 0) + { + teleportInvulnerabilityTimestamp = System.currentTimeMillis() + time; + } } @Override - public boolean canAfford(final double cost) + public void resetInvulnerabilityAfterTeleport() { - final double mon = getMoney(); - if (isAuthorized("essentials.eco.loan")) + if (teleportInvulnerabilityTimestamp != 0 + && teleportInvulnerabilityTimestamp < System.currentTimeMillis()) { - return (mon - cost) >= ess.getSettings().getMinMoney(); + teleportInvulnerabilityTimestamp = 0; } - return cost <= mon; } + + public void toggleVanished() + { + vanished = !vanished; + if (vanished) + { + ess.getVanishedPlayers().add(getName()); + } + else + { + ess.getVanishedPlayers().remove(getName()); + } + } + + + //start// + @Override + public void setDisplayName(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getPlayerListName() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPlayerListName(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setCompassTarget(Location lctn) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Location getCompassTarget() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InetSocketAddress getAddress() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendRawMessage(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void kickPlayer(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void chat(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean performCommand(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isSneaking() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSneaking(boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isSprinting() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSprinting(boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void saveData() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void loadData() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSleepingIgnored(boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isSleepingIgnored() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playNote(Location lctn, byte b, byte b1) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playNote(Location lctn, Instrument i, Note note) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playEffect(Location lctn, Effect effect, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playEffect(Location lctn, Effect effect, T t) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendBlockChange(Location lctn, Material mtrl, byte b) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean sendChunkChange(Location lctn, int i, int i1, int i2, byte[] bytes) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendBlockChange(Location lctn, int i, byte b) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendMap(MapView mv) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void updateInventory() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void awardAchievement(Achievement a) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void incrementStatistic(Statistic ststc) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void incrementStatistic(Statistic ststc, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void incrementStatistic(Statistic ststc, Material mtrl) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void incrementStatistic(Statistic ststc, Material mtrl, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPlayerTime(long l, boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getPlayerTime() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getPlayerTimeOffset() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isPlayerTimeRelative() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void resetPlayerTime() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void giveExp(int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getExp() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setExp(float f) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getLevel() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLevel(int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getTotalExperience() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTotalExperience(int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getExhaustion() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setExhaustion(float f) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getSaturation() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setSaturation(float f) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFoodLevel() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFoodLevel(int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setBedSpawnLocation(Location lctn) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getAllowFlight() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setAllowFlight(boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void hidePlayer(Player player) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void showPlayer(Player player) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean canSee(Player player) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isFlying() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFlying(boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PlayerInventory getInventory() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean setWindowProperty(Property prprt, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView getOpenInventory() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openInventory(Inventory invntr) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openWorkbench(Location lctn, boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public InventoryView openEnchanting(Location lctn, boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void openInventory(InventoryView iv) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void closeInventory() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ItemStack getItemInHand() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setItemInHand(ItemStack is) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public ItemStack getItemOnCursor() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setItemOnCursor(ItemStack is) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isSleeping() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getSleepTicks() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public GameMode getGameMode() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setGameMode(GameMode gm) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isBlocking() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getHealth() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setHealth(int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxHealth() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getEyeHeight() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public double getEyeHeight(boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Location getEyeLocation() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getLineOfSight(HashSet hs, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Block getTargetBlock(HashSet hs, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getLastTwoTargetBlocks(HashSet hs, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Egg throwEgg() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Snowball throwSnowball() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Arrow shootArrow() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public T launchProjectile(Class type) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getRemainingAir() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setRemainingAir(int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaximumAir() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaximumAir(int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void damage(int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void damage(int i, Entity entity) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaximumNoDamageTicks() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMaximumNoDamageTicks(int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getLastDamage() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLastDamage(int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getNoDamageTicks() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setNoDamageTicks(int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Player getKiller() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean addPotionEffect(PotionEffect pe) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean addPotionEffect(PotionEffect pe, boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean addPotionEffects(Collection clctn) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasPotionEffect(PotionEffectType pet) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removePotionEffect(PotionEffectType pet) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Collection getActivePotionEffects() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Location getLocation() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setVelocity(Vector vector) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Vector getVelocity() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public World getWorld() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean teleport(Location lctn) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean teleport(Location lctn, TeleportCause tc) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean teleport(Entity entity) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean teleport(Entity entity, TeleportCause tc) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getNearbyEntities(double d, double d1, double d2) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getEntityId() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getFireTicks() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getMaxFireTicks() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFireTicks(int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void remove() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isDead() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Server getServer() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Entity getPassenger() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean setPassenger(Entity entity) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isEmpty() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean eject() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public float getFallDistance() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setFallDistance(float f) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setLastDamageCause(EntityDamageEvent ede) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public EntityDamageEvent getLastDamageCause() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public UUID getUniqueId() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public int getTicksLived() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setTicksLived(int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void playEffect(EntityEffect ee) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public EntityType getType() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isInsideVehicle() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean leaveVehicle() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Entity getVehicle() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setMetadata(String string, MetadataValue mv) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public List getMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasMetadata(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeMetadata(String string, Plugin plugin) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isPermissionSet(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isPermissionSet(Permission prmsn) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasPermission(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin, String string, boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin, String string, boolean bln, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin, int i) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removeAttachment(PermissionAttachment pa) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void recalculatePermissions() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Set getEffectivePermissions() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isOp() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setOp(boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isConversing() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void acceptConversationInput(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean beginConversation(Conversation c) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void abandonConversation(Conversation c) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void abandonConversation(Conversation c, ConversationAbandonedEvent cae) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendMessage(String string) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendMessage(String[] strings) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isOnline() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isBanned() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isWhitelisted() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setWhitelisted(boolean bln) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Player getPlayer() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getFirstPlayed() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public long getLastPlayed() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasPlayedBefore() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Map serialize() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void sendPluginMessage(Plugin plugin, String string, byte[] bytes) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Set getListeningPluginChannels() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setName(String name) + { + throw new UnsupportedOperationException("Not supported yet."); + } + //end// } diff --git a/Essentials/src/com/earth2me/essentials/utils/Util.java b/Essentials/src/com/earth2me/essentials/utils/Util.java index 720376c66..889fd5bf8 100644 --- a/Essentials/src/com/earth2me/essentials/utils/Util.java +++ b/Essentials/src/com/earth2me/essentials/utils/Util.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.utils; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IEssentials; import com.earth2me.essentials.api.ISettings; +import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.api.InvalidNameException; import com.earth2me.essentials.utils.gnu.inet.encoding.Punycode; import com.earth2me.essentials.utils.gnu.inet.encoding.PunycodeException; @@ -178,7 +179,7 @@ public final class Util public static String formatAsCurrency(final double value) { - + String str = dFormat.format(value); if (str.endsWith(".00")) { @@ -333,26 +334,113 @@ public final class Util perm.recalculatePermissibles(); return perm; } - private static transient final Pattern VANILLA_COLOR_PATTERN = Pattern.compile("\u00A7+[0-9A-FKa-fk]"); - private static transient final Pattern EASY_COLOR_PATTERN = Pattern.compile("&([0-9a-fk])"); + private static transient final Pattern URL_PATTERN = Pattern.compile("((?:(?:https?)://)?[\\w-_\\.]{2,})\\.([a-z]{2,3}(?:/\\S+)?)"); + private static transient final Pattern VANILLA_PATTERN = Pattern.compile("\u00A7+[0-9A-FK-ORa-fk-or]"); + private static transient final Pattern REPLACE_PATTERN = Pattern.compile("&([0-9a-fk-or])"); + private static transient final Pattern VANILLA_COLOR_PATTERN = Pattern.compile("\u00A7+[0-9A-Fa-f]"); + private static transient final Pattern VANILLA_MAGIC_PATTERN = Pattern.compile("\u00A7+[Kk]"); + private static transient final Pattern VANILLA_FORMAT_PATTERN = Pattern.compile("\u00A7+[L-ORl-or]"); + private static transient final Pattern REPLACE_COLOR_PATTERN = Pattern.compile("&([0-9a-f])"); + private static transient final Pattern REPLACE_MAGIC_PATTERN = Pattern.compile("&(k)"); + private static transient final Pattern REPLACE_FORMAT_PATTERN = Pattern.compile("&([l-or])"); - public static String stripColor(final String input) + public static String stripFormat(final String input) { if (input == null) { return null; } + return VANILLA_PATTERN.matcher(input).replaceAll(""); + } - return VANILLA_COLOR_PATTERN.matcher(input).replaceAll(""); + public static String replaceFormat(final String input) + { + if (input == null) + { + return null; + } + return REPLACE_PATTERN.matcher(input).replaceAll("\u00a7$1"); + } + + public static String blockURL(final String input) + { + if (input == null) + { + return null; + } + String text = URL_PATTERN.matcher(input).replaceAll("$1 $2"); + while (URL_PATTERN.matcher(text).find()) + { + text = URL_PATTERN.matcher(text).replaceAll("$1 $2"); + } + return text; + } + + public static String formatString(final IUser user, final String permBase, final String input) + { + if (input == null) + { + return null; + } + String message; + if (user.isAuthorized(permBase + ".color")) + { + message = Util.replaceColor(input, REPLACE_COLOR_PATTERN); + } + else + { + message = Util.stripColor(input, VANILLA_COLOR_PATTERN); + } + if (user.isAuthorized(permBase + ".magic")) + { + message = Util.replaceColor(message, REPLACE_MAGIC_PATTERN); + } + else + { + message = Util.stripColor(message, VANILLA_MAGIC_PATTERN); + } + if (user.isAuthorized(permBase + ".format")) + { + message = Util.replaceColor(message, REPLACE_FORMAT_PATTERN); + } + else + { + message = Util.stripColor(message, VANILLA_FORMAT_PATTERN); + } + return message; } - public static String replaceColor(final String input) + public static String formatMessage(final IUser user, final String permBase, final String input) { if (input == null) { return null; } + String message = formatString(user, permBase, input); + if (!user.isAuthorized(permBase + ".url")) + { + message = Util.blockURL(message); + } + return message; + } - return EASY_COLOR_PATTERN.matcher(input).replaceAll("\u00a7$1"); + public static String stripColor(final String input) + { + if (input == null) + { + return null; + } + + return VANILLA_COLOR_PATTERN.matcher(input).replaceAll(""); + } + + private static String stripColor(final String input, final Pattern pattern) + { + return pattern.matcher(input).replaceAll(""); + } + + private static String replaceColor(final String input, final Pattern pattern) + { + return pattern.matcher(input).replaceAll("\u00a7$1"); } } diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java index 6a86de1f1..acf08a5dd 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java @@ -9,6 +9,7 @@ import com.earth2me.essentials.api.IRanks; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.permissions.Permissions; +import com.earth2me.essentials.storage.Location; import java.util.Locale; import java.util.Map; import java.util.logging.Logger; diff --git a/pom.xml b/pom.xml index 5d9ef3b78..e5688a3a6 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ UTF-8 - 1.2.5-R1.2-SNAPSHOT + 1.2.5-R3.1-SNAPSHOT Unknown true 2 -- cgit v1.2.3 From 0af4103b922f296deaad41ee567f2c983b446ed5 Mon Sep 17 00:00:00 2001 From: ementalo Date: Tue, 29 May 2012 22:20:52 +0100 Subject: 2.9 3.0 merge Fix permissions checks --- Essentials/src/com/earth2me/essentials/utils/Util.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/utils/Util.java b/Essentials/src/com/earth2me/essentials/utils/Util.java index 889fd5bf8..fbfed3f67 100644 --- a/Essentials/src/com/earth2me/essentials/utils/Util.java +++ b/Essentials/src/com/earth2me/essentials/utils/Util.java @@ -7,6 +7,7 @@ import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.api.InvalidNameException; import com.earth2me.essentials.utils.gnu.inet.encoding.Punycode; import com.earth2me.essentials.utils.gnu.inet.encoding.PunycodeException; +import de.bananaco.bpermissions.imp.Permissions; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.util.Collection; @@ -383,7 +384,7 @@ public final class Util return null; } String message; - if (user.isAuthorized(permBase + ".color")) + if (Permissions.hasPermission(user.getBase(), permBase + ".color")) { message = Util.replaceColor(input, REPLACE_COLOR_PATTERN); } @@ -391,7 +392,7 @@ public final class Util { message = Util.stripColor(input, VANILLA_COLOR_PATTERN); } - if (user.isAuthorized(permBase + ".magic")) + if (Permissions.hasPermission(user.getBase(), permBase + ".magic")) { message = Util.replaceColor(message, REPLACE_MAGIC_PATTERN); } @@ -399,7 +400,7 @@ public final class Util { message = Util.stripColor(message, VANILLA_MAGIC_PATTERN); } - if (user.isAuthorized(permBase + ".format")) + if (Permissions.hasPermission(user.getBase(), permBase + ".format")) { message = Util.replaceColor(message, REPLACE_FORMAT_PATTERN); } @@ -417,7 +418,7 @@ public final class Util return null; } String message = formatString(user, permBase, input); - if (!user.isAuthorized(permBase + ".url")) + if (!Permissions.hasPermission(user.getBase(), permBase + ".url")) { message = Util.blockURL(message); } -- cgit v1.2.3 From 53d54146d631d94def8202aa61d6bd6f47e24313 Mon Sep 17 00:00:00 2001 From: ementalo Date: Tue, 29 May 2012 22:51:15 +0100 Subject: 2.9 to 3.0 Trade file fixes --- Essentials/src/com/earth2me/essentials/economy/Trade.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/economy/Trade.java b/Essentials/src/com/earth2me/essentials/economy/Trade.java index f9812a2f9..c9304d1bb 100644 --- a/Essentials/src/com/earth2me/essentials/economy/Trade.java +++ b/Essentials/src/com/earth2me/essentials/economy/Trade.java @@ -72,7 +72,7 @@ public class Trade { if (getMoney() != null && getMoney() > 0 - && !Permissions.ECO_LOAN.isAuthorized(user)) + && !Permissions.ECO_LOAN.isAuthorized(user) && !user.canAfford(getMoney())) { throw new ChargeException(_("notEnoughMoney")); @@ -90,7 +90,7 @@ public class Trade if (command != null && !command.isEmpty() && !NoCommandCostPermissions.getPermission(command).isAuthorized(user) - && mon < settings.getData().getEconomy().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command) + && money < settings.getData().getEconomy().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command) && 0 < settings.getData().getEconomy().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command) && !Permissions.ECO_LOAN.isAuthorized(user)) { @@ -217,13 +217,13 @@ public class Trade { double cost = 0d; if (command != null && !command.isEmpty() - && !user.isAuthorized("essentials.nocommandcost.all") - && !user.isAuthorized("essentials.nocommandcost." + command)) + && !NoCommandCostPermissions.getPermission("all").isAuthorized(user) + && !NoCommandCostPermissions.getPermission(command).isAuthorized(user)) { - cost = ess.getSettings().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command); + cost = ess.getSettings().getData().getEconomy().getCommandCost(command.charAt(0) == '/' ? command.substring(1) : command); if (cost == 0.0 && fallbackCommand != null && !fallbackCommand.isEmpty()) { - cost = ess.getSettings().getCommandCost(fallbackCommand.charAt(0) == '/' ? fallbackCommand.substring(1) : fallbackCommand); + cost = ess.getSettings().getData().getEconomy().getCommandCost(fallbackCommand.charAt(0) == '/' ? fallbackCommand.substring(1) : fallbackCommand); } } return cost; -- cgit v1.2.3 From cea3113df4dba1b131b85322d5c02d670dfdf85f Mon Sep 17 00:00:00 2001 From: ementalo Date: Wed, 30 May 2012 13:12:50 +0100 Subject: 2.9 -> 3.0 Adding world pems to the various commands (this should be seperated out to its own method) --- .../src/com/earth2me/essentials/api/IUser.java | 4 +- .../earth2me/essentials/commands/Commandseen.java | 27 ++++++---- .../essentials/commands/Commandsetjail.java | 1 + .../essentials/commands/Commandsetwarp.java | 7 +-- .../essentials/commands/Commandspawner.java | 27 +++------- .../earth2me/essentials/commands/Commandtp.java | 22 +++++--- .../earth2me/essentials/commands/Commandtpa.java | 18 +++---- .../essentials/commands/Commandtpaall.java | 19 +++---- .../essentials/commands/Commandtpaccept.java | 58 ++++++---------------- .../essentials/commands/Commandtpahere.java | 15 +++--- .../earth2me/essentials/commands/Commandtpall.java | 14 ++++-- .../essentials/commands/Commandtphere.java | 13 +++-- .../earth2me/essentials/commands/Commandtpo.java | 23 ++++++--- .../essentials/commands/Commandtpohere.java | 13 +++-- .../essentials/commands/Commandvanish.java | 3 +- .../earth2me/essentials/commands/Commandwarp.java | 2 +- .../essentials/permissions/Permissions.java | 5 +- .../src/com/earth2me/essentials/user/User.java | 4 +- .../earth2me/essentials/protect/ProtectHolder.java | 12 +++++ 19 files changed, 150 insertions(+), 137 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/api/IUser.java b/Essentials/src/com/earth2me/essentials/api/IUser.java index 6d225bce6..a1d49f250 100644 --- a/Essentials/src/com/earth2me/essentials/api/IUser.java +++ b/Essentials/src/com/earth2me/essentials/api/IUser.java @@ -92,7 +92,7 @@ public interface IUser extends Player, IStorageObjectHolder, IReload, void requestTeleport(IUser user, boolean b); - boolean isTeleportRequestHere(); + boolean isTpRequestHere(); IUser getTeleportRequester(); @@ -115,4 +115,6 @@ public interface IUser extends Player, IStorageObjectHolder, IReload, void resetInvulnerabilityAfterTeleport(); void toggleVanished(); + + void update(final Player base); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index 5dcaa0f2a..fd20419ff 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.permissions.Permissions; +import com.earth2me.essentials.storage.Location; import com.earth2me.essentials.user.UserData.TimestampType; import com.earth2me.essentials.utils.DateUtil; import lombok.Cleanup; @@ -15,16 +16,16 @@ public class Commandseen extends EssentialsCommand @Override protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { - seen(sender,args,true); + seen(sender,args,true, true); } @Override protected void run(final IUser user, final String commandLabel, final String[] args) throws Exception { - seen(user,args,Permissions.SEEN_BANREASON.isAuthorized(user)); + seen(user,args,Permissions.SEEN_BANREASON.isAuthorized(user), Permissions.SEEN_EXTRA.isAuthorized(user)); } - protected void seen (final CommandSender sender, final String[] args, final boolean show) throws Exception + protected void seen (final CommandSender sender, final String[] args, final boolean showBan, final boolean extra) throws Exception { if (args.length < 1) { @@ -32,24 +33,28 @@ public class Commandseen extends EssentialsCommand } try { - IUser u = getPlayer(args, 0); + IUser player = getPlayer(args, 0); player.setDisplayNick(); - sender.sendMessage(_("seenOnline", u.getDisplayName(), DateUtil.formatDateDiff(u.getTimestamp(TimestampType.LOGIN)))); + sender.sendMessage(_("seenOnline", player.getDisplayName(), DateUtil.formatDateDiff(player.getTimestamp(TimestampType.LOGIN)))); + if (extra) + { + sender.sendMessage(_("whoisIPAddress", player.getAddress().getAddress().toString())); + } } catch (NoSuchFieldException e) { @Cleanup - IUser u = ess.getUser(args[0]); - u.acquireReadLock(); - if (u == null) + IUser player = ess.getUser(args[0]); + player.acquireReadLock(); + if (player == null) { throw new Exception(_("playerNotFound")); } player.setDisplayNick(); - sender.sendMessage(_("seenOffline", u.getDisplayName(), DateUtil.formatDateDiff(u.getTimestamp(TimestampType.LOGOUT)))); - if (u.isBanned()) + sender.sendMessage(_("seenOffline", player.getName(), DateUtil.formatDateDiff(player.getTimestamp(TimestampType.LOGOUT)))); + if (player.isBanned()) { - sender.sendMessage(_("whoisBanned", show ? u.getData().getBan().getReason() : _("true"))); + sender.sendMessage(_("whoisBanned", showBan ? player.getData().getBan().getReason() : _("true"))); } if (extra) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java index fea08f7a0..0b4c7f3ff 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; +import com.earth2me.essentials.utils.Util; public class Commandsetjail extends EssentialsCommand diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java index 72b42fe7c..8a1797f81 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java @@ -3,8 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.api.IWarps; -import com.earth2me.essentials.Util; -import com.earth2me.essentials.Warps; +import com.earth2me.essentials.permissions.WarpPermissions; import org.bukkit.Location; @@ -35,7 +34,9 @@ public class Commandsetwarp extends EssentialsCommand { } - if (warpLoc == null || user.hasPermission("essentials.warp.overwrite." + args[0])) + //todo permissions + if (warpLoc == null || WarpPermissions.getPermission("overwrite." + args[0]).isAuthorized(user)) + { warps.setWarp(args[0], loc); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java index 96670fa94..81ae6a659 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.*; import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.bukkit.Mob; import com.earth2me.essentials.economy.Trade; import com.earth2me.essentials.api.IUser; @@ -9,6 +10,7 @@ import com.earth2me.essentials.permissions.SpawnerPermissions; import com.earth2me.essentials.utils.LocationUtil; import com.earth2me.essentials.utils.Util; import java.util.Locale; +import lombok.Cleanup; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.CreatureSpawner; @@ -39,11 +41,14 @@ public class Commandspawner extends EssentialsCommand { throw new Exception(_("invalidMob")); } - if (ess.getSettings().getData().getGeneral().getPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH))) + @Cleanup + ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + if (settings.getData().getGeneral().getPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH))) { throw new Exception(_("disabledToSpawnMob")); } - if (!user.isAuthorized("essentials.spawner." + mob.name.toLowerCase(Locale.ENGLISH))) + if (!SpawnerPermissions.getPermission(mob.name.toLowerCase(Locale.ENGLISH)).isAuthorized(user)) { throw new Exception(_("noPermToSpawnMob")); } @@ -51,24 +56,8 @@ public class Commandspawner extends EssentialsCommand charge.isAffordableFor(user); try { - String name = args[0]; - - Mob mob = null; - mob = Mob.fromName(name); - if (mob == null) - { - user.sendMessage(_("invalidMob")); - return; - } - if (!SpawnerPermissions.getPermission(mob.name).isAuthorized(user)) - { - throw new Exception(_("unableToSpawnMob")); - } - final Trade charge = new Trade("spawner-" + mob.name.toLowerCase(Locale.ENGLISH), ess); - charge.isAffordableFor(user); ((CreatureSpawner)target.getBlock().getState()).setSpawnedType(mob.getType()); - charge.charge(user); - user.sendMessage(_("setSpawner", mob.name)); + } catch (Throwable ex) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java index f508c872c..93b0277e1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java @@ -2,9 +2,11 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.Console; import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.economy.Trade; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.permissions.Permissions; +import com.earth2me.essentials.permissions.WorldPermissions; import lombok.Cleanup; import org.bukkit.command.CommandSender; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -15,6 +17,9 @@ public class Commandtp extends EssentialsCommand @Override public void run(final IUser user, final String commandLabel, final String[] args) throws Exception { + @Cleanup + ISettings settings = ess.getSettings(); + settings.acquireReadLock(); switch (args.length) { case 0: @@ -28,8 +33,8 @@ public class Commandtp extends EssentialsCommand { throw new Exception(_("teleportDisabled", player.getDisplayName())); } - if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + player.getWorld().getName())) + if (user.getWorld() != player.getWorld() && settings.getData().getGeneral().isWorldTeleportPermissions() + && !WorldPermissions.getPermission(player.getWorld().getName()).isAuthorized(user)) { throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName())); } @@ -45,18 +50,23 @@ public class Commandtp extends EssentialsCommand throw new Exception(_("needTpohere")); } user.sendMessage(_("teleporting")); + @Cleanup final IUser target = getPlayer(args, 0); + @Cleanup final IUser toPlayer = getPlayer(args, 1); - if (!target.isTeleportEnabled()) + target.acquireReadLock(); + toPlayer.acquireReadLock(); + + if (!target.getData().isTeleportEnabled()) { throw new Exception(_("teleportDisabled", target.getDisplayName())); } - if (!toPlayer.isTeleportEnabled()) + if (!toPlayer.getData().isTeleportEnabled()) { throw new Exception(_("teleportDisabled", toPlayer.getDisplayName())); } - if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + toPlayer.getWorld().getName())) + if (target.getWorld() != toPlayer.getWorld() && settings.getData().getGeneral().isWorldTeleportPermissions() + && !WorldPermissions.getPermission(toPlayer.getWorld().getName()).isAuthorized(user)) { throw new Exception(_("noPerm", "essentials.world." + toPlayer.getWorld().getName())); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java index 6ce71b3ba..6e5f7ec53 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.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.permissions.WorldPermissions; import lombok.Cleanup; @@ -23,25 +24,22 @@ public class Commandtpa extends EssentialsCommand { throw new Exception(_("teleportDisabled", player.getDisplayName())); } - if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + player.getWorld().getName())) + @Cleanup + ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + if (user.getWorld() != player.getWorld() && ess.getSettings().getData().getGeneral().isWorldTeleportPermissions() + && !WorldPermissions.getPermission(user.getWorld().getName()).isAuthorized(user)) { throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName())); } - if (!player.isIgnoredPlayer(user.getName())) + if (!player.isIgnoringPlayer(user.getName())) { player.requestTeleport(user, false); player.sendMessage(_("teleportRequest", user.getDisplayName())); player.sendMessage(_("typeTpaccept")); player.sendMessage(_("typeTpdeny")); int tpaAcceptCancellation = 0; - ISettings settings = ess.getSettings(); - settings.acquireReadLock(); - try { - tpaAcceptCancellation = settings.getData().getCommands().getTpa().getTimeout(); - } finally { - settings.unlock(); - } + tpaAcceptCancellation = settings.getData().getCommands().getTpa().getTimeout(); if (tpaAcceptCancellation != 0) { player.sendMessage(_("teleportRequestTimeoutInfo", tpaAcceptCancellation)); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java index 7f7d36413..b5b889c30 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.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.permissions.WorldPermissions; import lombok.Cleanup; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -43,8 +44,11 @@ public class Commandtpaall extends EssentialsCommand { continue; } - if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + user.getWorld().getName())) + @Cleanup + ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + if (user.getWorld() != player.getWorld() && settings.getData().getGeneral().isWorldTeleportPermissions() + && !WorldPermissions.getPermission(user.getWorld().getName()).isAuthorized(user)) { continue; } @@ -54,16 +58,7 @@ public class Commandtpaall extends EssentialsCommand player.sendMessage(_("teleportHereRequest", user.getDisplayName())); player.sendMessage(_("typeTpaccept")); int tpaAcceptCancellation = 0; - ISettings settings = ess.getSettings(); - settings.acquireReadLock(); - try - { - tpaAcceptCancellation = settings.getData().getCommands().getTpa().getTimeout(); - } - finally - { - settings.unlock(); - } + tpaAcceptCancellation = settings.getData().getCommands().getTpa().getTimeout(); if (tpaAcceptCancellation != 0) { player.sendMessage(_("teleportRequestTimeoutInfo", tpaAcceptCancellation)); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java index 8b7cb7b1b..e0f3b7d0c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java @@ -1,11 +1,12 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.economy.Trade; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; +import com.earth2me.essentials.economy.Trade; import com.earth2me.essentials.permissions.Permissions; -import org.bukkit.OfflinePlayer; +import com.earth2me.essentials.permissions.WorldPermissions; +import lombok.Cleanup; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -14,58 +15,29 @@ public class Commandtpaccept extends EssentialsCommand @Override public void run(final IUser user, final String commandLabel, final String[] args) throws Exception { - if (user.getTeleportRequester() == null) - { - throw new Exception(_("noPendingRequest")); - } - final IUser target = user.getTeleportRequester(); - if (target == null - || !target.isOnline() - || (user.isTeleportRequestHere() && !Permissions.TPAHERE.isAuthorized(target)) - || (!user.isTeleportRequestHere() && !Permissions.TPA.isAuthorized(target) && !Permissions.TPAALL.isAuthorized(target))) - { - throw new Exception(_("noPendingRequest")); - } - - if (user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpahere") && !target.isAuthorized("essentials.tpaall")) - || (user.getWorld() != target.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + user.getWorld().getName())))) - { - throw new Exception(_("noPendingRequest")); - } - - if (!user.isTpRequestHere() && (!target.isAuthorized("essentials.tpa") - || (user.getWorld() != target.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + target.getWorld().getName())))) - { - throw new Exception(_("noPendingRequest")); - } - - if (args.length > 0 && !target.getName().contains(args[0])) - { - throw new Exception(_("noPendingRequest")); - } - - int tpaAcceptCancellation = 0; + @Cleanup ISettings settings = ess.getSettings(); settings.acquireReadLock(); - try + if (target == null || !target.isOnline() + || (args.length > 0 && !target.getName().contains(args[0])) + || (user.isTpRequestHere() && !Permissions.TPAHERE.isAuthorized(target)) + || (!user.isTpRequestHere() && ((!Permissions.TPA.isAuthorized(target) && !Permissions.TPAALL.isAuthorized(target)) + || (user.getWorld() != target.getWorld() + && settings.getData().getGeneral().isWorldTeleportPermissions() + && !WorldPermissions.getPermission(user.getWorld().getName()).isAuthorized(user))))) { - tpaAcceptCancellation = settings.getData().getCommands().getTpa().getTimeout(); - } - finally - { - settings.unlock(); + throw new Exception(_("noPendingRequest")); } - if (tpaAcceptCancellation != 0 && (System.currentTimeMillis() - user.getTeleportRequestTime()) / 1000 > tpaAcceptCancellation) + long timeout = settings.getData().getCommands().getTpa().getTimeout(); + if (timeout != 0 && (System.currentTimeMillis() - user.getTeleportRequestTime()) / 1000 > timeout) { user.requestTeleport(null, false); throw new Exception(_("requestTimedOut")); } - final Trade charge = new Trade(commandName, ess); + final Trade charge = new Trade(this.commandName, ess); if (user.isTpRequestHere()) { charge.isAffordableFor(user); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java index c32a14470..c483f256b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.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.permissions.WorldPermissions; import lombok.Cleanup; @@ -23,8 +24,11 @@ public class Commandtpahere extends EssentialsCommand { throw new Exception(_("teleportDisabled", player.getDisplayName())); } - if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + user.getWorld().getName())) + @Cleanup + ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + if (user.getWorld() != player.getWorld() && ess.getSettings().getData().getGeneral().isWorldTeleportPermissions() + && !WorldPermissions.getPermission(user.getWorld().getName()).isAuthorized(user)) { throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName())); } @@ -32,16 +36,9 @@ public class Commandtpahere extends EssentialsCommand player.sendMessage(_("teleportHereRequest", user.getDisplayName())); player.sendMessage(_("typeTpaccept")); int tpaAcceptCancellation = 0; - ISettings settings = ess.getSettings(); - settings.acquireReadLock(); - try { tpaAcceptCancellation = settings.getData().getCommands().getTpa().getTimeout(); } - finally - { - settings.unlock(); - } if (tpaAcceptCancellation != 0) { player.sendMessage(_("teleportRequestTimeoutInfo", tpaAcceptCancellation)); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java index fb7efcdcb..a34ce13bd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java @@ -1,7 +1,10 @@ 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.permissions.WorldPermissions; +import lombok.Cleanup; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -36,8 +39,12 @@ public class Commandtpall extends EssentialsCommand { continue; } - if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + user.getWorld().getName())) + @Cleanup + ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + + if (user.getWorld() != player.getWorld() && ess.getSettings().getData().getGeneral().isWorldTeleportPermissions() + && !WorldPermissions.getPermission(user.getWorld().getName()).isAuthorized(user)) { continue; } @@ -49,6 +56,7 @@ public class Commandtpall extends EssentialsCommand { ess.getCommandHandler().showCommandError(sender, commandName, ex); } + } } -} +} \ No newline at end of file diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java index a995e31f4..d5449c9e5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java @@ -1,8 +1,10 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.economy.Trade; +import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; +import com.earth2me.essentials.economy.Trade; +import com.earth2me.essentials.permissions.WorldPermissions; import lombok.Cleanup; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -19,12 +21,15 @@ public class Commandtphere extends EssentialsCommand { throw new Exception(_("teleportDisabled", player.getDisplayName())); } - if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + user.getWorld().getName())) + @Cleanup + ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + if (user.getWorld() != player.getWorld() && ess.getSettings().getData().getGeneral().isWorldTeleportPermissions() + && !WorldPermissions.getPermission(user.getWorld().getName()).isAuthorized(user)) { throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName())); } - player.getTeleport().teleport(user, new Trade(this.getName(), ess), TeleportCause.COMMAND); + player.getTeleport().teleport(user, new Trade(this.commandName, ess), TeleportCause.COMMAND); user.sendMessage(_("teleporting")); player.sendMessage(_("teleporting")); throw new NoChargeException(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java index 931f50202..0dc54b8d7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java @@ -1,8 +1,11 @@ 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.permissions.Permissions; +import com.earth2me.essentials.permissions.WorldPermissions; +import lombok.Cleanup; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -11,6 +14,8 @@ public class Commandtpo extends EssentialsCommand @Override public void run(final IUser user, final String commandLabel, final String[] args) throws Exception { + @Cleanup + ISettings settings = ess.getSettings(); switch (args.length) { case 0: @@ -18,21 +23,23 @@ public class Commandtpo extends EssentialsCommand case 1: final IUser player = getPlayer(args, 0, true); - if (!player.isOnline() || (player.isHidden() && !user.isAuthorized("essentials.teleport.hidden"))) + if (!player.isOnline() || (player.isHidden() && !Permissions.TELEPORT_HIDDEN.isAuthorized(player))) { throw new NoSuchFieldException(_("playerNotFound")); } - if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + player.getWorld().getName())) + settings.acquireReadLock(); + if (user.getWorld() != player.getWorld() && settings.getData().getGeneral().isWorldTeleportPermissions() + && !WorldPermissions.getPermission(player.getWorld().getName()).isAuthorized(player)) { throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName())); } + user.sendMessage(_("teleporting")); user.getTeleport().now(player, false, TeleportCause.COMMAND); break; default: - if (!user.isAuthorized("essentials.tp.others")) + if (!Permissions.TELEPORT_OTHERS.isAuthorized(user)) { throw new Exception(_("noPerm", "essentials.tp.others")); } @@ -41,13 +48,13 @@ public class Commandtpo extends EssentialsCommand final IUser toPlayer = getPlayer(args, 1, true); if (!target.isOnline() || !toPlayer.isOnline() - || ((target.isHidden() || toPlayer.isHidden()) && !user.isAuthorized("essentials.teleport.hidden"))) + || ((target.isHidden() || toPlayer.isHidden()) && !Permissions.TELEPORT_HIDDEN.isAuthorized(user))) { throw new NoSuchFieldException(_("playerNotFound")); } - - if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + toPlayer.getWorld().getName())) + settings.acquireReadLock(); + if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().getData().getGeneral().isWorldTeleportPermissions() + && !WorldPermissions.getPermission(toPlayer.getWorld().getName()).isAuthorized(user)) { throw new Exception(_("noPerm", "essentials.world." + toPlayer.getWorld().getName())); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java index e27613b20..c108f56f8 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java @@ -1,8 +1,11 @@ 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.permissions.Permissions; +import com.earth2me.essentials.permissions.WorldPermissions; +import lombok.Cleanup; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -24,13 +27,17 @@ public class Commandtpohere extends EssentialsCommand { throw new NoSuchFieldException(_("playerNotFound")); } - - if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() - && !user.isAuthorized("essentials.world." + user.getWorld().getName())) + @Cleanup + ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + //todo - common method + if (user.getWorld() != player.getWorld() && settings.getData().getGeneral().isWorldTeleportPermissions() + && !WorldPermissions.getPermission(user.getWorld().getName()).isAuthorized(player)) { throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName())); } + // Verify permission if (!player.isHidden() || Permissions.TELEPORT_HIDDEN.isAuthorized(user)) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java index 032631056..ff4ca2ada 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; +import com.earth2me.essentials.permissions.Permissions; import org.bukkit.entity.Player; @@ -22,7 +23,7 @@ public class Commandvanish extends EssentialsCommand { for (Player p : server.getOnlinePlayers()) { - if (!ess.getUser(p).isAuthorized("essentials.vanish.see")) + if (!Permissions.VANISH_SEE_OTHERS.isAuthorized(p)) { p.hidePlayer(user); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java index a809c3c8d..db146a107 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java @@ -112,7 +112,7 @@ public class Commandwarp extends EssentialsCommand private void warpUser(final IUser user, final String name) throws Exception { final Trade chargeWarp = new Trade("warp-" + name.toLowerCase(Locale.ENGLISH).replace('_', '-'), ess); - final Trade chargeCmd = new Trade(this.getName(), ess); + final Trade chargeCmd = new Trade(this.commandName, ess); final double fullCharge = chargeWarp.getCommandCost(user) + chargeCmd.getCommandCost(user); final Trade charge = new Trade(fullCharge, ess); charge.isAffordableFor(user); diff --git a/Essentials/src/com/earth2me/essentials/permissions/Permissions.java b/Essentials/src/com/earth2me/essentials/permissions/Permissions.java index 151ed77c9..e832fbc8d 100644 --- a/Essentials/src/com/earth2me/essentials/permissions/Permissions.java +++ b/Essentials/src/com/earth2me/essentials/permissions/Permissions.java @@ -56,6 +56,7 @@ public enum Permissions implements IPermission REPAIR_ARMOR, REPAIR_ENCHANTED, SEEN_BANREASON, + SEEN_EXTRA, SETHOME_MULTIPLE, SETHOME_OTHERS, SLEEPINGIGNORED, @@ -63,6 +64,7 @@ public enum Permissions implements IPermission SUDO_EXEMPT, TELEPORT_COOLDOWN_BYPASS, TELEPORT_HIDDEN, + TELEPORT_OTHERS, TELEPORT_TIMER_BYPASS, TEMPBAN_EXEMPT, TEMPBAN_OFFLINE, @@ -74,7 +76,8 @@ public enum Permissions implements IPermission TPOHERE, UNLIMITED_OTHERS, WARP_LIST(PermissionDefault.TRUE), - WARP_OTHERS; + WARP_OTHERS, + VANISH_SEE_OTHERS; private static final String base = "essentials."; private final String permission; private final PermissionDefault defaultPerm; diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index e181ac1e3..1fa972441 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -73,7 +73,7 @@ public class User extends UserBase implements IUser @Getter private transient IUser teleportRequester; @Getter - private transient boolean teleportRequestHere; + private transient boolean tpRequestHere; @Getter private transient final ITeleport teleport; @Getter @@ -250,7 +250,7 @@ public class User extends UserBase implements IUser { teleportRequestTime = System.currentTimeMillis(); teleportRequester = player; - teleportRequestHere = here; + tpRequestHere = here; } public String getNick(boolean addprefixsuffix) diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectHolder.java b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectHolder.java index 2e2451397..c2ad4f8d3 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectHolder.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectHolder.java @@ -19,4 +19,16 @@ public class ProtectHolder extends AsyncStorageObjectHolder { return new File(ess.getDataFolder(), "protect.yml"); } + + @Override + public void finishRead() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void finishWrite() + { + throw new UnsupportedOperationException("Not supported yet."); + } } -- cgit v1.2.3 From 03a52cd070d30837ec6be85d9d80fb3f9dae7436 Mon Sep 17 00:00:00 2001 From: ementalo Date: Thu, 31 May 2012 00:40:35 +0100 Subject: 2.9 -> 3.0 Permissions and command fixes Kit cleanup (needs timestamp work still) --- Essentials/src/com/earth2me/essentials/Kits.java | 31 ++++++ .../src/com/earth2me/essentials/api/IKits.java | 3 + .../src/com/earth2me/essentials/api/IUser.java | 5 +- .../essentials/commands/Commandessentials.java | 121 ++++++++++----------- .../earth2me/essentials/commands/Commandexp.java | 31 +++--- .../earth2me/essentials/commands/Commandfly.java | 3 +- .../essentials/commands/Commandgetpos.java | 2 +- .../earth2me/essentials/commands/Commandhome.java | 4 +- .../earth2me/essentials/commands/Commanditem.java | 3 +- .../earth2me/essentials/commands/Commandkit.java | 36 +++--- .../essentials/commands/Commandkittycannon.java | 23 +--- .../earth2me/essentials/commands/Commandlist.java | 5 +- .../earth2me/essentials/commands/Commandme.java | 2 +- .../earth2me/essentials/commands/Commandmsg.java | 2 +- .../earth2me/essentials/commands/Commandping.java | 4 +- .../essentials/commands/Commandpowertool.java | 6 +- .../earth2me/essentials/commands/Commandseen.java | 6 +- .../essentials/commands/Commandsetworth.java | 28 +---- .../essentials/commands/Commandtpahere.java | 2 +- .../earth2me/essentials/commands/Commandtpall.java | 2 +- .../essentials/commands/Commandtphere.java | 2 +- .../earth2me/essentials/commands/Commandtpo.java | 2 +- .../essentials/permissions/Permissions.java | 6 + .../com/earth2me/essentials/settings/General.java | 2 + .../src/com/earth2me/essentials/user/User.java | 1 + 25 files changed, 164 insertions(+), 168 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Kits.java b/Essentials/src/com/earth2me/essentials/Kits.java index a9fd1fa2f..74d2a73e5 100644 --- a/Essentials/src/com/earth2me/essentials/Kits.java +++ b/Essentials/src/com/earth2me/essentials/Kits.java @@ -4,8 +4,12 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IEssentials; import com.earth2me.essentials.api.IKits; import com.earth2me.essentials.api.IUser; +import com.earth2me.essentials.commands.NoChargeException; import com.earth2me.essentials.settings.Kit; import com.earth2me.essentials.storage.AsyncStorageObjectHolder; +import com.earth2me.essentials.user.UserData; +import com.earth2me.essentials.user.UserData.TimestampType; +import com.earth2me.essentials.utils.DateUtil; import java.io.File; import java.io.IOException; import java.util.*; @@ -101,4 +105,31 @@ public class Kits extends AsyncStorageObjectHolder getList() throws Exception; boolean isEmpty(); + + void checkTime(final IUser user, Kit kit) throws NoChargeException; } diff --git a/Essentials/src/com/earth2me/essentials/api/IUser.java b/Essentials/src/com/earth2me/essentials/api/IUser.java index a1d49f250..c5177162c 100644 --- a/Essentials/src/com/earth2me/essentials/api/IUser.java +++ b/Essentials/src/com/earth2me/essentials/api/IUser.java @@ -116,5 +116,8 @@ public interface IUser extends Player, IStorageObjectHolder, IReload, void toggleVanished(); - void update(final Player base); + boolean isInvSee(); + + void setInvSee(boolean invsee); + } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index 72aa66e99..84e439e6d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -19,40 +19,35 @@ public class Commandessentials extends EssentialsCommand { private transient int taskid; private final transient Map noteBlocks = new HashMap(); - + @Override public void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { - if (args.length == 0) - { - run_disabled(sender, args); + if (args.length == 0) { + run_disabled(sender, commandLabel, args); } else if (args[0].equalsIgnoreCase("debug")) { - run_debug(sender, args); + run_debug(sender, commandLabel, args); } else if (args[0].equalsIgnoreCase("nya")) { - run_nya(sender, args); + run_nya(sender, commandLabel, args); } else if (args[0].equalsIgnoreCase("moo")) { - run_moo(server, sender, commandLabel, args); + run_moo(sender, commandLabel, args); } else if (args[0].equalsIgnoreCase("opt-out")) { - run_optout(server, sender, commandLabel, args); + run_optout(sender, commandLabel, args); } else { - run_reload(server, sender, commandLabel, args); - } - else - { - run_reload(sender, args); + run_reload(sender, commandLabel, args); } } - private void run_disabled(final CommandSender sender, final String[] args) throws Exception + private void run_disabled(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { sender.sendMessage("Essentials " + ess.getDescription().getVersion()); sender.sendMessage("/ "); @@ -60,8 +55,7 @@ public class Commandessentials extends EssentialsCommand final StringBuilder disabledCommands = new StringBuilder(); for (Map.Entry entry : ess.getCommandHandler().disabledCommands().entrySet()) { - if (disabledCommands.length() > 0) - { + if (disabledCommands.length() > 0) { disabledCommands.append(", "); } disabledCommands.append(entry.getKey()).append(" => ").append(entry.getValue()); @@ -69,19 +63,19 @@ public class Commandessentials extends EssentialsCommand sender.sendMessage(disabledCommands.toString()); } - private void run_debug(final CommandSender sender, final String[] args) throws Exception + private void run_debug(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { ess.getSettings().setDebug(!ess.getSettings().isDebug()); sender.sendMessage("Essentials " + ess.getDescription().getVersion() + " debug mode " + (ess.getSettings().isDebug() ? "enabled" : "disabled")); } - private void run_reload(final CommandSender sender, final String[] args) throws Exception + private void run_reload(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { ess.reload(); sender.sendMessage(_("essentialsReload", ess.getDescription().getVersion())); } - private void run_nya(final CommandSender sender, final String[] args) throws Exception + private void run_nya(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { final Map noteMap = new HashMap(); noteMap.put("1F#", (byte)0x0); @@ -108,60 +102,60 @@ public class Commandessentials extends EssentialsCommand noteMap.put("2D#", (byte)(0x9 + 0xC)); noteMap.put("2E", (byte)(0xA + 0xC)); noteMap.put("2F", (byte)(0xB + 0xC)); - if (!noteBlocks.isEmpty()) - { - return; - } - final String tuneStr = "1D#,1E,2F#,,2A#,1E,1D#,1E,2F#,2B,2D#,2E,2D#,2A#,2B,,2F#,,1D#,1E,2F#,2B,2C#,2A#,2B,2C#,2E,2D#,2E,2C#,,2F#,,2G#,,1D,1D#,,1C#,1D,1C#,1B,,1B,,1C#,,1D,,1D,1C#,1B,1C#,1D#,2F#,2G#,1D#,2F#,1C#,1D#,1B,1C#,1B,1D#,,2F#,,2G#,1D#,2F#,1C#,1D#,1B,1D,1D#,1D,1C#,1B,1C#,1D,,1B,1C#,1D#,2F#,1C#,1D,1C#,1B,1C#,,1B,,1C#,,2F#,,2G#,,1D,1D#,,1C#,1D,1C#,1B,,1B,,1C#,,1D,,1D,1C#,1B,1C#,1D#,2F#,2G#,1D#,2F#,1C#,1D#,1B,1C#,1B,1D#,,2F#,,2G#,1D#,2F#,1C#,1D#,1B,1D,1D#,1D,1C#,1B,1C#,1D,,1B,1C#,1D#,2F#,1C#,1D,1C#,1B,1C#,,1B,,1B,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1B,,"; - final String[] tune = tuneStr.split(","); - for (Player player : server.getOnlinePlayers()) - { - final Location loc = player.getLocation(); - loc.add(0, 3, 0); - while (loc.getBlockY() < player.getLocation().getBlockY() + 10 && loc.getBlock().getTypeId() != 0) + if (!noteBlocks.isEmpty()) { - loc.add(0, 1, 0); + return; } - if (loc.getBlock().getTypeId() == 0) - { - noteBlocks.put(player, loc.getBlock()); - player.sendBlockChange(loc, Material.NOTE_BLOCK, (byte)0); - } - } - taskid = ess.scheduleSyncRepeatingTask(new Runnable() - { - int i = 0; - - @Override - public void run() + final String tuneStr = "1D#,1E,2F#,,2A#,1E,1D#,1E,2F#,2B,2D#,2E,2D#,2A#,2B,,2F#,,1D#,1E,2F#,2B,2C#,2A#,2B,2C#,2E,2D#,2E,2C#,,2F#,,2G#,,1D,1D#,,1C#,1D,1C#,1B,,1B,,1C#,,1D,,1D,1C#,1B,1C#,1D#,2F#,2G#,1D#,2F#,1C#,1D#,1B,1C#,1B,1D#,,2F#,,2G#,1D#,2F#,1C#,1D#,1B,1D,1D#,1D,1C#,1B,1C#,1D,,1B,1C#,1D#,2F#,1C#,1D,1C#,1B,1C#,,1B,,1C#,,2F#,,2G#,,1D,1D#,,1C#,1D,1C#,1B,,1B,,1C#,,1D,,1D,1C#,1B,1C#,1D#,2F#,2G#,1D#,2F#,1C#,1D#,1B,1C#,1B,1D#,,2F#,,2G#,1D#,2F#,1C#,1D#,1B,1D,1D#,1D,1C#,1B,1C#,1D,,1B,1C#,1D#,2F#,1C#,1D,1C#,1B,1C#,,1B,,1B,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1B,,"; + final String[] tune = tuneStr.split(","); + for (Player player : server.getOnlinePlayers()) { - final String note = tune[i]; - i++; - if (i >= tune.length) + final Location loc = player.getLocation(); + loc.add(0, 3, 0); + while (loc.getBlockY() < player.getLocation().getBlockY() + 10 && loc.getBlock().getTypeId() != 0) { - Commandessentials.this.stopTune(); + loc.add(0, 1, 0); } - if (note.isEmpty()) + if (loc.getBlock().getTypeId() == 0) { - return; + noteBlocks.put(player, loc.getBlock()); + loc.getBlock().setType(Material.NOTE_BLOCK); } - Map noteBlocks = Commandessentials.this.noteBlocks; - for (Player onlinePlayer : server.getOnlinePlayers()) + } + taskid = ess.scheduleSyncRepeatingTask(new Runnable() + { + int i = 0; + + @Override + public void run() { - final Block block = noteBlocks.get(onlinePlayer); - if (block == null || block.getType() != Material.NOTE_BLOCK) + final String note = tune[i]; + i++; + if (i >= tune.length) + { + Commandessentials.this.stopTune(); + } + if (note.isEmpty()) + { + return; + } + Map noteBlocks = Commandessentials.this.noteBlocks; + for (Player onlinePlayer : server.getOnlinePlayers()) { - continue; + final Block block = noteBlocks.get(onlinePlayer); + if (block == null || block.getType() != Material.NOTE_BLOCK) + { + continue; + } + onlinePlayer.playNote(block.getLocation(), (byte)0, noteMap.get(note)); } - onlinePlayer.playNote(block.getLocation(), (byte)0, noteMap.get(note)); } - } - }, 20, 2); + }, 20, 2); } private void stopTune() { - ess.getServer().getScheduler().cancelTask(taskid); + server.getScheduler().cancelTask(taskid); for (Block block : noteBlocks.values()) { if (block.getType() == Material.NOTE_BLOCK) @@ -171,16 +165,16 @@ public class Commandessentials extends EssentialsCommand } noteBlocks.clear(); } - - private void run_moo(final Server server, final CommandSender sender, final String command, final String args[]) + + private void run_moo(final CommandSender sender, final String command, 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?\"..." } ); } - - private void run_optout(final Server server, final CommandSender sender, final String command, final String args[]) + + private void run_optout(final CommandSender sender, final String command, final String args[]) { final Metrics metrics = ess.getMetrics(); try @@ -197,4 +191,5 @@ public class Commandessentials extends EssentialsCommand { sender.sendMessage("Unable to modify 'plugins/PluginMetrics/config.yml': " + ex.getMessage()); } -} + } +} \ No newline at end of file diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java index d0306d76f..687335f0d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java @@ -1,31 +1,30 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.user.User; +import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.craftbukkit.SetExpFix; -import org.bukkit.command.CommandSender; +import com.earth2me.essentials.permissions.Permissions; import org.bukkit.entity.Player; public class Commandexp extends EssentialsCommand { - //todo - fix this @Override - public void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception + public void run(final IUser user, final String commandLabel, final String[] args) throws Exception { - if (args.length == 0 && sender instanceof Player) + if (args.length == 0) { - showExp((User)sender, (User)sender); + showExp(user, user); } - else if (args[0].equalsIgnoreCase("set") && user.isAuthorized("essentials.exp.set")) + else if (args[0].equalsIgnoreCase("set") && Permissions.EXP_SET.isAuthorized(user)) { - if (args.length == 3 && user.isAuthorized("essentials.exp.set.others")) + if (args.length == 3 && Permissions.EXP_SET_OTHERS.isAuthorized(user)) { Boolean foundUser = false; for (Player matchPlayer : server.matchPlayer(args[1])) { - User target = ess.getUser(matchPlayer); + IUser target = ess.getUser(matchPlayer); setExp(user, target, args[2], false); foundUser = true; } @@ -37,14 +36,14 @@ public class Commandexp extends EssentialsCommand } setExp(user, user, args[1], false); } - else if (args[0].equalsIgnoreCase("give") && user.isAuthorized("essentials.exp.give")) + else if (args[0].equalsIgnoreCase("give") && Permissions.EXP_GIVE.isAuthorized(user)) { - if (args.length == 3 && user.isAuthorized("essentials.exp.give.others")) + if (args.length == 3 && Permissions.EXP_GIVE_OTHERS.isAuthorized(user)) { Boolean foundUser = false; for (Player matchPlayer : server.matchPlayer(args[1])) { - User target = ess.getUser(matchPlayer); + IUser target = ess.getUser(matchPlayer); setExp(user, target, args[2], true); foundUser = true; } @@ -63,27 +62,27 @@ public class Commandexp extends EssentialsCommand { search = args[1].trim(); } - if (search.equalsIgnoreCase("show") || !user.isAuthorized("essentials.exp.others")) + if (search.equalsIgnoreCase("show") || !Permissions.EXP_OTHERS.isAuthorized(user)) { showExp(user, user); return; } for (Player matchPlayer : server.matchPlayer(search)) { - User target = ess.getUser(matchPlayer); + IUser target = ess.getUser(matchPlayer); showExp(user, target); } } } - private void showExp(final User user, final User target) + private void showExp(final IUser user, final IUser target) { final int totalExp = SetExpFix.getTotalExperience(target); final int expLeft = (int)Util.roundDouble(((((3.5 * target.getLevel()) + 6.7) - (totalExp - ((1.75 * (target.getLevel() * target.getLevel())) + (5.00 * target.getLevel())))) + 1)); user.sendMessage(_("exp", target.getDisplayName(), SetExpFix.getTotalExperience(target), target.getLevel(), expLeft)); } - private void setExp(final User user, final User target, final String strAmount, final boolean give) + private void setExp(final IUser user, final IUser target, final String strAmount, final boolean give) { Long amount = Long.parseLong(strAmount); if (give) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java index 46ae31a16..d785823cc 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; +import com.earth2me.essentials.permissions.Permissions; import org.bukkit.Server; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -24,7 +25,7 @@ public class Commandfly extends EssentialsCommand protected void run(final IUser user, final String commandLabel, final String[] args) throws Exception { //todo permissions - if (args.length > 0 && args[0].trim().length() > 2 && user.isAuthorized("essentials.fly.others")) + if (args.length > 0 && args[0].trim().length() > 2 && Permissions.FLY_OTHERS.isAuthorized(user)) { flyOtherPlayers(server, user, args[0]); return; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java b/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java index 3ffce7595..c31c76d3c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java @@ -15,7 +15,7 @@ public class Commandgetpos extends EssentialsCommand { //todo permissions final IUser otherUser = getPlayer(args, 0); - if (!otherUser.isHidden() || user.isAuthorized("essentials.list.hidden")) + if (!otherUser.isHidden() || Permissions.LIST_HIDDEN.isAuthorized(user)) { outputPosition(user, otherUser.getLocation(), user.getLocation()); return; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java index 645e8fd8b..cb3220479 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java @@ -4,7 +4,9 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.economy.Trade; import com.earth2me.essentials.permissions.Permissions; +import com.earth2me.essentials.permissions.WorldPermissions; import com.earth2me.essentials.utils.Util; +import de.bananaco.permissions.worlds.WorldPermissionSet; import java.util.List; import java.util.Locale; import org.bukkit.Location; @@ -97,7 +99,7 @@ public class Commandhome extends EssentialsCommand throw new NotEnoughArgumentsException(); } if (user.getWorld() != loc.getWorld() && ess.getSettings().getData().getGeneral().isWorldHomePermissions() - && !user.isAuthorized("essentials.world." + loc.getWorld().getName())) + && !WorldPermissions.getPermission(loc.getWorld().getName()).isAuthorized(user)) { throw new Exception(_("noPerm", "essentials.world." + loc.getWorld().getName())); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java index bf955fbb5..0dae772cc 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.permissions.ItemPermissions; +import com.earth2me.essentials.permissions.Permissions; import java.util.Locale; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; @@ -36,7 +37,7 @@ public class Commanditem extends EssentialsCommand { stack.setAmount(ess.getSettings().getData().getGeneral().getDefaultStacksize()); } - else if (ess.getSettings().getData().getGeneral().getOversizedStacksize()> 0 && user.isAuthorized("essentials.oversizedstacks")) + else if (ess.getSettings().getData().getGeneral().getOversizedStacksize()> 0 && Permissions.OVERSIZEDSTACKS.isAuthorized(user)) { stack.setAmount(ess.getSettings().getData().getGeneral().getOversizedStacksize()); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java index 2d71302b7..a6c1183ad 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java @@ -1,16 +1,16 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.economy.Trade; -import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; +import com.earth2me.essentials.economy.Trade; import com.earth2me.essentials.permissions.KitPermissions; import com.earth2me.essentials.settings.Kit; +import com.earth2me.essentials.utils.Util; import java.util.Collection; import java.util.List; import java.util.Locale; -import java.util.Map; import org.bukkit.command.CommandSender; +import org.bukkit.inventory.ItemStack; public class Commandkit extends EssentialsCommand @@ -38,16 +38,18 @@ public class Commandkit extends EssentialsCommand } throw new NoChargeException(); } - else if (args.length > 1 && user.isAuthorized("essentials.kit.others")) + else if (args.length > 1 && KitPermissions.getPermission("others").isAuthorized(user)) { final IUser userTo = getPlayer(args, 1, true); final String kitName = Util.sanitizeString(args[0].toLowerCase(Locale.ENGLISH)); giveKit(userTo, user, kitName); + } else { final String kitName = Util.sanitizeString(args[0].toLowerCase(Locale.ENGLISH)); giveKit(user, user, kitName); + } } @@ -59,53 +61,47 @@ public class Commandkit extends EssentialsCommand listKits(sender); throw new NoChargeException(); } - else { final IUser userTo = getPlayer(args, 1, true); final String kitName = args[0].toLowerCase(Locale.ENGLISH); final Kit kit = ess.getKits().getKit(kitName); - final List items = Kit.getItems(userTo, kit); - Kit.expandItems(ess,userTo,items); - - - - //TODO: Check kit delay + ess.getKits().sendKit(userTo, kit); sender.sendMessage(_("kitGive", kitName)); } } private void listKits(CommandSender sender) throws Exception { - final String kitList = Kit.listKits(ess, null); - if (kitList.length() > 0) + Collection kitList = ess.getKits().getList(); + if (kitList.isEmpty()) { sender.sendMessage(_("kits", kitList)); } else { - sender.sendMessage(_("noKits")); + sender.sendMessage(_("kits", Util.joinList(kitList))); } } private void giveKit(IUser userTo, IUser userFrom, String kitName) throws Exception { - final Map kit = ess.getSettings().getKit(kitName); - - if (!userFrom.isAuthorized("essentials.kit." + kitName)) + if (!KitPermissions.getPermission(kitName).isAuthorized(userFrom)) { throw new Exception(_("noKitPermission", "essentials.kit." + kitName)); } + final Kit kit = ess.getKits().getKit(kitName); + - final List items = Kit.getItems(userTo, kit); - Kit.checkTime(userFrom, kitName, kit); + ess.getKits().checkTime(userFrom, kit); final Trade charge = new Trade("kit-" + kitName, ess); charge.isAffordableFor(userFrom); - Kit.expandItems(ess, userTo, items); + ess.getKits().sendKit(userTo, kit); charge.charge(userFrom); userTo.sendMessage(_("kitGive", kitName)); } } + diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java b/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java index 602f324ad..99a6aa0f3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java @@ -1,17 +1,10 @@ package com.earth2me.essentials.commands; -<<<<<<< HEAD -import com.earth2me.essentials.Mob; -import com.earth2me.essentials.User; -import java.util.Random; -import org.bukkit.Location; -import org.bukkit.Server; -======= -import com.earth2me.essentials.bukkit.Mob; + import com.earth2me.essentials.api.IUser; +import com.earth2me.essentials.bukkit.Mob; import java.util.Random; import org.bukkit.Location; ->>>>>>> 3.0 import org.bukkit.entity.Ocelot; @@ -19,18 +12,8 @@ public class Commandkittycannon extends EssentialsCommand { private static Random random = new Random(); -<<<<<<< HEAD - public Commandkittycannon() - { - super("kittycannon"); - } - - @Override - protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception -======= @Override protected void run(final IUser user, final String commandLabel, final String[] args) throws Exception ->>>>>>> 3.0 { final Mob cat = Mob.OCELOT; final Ocelot ocelot = (Ocelot)cat.spawn(user, server, user.getEyeLocation()); @@ -53,4 +36,4 @@ public class Commandkittycannon extends EssentialsCommand } }, 20); } -} +} \ No newline at end of file diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java index 0a433ad7e..db8ec5aea 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java @@ -1,11 +1,10 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.permissions.Permissions; -import com.earth2me.essentials.Util; +import com.earth2me.essentials.utils.Util; import java.util.*; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -77,7 +76,7 @@ public class Commandlist extends EssentialsCommand for (String group : groups) { final StringBuilder groupString = new StringBuilder(); - groupString.append(_("listGroupTag",Util.replaceColor(group))); + groupString.append(_("listGroupTag",Util.replaceFormat(group))); final List users = sort.get(group); Collections.sort(users); boolean first = true; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandme.java b/Essentials/src/com/earth2me/essentials/commands/Commandme.java index 8477c98bc..c420195cc 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandme.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandme.java @@ -24,7 +24,7 @@ public class Commandme extends EssentialsCommand String message = getFinalArg(args, 0); if (Permissions.CHAT_COLOR.isAuthorized(user)) { - message = Util.replaceColor(message); + message = Util.replaceFormat(message); } else { message = Util.stripColor(message); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java index 8cc683e55..b28346ae1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java @@ -34,7 +34,7 @@ public class Commandmsg extends EssentialsCommand } if (Permissions.MSG_COLOR.isAuthorized(user)) { - message = Util.replaceColor(message); + message = Util.replaceFormat(message); } else { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandping.java b/Essentials/src/com/earth2me/essentials/commands/Commandping.java index 5da879907..8c253e183 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandping.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandping.java @@ -1,8 +1,8 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; +import com.earth2me.essentials.utils.Util; public class Commandping extends EssentialsCommand @@ -16,7 +16,7 @@ public class Commandping extends EssentialsCommand } else { - sender.sendMessage(Util.replaceFormat(getFinalArg(args, 0))); + user.sendMessage(Util.replaceFormat(getFinalArg(args, 0))); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java index 9f0cf006a..1f5a6912f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java @@ -1,9 +1,9 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.permissions.Permissions; +import com.earth2me.essentials.utils.Util; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -97,9 +97,9 @@ public class Commandpowertool extends EssentialsCommand user.sendMessage(_("powerToolRemoveAll", itemName)); } - if (!user.arePowerToolsEnabled()) + if (!user.getData().isPowerToolsEnabled()) { - user.setPowerToolsEnabled(true); + user.getData().setPowerToolsEnabled(true); user.sendMessage(_("powerToolsEnabled")); } user.acquireWriteLock(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index fd20419ff..d9f456a0d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -58,10 +58,10 @@ public class Commandseen extends EssentialsCommand } if (extra) { - sender.sendMessage(_("whoisIPAddress", player.getLastLoginAddress())); - final Location loc = player.getLastLocation(); + sender.sendMessage(_("whoisIPAddress", player.getData().getIpAddress())); + final Location loc = player.getData().getLastLocation(); if (loc != null) { - sender.sendMessage(_("whoisLocation", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + sender.sendMessage(_("whoisLocation", loc.getWorldName(), loc.getX(), loc.getY(), loc.getZ())); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java index e42c11651..8bb06e48d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java @@ -33,36 +33,10 @@ public class Commandsetworth extends EssentialsCommand 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 < 1) - { - 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 Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 2) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java index c483f256b..3de6c0ba8 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java @@ -27,7 +27,7 @@ public class Commandtpahere extends EssentialsCommand @Cleanup ISettings settings = ess.getSettings(); settings.acquireReadLock(); - if (user.getWorld() != player.getWorld() && ess.getSettings().getData().getGeneral().isWorldTeleportPermissions() + if (user.getWorld() != player.getWorld() && settings.getData().getGeneral().isWorldTeleportPermissions() && !WorldPermissions.getPermission(user.getWorld().getName()).isAuthorized(user)) { throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName())); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java index a34ce13bd..e9f7419c3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java @@ -43,7 +43,7 @@ public class Commandtpall extends EssentialsCommand ISettings settings = ess.getSettings(); settings.acquireReadLock(); - if (user.getWorld() != player.getWorld() && ess.getSettings().getData().getGeneral().isWorldTeleportPermissions() + if (user.getWorld() != player.getWorld() && settings.getData().getGeneral().isWorldTeleportPermissions() && !WorldPermissions.getPermission(user.getWorld().getName()).isAuthorized(user)) { continue; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java index d5449c9e5..1954b0874 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java @@ -24,7 +24,7 @@ public class Commandtphere extends EssentialsCommand @Cleanup ISettings settings = ess.getSettings(); settings.acquireReadLock(); - if (user.getWorld() != player.getWorld() && ess.getSettings().getData().getGeneral().isWorldTeleportPermissions() + if (user.getWorld() != player.getWorld() && settings.getData().getGeneral().isWorldTeleportPermissions() && !WorldPermissions.getPermission(user.getWorld().getName()).isAuthorized(user)) { throw new Exception(_("noPerm", "essentials.world." + user.getWorld().getName())); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java index 0dc54b8d7..006812e48 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java @@ -53,7 +53,7 @@ public class Commandtpo extends EssentialsCommand throw new NoSuchFieldException(_("playerNotFound")); } settings.acquireReadLock(); - if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().getData().getGeneral().isWorldTeleportPermissions() + if (target.getWorld() != toPlayer.getWorld() && settings.getData().getGeneral().isWorldTeleportPermissions() && !WorldPermissions.getPermission(toPlayer.getWorld().getName()).isAuthorized(user)) { throw new Exception(_("noPerm", "essentials.world." + toPlayer.getWorld().getName())); diff --git a/Essentials/src/com/earth2me/essentials/permissions/Permissions.java b/Essentials/src/com/earth2me/essentials/permissions/Permissions.java index e832fbc8d..aa6bfa583 100644 --- a/Essentials/src/com/earth2me/essentials/permissions/Permissions.java +++ b/Essentials/src/com/earth2me/essentials/permissions/Permissions.java @@ -24,7 +24,13 @@ public enum Permissions implements IPermission CLEARINVENTORY_OTHERS, DELHOME_OTHERS, ECO_LOAN(PermissionDefault.FALSE), + EXP_GIVE, + EXP_GIVE_OTHERS, + EXP_SET, + EXP_SET_OTHERS, + EXP_OTHERS, FEED_OTHERS, + FLY_OTHERS, GAMEMODE_OTHERS, GEOIP_HIDE(PermissionDefault.FALSE), GEOIP_SHOW(PermissionDefault.TRUE), diff --git a/Essentials/src/com/earth2me/essentials/settings/General.java b/Essentials/src/com/earth2me/essentials/settings/General.java index 033a6ce31..f1b827675 100644 --- a/Essentials/src/com/earth2me/essentials/settings/General.java +++ b/Essentials/src/com/earth2me/essentials/settings/General.java @@ -82,6 +82,8 @@ public class General implements StorageObject }) private boolean worldTeleportPermissions = false; + private boolean worldHomePermissions = false; + @Comment("Prevent creatures spawning") private Map creatureSpawn = new HashMap(); diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index 1fa972441..5c9015237 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -88,6 +88,7 @@ public class User extends UserBase implements IUser @Getter private transient boolean vanished; @Getter + @Setter private boolean invSee = false; private transient Location afkPosition; private static final Logger logger = Bukkit.getLogger(); -- cgit v1.2.3 From 9b7a40736e54c6a692d3f5ceda72d11b638e728f Mon Sep 17 00:00:00 2001 From: ementalo Date: Thu, 31 May 2012 01:27:24 +0100 Subject: 2.9 -> 3.0 merge Commented out a load of metrics code for the time being --- Essentials/src/com/earth2me/essentials/Kits.java | 4 +- .../com/earth2me/essentials/api/IEssentials.java | 5 + .../src/com/earth2me/essentials/api/IUser.java | 2 + .../earth2me/essentials/commands/Commandback.java | 2 +- .../essentials/commands/Commandbackup.java | 8 +- .../essentials/commands/Commandbalance.java | 6 +- .../earth2me/essentials/economy/MoneyHolder.java | 4 +- .../earth2me/essentials/economy/WorthHolder.java | 4 +- .../essentials/metrics/MetricsListener.java | 4 +- .../essentials/metrics/MetricsStarter.java | 127 ++- .../earth2me/essentials/ranks/RanksStorage.java | 4 +- .../src/com/earth2me/essentials/settings/Kit.java | 1 + .../essentials/settings/SettingsHolder.java | 4 +- .../earth2me/essentials/settings/SpawnsHolder.java | 4 +- .../earth2me/essentials/settings/WarpHolder.java | 4 +- .../src/com/earth2me/essentials/user/User.java | 1101 +------------------- .../src/com/earth2me/essentials/user/UserData.java | 2 +- .../test/com/earth2me/essentials/UtilTest.java | 2 +- .../earth2me/essentials/protect/ProtectHolder.java | 4 +- 19 files changed, 129 insertions(+), 1163 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Kits.java b/Essentials/src/com/earth2me/essentials/Kits.java index 74d2a73e5..730e63c2f 100644 --- a/Essentials/src/com/earth2me/essentials/Kits.java +++ b/Essentials/src/com/earth2me/essentials/Kits.java @@ -97,13 +97,13 @@ public class Kits extends AsyncStorageObjectHolder getVanishedPlayers(); EssentialsTimer getTimer(); + + Metrics getMetrics(); + + void setMetrics(Metrics metrics); } diff --git a/Essentials/src/com/earth2me/essentials/api/IUser.java b/Essentials/src/com/earth2me/essentials/api/IUser.java index c5177162c..b7a22ac4d 100644 --- a/Essentials/src/com/earth2me/essentials/api/IUser.java +++ b/Essentials/src/com/earth2me/essentials/api/IUser.java @@ -120,4 +120,6 @@ public interface IUser extends Player, IStorageObjectHolder, IReload, void setInvSee(boolean invsee); + void update(final Player base); + } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandback.java b/Essentials/src/com/earth2me/essentials/commands/Commandback.java index 2b112ffa9..d325b7f6a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandback.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandback.java @@ -13,7 +13,7 @@ public class Commandback extends EssentialsCommand { final String worldName = user.getData().getLastLocation().getWorldName(); if (user.getWorld() != user.getData().getLastLocation().getBukkitLocation().getWorld() && ess.getSettings().getData().getGeneral().isWorldTeleportPermissions() - && WorldPermissions.getPermission(worldName)) + && WorldPermissions.getPermission(worldName).isAuthorized(user)) { throw new Exception(_("noPerm", "essentials.world." + worldName)); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java index e620fa52d..6ea8aec87 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java @@ -2,6 +2,8 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IBackup; +import com.earth2me.essentials.api.ISettings; +import lombok.Cleanup; import org.bukkit.command.CommandSender; @@ -15,7 +17,11 @@ public class Commandbackup extends EssentialsCommand { throw new Exception(_("backupDisabled")); } - final String command = ess.getSettings().getData().getCommands().getBackupCommand(); + + @Cleanup + ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + final String command = settings.getData().getGeneral().getBackup().getCommand(); if (command == null || "".equals(command) || "save-all".equalsIgnoreCase(command)) { throw new Exception(_("backupDisabled")); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java index 4e8b8f8af..c8491a2c0 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java @@ -1,9 +1,9 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.permissions.Permissions; +import com.earth2me.essentials.utils.Util; import org.bukkit.command.CommandSender; @@ -16,7 +16,7 @@ public class Commandbalance extends EssentialsCommand { throw new NotEnoughArgumentsException(); } - sender.sendMessage(_("balance", Util.displayCurrency(getPlayer(server, args, 0, true).getMoney(), ess))); + sender.sendMessage(_("balance", Util.displayCurrency(getPlayer(args, 0, true).getMoney(), ess))); } @Override @@ -25,7 +25,7 @@ public class Commandbalance extends EssentialsCommand final double bal = (args.length < 1 || !Permissions.BALANCE_OTHERS.isAuthorized(user) ? user - : getPlayer(server, args, 0, true)).getMoney(); + : getPlayer(args, 0, true)).getMoney(); user.sendMessage(_("balance", Util.displayCurrency(bal, ess))); } } diff --git a/Essentials/src/com/earth2me/essentials/economy/MoneyHolder.java b/Essentials/src/com/earth2me/essentials/economy/MoneyHolder.java index cdde3506e..3ecf6b2d0 100644 --- a/Essentials/src/com/earth2me/essentials/economy/MoneyHolder.java +++ b/Essentials/src/com/earth2me/essentials/economy/MoneyHolder.java @@ -12,13 +12,13 @@ public class MoneyHolder extends AsyncStorageObjectHolder @Override public void finishRead() { - throw new UnsupportedOperationException("Not supported yet."); + } @Override public void finishWrite() { - throw new UnsupportedOperationException("Not supported yet."); + } diff --git a/Essentials/src/com/earth2me/essentials/economy/WorthHolder.java b/Essentials/src/com/earth2me/essentials/economy/WorthHolder.java index 499b92bac..d514c9797 100644 --- a/Essentials/src/com/earth2me/essentials/economy/WorthHolder.java +++ b/Essentials/src/com/earth2me/essentials/economy/WorthHolder.java @@ -19,13 +19,13 @@ public class WorthHolder extends AsyncStorageObjectHolder 0) + if (ess.getKits().getList().size() > 0) { enabledGraph.addPlotter(new SimplePlotter("Kits")); } - if (ess.getWarps().getWarpNames().size() > 0) + if (ess.getWarps().getList().size() > 0) { enabledGraph.addPlotter(new SimplePlotter("Warps")); } - if (!ess.getSettings().areSignsDisabled()) - { - enabledGraph.addPlotter(new SimplePlotter("Signs")); - } - if (ess.getSettings().getAutoAfk() > 0) - { - enabledGraph.addPlotter(new SimplePlotter("AutoAFK")); - } - if (ess.getSettings().changeDisplayName()) - { - enabledGraph.addPlotter(new SimplePlotter("DisplayName")); - } - if (ess.getSettings().getChatRadius() >= 1) - { - enabledGraph.addPlotter(new SimplePlotter("LocalChat")); - } - + //todo - enable once settings are in + /* + if (!ess.getSettings().areSignsDisabled()) + { + enabledGraph.addPlotter(new SimplePlotter("Signs")); + } + if (ess.getSettings().getAutoAfk() > 0) + { + enabledGraph.addPlotter(new SimplePlotter("AutoAFK")); + } + if (ess.getSettings().changeDisplayName()) + { + enabledGraph.addPlotter(new SimplePlotter("DisplayName")); + } + if (ess.getSettings().getChatRadius() >= 1) + { + enabledGraph.addPlotter(new SimplePlotter("LocalChat")); + } + */ final Graph depGraph = metrics.createGraph("Dependencies"); final Method method = ess.getPaymentMethod().getMethod(); if (method != null) @@ -167,7 +191,8 @@ public class MetricsStarter implements Runnable } depGraph.addPlotter(new SimplePlotter(method.getName() + " " + version)); } - depGraph.addPlotter(new SimplePlotter(ess.getPermissionsHandler().getName())); + //todo - verify + depGraph.addPlotter(new SimplePlotter(Permissions.getInstance().getName())); metrics.start(); diff --git a/Essentials/src/com/earth2me/essentials/ranks/RanksStorage.java b/Essentials/src/com/earth2me/essentials/ranks/RanksStorage.java index 85658863b..7e3eac946 100644 --- a/Essentials/src/com/earth2me/essentials/ranks/RanksStorage.java +++ b/Essentials/src/com/earth2me/essentials/ranks/RanksStorage.java @@ -23,13 +23,13 @@ public class RanksStorage extends AsyncStorageObjectHolder implements IRa @Override public void finishRead() { - throw new UnsupportedOperationException("Not supported yet."); + } @Override public void finishWrite() { - throw new UnsupportedOperationException("Not supported yet."); + } public RanksStorage(final IEssentials ess) { diff --git a/Essentials/src/com/earth2me/essentials/settings/Kit.java b/Essentials/src/com/earth2me/essentials/settings/Kit.java index 19267e6f3..ea0631124 100644 --- a/Essentials/src/com/earth2me/essentials/settings/Kit.java +++ b/Essentials/src/com/earth2me/essentials/settings/Kit.java @@ -16,4 +16,5 @@ public class Kit implements StorageObject @ListType(ItemStack.class) private List items = new ArrayList(); private Double delay; + } diff --git a/Essentials/src/com/earth2me/essentials/settings/SettingsHolder.java b/Essentials/src/com/earth2me/essentials/settings/SettingsHolder.java index 56aecf378..2554ba9e8 100644 --- a/Essentials/src/com/earth2me/essentials/settings/SettingsHolder.java +++ b/Essentials/src/com/earth2me/essentials/settings/SettingsHolder.java @@ -13,13 +13,13 @@ public class SettingsHolder extends AsyncStorageObjectHolder implement @Override public void finishRead() { - throw new UnsupportedOperationException("Not supported yet."); + } @Override public void finishWrite() { - throw new UnsupportedOperationException("Not supported yet."); + } private final transient AtomicBoolean debug = new AtomicBoolean(false); public SettingsHolder(final IEssentials ess) diff --git a/Essentials/src/com/earth2me/essentials/settings/SpawnsHolder.java b/Essentials/src/com/earth2me/essentials/settings/SpawnsHolder.java index c2dc0def2..c1826d9ef 100644 --- a/Essentials/src/com/earth2me/essentials/settings/SpawnsHolder.java +++ b/Essentials/src/com/earth2me/essentials/settings/SpawnsHolder.java @@ -33,13 +33,13 @@ public class SpawnsHolder extends AsyncStorageObjectHolder implements IE @Override public void finishRead() { - throw new UnsupportedOperationException("Not supported yet."); + } @Override public void finishWrite() { - throw new UnsupportedOperationException("Not supported yet."); + } public SpawnsHolder(final IEssentials ess) diff --git a/Essentials/src/com/earth2me/essentials/settings/WarpHolder.java b/Essentials/src/com/earth2me/essentials/settings/WarpHolder.java index a2facb824..a14db0339 100644 --- a/Essentials/src/com/earth2me/essentials/settings/WarpHolder.java +++ b/Essentials/src/com/earth2me/essentials/settings/WarpHolder.java @@ -14,13 +14,13 @@ public class WarpHolder extends AsyncStorageObjectHolder implements IWarp @Override public void finishRead() { - throw new UnsupportedOperationException("Not supported yet."); + } @Override public void finishWrite() { - throw new UnsupportedOperationException("Not supported yet."); + } private final String name; diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index 5c9015237..fdd229794 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -9,61 +9,22 @@ import com.earth2me.essentials.economy.register.Method; import com.earth2me.essentials.permissions.Permissions; import com.earth2me.essentials.utils.DateUtil; import com.earth2me.essentials.utils.Util; -import java.net.InetSocketAddress; import java.util.Calendar; -import java.util.Collection; import java.util.GregorianCalendar; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; -import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.logging.Level; import java.util.logging.Logger; import lombok.Cleanup; import lombok.Getter; import lombok.Setter; -import org.bukkit.Achievement; import org.bukkit.Bukkit; -import org.bukkit.Effect; -import org.bukkit.EntityEffect; -import org.bukkit.GameMode; -import org.bukkit.Instrument; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.Note; import org.bukkit.OfflinePlayer; -import org.bukkit.Server; -import org.bukkit.Statistic; -import org.bukkit.World; -import org.bukkit.block.Block; import org.bukkit.command.CommandSender; -import org.bukkit.conversations.Conversation; -import org.bukkit.conversations.ConversationAbandonedEvent; -import org.bukkit.entity.Arrow; -import org.bukkit.entity.Egg; -import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; -import org.bukkit.entity.Projectile; -import org.bukkit.entity.Snowball; -import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.InventoryView; -import org.bukkit.inventory.InventoryView.Property; import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.PlayerInventory; -import org.bukkit.map.MapView; -import org.bukkit.metadata.MetadataValue; -import org.bukkit.permissions.Permission; -import org.bukkit.permissions.PermissionAttachment; -import org.bukkit.permissions.PermissionAttachmentInfo; -import org.bukkit.plugin.Plugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.util.Vector; public class User extends UserBase implements IUser @@ -100,6 +61,7 @@ public class User extends UserBase implements IUser teleport = new Teleport(this, ess); } + public User(final OfflinePlayer offlinePlayer, final IEssentials ess) { super(offlinePlayer, ess); @@ -130,6 +92,12 @@ public class User extends UserBase implements IUser public void finishWrite() { } + + @Override + public void update(final Player base) + { + super.update(base); + } @Override public void checkCooldown(final UserData.TimestampType cooldownType, final double cooldown, final boolean set, final IPermission bypassPermission) throws CooldownException @@ -462,6 +430,7 @@ public class User extends UserBase implements IUser } //Returns true if status expired during this check + @Override public boolean checkBanTimeout(final long currentTime) { acquireReadLock(); @@ -482,6 +451,7 @@ public class User extends UserBase implements IUser } } + @Override public void updateActivity(final boolean broadcast) { acquireReadLock(); @@ -504,6 +474,7 @@ public class User extends UserBase implements IUser } } + @Override public void checkActivity() { @Cleanup @@ -548,11 +519,13 @@ public class User extends UserBase implements IUser } } + @Override public Location getAfkPosition() { return afkPosition; } + @Override public boolean toggleGodModeEnabled() { if (!isGodModeEnabled()) @@ -562,6 +535,7 @@ public class User extends UserBase implements IUser return super.toggleGodmode(); } + @Override public boolean isGodModeEnabled() { acquireReadLock(); @@ -730,7 +704,6 @@ public class User extends UserBase implements IUser } return cost <= mon; } - @Override public void updateMoneyCache(double userMoney) { if (super.getMoney() != userMoney) { @@ -767,6 +740,7 @@ public class User extends UserBase implements IUser } } + @Override public void toggleVanished() { vanished = !vanished; @@ -779,1051 +753,4 @@ public class User extends UserBase implements IUser ess.getVanishedPlayers().remove(getName()); } } - - - //start// - @Override - public void setDisplayName(String string) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public String getPlayerListName() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setPlayerListName(String string) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setCompassTarget(Location lctn) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Location getCompassTarget() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public InetSocketAddress getAddress() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void sendRawMessage(String string) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void kickPlayer(String string) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void chat(String string) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean performCommand(String string) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isSneaking() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setSneaking(boolean bln) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isSprinting() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setSprinting(boolean bln) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void saveData() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void loadData() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setSleepingIgnored(boolean bln) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isSleepingIgnored() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void playNote(Location lctn, byte b, byte b1) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void playNote(Location lctn, Instrument i, Note note) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void playEffect(Location lctn, Effect effect, int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void playEffect(Location lctn, Effect effect, T t) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void sendBlockChange(Location lctn, Material mtrl, byte b) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean sendChunkChange(Location lctn, int i, int i1, int i2, byte[] bytes) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void sendBlockChange(Location lctn, int i, byte b) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void sendMap(MapView mv) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void updateInventory() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void awardAchievement(Achievement a) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void incrementStatistic(Statistic ststc) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void incrementStatistic(Statistic ststc, int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void incrementStatistic(Statistic ststc, Material mtrl) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void incrementStatistic(Statistic ststc, Material mtrl, int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setPlayerTime(long l, boolean bln) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public long getPlayerTime() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public long getPlayerTimeOffset() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isPlayerTimeRelative() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void resetPlayerTime() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void giveExp(int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public float getExp() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setExp(float f) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getLevel() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setLevel(int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getTotalExperience() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setTotalExperience(int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public float getExhaustion() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setExhaustion(float f) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public float getSaturation() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setSaturation(float f) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getFoodLevel() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setFoodLevel(int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setBedSpawnLocation(Location lctn) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean getAllowFlight() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setAllowFlight(boolean bln) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void hidePlayer(Player player) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void showPlayer(Player player) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean canSee(Player player) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isFlying() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setFlying(boolean bln) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public PlayerInventory getInventory() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean setWindowProperty(Property prprt, int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public InventoryView getOpenInventory() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public InventoryView openInventory(Inventory invntr) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public InventoryView openWorkbench(Location lctn, boolean bln) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public InventoryView openEnchanting(Location lctn, boolean bln) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void openInventory(InventoryView iv) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void closeInventory() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public ItemStack getItemInHand() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setItemInHand(ItemStack is) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public ItemStack getItemOnCursor() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setItemOnCursor(ItemStack is) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isSleeping() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getSleepTicks() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public GameMode getGameMode() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setGameMode(GameMode gm) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isBlocking() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getHealth() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setHealth(int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getMaxHealth() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public double getEyeHeight() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public double getEyeHeight(boolean bln) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Location getEyeLocation() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public List getLineOfSight(HashSet hs, int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Block getTargetBlock(HashSet hs, int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public List getLastTwoTargetBlocks(HashSet hs, int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Egg throwEgg() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Snowball throwSnowball() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Arrow shootArrow() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public T launchProjectile(Class type) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getRemainingAir() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setRemainingAir(int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getMaximumAir() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setMaximumAir(int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void damage(int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void damage(int i, Entity entity) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getMaximumNoDamageTicks() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setMaximumNoDamageTicks(int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getLastDamage() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setLastDamage(int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getNoDamageTicks() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setNoDamageTicks(int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Player getKiller() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean addPotionEffect(PotionEffect pe) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean addPotionEffect(PotionEffect pe, boolean bln) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean addPotionEffects(Collection clctn) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean hasPotionEffect(PotionEffectType pet) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void removePotionEffect(PotionEffectType pet) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Collection getActivePotionEffects() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Location getLocation() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setVelocity(Vector vector) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Vector getVelocity() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public World getWorld() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean teleport(Location lctn) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean teleport(Location lctn, TeleportCause tc) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean teleport(Entity entity) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean teleport(Entity entity, TeleportCause tc) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public List getNearbyEntities(double d, double d1, double d2) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getEntityId() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getFireTicks() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getMaxFireTicks() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setFireTicks(int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void remove() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isDead() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Server getServer() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Entity getPassenger() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean setPassenger(Entity entity) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isEmpty() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean eject() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public float getFallDistance() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setFallDistance(float f) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setLastDamageCause(EntityDamageEvent ede) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public EntityDamageEvent getLastDamageCause() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public UUID getUniqueId() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public int getTicksLived() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setTicksLived(int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void playEffect(EntityEffect ee) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public EntityType getType() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isInsideVehicle() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean leaveVehicle() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Entity getVehicle() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setMetadata(String string, MetadataValue mv) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public List getMetadata(String string) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean hasMetadata(String string) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void removeMetadata(String string, Plugin plugin) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isPermissionSet(String string) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isPermissionSet(Permission prmsn) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean hasPermission(String string) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public PermissionAttachment addAttachment(Plugin plugin, String string, boolean bln) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public PermissionAttachment addAttachment(Plugin plugin) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public PermissionAttachment addAttachment(Plugin plugin, String string, boolean bln, int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public PermissionAttachment addAttachment(Plugin plugin, int i) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void removeAttachment(PermissionAttachment pa) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void recalculatePermissions() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Set getEffectivePermissions() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isOp() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setOp(boolean bln) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isConversing() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void acceptConversationInput(String string) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean beginConversation(Conversation c) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void abandonConversation(Conversation c) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void abandonConversation(Conversation c, ConversationAbandonedEvent cae) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void sendMessage(String string) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void sendMessage(String[] strings) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isOnline() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isBanned() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean isWhitelisted() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setWhitelisted(boolean bln) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Player getPlayer() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public long getFirstPlayed() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public long getLastPlayed() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public boolean hasPlayedBefore() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Map serialize() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void sendPluginMessage(Plugin plugin, String string, byte[] bytes) - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public Set getListeningPluginChannels() - { - throw new UnsupportedOperationException("Not supported yet."); - } - - @Override - public void setName(String name) - { - throw new UnsupportedOperationException("Not supported yet."); - } - //end// } diff --git a/Essentials/src/com/earth2me/essentials/user/UserData.java b/Essentials/src/com/earth2me/essentials/user/UserData.java index d61d21a49..b181a5f24 100644 --- a/Essentials/src/com/earth2me/essentials/user/UserData.java +++ b/Essentials/src/com/earth2me/essentials/user/UserData.java @@ -13,7 +13,7 @@ public class UserData implements StorageObject { public enum TimestampType { - JAIL, MUTE, LASTHEAL, LASTTELEPORT, LOGIN, LOGOUT + JAIL, MUTE, LASTHEAL, LASTTELEPORT, LOGIN, LOGOUT, KIT } private String nickname; private Double money; diff --git a/Essentials/test/com/earth2me/essentials/UtilTest.java b/Essentials/test/com/earth2me/essentials/UtilTest.java index fb75d19b0..94cd2877d 100644 --- a/Essentials/test/com/earth2me/essentials/UtilTest.java +++ b/Essentials/test/com/earth2me/essentials/UtilTest.java @@ -189,7 +189,7 @@ public class UtilTest extends TestCase assertEquals("_-", Util.sanitizeFileName("../")); assertEquals("_-", Util.sanitizeFileName("\"")); assertEquals("_-", Util.sanitizeFileName("<>?:*.")); - assertEquals("a-0fa", Util.sanitizeFileName("aä")); + assertEquals("a-0fa", Util.sanitizeFileName("aä")); } catch (InvalidNameException ex) diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectHolder.java b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectHolder.java index c2ad4f8d3..8c3add157 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectHolder.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/ProtectHolder.java @@ -23,12 +23,12 @@ public class ProtectHolder extends AsyncStorageObjectHolder @Override public void finishRead() { - throw new UnsupportedOperationException("Not supported yet."); + } @Override public void finishWrite() { - throw new UnsupportedOperationException("Not supported yet."); + } } -- cgit v1.2.3 From ff5a82a14cbffbbd65e9baefb09d2c95305124c1 Mon Sep 17 00:00:00 2001 From: ementalo Date: Wed, 6 Jun 2012 01:53:34 +0100 Subject: 2.9 -> 3.0 merge --- .../src/com/earth2me/essentials/api/IUser.java | 2 + .../earth2me/essentials/commands/Commandkit.java | 6 --- .../essentials/commands/Commandpowertool.java | 1 + .../essentials/craftbukkit/FakeExplosion.java | 51 ++++++++++++++++++++++ .../listener/EssentialsEntityListener.java | 35 +++++++++++++-- .../essentials/permissions/Permissions.java | 1 + .../com/earth2me/essentials/settings/General.java | 12 ++++- .../src/com/earth2me/essentials/user/User.java | 4 ++ .../src/com/earth2me/essentials/user/UserBase.java | 9 +--- .../com/earth2me/essentials/EssentialsUpgrade.java | 3 +- .../essentials/chat/EssentialsChatPlayer.java | 21 +-------- .../chat/EssentialsLocalChatEventListener.java | 25 ++++++----- .../earth2me/essentials/geoip/ConfigHolder.java | 12 +++++ .../protect/EssentialsProtectEntityListener.java | 1 + .../com/earth2me/essentials/signs/SignBalance.java | 2 +- .../essentials/signs/SignBlockListener.java | 30 +++++-------- .../essentials/signs/SignEntityListener.java | 2 +- .../src/com/earth2me/essentials/signs/SignKit.java | 10 ++--- .../essentials/signs/SignPlayerListener.java | 2 +- .../essentials/signs/SignsConfigHolder.java | 23 ++++++++++ .../update/states/InstallationFinishedEvent.java | 8 +--- 21 files changed, 174 insertions(+), 86 deletions(-) create mode 100644 Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java diff --git a/Essentials/src/com/earth2me/essentials/api/IUser.java b/Essentials/src/com/earth2me/essentials/api/IUser.java index b7a22ac4d..d9811a9af 100644 --- a/Essentials/src/com/earth2me/essentials/api/IUser.java +++ b/Essentials/src/com/earth2me/essentials/api/IUser.java @@ -120,6 +120,8 @@ public interface IUser extends Player, IStorageObjectHolder, IReload, void setInvSee(boolean invsee); + boolean hasInvulnerabilityAfterTeleport(); + void update(final Player base); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java index a6c1183ad..4130429f8 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java @@ -90,16 +90,10 @@ public class Commandkit extends EssentialsCommand throw new Exception(_("noKitPermission", "essentials.kit." + kitName)); } final Kit kit = ess.getKits().getKit(kitName); - - - ess.getKits().checkTime(userFrom, kit); - final Trade charge = new Trade("kit-" + kitName, ess); charge.isAffordableFor(userFrom); - ess.getKits().sendKit(userTo, kit); - charge.charge(userFrom); userTo.sendMessage(_("kitGive", kitName)); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java index 1f5a6912f..6cf391bf7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java @@ -34,6 +34,7 @@ public class Commandpowertool extends EssentialsCommand } final String itemName = itemStack.getType().toString().toLowerCase(Locale.ENGLISH).replaceAll("_", " "); + user.acquireReadLock(); List powertools = user.getData().getPowertool(itemStack.getType()); if (command != null && !command.isEmpty()) { diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java new file mode 100644 index 000000000..934d94fa2 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeExplosion.java @@ -0,0 +1,51 @@ +package com.earth2me.essentials.craftbukkit; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; +import net.minecraft.server.ChunkPosition; +import net.minecraft.server.Packet60Explosion; +import org.bukkit.Location; +import org.bukkit.Server; +import org.bukkit.block.Block; +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.craftbukkit.CraftWorld; +import org.bukkit.entity.Player; +import org.bukkit.event.entity.EntityExplodeEvent; + + +public class FakeExplosion +{ + public static void createExplosion(final EntityExplodeEvent event, final Server server, final Player[] players) + { + try + { + final Set set = new HashSet(event.blockList().size()); + final List blocksUnderPlayers = new ArrayList(players.length); + final Location loc = event.getLocation(); + for (Player player : players) + { + if (player.getWorld().equals(loc.getWorld())) + { + blocksUnderPlayers.add(new ChunkPosition(player.getLocation().getBlockX(), player.getLocation().getBlockY() - 1, player.getLocation().getBlockZ())); + } + } + for (Block block : event.blockList()) + { + final ChunkPosition cp = new ChunkPosition(block.getX(), block.getY(), block.getZ()); + if (!blocksUnderPlayers.contains(cp)) + { + set.add(cp); + } + } + ((CraftServer)server).getHandle().sendPacketNearby(loc.getX(), loc.getY(), loc.getZ(), 64.0, ((CraftWorld)loc.getWorld()).getHandle().worldProvider.dimension, new Packet60Explosion(loc.getX(), loc.getY(), loc.getZ(), 3.0F, set)); + } + catch (Throwable ex) + { + Logger.getLogger("Minecraft").log(Level.SEVERE, null, ex); + } + } +} diff --git a/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java index 036da57d2..675d861f5 100644 --- a/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java @@ -5,9 +5,11 @@ import com.earth2me.essentials.api.IEssentials; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.permissions.Permissions; +import com.earth2me.essentials.user.UserData.TimestampType; import java.util.List; import lombok.Cleanup; import org.bukkit.Material; +import org.bukkit.entity.Ageable; import org.bukkit.entity.Animals; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -33,34 +35,59 @@ public class EssentialsEntityListener implements Listener { final Entity eAttack = event.getDamager(); final Entity eDefend = event.getEntity(); + if (eDefend instanceof Player && eAttack instanceof Player) { @Cleanup final IUser attacker = ess.getUser((Player)eAttack); + @Cleanup + final IUser defender = ess.getUser((Player)eDefend); + @Cleanup + ISettings settings = ess.getSettings(); + settings.acquireReadLock(); attacker.acquireReadLock(); + defender.acquireReadLock(); + attacker.updateActivity(true); + if (settings.getData().getGeneral().getLoginAttackDelay() > 0 && !Permissions.PVPDELAY_EXEMPT.isAuthorized(attacker) + && (System.currentTimeMillis() < (attacker.getTimestamp(TimestampType.LOGIN) + settings.getData().getGeneral().getLoginAttackDelay()))) + { + event.setCancelled(true); + } + if (attacker.hasInvulnerabilityAfterTeleport() || defender.hasInvulnerabilityAfterTeleport()) + { + event.setCancelled(true); + } final ItemStack itemstack = attacker.getItemInHand(); final List commandList = attacker.getData().getPowertool(itemstack.getType()); if (commandList != null && !commandList.isEmpty()) { - for (String command : commandList) + for (final String command : commandList) { if (command != null && !command.isEmpty()) { - attacker.getServer().dispatchCommand(attacker, command.replaceAll("\\{player\\}", ((Player)eDefend).getName())); + ess.scheduleSyncDelayedTask( + new Runnable() + { + @Override + public void run() + { + attacker.getServer().dispatchCommand(attacker.getBase(), command.replaceAll("\\{player\\}", defender.getName())); + } + }); event.setCancelled(true); return; } } } } - else if (eDefend instanceof Animals && eAttack instanceof Player) + else if (eDefend instanceof Ageable && eAttack instanceof Player) { final Player player = (Player)eAttack; final ItemStack hand = player.getItemInHand(); if (hand != null && hand.getType() == Material.MILK_BUCKET) { - ((Animals)eDefend).setBaby(); + ((Ageable)eDefend).setBaby(); hand.setType(Material.BUCKET); player.setItemInHand(hand); player.updateInventory(); diff --git a/Essentials/src/com/earth2me/essentials/permissions/Permissions.java b/Essentials/src/com/earth2me/essentials/permissions/Permissions.java index aa6bfa583..8cc9b060c 100644 --- a/Essentials/src/com/earth2me/essentials/permissions/Permissions.java +++ b/Essentials/src/com/earth2me/essentials/permissions/Permissions.java @@ -59,6 +59,7 @@ public enum Permissions implements IPermission OVERSIZEDSTACKS(PermissionDefault.FALSE), POWERTOOL_APPEND, PTIME_OTHERS, + PVPDELAY_EXEMPT, REPAIR_ARMOR, REPAIR_ENCHANTED, SEEN_BANREASON, diff --git a/Essentials/src/com/earth2me/essentials/settings/General.java b/Essentials/src/com/earth2me/essentials/settings/General.java index f1b827675..9647d3bed 100644 --- a/Essentials/src/com/earth2me/essentials/settings/General.java +++ b/Essentials/src/com/earth2me/essentials/settings/General.java @@ -80,9 +80,9 @@ public class General implements StorageObject "This applies to /world, /back, /tp[a|o][here|all], but not warps.", "Give someone permission to teleport to a world with essentials.world." }) - private boolean worldTeleportPermissions = false; - + private boolean worldTeleportPermissions = false; private boolean worldHomePermissions = false; + @Comment("Prevent creatures spawning") private Map creatureSpawn = new HashMap(); @@ -95,4 +95,12 @@ public class General implements StorageObject } return creatureSpawn.get(creatureName); } + + @Comment("Delay to wait before people can cause attack damage after logging in ") + private long loginAttackDelay = 0; + + public long getLoginAttackDelay() + { + return loginAttackDelay * 1000; + } } diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index fdd229794..fcb601c9a 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -739,6 +739,10 @@ public class User extends UserBase implements IUser teleportInvulnerabilityTimestamp = 0; } } + public boolean hasInvulnerabilityAfterTeleport() + { + return teleportInvulnerabilityTimestamp != 0 && teleportInvulnerabilityTimestamp >= System.currentTimeMillis(); + } @Override public void toggleVanished() diff --git a/Essentials/src/com/earth2me/essentials/user/UserBase.java b/Essentials/src/com/earth2me/essentials/user/UserBase.java index 4e0ab75fb..7daeba0c6 100644 --- a/Essentials/src/com/earth2me/essentials/user/UserBase.java +++ b/Essentials/src/com/earth2me/essentials/user/UserBase.java @@ -113,14 +113,7 @@ public abstract class UserBase extends AsyncStorageObjectHolder implem @Override public Location getBedSpawnLocation() { - if (isOnlineUser()) - { - return base.getBedSpawnLocation(); - } - else - { - return offlinePlayer.getBedSpawnLocation(); - } + return base.getBedSpawnLocation(); } @Override diff --git a/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java index 97338579d..865af41e3 100644 --- a/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java +++ b/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java @@ -696,7 +696,8 @@ public class EssentialsUpgrade { return; } - ess.getSettings().setMetricsEnabled(false); + //todo - metrics + // ess.getSettings().setMetricsEnabled(false); doneFile.setProperty("warnMetrics", true); doneFile.save(); } diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java index acf08a5dd..7618a66ab 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java @@ -112,6 +112,7 @@ public abstract class EssentialsChatPlayer implements Listener protected void handleLocalChat(final PlayerChatEvent event, final ChatStore chatStore) { + long radius = 0; ISettings settings = ess.getSettings(); settings.acquireReadLock(); @@ -143,26 +144,6 @@ public abstract class EssentialsChatPlayer implements Listener event.setFormat(_(format.toString(), event.getFormat())); return; } - if (!onlineUser.equals(sender)) - { - if (onlineUser.isAuthorized("essentials.chat.spy")) - { - type = type.concat(_("chatTypeSpy")); - } - else - { - final Location playerLoc = onlineUser.getLocation(); - if (playerLoc.getWorld() != world) - { - continue; - } - final double delta = playerLoc.distanceSquared(loc); - if (delta > chatStore.getRadius()) - { - continue; - } - } - } final StringBuilder errorMsg = new StringBuilder(); errorMsg.append("notAllowedTo").append(chatStore.getType().substring(0, 1).toUpperCase(Locale.ENGLISH)).append(chatStore.getType().substring(1)); diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java index 401fa1142..8788d755d 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsLocalChatEventListener.java @@ -44,28 +44,29 @@ public class EssentialsLocalChatEventListener implements Listener } if (!user.equals(sender)) { - final Location playerLoc = user.getLocation(); - if (playerLoc.getWorld() != world) + if (Permissions.CHAT_SPY.isAuthorized(user)) { - continue; + type = type.concat(_("chatTypeSpy")); } - final double delta = playerLoc.distanceSquared(loc); - - if (delta > event.getRadius()) + else { - if (Permissions.CHAT_SPY.isAuthorized(user)) + final Location playerLoc = user.getLocation(); + if (playerLoc.getWorld() != world) { - type = type.concat(_("chatTypeSpy")); + continue; } - else + final double delta = playerLoc.distanceSquared(loc); + + if (delta > event.getRadius()) { continue; } } - } - final String message = type.concat(String.format(event.getFormat(), sender.getDisplayName(), event.getMessage())); - user.sendMessage(message); + final String message = type.concat(String.format(event.getFormat(), sender.getDisplayName(), event.getMessage())); + user.sendMessage(message); + } } + } } \ No newline at end of file diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/ConfigHolder.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/ConfigHolder.java index e2d82d644..bf45e54c6 100644 --- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/ConfigHolder.java +++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/ConfigHolder.java @@ -24,4 +24,16 @@ public class ConfigHolder extends AsyncStorageObjectHolder return new File(geoip.getDataFolder(), "config.yml"); } + @Override + public void finishRead() + { + + } + + @Override + public void finishWrite() + { + + } + } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java index e475296b5..8cd0e271b 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectEntityListener.java @@ -1,6 +1,7 @@ package com.earth2me.essentials.protect; import com.earth2me.essentials.api.IEssentials; +import com.earth2me.essentials.craftbukkit.FakeExplosion; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignBalance.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignBalance.java index 77f82bdb5..cb8e568aa 100644 --- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignBalance.java +++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignBalance.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.signs; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IEssentials; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.Util; +import com.earth2me.essentials.utils.Util; public class SignBalance extends EssentialsSign diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignBlockListener.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignBlockListener.java index c678c2efa..a2465c76d 100644 --- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignBlockListener.java +++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignBlockListener.java @@ -1,8 +1,9 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.api.IEssentials; +import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.Util; +import com.earth2me.essentials.utils.Util; import java.util.logging.Level; import java.util.logging.Logger; import org.bukkit.Material; @@ -32,7 +33,9 @@ public class SignBlockListener implements Listener @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockBreak(final BlockBreakEvent event) { - if (ess.getSettings().areSignsDisabled()) + ISettings settings = ess.getSettings(); + settings.acquireReadLock(); + if (plugin.getSettings().areSignsDisabled()) { return; } @@ -65,15 +68,7 @@ public class SignBlockListener implements Listener LOGGER.log(Level.INFO, "Prevented that a block was broken next to a sign."); return true; } - for (EssentialsSign sign : ess.getSettings().enabledSigns()) - { - if (sign.getBlocks().contains(block.getType()) - && !sign.onBlockBreak(block, player, ess)) - { - LOGGER.log(Level.INFO, "A block was protected by a sign."); - return true; - } - for (EssentialsSign sign : plugin.getSettings().getEnabledSigns()) + for (EssentialsSign sign : plugin.getSettings().getEnabledSigns()) { if (sign.getBlocks().contains(block.getType()) && !sign.onBlockBreak(block, player, ess)) @@ -81,19 +76,18 @@ public class SignBlockListener implements Listener LOGGER.log(Level.INFO, "A block was protected by a sign."); return true; } - } - } + } return false; } @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onSignChange(final SignChangeEvent event) { - if (ess.getSettings().areSignsDisabled()) + if (plugin.getSettings().areSignsDisabled()) { return; } - User user = ess.getUser(event.getPlayer()); + IUser user = ess.getUser(event.getPlayer()); for (int i = 0; i < 4; i++) { @@ -120,7 +114,7 @@ public class SignBlockListener implements Listener @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onBlockPlace(final BlockPlaceEvent event) { - if (ess.getSettings().areSignsDisabled()) + if (plugin.getSettings().areSignsDisabled()) { return; } @@ -154,7 +148,7 @@ public class SignBlockListener implements Listener @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onBlockBurn(final BlockBurnEvent event) { - if (ess.getSettings().areSignsDisabled()) + if (plugin.getSettings().areSignsDisabled()) { return; } @@ -182,7 +176,7 @@ public class SignBlockListener implements Listener @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onBlockIgnite(final BlockIgniteEvent event) { - if (ess.getSettings().areSignsDisabled()) + if (plugin.getSettings().areSignsDisabled()) { return; } diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignEntityListener.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignEntityListener.java index 00ebc60d0..213b0e125 100644 --- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignEntityListener.java +++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignEntityListener.java @@ -48,7 +48,7 @@ public class SignEntityListener implements Listener @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onEntityChangeBlock(final EntityChangeBlockEvent event) { - if (ess.getSettings().areSignsDisabled()) + if (plugin.getSettings().areSignsDisabled()) { return; } diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignKit.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignKit.java index 46bbb65db..b33e05a35 100644 --- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignKit.java +++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignKit.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.signs; +import com.earth2me.essentials.Kits; import com.earth2me.essentials.api.ChargeException; import com.earth2me.essentials.economy.Trade; import com.earth2me.essentials.api.IEssentials; @@ -58,11 +59,10 @@ public class SignKit extends EssentialsSign final Trade charge = getTrade(sign, 3, ess); charge.isAffordableFor(player); try - { - final Kit kit = ess.getKits().getKit(kitName); - Kit.checkTime(player, kitName, kit); - final List items = Kit.getItems(player, kit); - Kit.expandItems(ess, player, items); + {; + final Kit kit = ess.getKits().getKit(kitName); + ess.getKits().checkTime(player, kit); + ess.getKits().sendKit(player,kit); charge.charge(player); } catch (Exception ex) diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignPlayerListener.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignPlayerListener.java index 1a401ce64..9d597820f 100644 --- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignPlayerListener.java +++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignPlayerListener.java @@ -25,7 +25,7 @@ public class SignPlayerListener implements Listener @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onPlayerInteract(final PlayerInteractEvent event) { - if (ess.getSettings().areSignsDisabled() || event.getAction() != Action.RIGHT_CLICK_BLOCK) + if (plugin.getSettings().areSignsDisabled() || event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; } diff --git a/EssentialsSigns/src/com/earth2me/essentials/signs/SignsConfigHolder.java b/EssentialsSigns/src/com/earth2me/essentials/signs/SignsConfigHolder.java index dcf436b03..d5ece9f69 100644 --- a/EssentialsSigns/src/com/earth2me/essentials/signs/SignsConfigHolder.java +++ b/EssentialsSigns/src/com/earth2me/essentials/signs/SignsConfigHolder.java @@ -12,6 +12,7 @@ public class SignsConfigHolder extends AsyncStorageObjectHolder { private final Plugin plugin; private Set enabledSigns = new HashSet(); + private boolean signsEnabled = false; public SignsConfigHolder(final IEssentials ess, final Plugin plugin) { @@ -24,6 +25,11 @@ public class SignsConfigHolder extends AsyncStorageObjectHolder Map signs = getData().getSigns(); for (Map.Entry entry : signs.entrySet()) { + if(entry.getKey().trim().toUpperCase(Locale.ENGLISH).equals("COLOR") || entry.getKey().trim().toUpperCase(Locale.ENGLISH).equals("COLOUR")) + { + signsEnabled = true; + continue; + } Signs sign = Signs.valueOf(entry.getKey().toUpperCase(Locale.ENGLISH)); if (sign != null && entry.getValue()) { @@ -61,4 +67,21 @@ public class SignsConfigHolder extends AsyncStorageObjectHolder { return enabledSigns; } + + public boolean areSignsDisabled() + { + return !signsEnabled; + } + + @Override + public void finishRead() + { + + } + + @Override + public void finishWrite() + { + + } } diff --git a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java index c00ef38af..194d7e98e 100644 --- a/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java +++ b/EssentialsUpdate/src/com/earth2me/essentials/update/states/InstallationFinishedEvent.java @@ -12,11 +12,5 @@ public class InstallationFinishedEvent extends Event public HandlerList getHandlers() { return handlers; - } - - @Override - public HandlerList getHandlers() - { - throw new UnsupportedOperationException("Not supported yet."); - } + } } -- cgit v1.2.3 From 5c0f944b2b0bd7e335dabe54cccaf12d5a3b9cba Mon Sep 17 00:00:00 2001 From: ementalo Date: Wed, 6 Jun 2012 02:12:23 +0100 Subject: 2.9 -> 3.0 Missing inventory events. Updated polish translations --- .../listener/EssentialsPlayerListener.java | 35 +++++ .../essentials/permissions/Permissions.java | 2 + Essentials/src/messages_pl.properties | 142 ++++++++++----------- 3 files changed, 108 insertions(+), 71 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java index 978794b75..b2071d6d4 100644 --- a/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java @@ -22,13 +22,18 @@ import lombok.Cleanup; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Server; +import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryCloseEvent; +import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.player.PlayerLoginEvent.Result; import org.bukkit.event.player.*; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; +import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; @@ -435,4 +440,34 @@ public class EssentialsPlayerListener implements Listener event.setCancelled(true); } } + + @EventHandler(priority = EventPriority.LOWEST) + public void onInventoryClickEvent(final InventoryClickEvent event) + { + if (event.getView().getTopInventory().getType() == InventoryType.PLAYER) + { + final IUser user = ess.getUser(event.getWhoClicked()); + final InventoryHolder invHolder = event.getView().getTopInventory().getHolder(); + if (invHolder != null && invHolder instanceof HumanEntity) + { + final IUser invOwner = ess.getUser((HumanEntity)invHolder); + if (user.isInvSee() && (!Permissions.INVSEE_MODIFY.isAuthorized(user) + || Permissions.INVSEE_PREVENT_MODIFY.isAuthorized(invOwner) + || !invOwner.isOnline())) + { + event.setCancelled(true); + } + } + } + } + + @EventHandler(priority = EventPriority.MONITOR) + public void onInventoryCloseEvent(final InventoryCloseEvent event) + { + if (event.getView().getTopInventory().getType() == InventoryType.PLAYER) + { + final IUser user = ess.getUser(event.getPlayer()); + user.setInvSee(false); + } + } } diff --git a/Essentials/src/com/earth2me/essentials/permissions/Permissions.java b/Essentials/src/com/earth2me/essentials/permissions/Permissions.java index 8cc9b060c..ddfa78348 100644 --- a/Essentials/src/com/earth2me/essentials/permissions/Permissions.java +++ b/Essentials/src/com/earth2me/essentials/permissions/Permissions.java @@ -42,6 +42,8 @@ public enum Permissions implements IPermission HOME_OTHERS, JAIL_EXEMPT, JOINFULLSERVER, + INVSEE_MODIFY, + INVSEE_PREVENT_MODIFY, KICK_EXEMPT, KICK_NOTIFY, LIST_HIDDEN, diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties index 1ca936863..a6bff70f6 100644 --- a/Essentials/src/messages_pl.properties +++ b/Essentials/src/messages_pl.properties @@ -1,7 +1,7 @@ #version: TeamCity # Single quotes have to be doubled: '' # Translations start here -# by: losdamianos +# by: losdamianos, edited by Rutr action=* {0} {1} addedToAccount=\u00a7a{0} zostalo dodane do twojego konta. addedToOthersAccount=\u00a7a{0} dodane do konta {1}\u00a7. Nowy stan konta: {2}. @@ -9,7 +9,7 @@ alertBroke=broke: alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} at: {3} alertPlaced=postawil: alertUsed=uzyl: -autoAfkKickReason=Zostales wyrzucony z serwera za pozostawanie bez ruchu przez wiecej niz {0} minut. +autoAfkKickReason=Zostales wyrzucony z serwera za nie ruszanie sie przez wiecej niz {0} minut. backAfterDeath=\u00a77Uzyj komendy /back aby powrocic na miejsce swojej smierci. backUsageMsg=\u00a77Transportowanie do poprzedniej lokacji. backupDisabled=Zewnetrzny skrypt backupu nie zostal skonfigurowany. @@ -23,10 +23,10 @@ bannedIpsFileError=Blad odczytu banned-ips.txt bannedIpsFileNotFound=banned-ips.txt nie znaleziony bannedPlayersFileError=Blad odczytu banned-players.txt bannedPlayersFileNotFound=banned-players.txt nie znaleziony -bigTreeFailure=\u00a7cGenerator duzych drzew zaliczyl blad. Sprobuj ponownie na ziemi lub trawie. +bigTreeFailure=\u00a7cNie mozna tutaj postawic duzego drzewa. Sprobuj ponownie na ziemi lub trawie. bigTreeSuccess= \u00a77Utworzono duze drzewo. -blockList=Essentials relayed the following commands to another plugin: -broadcast=[\u00a7cBroadcast\u00a7f]\u00a7a {0} +blockList=Essentials przekazuje nastepujace polecenie do innej wtyczki: +broadcast=[\u00a7cOgloszenie\u00a7f]\u00a7a {0} buildAlert=\u00a7cNie mozesz tu budowac bukkitFormatChanged=Format wersji Bukkita jest zmieniony. Wersja nie jest sprawdzana. burnMsg=\u00a77Podpaliles {0} na {1} sekund. @@ -35,23 +35,23 @@ cantFindGeoIpDB=Nie mozna znalezc bazy danych GeoIP! cantReadGeoIpDB=Odczytywanie bazy danych GeoIP zawiodlo! cantSpawnItem=\u00a7cNie mozesz stworzyc przedmiotu {0}. chatTypeLocal=[L] -chatTypeSpy=[Spy] +chatTypeSpy=[Szpieg] commandFailed=Komenda {0} zawiodla. commandHelpFailedForPlugin=Blad podczas uzyskiwania pomocy dla: {0} -commandNotLoaded=\u00a7cKomenda {0} jest zaladowana nieprawidlowo.. -compassBearing=\u00a77Bearing: {0} ({1} degrees). -configFileMoveError=Failed to move config.yml to backup location. -configFileRenameError=Failed to rename temp file to config.yml +commandNotLoaded=\u00a7cKomenda {0} nie jest zaladowana! +compassBearing=\u00a77Bearing: {0} ({1} stopni). +configFileMoveError=Nie udalo sie przeniesc config.yml do lokalizacji backupa. +configFileRenameError=Nie udalo sie zmienic nazwy tymczasowego pliku na config.yml connectedPlayers=Obecni gracze: connectionFailed=Blad podczas otwierania polaczenia. cooldownWithMessage=\u00a7cCooldown: {0} -corruptNodeInConfig=\u00a74Notice: Your configuration file has a corrupt {0} node. -couldNotFindTemplate=Could not find template {0} -creatingConfigFromTemplate=Creating config from template: {0} +corruptNodeInConfig=\u00a74Notice: Twoj plik konfiguracyjny ma uszkodzony wpis: {0} +couldNotFindTemplate=Nie mozna znajsc szablonu: {0} +creatingConfigFromTemplate=tworzenie konfiguracji z szablonu: {0} creatingEmptyConfig=Stworzono pusty config: {0} -creative=Tworczy +creative=Kreatywny currency={0}{1} -currentWorld=Current World: {0} +currentWorld=Biezacy swiat: {0} day=dzien days=dnie defaultBanReason=Admin ma zawsze racje! @@ -119,28 +119,28 @@ helpMatching=\u00a77Komendy odpowiadajace "{0}": helpOp=\u00a7c[HelpOp]\u00a7f \u00a77{0}:\u00a7f {1} helpPages=Strona \u00a7c{0}\u00a7f z \u00a7c{1}\u00a7f: helpPlugin=\u00a74{0}\u00a7f: Plugin Help: /help {1} -holeInFloor=Czarna dziura -homeSet=\u00a77Posterunek ustawiono -homeSetToBed=\u00a77Twoj posterunek znajduje sie teraz w tym lozku. -homes=Posterunki: {0} +holeInFloor=Kosmos +homeSet=\u00a77Dom ustawiono +homeSetToBed=\u00a77Twoj dom znajduje sie teraz w tym lozku. +homes=Domy: {0} hour=godzina hours=godziny ignorePlayer=Od tej chwili ignorujesz gracza {0}. -illegalDate=Illegal date format. +illegalDate=Nie prawidlowy format daty. infoChapter=Wybierz rozdzial: infoChapterPages=Rozdzial {0}, strona \u00a7c{1}\u00a7f z \u00a7c{2}\u00a7f: infoFileDoesNotExist=Plik \u0093info.txt\u0094 nie istnieje. Tworzenie tego pliku. -infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Page \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- +infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Strona \u00a74{0}\u00a76/\u00a74{1} \u00a7e---- infoUnknownChapter=Nieznany rozdzial. invBigger=Ekwipunek innego gracza jest wiekszy niz Twoj. invRestored=Twoj ekwipunek zostal przywrocony. invSee=Widzisz ekwipunek {0}. invSeeHelp=Wpisz /invsee aby przywrocic swoj ekwipunek. invalidCharge=\u00a7cInvalid charge. -invalidHome=Posterunek {0} nie istnieje. +invalidHome=Dom {0} nie istnieje. invalidMob=Niepoprawny typ moba.. invalidServer=Niepoprawny serwer! -invalidSignLine=Linijka {0} na znaku jest bledna. +invalidSignLine=Linia {0} na znaku jest bledna. invalidWorld=\u00a7cNieprawidlowy swiat. inventoryCleared=\u00a77Ekwipunek oprozniony. inventoryClearedOthers=\u00a77Ekwipunek \u00a7c{0}\u00a77 oprozniony. @@ -162,40 +162,40 @@ jailReleased=\u00a77Gracz \u00a7e{0}\u00a77 wypuszczony z wiezienia. jailReleasedPlayerNotify=\u00a77Zostales zwolniony! jailSentenceExtended=Czas pobyty w wiezieniu zwiekszony do: {0) jailSet=\u00a77Zostalo stworzone wiezienie \u0093{0}\u0094. -jumpError=That would hurt your computer''s brain. -kickedAll=\u00a7cKicked all players from server -kickDefault=Zostales wyproszony z serwera. -kickExempt=\u00a7cNie mozesz wyprosic tej osoby. +jumpError=To moglo by ci cos zrobic. +kickedAll=\u00a7cWyrzucanie wszystki graczy z serwera +kickDefault=Zostales wyrzucony z serwera. +kickExempt=\u00a7cNie mozesz wyrzucic tej osoby. kill=\u00a77Zabito {0}. kitError2=\u00a7cTen zestaw nie istnieje lub zostal zle zdefininowany. kitError=\u00a7cNie ma prawidlowych zestawow. kitErrorHelp=\u00a7cByc moze przedmiotowi brakuje ilosci w konfiguracji? kitGive=\u00a77Przydzielanie zestawu {0}. -kitInvFull=\u00a7cTwoj ekwipuek jest pelen, wykladanie zestawu na podloge. -kitTimed=\u00a7cNie mozesz uzyc tego zestawu przez kolejne {0}. +kitInvFull=\u00a7cTwoj ekwipuek jest pelen, wyrzucanie zestawu na podloge. +kitTimed=\u00a7cNie mozesz wziasc tego zestawu przez kolejne {0}. kits=\u00a77Zestawy: {0} -lightningSmited=\u00a77Zostales zdzielony piorunem. +lightningSmited=\u00a77Zostales uderzony piorunem. lightningUse=\u00a77Uderzanie piorunem {0}. listAfkTag = \u00a77[AFK]\u00a7f listAmount = \u00a79Na serwerze jest \u00a7c{0}\u00a79 graczy z maksimum \u00a7c{1}\u00a79 online. listAmountHidden = \u00a79There are \u00a7c{0}\u00a77/{1}\u00a79 out of maximum \u00a7c{2}\u00a79 players online. listGroupTag={0}\u00a7f: -listHiddenTag = \u00a77[HIDDEN]\u00a7f +listHiddenTag = \u00a77[UKRYTY]\u00a7f loadWarpError=Blad przy wczytywaniu Warpu {0} -localFormat=Local: <{0}> {1} +localFormat=Lokalny: <{0}> {1} mailClear=\u00a7cAby oczyscic skrzynke, wpisz /mail clear mailCleared=\u00a77Skrzynka oprozniona!! mailSent=\u00a77Wiadomosc wyslana! markMailAsRead=\u00a7cAby oczyscic skrzynke, wpisz /mail clear markedAsAway=\u00a77Zostales oznaczony jako nieobecny. markedAsNotAway=\u00a77Juz nie jestes nieobecny. -maxHomes=Nie mozesz ustawic wiecej niz {0} posterunkow. +maxHomes=Nie mozesz ustawic wiecej niz {0} domow. mayNotJail=\u00a7cNie mozesz wtracic do wiezienia tej osoby. me=ja minute=minuta minutes=minuty missingItems=Nie masz {0}x{1}. -missingPrefixSuffix=Missing a prefix or suffix for {0} +missingPrefixSuffix=Brakuje prefixu lub suffixu dla {0} mobSpawnError=Blad podczas zmiany spawnera. mobSpawnLimit=Ilosc mobow ograniczona do limitu serwera. mobSpawnTarget=Blok musi byc spawnerem. @@ -208,32 +208,32 @@ months=miesiecy moreThanZero=Ilosc musi byc wieksza od 0. msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} muteExempt=\u00a7cNie mozesz wyciszyc tego gracza.. -mutedPlayer=Player {0} wyciszony. -mutedPlayerFor=Player {0} wyciszony na {1}. +mutedPlayer=Gracz {0} wyciszony. +mutedPlayerFor=Gracz {0} wyciszony na {1}. mutedUserSpeaks={0} probowal sie odezwac, ale jest wyciszony. nearbyPlayers=Gracze w poblizu: {0} negativeBalanceError=Gracz nie moze miec ujemnego stanu konta. nickChanged=Nick zmieniony. nickDisplayName=\u00a77Musisz wlaczyc \u0093change-displayname\u0094 w configu Essential. -nickInUse=\u00a7cTen nick jest juz w uzyciu. -nickNamesAlpha=\u00a7cNicki musza byc alfanumeryczne. -nickNoMore=\u00a77Nie masz juz nicku. -nickOthersPermission=\u00a7cNie masz uprawnienia do zmiany nicku innym. -nickSet=\u00a77Twoj nick od teraz to \u00a7c{0} +nickInUse=\u00a7cTen pseudonim jest juz w uzyciu. +nickNamesAlpha=\u00a7cPseudonimy musza byc alfanumeryczne. +nickNoMore=\u00a77Nie masz juz pseudonimu. +nickOthersPermission=\u00a7cNie masz uprawnienia do zmiany pseudonimu innym. +nickSet=\u00a77Twoj pseudonim od teraz to \u00a7c{0} noAccessCommand=\u00a7cNie masz dostepu do tej komendy. noAccessPermission=\u00a7cNie masz uprawnien do dostepu do {0}. noBreakBedrock=Nie masz uprawnien do niszczenia bedrocka. noDestroyPermission=\u00a7cNie masz uprawnien do niszczenia {0}. noGodWorldWarning=\u00a7cUwaga! Godmode wylaczony w tym swiecie!. noHelpFound=\u00a7cNie ma odpowiadajacych komend. -noHomeSet=Nie masz ustawionego posterunku. -noHomeSetPlayer=Gracz nie ma ustawionego posterunku. +noHomeSet=Nie masz ustawionego domu. +noHomeSetPlayer=Gracz nie ma ustawionego domu. noKitPermission=\u00a7cMusisz posiadac uprawnienia \u00a7c{0}\u00a7c aby uzywac tego zestawu. noKits=\u00a77Nie ma jeszcze dostepnych zestawow. noMail=Nie masz zadnych wiadomosci. noMotd=\u00a7cNie ma wiadomosci dnia.. noNewMail=\u00a77Nie masz zadnych nowych wiadomosci. -noPendingRequest=You do not have a pending request. +noPendingRequest=Nie masz oczekuj\u00e1cego z\u00e1dania. noPerm=\u00a7cNie masz uprawnien \u00a7f{0}. noPermToSpawnMob=\u00a7cNie masz uprawnien do tworzenia tego moba.. noPlacePermission=\u00a7cNie masz uprawnien do stawiania bloku kolo tego znaku.. @@ -270,7 +270,7 @@ playerBanned=\u00a7c{0} zbanowal {1} za {2}. playerInJail=\u00a7cGracz jest juz w wiezieniu \u0093{0}\u0094. playerJailed=\u00a77Gracz {0} wtracony do wiezienia. playerJailedFor= \u00a77Gracz {0} wtracony do wiezienia na {1}. -playerKicked=\u00a7c{0} wywalil {1} za {2}. +playerKicked=\u00a7c{0} wyrzucil {1} za {2}. playerMuted=\u00a77Zostales wyciszony. playerMutedFor=\u00a77Zostales wyciszony na {0}. playerNeverOnServer=\u00a7cGracz {0} nigdy nie byl na tym serwerze. @@ -300,12 +300,12 @@ repairEnchanted=\u00a77Nie masz zezwolenia do naprawiania ulepszonych przedmioto repairInvalidType=\u00a7cTen przedmiot nie moze byc naprawiony. repairNone=Zaden przedmiot nie wymagal naprawy. requestAccepted=\u00a77Zadanie teleportacji - zaakceptowano. -requestAcceptedFrom=\u00a77{0} zaakceptowal Twoje zadanie teleportacji. +requestAcceptedFrom=\u00a77{0} zaakceptowal Twoje z\u00e1danie teleportacji. requestDenied=\u00a77Zadanie teleportacji - odrzucone. -requestDeniedFrom=\u00a77{0} odrzucil Twoje zadanie teleportacji. -requestSent=\u00a77zZadanie wyslania do {0}\u00a77. -requestTimedOut=\u00a7cZadanie teleportacji - przedawnione. -requiredBukkit= * ! * Potrzebujesz ostatniego {0} CraftBukkit-a, pobierz go z http://dl.bukkit.org/downloads/craftbukkit/ +requestDeniedFrom=\u00a77{0} odrzucil Twoje z\u00e1danie teleportacji. +requestSent=\u00a77zZ\u00e1danie wyslania do {0}\u00a77. +requestTimedOut=\u00a7cZ\u00e1danie teleportacji - przedawnione. +requiredBukkit= * ! * Potrzebujesz najnowszego {0} CraftBukkit-a, pobierz go z http://dl.bukkit.org/downloads/craftbukkit/ returnPlayerToJailError=Wystapil blad podczas powrotu gracza {0} do wiezienia: {1} second=sekunda seconds=sekund @@ -320,7 +320,7 @@ signFormatFail=\u00a74[{0}] signFormatSuccess=\u00a71[{0}] signFormatTemplate=[{0}] signProtectInvalidLocation=\u00a74Nie masz zezwolenia do tworzenia tutaj znakow. -similarWarpExist=Warp o identycznej nazwie juz istnieje. +similarWarpExist=Warp o tej nazwie juz istnieje. slimeMalformedSize=Niewlasciwy rozmiar. soloMob=Ten mob lubi byc sam. spawnSet=\u00a77Ustawiono punkt spawnu dla grupy {0}. @@ -377,41 +377,41 @@ unknownItemName=Nieznana nazwa przedmiotu: {0}. unlimitedItemPermission=\u00a7cBrak uprawnien dla nielimitowanego przedmiotu {0}. unlimitedItems=Nielimitowane przedmioty: unmutedPlayer=Gracz {0} moze znowu mowic. -upgradingFilesError=Wystapil blad podczas upgradu plikow. +upgradingFilesError=Wystapil blad podczas aktualizowaniu plik\u00f3w. userDoesNotExist=Uzytkownik {0} nie istnieje w bazie danych. userIsAway={0} jest teraz AFK. userIsNotAway={0} nie jest juz AFK. -userJailed=\u00a77Zostales skazany. +userJailed=\u00a77Zostales zamkniety w wiezieniu. userUsedPortal={0} uzyl istniejacego portalu wyjscia. userdataMoveBackError=Nie udalo sie przeniesc userdata/{0}.tmp do userdata/{1} userdataMoveError=Nie udalo sie przeniesc userdata/{0} do userdata/{1}.tmp usingTempFolderForTesting=Uzywam tymczasowego folderu dla testu: -versionMismatch=Niepoprawna wersja! Prosze ulepszyc {0} do tej samej wersji co inne pliki. -versionMismatchAll=Niepoprawna wersja! Prosze ulepszyc wszystkie pliki Essentials do tej samej wersji. +versionMismatch=Niepoprawna wersja! Prosze zaktualizowac {0} do tej samej wersji co inne pliki. +versionMismatchAll=Niepoprawna wersja! Prosze zaktualizowac wszystkie pliki Essentials do tej samej wersji. voiceSilenced=\u00a77Twe usta zostaly zaszyte. warpDeleteError=Wystapil problem podczas usuwania pliku z Warpami. -warpListPermission=\u00a7cNie masz pozwolenia na sprawdzenie listy Warpow.. +warpListPermission=\u00a7cNie masz pozwolenia na sprawdzenie listy Warp\u00f3w.. warpNotExist=Ten Warp nie istnieje. warpOverwrite=\u00a7cNie mozesz nadpisac tego Warpa. warpSet=\u00a77Warp {0} stworzony. warpUsePermission=\u00a7cNie masz pozwolenie na korzystanie z tego Warpa. warpingTo=\u00a77Teleportuje do {0}. warps=Warpy: {0} -warpsCount=\u00a77Istnieje {0} warpow. Pokazuje strone {1} z {2}. -weatherStorm=\u00a77Ustawiles burzowa pogode w {0}. -weatherStormFor=\u00a77Ustawiles burzowa pogode w {0} na {1} sekund. +warpsCount=\u00a77Istnieje {0} warp\u00f3w. Pokazuje strone {1} z {2}. +weatherStorm=\u00a77Ustawiles burze w {0}. +weatherStormFor=\u00a77Ustawiles burze w {0} na {1} sekund. weatherSun=\u00a77Ustawiles bezchmurna pogode w {0}. weatherSunFor=\u00a77Ustawiles bezchmurna pogode w {0} na {1} sekund. whoisBanned=\u00a79 - Zbanowany: {0}. whoisExp=\u00a79 - Punkty Doswiadczenia: {0} (Poziom {1}). whoisGamemode=\u00a79 - Tryb Gry: {0}. -whoisGeoLocation=\u00a79 - Lokacja: {0}. +whoisGeoLocation=\u00a79 - Lokalizacja: {0}. whoisGod=\u00a79 - Godmode: {0}. -whoisHealth=\u00a79 - Zycie: {0}/20. +whoisHealth=\u00a79 - Zdrowie: {0}/20. whoisIPAddress=\u00a79 - Adres IP: {0}. whoisIs={0} jest {1}. whoisJail=\u00a79 - W wiezieniu: {0}. -whoisLocation=\u00a79 - Lokacja: ({0}, {1}, {2}, {3}) +whoisLocation=\u00a79 - Lokalizacja: ({0}, {1}, {2}, {3}) whoisMoney=\u00a79 - Pieniadze: {0}. whoisOP=\u00a79 - OP: {0} whoisStatusAvailable=\u00a79 - Status: Dostepny @@ -421,14 +421,14 @@ worthMeta=\u00a77Stack {0} z metadata {1} jest warty \u00a7c{2}\u00a77 ({3} prze worthSet=Cena przedmiotu ustawiona. year=rok years=lat -youAreHealed=\u00a77Zostales/las uleczony/na. +youAreHealed=\u00a77Zostales/as uleczony/na. youHaveNewMail=\u00a7cMasz {0} wiadomosci!\u00a7f napisz \u00a77/mail read\u00a7f aby je przeczytac. -exp=\u00a7c{0} \u00a77has\u00a7c {1} \u00a77exp (level\u00a7c {2}\u00a77) and needs\u00a7c {3} \u00a77more exp to level up. -expSet=\u00a7c{0} \u00a77now has\u00a7c {1} \u00a77exp. -unvanished=\u00a7aYou are once again visible. -unvanishedReload=\u00a7cA reload has forced you to become visible. -vanished=\u00a7aYou have now been vanished. +exp=\u00a7c{0} \u00a77ma\u00a7c {1} \u00a77doswiadczenia (poziom\u00a7c {2}\u00a77), potrzebuje\u00a7c {3} \u00a77wiecej doswiadczenia do nastepnego poziomu. +expSet=\u00a7c{0} \u00a77teraz ma\u00a7c {1} \u00a77doswiadczenia. +unvanished=\u00a7aZn\u00f3w jestes widoczny. +unvanishedReload=\u00a7cReload spowodowal ze cie widac. +vanished=\u00a7aJuz jestes niewidoczny. tps=Current TPS = {0} -hatPlaced=\u00a7eEnjoy your new hat! -hatFail=\u00a7cYou must have something to wear in your hand. -hatArmor=\u00a7cError, you cannot use armor as a hat! +hatPlaced=\u00a7eCiesz sie nowym kapeluszem! +hatFail=\u00a7cMusisz cos trzymac w dloni. +hatArmor=\u00a7cNie mozesz uzywac zbroi jako nakrycia glowy! \ No newline at end of file -- cgit v1.2.3