summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-10-01 17:50:08 +0100
committerElgarL <ElgarL@palmergames.com>2012-10-01 17:50:08 +0100
commit8cf2ce7b73829a3496397d2a4405a0618bed5798 (patch)
treeb8a051d8478d10ebe0bdd72d483330cb08508bb6
parent1ecf592893213d54dd4005dfc3de28d1a682ddc2 (diff)
parent0dd0dba33837ce73f784704f893848aa9d7282e9 (diff)
downloadEssentials-8cf2ce7b73829a3496397d2a4405a0618bed5798.tar
Essentials-8cf2ce7b73829a3496397d2a4405a0618bed5798.tar.gz
Essentials-8cf2ce7b73829a3496397d2a4405a0618bed5798.tar.lz
Essentials-8cf2ce7b73829a3496397d2a4405a0618bed5798.tar.xz
Essentials-8cf2ce7b73829a3496397d2a4405a0618bed5798.zip
Merge branch '2.9' of https://ElgarL@github.com/essentials/Essentials.git into 2.9
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java15
-rw-r--r--Essentials/src/com/earth2me/essentials/Teleport.java173
-rw-r--r--Essentials/src/com/earth2me/essentials/Util.java5
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandban.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandheal.java21
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsethome.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsudo.java12
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtphere.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/perm/SuperpermsHandler.java33
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignKit.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignWarp.java7
-rw-r--r--Essentials/src/config.yml18
-rw-r--r--Essentials/src/items.csv278
-rw-r--r--Essentials/src/messages.properties1
-rw-r--r--Essentials/src/messages_cs.properties1
-rw-r--r--Essentials/src/messages_da.properties1
-rw-r--r--Essentials/src/messages_de.properties3
-rw-r--r--Essentials/src/messages_en.properties1
-rw-r--r--Essentials/src/messages_es.properties1
-rw-r--r--Essentials/src/messages_fi.properties1
-rw-r--r--Essentials/src/messages_fr.properties1
-rw-r--r--Essentials/src/messages_it.properties1
-rw-r--r--Essentials/src/messages_nl.properties1
-rw-r--r--Essentials/src/messages_pl.properties1
-rw-r--r--Essentials/src/messages_pt.properties1
-rw-r--r--Essentials/src/messages_se.properties1
-rw-r--r--EssentialsGroupManager/src/Changelog.txt4
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java2
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java2
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java2
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java237
-rw-r--r--EssentialsGroupManager/src/users.yml6
33 files changed, 603 insertions, 243 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
index 8dbd02a38..0077d988c 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
@@ -7,6 +7,7 @@ import java.util.logging.Logger;
import org.bukkit.Material;
import org.bukkit.entity.Ageable;
import org.bukkit.entity.Entity;
+import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@@ -46,7 +47,7 @@ public class EssentialsEntityListener implements Listener
{
event.setCancelled(true);
}
-
+
if (attacker.isGodModeEnabled() && !attacker.isAuthorized("essentials.god.pvp"))
{
event.setCancelled(true);
@@ -161,4 +162,16 @@ public class EssentialsEntityListener implements Listener
event.setCancelled(true);
}
}
+
+ @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
+ public void onPotionSplashEvent(final PotionSplashEvent event)
+ {
+ for (LivingEntity entity : event.getAffectedEntities())
+ {
+ if (entity instanceof Player && ess.getUser(entity).isGodModeEnabled())
+ {
+ event.setIntensity(entity, 0d);
+ }
+ }
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java
index c6106ad24..6a666a199 100644
--- a/Essentials/src/com/earth2me/essentials/Teleport.java
+++ b/Essentials/src/com/earth2me/essentials/Teleport.java
@@ -37,13 +37,14 @@ public class Teleport implements Runnable, ITeleport
{
if (this.name != null)
{
-
+
return ess.getServer().getPlayerExact(name).getLocation();
}
return location;
}
}
private IUser user;
+ private IUser teleportUser;
private int teleTimer = -1;
private long started; // time this task was initiated
private long delay; // how long to delay the teleport
@@ -62,12 +63,18 @@ public class Teleport implements Runnable, ITeleport
private void initTimer(long delay, Target target, Trade chargeFor, TeleportCause cause)
{
+ initTimer(delay, user, target, chargeFor, cause);
+ }
+
+ private void initTimer(long delay, IUser teleportUser, Target target, Trade chargeFor, TeleportCause cause)
+ {
this.started = System.currentTimeMillis();
this.delay = delay;
- this.health = user.getHealth();
- this.initX = Math.round(user.getLocation().getX() * MOVE_CONSTANT);
- this.initY = Math.round(user.getLocation().getY() * MOVE_CONSTANT);
- this.initZ = Math.round(user.getLocation().getZ() * MOVE_CONSTANT);
+ this.health = teleportUser.getHealth();
+ this.initX = Math.round(teleportUser.getLocation().getX() * MOVE_CONSTANT);
+ this.initY = Math.round(teleportUser.getLocation().getY() * MOVE_CONSTANT);
+ this.initZ = Math.round(teleportUser.getLocation().getZ() * MOVE_CONSTANT);
+ this.teleportUser = teleportUser;
this.teleportTarget = target;
this.chargeFor = chargeFor;
this.cause = cause;
@@ -79,31 +86,38 @@ public class Teleport implements Runnable, ITeleport
if (user == null || !user.isOnline() || user.getLocation() == null)
{
- cancel();
+ cancel(false);
return;
}
- if (Math.round(user.getLocation().getX() * MOVE_CONSTANT) != initX
- || Math.round(user.getLocation().getY() * MOVE_CONSTANT) != initY
- || Math.round(user.getLocation().getZ() * MOVE_CONSTANT) != initZ
- || user.getHealth() < health)
- { // user moved, cancel teleport
- cancel(true);
+ if (teleportUser == null || !teleportUser.isOnline() || teleportUser.getLocation() == null)
+ {
+ cancel(false);
return;
}
- health = user.getHealth(); // in case user healed, then later gets injured
-
+ if (!user.isAuthorized("essentials.teleport.timer.move")
+ && (Math.round(teleportUser.getLocation().getX() * MOVE_CONSTANT) != initX
+ || Math.round(teleportUser.getLocation().getY() * MOVE_CONSTANT) != initY
+ || Math.round(teleportUser.getLocation().getZ() * MOVE_CONSTANT) != initZ
+ || teleportUser.getHealth() < health))
+ {
+ // user moved, cancel teleport
+ cancel(true);
+ return;
+ }
+ health = teleportUser.getHealth(); // in case user healed, then later gets injured
long now = System.currentTimeMillis();
if (now > started + delay)
{
try
{
cooldown(false);
- user.sendMessage(_("teleportationCommencing"));
+ teleportUser.sendMessage(_("teleportationCommencing"));
try
{
- now(teleportTarget, cause);
+ teleportUser.getTeleport().now(teleportTarget, cause);
+ cancel(false);
if (chargeFor != null)
{
chargeFor.charge(user);
@@ -117,6 +131,10 @@ public class Teleport implements Runnable, ITeleport
catch (Exception ex)
{
user.sendMessage(_("cooldownWithMessage", ex.getMessage()));
+ if (user != teleportUser)
+ {
+ teleportUser.sendMessage(_("cooldownWithMessage", ex.getMessage()));
+ }
}
}
}
@@ -127,22 +145,6 @@ public class Teleport implements Runnable, ITeleport
this.ess = ess;
}
- public void respawn(final Trade chargeFor, TeleportCause cause) throws Exception
- {
- final Player player = user.getBase();
- final Location bed = player.getBedSpawnLocation();
- final PlayerRespawnEvent pre = new PlayerRespawnEvent(player, bed == null ? player.getWorld().getSpawnLocation() : bed, bed != null);
- ess.getServer().getPluginManager().callEvent(pre);
- teleport(new Target(pre.getRespawnLocation()), chargeFor, cause);
- }
-
- public void warp(String warp, Trade chargeFor, TeleportCause cause) throws Exception
- {
- Location loc = ess.getWarps().getWarp(warp);
- teleport(new Target(loc), chargeFor, cause);
- user.sendMessage(_("warpingTo", warp));
- }
-
public void cooldown(boolean check) throws Exception
{
final Calendar time = new GregorianCalendar();
@@ -181,6 +183,7 @@ public class Teleport implements Runnable, ITeleport
}
}
+ //If we need to cancel a pending teleport call this method
public void cancel(boolean notifyUser)
{
if (teleTimer == -1)
@@ -193,6 +196,10 @@ public class Teleport implements Runnable, ITeleport
if (notifyUser)
{
user.sendMessage(_("pendingTeleportCancelled"));
+ if (teleportUser != user)
+ {
+ teleportUser.sendMessage(_("pendingTeleportCancelled"));
+ }
}
}
finally
@@ -201,16 +208,40 @@ public class Teleport implements Runnable, ITeleport
}
}
- public void cancel()
+ //The now function is used when you want to skip tp delay when teleporting someone to a location or player.
+ public void now(Location loc, boolean cooldown, TeleportCause cause) throws Exception
+ {
+ if (cooldown)
+ {
+ cooldown(false);
+ }
+ now(new Target(loc), cause);
+ }
+
+ public void now(Player entity, boolean cooldown, TeleportCause cause) throws Exception
+ {
+ if (cooldown)
+ {
+ cooldown(false);
+ }
+ now(new Target(entity), cause);
+ }
+
+ private void now(Target target, TeleportCause cause) throws Exception
{
cancel(false);
+ user.setLastLocation();
+ user.getBase().teleport(Util.getSafeDestination(target.getLocation()), cause);
}
+ //The teleport function is used when you want to normally teleport someone to a location or player.
+ //This method is nolonger used internally and will be removed.
+ @Deprecated
public void teleport(Location loc, Trade chargeFor) throws Exception
{
- teleport(new Target(loc), chargeFor, TeleportCause.PLUGIN);
+ teleport(loc, chargeFor, TeleportCause.PLUGIN);
}
-
+
public void teleport(Location loc, Trade chargeFor, TeleportCause cause) throws Exception
{
teleport(new Target(loc), chargeFor, cause);
@@ -241,58 +272,82 @@ public class Teleport implements Runnable, ITeleport
return;
}
- cancel();
- Calendar c = new GregorianCalendar();
- c.add(Calendar.SECOND, (int)delay);
- c.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0));
- user.sendMessage(_("dontMoveMessage", Util.formatDateDiff(c.getTimeInMillis())));
+ cancel(false);
+ warnUser(user);
initTimer((long)(delay * 1000.0), target, chargeFor, cause);
teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
}
- private void now(Target target, TeleportCause cause) throws Exception
+ //The teleportToMe function is a wrapper used to handle teleporting players to them, like /tphere
+ public void teleportToMe(User otherUser, Trade chargeFor, TeleportCause cause) throws Exception
{
- cancel();
- user.setLastLocation();
- user.getBase().teleport(Util.getSafeDestination(target.getLocation()), cause);
- }
+ Target target = new Target(user);
- public void now(Location loc, boolean cooldown, TeleportCause cause) throws Exception
- {
- if (cooldown)
+ double delay = ess.getSettings().getTeleportDelay();
+
+ if (chargeFor != null)
+ {
+ chargeFor.isAffordableFor(user);
+ }
+ cooldown(true);
+ if (delay <= 0 || user.isAuthorized("essentials.teleport.timer.bypass"))
{
cooldown(false);
+ otherUser.getTeleport().now(target, cause);
+ if (chargeFor != null)
+ {
+ chargeFor.charge(user);
+ }
+ return;
}
- now(new Target(loc), cause);
+
+ cancel(false);
+ warnUser(otherUser);
+ initTimer((long)(delay * 1000.0), otherUser, target, chargeFor, cause);
+
+ teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
}
- public void now(Location loc, Trade chargeFor, TeleportCause cause) throws Exception
+ private void warnUser(final IUser user)
{
- cooldown(false);
- chargeFor.charge(user);
- now(new Target(loc), cause);
+ Calendar c = new GregorianCalendar();
+ c.add(Calendar.SECOND, (int)delay);
+ c.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0));
+ user.sendMessage(_("dontMoveMessage", Util.formatDateDiff(c.getTimeInMillis())));
}
- public void now(Player entity, boolean cooldown, TeleportCause cause) throws Exception
+ //The respawn function is a wrapper used to handle tp fallback, on /jail and /home
+ public void respawn(final Trade chargeFor, TeleportCause cause) throws Exception
{
- if (cooldown)
- {
- cooldown(false);
- }
- now(new Target(entity), cause);
+ final Player player = user.getBase();
+ final Location bed = player.getBedSpawnLocation();
+ final PlayerRespawnEvent pre = new PlayerRespawnEvent(player, bed == null ? player.getWorld().getSpawnLocation() : bed, bed != null);
+ ess.getServer().getPluginManager().callEvent(pre);
+ teleport(new Target(pre.getRespawnLocation()), chargeFor, cause);
+ }
+
+ //The warp function is a wrapper used to teleport a player to a /warp
+ public void warp(String warp, Trade chargeFor, TeleportCause cause) throws Exception
+ {
+ Location loc = ess.getWarps().getWarp(warp);
+ teleport(new Target(loc), chargeFor, cause);
+ user.sendMessage(_("warpingTo", warp));
}
+ //The back function is a wrapper used to teleport a player /back to their previous location.
public void back(Trade chargeFor) throws Exception
{
teleport(new Target(user.getLastLocation()), chargeFor, TeleportCause.COMMAND);
}
+ //This function is used to throw a user back after a jail sentence
public void back() throws Exception
{
now(new Target(user.getLastLocation()), TeleportCause.COMMAND);
}
+ //This function handles teleporting to /home
public void home(Location loc, Trade chargeFor) throws Exception
{
teleport(new Target(loc), chargeFor, TeleportCause.COMMAND);
diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java
index c1f7cd014..34e5c6420 100644
--- a/Essentials/src/com/earth2me/essentials/Util.java
+++ b/Essentials/src/com/earth2me/essentials/Util.java
@@ -23,10 +23,13 @@ public class Util
private final static Logger logger = Logger.getLogger("Minecraft");
private final static Pattern INVALIDFILECHARS = Pattern.compile("[^a-z0-9]");
private final static Pattern INVALIDCHARS = Pattern.compile("[^\t\n\r\u0020-\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFC]");
+ private final static Pattern BADFILENAMES = Pattern.compile("^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\\.(.+))?$", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE | Pattern.COMMENTS);
public static String sanitizeFileName(final String name)
{
- final String newName = INVALIDFILECHARS.matcher(name.toLowerCase(Locale.ENGLISH)).replaceAll("_");
+ String newName = INVALIDFILECHARS.matcher(name.toLowerCase(Locale.ENGLISH)).replaceAll("_");
+ if(BADFILENAMES.matcher(newName).matches())
+ newName = "_" + newName;
return newName;
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java
index 5f70df273..cf6ea53df 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java
@@ -44,7 +44,7 @@ public class Commandban extends EssentialsCommand
}
else
{
- if (user.isAuthorized("essentials.ban.exempt"))
+ if (user.isAuthorized("essentials.ban.exempt") && sender instanceof Player)
{
sender.sendMessage(_("banExempt"));
return;
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandheal.java b/Essentials/src/com/earth2me/essentials/commands/Commandheal.java
index 82678c96e..224e782de 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandheal.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandheal.java
@@ -6,6 +6,8 @@ import java.util.List;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
+import org.bukkit.potion.PotionEffect;
+import org.bukkit.potion.PotionEffectType;
public class Commandheal extends EssentialsCommand
@@ -33,9 +35,7 @@ public class Commandheal extends EssentialsCommand
{
user.healCooldown();
}
- user.setHealth(20);
- user.setFoodLevel(20);
- user.sendMessage(_("heal"));
+ healPlayer(user);
}
@Override
@@ -63,10 +63,19 @@ public class Commandheal extends EssentialsCommand
{
continue;
}
- p.setHealth(20);
- p.setFoodLevel(20);
- p.sendMessage(_("heal"));
+ healPlayer(p);
sender.sendMessage(_("healOther", p.getDisplayName()));
}
}
+
+ private void healPlayer(final Player p)
+ {
+ p.setHealth(20);
+ p.setFoodLevel(20);
+ p.sendMessage(_("heal"));
+ for (PotionEffect effect : p.getActivePotionEffects())
+ {
+ p.removePotionEffect(effect.getType());
+ }
+ }
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
index 7ec1ba11d..c97761f8d 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
@@ -2,7 +2,9 @@ package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
import java.util.Locale;
+import java.util.regex.Pattern;
import org.bukkit.Location;
import org.bukkit.Server;
@@ -55,9 +57,10 @@ public class Commandsethome extends EssentialsCommand
{
name = "home";
}
- if ("bed".equals(name))
+ if ("bed".equals(name) || Util.isInt(name))
{
- throw new NotEnoughArgumentsException();
+ user.sendMessage(_("invalidHomeName"));
+ throw new NoChargeException();
}
usersHome.setHome(name, location);
user.sendMessage(_("homeSet", user.getLocation().getWorld().getName(), user.getLocation().getBlockX(), user.getLocation().getBlockY(), user.getLocation().getBlockZ()));
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java
index 1d974121b..d41cf9a51 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java
@@ -7,6 +7,7 @@ import java.util.logging.Logger;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand;
+import org.bukkit.entity.Player;
public class Commandsudo extends EssentialsCommand
@@ -26,6 +27,15 @@ public class Commandsudo extends EssentialsCommand
}
final User user = getPlayer(server, args, 0, false);
+ if(args[1].equalsIgnoreCase("say"))
+ {
+ if (user.isAuthorized("essentials.sudo.exempt"))
+ {
+ throw new Exception(_("sudoExempt"));
+ }
+ user.chat(getFinalArg(args, 2));
+ return;
+ }
final String command = args[1];
final String[] arguments = new String[args.length - 2];
if (arguments.length > 0)
@@ -33,7 +43,7 @@ public class Commandsudo extends EssentialsCommand
System.arraycopy(args, 2, arguments, 0, args.length - 2);
}
- if (user.isAuthorized("essentials.sudo.exempt"))
+ if (user.isAuthorized("essentials.sudo.exempt") && sender instanceof Player)
{
throw new Exception(_("sudoExempt"));
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
index 86f88f884..865492921 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
@@ -65,12 +65,13 @@ public class Commandtpaccept extends EssentialsCommand
if (user.isTpRequestHere())
{
- user.getTeleport().teleport(target, charge, TeleportCause.COMMAND);
+ target.getTeleport().teleportToMe(user, charge, TeleportCause.COMMAND);
}
else
{
target.getTeleport().teleport(user, charge, TeleportCause.COMMAND);
}
user.requestTeleport(null, false);
+ throw new NoChargeException();
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java
index 641290575..76041ca6c 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java
@@ -27,7 +27,7 @@ public class Commandtphere extends EssentialsCommand
{
throw new Exception(_("noPerm", "essentials.worlds." + user.getWorld().getName()));
}
- player.getTeleport().teleport(user, new Trade(this.getName(), ess), TeleportCause.COMMAND);
+ user.getTeleport().teleportToMe(player, new Trade(this.getName(), ess), TeleportCause.COMMAND);
user.sendMessage(_("teleporting"));
player.sendMessage(_("teleporting"));
throw new NoChargeException();
diff --git a/Essentials/src/com/earth2me/essentials/perm/SuperpermsHandler.java b/Essentials/src/com/earth2me/essentials/perm/SuperpermsHandler.java
index 5dbe9eb93..0b4b93058 100644
--- a/Essentials/src/com/earth2me/essentials/perm/SuperpermsHandler.java
+++ b/Essentials/src/com/earth2me/essentials/perm/SuperpermsHandler.java
@@ -31,29 +31,26 @@ public class SuperpermsHandler implements IPermissionsHandler
}
@Override
- public boolean hasPermission(final Player base, final String node)
+ public boolean hasPermission(final Player base, String node)
{
- if (base.hasPermission("*"))
+ String permCheck = node;
+ int index;
+ while (true)
{
- return true;
- }
- if (base.hasPermission("-" + node))
- {
- return false;
- }
- final String[] parts = node.split("\\.");
- final StringBuilder builder = new StringBuilder(node.length());
- for (String part : parts)
- {
- builder.append('*');
- if (base.hasPermission(builder.toString()))
+ if (base.isPermissionSet(permCheck))
{
- return true;
+ return base.hasPermission(permCheck);
}
- builder.deleteCharAt(builder.length() - 1);
- builder.append(part).append('.');
+
+ index = node.lastIndexOf('.');
+ if (index < 1)
+ {
+ return base.hasPermission("*");
+ }
+
+ node = node.substring(0, index);
+ permCheck = node + ".*";
}
- return base.hasPermission(node);
}
@Override
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignKit.java b/Essentials/src/com/earth2me/essentials/signs/SignKit.java
index aee1d7dea..1c3528a18 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignKit.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignKit.java
@@ -51,7 +51,7 @@ public class SignKit extends EssentialsSign
final String kitName = sign.getLine(1).toLowerCase(Locale.ENGLISH).trim();
final String group = sign.getLine(2);
if ((!group.isEmpty() && ("§2Everyone".equals(group) || player.inGroup(group)))
- || (group.isEmpty() && (player.isAuthorized("essentials.kit." + kitName))))
+ || (group.isEmpty() && (player.isAuthorized("essentials.kits." + kitName))))
{
final Trade charge = getTrade(sign, 3, ess);
charge.isAffordableFor(player);
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignWarp.java b/Essentials/src/com/earth2me/essentials/signs/SignWarp.java
index ae49f743b..eb81ea4e1 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignWarp.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignWarp.java
@@ -1,6 +1,7 @@
package com.earth2me.essentials.signs;
import com.earth2me.essentials.ChargeException;
+import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
@@ -17,15 +18,13 @@ public class SignWarp extends EssentialsSign
@Override
protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException
{
- ess.getLogger().info("triggered warp sign create");
validateTrade(sign, 3, ess);
final String warpName = sign.getLine(1);
if (warpName.isEmpty())
{
- ess.getLogger().info("trying to change sign to show error");
sign.setLine(1, "§c<Warp name>");
- return false;
+ throw new SignException(_("invalidSignLine", 1));
}
else
{
@@ -54,7 +53,7 @@ public class SignWarp extends EssentialsSign
if ((!group.isEmpty()
&& ("§2Everyone".equals(group)
|| player.inGroup(group)))
- || (group.isEmpty() && (!ess.getSettings().getPerWarpPermission() || player.isAuthorized("essentials.warp." + warpName))))
+ || (group.isEmpty() && (!ess.getSettings().getPerWarpPermission() || player.isAuthorized("essentials.warps." + warpName))))
{
final Trade charge = getTrade(sign, 3, ess);
try
diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml
index 4707cd3b0..9fa0f8c4c 100644
--- a/Essentials/src/config.yml
+++ b/Essentials/src/config.yml
@@ -8,7 +8,7 @@
# If you receive an error when Essentials loads, ensure that:
# - No tabs are present: YAML only allows spaces
# - Indents are correct: YAML hierarchy is based entirely on indentation
-# - You have "escaped" all apostrophes in your text: If you want to write "don't", for example, write "don''t" instead (note the doubled apostrphe)
+# - You have "escaped" all apostrophes in your text: If you want to write "don't", for example, write "don''t" instead (note the doubled apostrophe)
# - Text with symbols is enclosed in single or double quotation marks
# If you have problems join the Essentials help support channel: http://tiny.cc/EssentialsChat
@@ -246,7 +246,7 @@ debug: false
# Set the locale for all messages
# If you don't set this, the default locale of the server will be used.
-# Don't forget to remove the # infront of the line
+# Don't forget to remove the # in front of the line
#locale: de_DE
# Turn off god mode when people exit
@@ -277,7 +277,7 @@ disable-item-pickup-while-afk: false
# Disable this to reduce server lag.
cancel-afk-on-move: true
-# You can disable the death messages of minecraft here
+# You can disable the death messages of Minecraft here
death-messages: true
# Add worlds to this list, if you want to automatically disable god mode there
@@ -287,17 +287,17 @@ no-god-in-worlds:
# Set to true to enable per-world permissions for teleporting between worlds with essentials commands
# This applies to /world, /back, /tp[a|o][here|all], but not warps.
# Give someone permission to teleport to a world with essentials.worlds.<worldname>
-# This does not effect the /home command, there is a seperate toggle below for this.
+# This does not effect the /home command, there is a separate toggle below for this.
world-teleport-permissions: false
# The number of items given if the quantity parameter is left out in /item or /give.
-# If this number is below 1, the maximum stack size size is given. If oversized stacks
-# is not enabled, any number higher then the maximum stack size results in more than one stack.
+# If this number is below 1, the maximum stack size size is given. If over-sized stacks
+# are not enabled, any number higher then the maximum stack size results in more than one stack.
default-stack-size: -1
-# Oversized stacks are stacks that ignore the normal max stacksize.
+# Over-sized stacks are stacks that ignore the normal max stack size.
# They can be obtained using /give and /item, if the player has essentials.oversizedstacks permission.
-# How many items should be in an oversized stack?
+# How many items should be in an over-sized stack?
oversized-stacksize: 64
# Allow repair of enchanted weapons and armor.
@@ -357,7 +357,7 @@ starting-balance: 0
# These are now defined in worth.yml
# Defines the cost to use the given commands PER USE
-# Some commands like /repair have subcosts, check the wiki for more information.
+# Some commands like /repair have sub-costs, check the wiki for more information.
command-costs:
# /example costs $1000 PER USE
#example: 1000
diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv
index 1bffb4248..a3d6ca91b 100644
--- a/Essentials/src/items.csv
+++ b/Essentials/src/items.csv
@@ -1,4 +1,4 @@
-#version: teamcity
+#version: TeamCity
#If you change this file, it will not be automatically updated after the next release,
#item,id,metadata
stone,1,0
@@ -1329,7 +1329,6 @@ burningfurnace,62,0
bfurnace,62,0
signpost,63,0
spost,63,0
-door,64,0
woodendoorhalf,64,0
wooddoorhalf,64,0
wdoorhalf,64,0
@@ -1588,7 +1587,9 @@ tdoor,96,0
doort,96,0
trapd,96,0
dtrap,96,0
+monsteregg,97,0
silverfish,97,0
+monsteregg,97,0
monstereggsmoothstone,97,0
monstereggsstone,97,0
meggsmoothstone,97,0
@@ -3397,6 +3398,7 @@ sign,323,0
woodendoor,324,0
wooddoor,324,0
wdoor,324,0
+door,324,0
bucket,325,0
bukkit,325,0
waterbucket,326,0
@@ -3946,14 +3948,98 @@ waterbottle,373,0
fullbottle,373,0
watervase,373,0
fullvase,373,0
+clearpotion,373,6
+clearpot,373,6
+clearextendedpotion,373,7
+clearexpotion,373,7
+clear2potion,373,7
+clearextendedpot,373,7
+clearexpot,373,7
+clear2pot,373,7
+diffusepotion,373,11
+diffusepot,373,11
+artlesspotion,373,13
+artlesspot,373,13
+thinpotion,373,14
+thinpot,373,14
+thinextendedpotion,373,15
+thinexpotion,373,15
+thin2potion,373,15
+thinextendedpot,373,15
+thinexpot,373,15
+thin2pot,373,15
awkwardpotion,373,16
awkwardpot,373,16
+bunglingpotion,373,22
+bunglingpot,373,22
+bunglingextendedpotion,373,23
+bunglingexpotion,373,23
+bungling2potion,373,23
+bunglingextendedpot,373,23
+bunglingexpot,373,23
+bungling2pot,373,23
+smoothpotion,373,27
+smoothpot,373,27
+suavepotion,373,29
+suavepot,373,29
+debonairpotion,373,30
+debonairpot,373,30
+debonairextendedpotion,373,31
+debonairexpotion,373,31
+debonair2potion,373,31
+debonairextendedpot,373,31
+debonairexpot,373,31
+debonair2pot,373,31
thickpotion,373,32
thickpot,373,32
-mundaneexpotion,373,64
+charmingpotion,373,38
+charmingpot,373,38
+charmingextendedpotion,373,39
+charmingexpotion,373,39
+charming2potion,373,39
+charmingextendedpot,373,39
+charmingexpot,373,39
+charming2pot,373,39
+refinedpotion,373,43
+refinedpot,373,43
+cordialpotion,373,45
+cordialpot,373,45
+sparklingpotion,373,46
+sparklingpot,373,46
+sparklingextendedpotion,373,47
+sparklingexpotion,373,47
+sparkling2potion,373,47
+sparklingextendedpot,373,47
+sparklingexpot,373,47
+sparkling2pot,373,47
+potentpotion,373,48
+potentpot,373,48
+rankpotion,373,54
+rankpot,373,54
+rankextendedpotion,373,55
+rankexpotion,373,55
+rank2potion,373,55
+rankextendedpot,373,55
+rankexpot,373,55
+rank2pot,373,55
+acridpotion,373,59
+acridpot,373,59
+grosspotion,373,61
+grosspot,373,61
+stinkypotion,373,62
+stinkypot,373,62
+stinkyextendedpotion,373,63
+stinkyexpotion,373,63
+stinky2potion,373,63
+stinkyextendedpot,373,63
+stinkyexpot,373,63
+stinky2pot,373,63
mundaneextendedpotion,373,64
-mundaneexpot,373,64
+mundaneexpotion,373,64
+mundane2potion,373,64
mundaneextendedpot,373,64
+mundaneexpot,373,64
+mundane2pot,373,64
mundanepotion,373,8192
mundanepot,373,8192
regenerationpotion,373,8193
@@ -4308,6 +4394,22 @@ splhealingpot,373,16389
splhealpot,373,16389
spllifepot,373,16389
sphpot,373,16389
+splashclearpotion,373,16390
+splashclearpot,373,16390
+splclearpotion,373,16390
+splclearpot,373,16390
+splashclearextendedpotion,373,16391
+splashclearexpotion,373,16391
+splashclear2potion,373,16391
+splashclearextendedpot,373,16391
+splashclearexpot,373,16391
+splashclear2pot,373,16391
+splclearextendedpotion,373,16391
+splclearexpotion,373,16391
+splclear2potion,373,16391
+splclearextendedpot,373,16391
+splclearexpot,373,16391
+splclear2pot,373,16391
splashweaknesspotion,373,16392
splashweakpotion,373,16392
splashweaknesspot,373,16392
@@ -4339,6 +4441,10 @@ splslowpotion,373,16394
splslownesspot,373,16394
splslowpot,373,16394
spslpot,373,16394
+splashdiffusepotion,373,16395
+splashdiffusepot,373,16395
+spldiffusepotion,373,16395
+spldiffusepot,373,16395
splashharmingpotion,373,16396
splashdamagepotion,373,16396
splashdmgpotion,373,16396
@@ -4352,6 +4458,74 @@ splharmingpot,373,16396
spldamagepot,373,16396
spldmgpot,373,16396
spdpot,373,16396
+splashartlesspotion,373,16397
+splashartlesspot,373,16397
+splartlesspotion,373,16397
+splartlesspot,373,16397
+splashthinpotion,373,16398
+splashthinpot,373,16398
+splthinpotion,373,16398
+splthinpot,373,16398
+splashthinextendedpotion,373,16399
+splashthinexpotion,373,16399
+splashthin2potion,373,16399
+splashthinextendedpot,373,16399
+splashthinexpot,373,16399
+splashthin2pot,373,16399
+splthinextendedpotion,373,16399
+splthinexpotion,373,16399
+splthin2potion,373,16399
+splthinextendedpot,373,16399
+splthinexpot,373,16399
+splthin2pot,373,16399
+splashawkwardpotion,373,16400
+splashawkwardpot,373,16400
+splawkwardpotion,373,16400
+splawkwardpot,373,16400
+splashbunglingpotion,373,16406
+splashbunglingpot,373,16406
+splbunglingpotion,373,16406
+splbunglingpot,373,16406
+splashbunglingextendedpotion,373,16407
+splashbunglingexpotion,373,16407
+splashbungling2potion,373,16407
+splashbunglingextendedpot,373,16407
+splashbunglingexpot,373,16407
+splashbungling2pot,373,16407
+splbunglingextendedpotion,373,16407
+splbunglingexpotion,373,16407
+splbungling2potion,373,16407
+splbunglingextendedpot,373,16407
+splbunglingexpot,373,16407
+splbungling2pot,373,16407
+splashsmoothpotion,373,16411
+splashsmoothpot,373,16411
+splsmoothpotion,373,16411
+splsmoothpot,373,16411
+splashsuavepotion,373,16413
+splashsuavepot,373,16413
+splsuavepotion,373,16413
+splsuavepot,373,16413
+splashdebonairpotion,373,16414
+splashdebonairpot,373,16414
+spldebonairpotion,373,16414
+spldebonairpot,373,16414
+splashdebonairextendedpotion,373,16415
+splashdebonairexpotion,373,16415
+splashdebonair2potion,373,16415
+splashdebonairextendedpot,373,16415
+splashdebonairexpot,373,16415
+splashdebonair2pot,373,16415
+spldebonairextendedpotion,373,16415
+spldebonairexpotion,373,16415
+spldebonair2potion,373,16415
+spldebonairextendedpot,373,16415
+spldebonairexpot,373,16415
+spldebonair2pot,373,16415
+splashthickpotion,373,16416
+splashthickpot,373,16416
+splthickpotion,373,16416
+splthickpot,373,16416
splashregenerationleveliipotion,373,16417
splashregenerateleveliipotion,373,16417
splashregenleveliipotion,373,16417
@@ -4476,6 +4650,22 @@ splheallevel2pot,373,16421
splhealingiipot,373,16421
splhealiipot,373,16421
sph2pot,373,16421
+splashcharmingpotion,373,16422
+splashcharmingpot,373,16422
+splcharmingpotion,373,16422
+splcharmingpot,373,16422
+splashcharmingextendedpotion,373,16423
+splashcharmingexpotion,373,16423
+splashcharming2potion,373,16423
+splashcharmingextendedpot,373,16423
+splashcharmingexpot,373,16423
+splashcharming2pot,373,16423
+splcharmingextendedpotion,373,16423
+splcharmingexpotion,373,16423
+splcharming2potion,373,16423
+splcharmingextendedpot,373,16423
+splcharmingexpot,373,16423
+splcharming2pot,373,16423
splashstrengthleveliipotion,373,16425
splashstrongleveliipotion,373,16425
splashstrleveliipotion,373,16425
@@ -4513,6 +4703,10 @@ splstrengthiipot,373,16425
splstrongiipot,373,16425
splstriipot,373,16425
spst2pot,373,16425
+splashrefinedpotion,373,16427
+splashrefinedpot,373,16427
+splrefinedpotion,373,16427
+splrefinedpot,373,16427
splashharmingleveliipotion,373,16428
splashdamageleveliipotion,373,16428
splashdmgleveliipotion,373,16428
@@ -4550,6 +4744,82 @@ splharmingiipot,373,16428
spldamageiipot,373,16428
spldmgiipot,373,16428
spd2pot,373,16428
+splashcordialpotion,373,16429
+splashcordialpot,373,16429
+splcordialpotion,373,16429
+splcordialpot,373,16429
+splashsparklingpotion,373,16430
+splashsparklingpot,373,16430
+splsparklingpotion,373,16430
+splsparklingpot,373,16430
+splashsparklingextendedpotion,373,16431
+splashsparklingexpotion,373,16431
+splashsparkling2potion,373,16431
+splashsparklingextendedpot,373,16431
+splashsparklingexpot,373,16431
+splashsparkling2pot,373,16431
+splsparklingextendedpotion,373,16431
+splsparklingexpotion,373,16431
+splsparkling2potion,373,16431
+splsparklingextendedpot,373,16431
+splsparklingexpot,373,16431
+splsparkling2pot,373,16431
+splashpotentpotion,373,16432
+splashpotentpot,373,16432
+splpotentpotion,373,16432
+splpotentpot,373,16432
+splashrankpotion,373,16438
+splashrankpot,373,16438
+splrankpotion,373,16438
+splrankpot,373,16438
+splashrankextendedpotion,373,16439
+splashrankexpotion,373,16439
+splashrank2potion,373,16439
+splashrankextendedpot,373,16439
+splashrankexpot,373,16439
+splashrank2pot,373,16439
+splrankextendedpotion,373,16439
+splrankexpotion,373,16439
+splrank2potion,373,16439
+splrankextendedpot,373,16439
+splrankexpot,373,16439
+splrank2pot,373,16439
+splashacridpotion,373,16443
+splashacridpot,373,16443
+splacridpotion,373,16443
+splacridpot,373,16443
+splashgrosspotion,373,16445
+splashgrosspot,373,16445
+splgrosspotion,373,16445
+splgrosspot,373,16445
+splashstinkypotion,373,16446
+splashstinkypot,373,16446
+splstinkypotion,373,16446
+splstinkypot,373,16446
+splashstinkyextendedpotion,373,16447
+splashstinkyexpotion,373,16447
+splashstinky2potion,373,16447
+splashstinkyextendedpot,373,16447
+splashstinkyexpot,373,16447
+splashstinky2pot,373,16447
+splstinkyextendedpotion,373,16447
+splstinkyexpotion,373,16447
+splstinky2potion,373,16447
+splstinkyextendedpot,373,16447
+splstinkyexpot,373,16447
+splstinky2pot,373,16447
+splashmundaneextendedpotion,373,16448
+splashmundaneexpotion,373,16448
+splashmundane2potion,373,16448
+splashmundaneextendedpot,373,16448
+splashmundaneexpot,373,16448
+splashmundane2pot,373,16448
+splmundaneextendedpotion,373,16448
+splmundaneexpotion,373,16448
+splmundane2potion,373,16448
+splmundaneextendedpot,373,16448
+splmundaneexpot,373,16448
+splmundane2pot,373,16448
splashregenerationextendedpotion,373,16449
splashregenerateextendedpotion,373,16449
splashregenextendepotion,373,16449
diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties
index 37b8f0945..4852f2bef 100644
--- a/Essentials/src/messages.properties
+++ b/Essentials/src/messages.properties
@@ -457,3 +457,4 @@ uptime=\u00a76Uptime:\u00a7c {0}
antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
+invalidHomeName=\u00a74Invalid home name
diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties
index c0bb5a3d0..26e039001 100644
--- a/Essentials/src/messages_cs.properties
+++ b/Essentials/src/messages_cs.properties
@@ -460,3 +460,4 @@ uptime=\u00a76Uptime:\u00a7c {0}
antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
+invalidHomeName=\u00a74Invalid home name
diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties
index e1245de43..9419ad45e 100644
--- a/Essentials/src/messages_da.properties
+++ b/Essentials/src/messages_da.properties
@@ -457,3 +457,4 @@ uptime=\u00a76Uptime:\u00a7c {0}
antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
+invalidHomeName=\u00a74Invalid home name
diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties
index 7beb49169..90e373b33 100644
--- a/Essentials/src/messages_de.properties
+++ b/Essentials/src/messages_de.properties
@@ -230,7 +230,7 @@ nickChanged=Nickname ge\u00e4ndert.
nickDisplayName=\u00a77Du musst \u00a7fchange-displayname\u00a7c in der Essentials-Config aktivieren.
nickInUse=\u00a7cDieser Name wird bereits verwendet.
nickNamesAlpha=\u00a7cNicknamen d\u00fcrfen nur alphanumerische Zeichen enthalten.
-nickNoMore=\u00a7Du hast keinen Nicknamen mehr.
+nickNoMore=\u00a7cDu hast keinen Nicknamen mehr.
nickOthersPermission=\u00a7cDu hast keine Rechte um den Nicknamen von anderen zu \u00e4ndern.
nickSet=\u00a77Dein Nickname ist nun \u00a7c{0}
noAccessCommand=\u00a7cDu hast keinen Zugriff auf diesen Befehl.
@@ -457,3 +457,4 @@ uptime=\u00a76Uptime:\u00a7c {0}
antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
+invalidHomeName=\u00a74Invalid home name
diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties
index 37b8f0945..4852f2bef 100644
--- a/Essentials/src/messages_en.properties
+++ b/Essentials/src/messages_en.properties
@@ -457,3 +457,4 @@ uptime=\u00a76Uptime:\u00a7c {0}
antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
+invalidHomeName=\u00a74Invalid home name
diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties
index 78738532d..b3b098d91 100644
--- a/Essentials/src/messages_es.properties
+++ b/Essentials/src/messages_es.properties
@@ -457,3 +457,4 @@ uptime=\u00a76Uptime:\u00a7c {0}
antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
+invalidHomeName=\u00a74Invalid home name
diff --git a/Essentials/src/messages_fi.properties b/Essentials/src/messages_fi.properties
index 97bf0ae36..8dd5343ad 100644
--- a/Essentials/src/messages_fi.properties
+++ b/Essentials/src/messages_fi.properties
@@ -457,3 +457,4 @@ uptime=\u00a76Uptime:\u00a7c {0}
antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
+invalidHomeName=\u00a74Invalid home name
diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties
index 242616fbb..7468952a6 100644
--- a/Essentials/src/messages_fr.properties
+++ b/Essentials/src/messages_fr.properties
@@ -457,3 +457,4 @@ uptime=\u00a76Uptime:\u00a7c {0}
antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
+invalidHomeName=\u00a74Invalid home name
diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties
index 042ee1412..91e2e8f27 100644
--- a/Essentials/src/messages_it.properties
+++ b/Essentials/src/messages_it.properties
@@ -457,3 +457,4 @@ uptime=\u00a76Uptime:\u00a7c {0}
antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
+invalidHomeName=\u00a74Invalid home name
diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties
index 0e8849f34..62be530f1 100644
--- a/Essentials/src/messages_nl.properties
+++ b/Essentials/src/messages_nl.properties
@@ -457,3 +457,4 @@ uptime=\u00a76Uptime:\u00a7c {0}
antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
+invalidHomeName=\u00a74Invalid home name
diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties
index d6dccc753..1a1e73d65 100644
--- a/Essentials/src/messages_pl.properties
+++ b/Essentials/src/messages_pl.properties
@@ -457,3 +457,4 @@ uptime=\u00a76Uptime:\u00a7c {0}
antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
+invalidHomeName=\u00a74Invalid home name
diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties
index 9ee14ed91..11a2c1df0 100644
--- a/Essentials/src/messages_pt.properties
+++ b/Essentials/src/messages_pt.properties
@@ -457,3 +457,4 @@ uptime=\u00a76Uptime:\u00a7c {0}
antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
+invalidHomeName=\u00a74Invalid home name
diff --git a/Essentials/src/messages_se.properties b/Essentials/src/messages_se.properties
index 4701d34c2..c7685d6f4 100644
--- a/Essentials/src/messages_se.properties
+++ b/Essentials/src/messages_se.properties
@@ -457,3 +457,4 @@ uptime=\u00a76Uptime:\u00a7c {0}
antiBuildCraft=\u00a74You are not permitted to create\u00a7c {0}\u00a74.
antiBuildDrop=\u00a74You are not permitted to drop\u00a7c {0}\u00a74.
gcWorld=\u00a76{0} "\u00a7c{1}\u00a76": \u00a7c{2}\u00a76 chunks, \u00a7c{3}\u00a76 entities
+invalidHomeName=\u00a74Invalid home name
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index c170b725a..0c9b13a47 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -198,4 +198,6 @@ v 2.0:
- Give a better error when a subgroup is null.
- Include the GM version when logging errors.
- Fix Synchronization on adding subgroups (thanks snowleo).
- - Remove info node support from GlobalGroups. It should not have them as GlobalGroups are only permission collections. \ No newline at end of file
+ - Remove info node support from GlobalGroups. It should not have them as GlobalGroups are only permission collections.
+ - Change order of data in Users.yml to [name, Group, SubGroup, Permissions, Info nodes].
+ - Add alphabetically sorted user lists. \ 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 46ec861a3..ee1130483 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
@@ -1654,7 +1654,7 @@ public class GroupManager extends JavaPlugin {
try {
worldsHolder.saveChanges(forced);
- sender.sendMessage(ChatColor.YELLOW + " All changes were saved.");
+ sender.sendMessage(ChatColor.YELLOW + "All changes were saved.");
} catch (IllegalStateException ex) {
sender.sendMessage(ChatColor.RED + ex.getMessage());
}
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java
index fdd099c87..418405f65 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/GroupsDataHolder.java
@@ -69,7 +69,7 @@ public class GroupsDataHolder {
}
/**
- * @param groups the groups to set
+ * Resets the Groups
*/
public void resetGroups() {
this.groups.clear();
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java
index 8a3c4c102..5f14a7d45 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/UsersDataHolder.java
@@ -52,7 +52,7 @@ public class UsersDataHolder {
}
/**
- * @param users the users to set
+ * Resets the Users
*/
public void resetUsers() {
this.users.clear();
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
index 4d85eff68..a4b346154 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java
@@ -15,8 +15,10 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.TreeSet;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.anjocaido.groupmanager.GroupManager;
@@ -37,9 +39,9 @@ import org.yaml.snakeyaml.constructor.SafeConstructor;
import org.yaml.snakeyaml.reader.UnicodeReader;
/**
- * One instance of this should exist per world/mirror
- * it contains all functions to manage these data sets
- * and points to the relevant users and groups objects.
+ * One instance of this should exist per world/mirror it contains all functions
+ * to manage these data sets and points to the relevant users and groups
+ * objects.
*
* @author gabrielcouto, ElgarL
*/
@@ -100,8 +102,8 @@ public class WorldDataHolder {
}
/**
- * Search for a user. If it doesn't exist, create a new one with
- * default group.
+ * 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
@@ -207,8 +209,8 @@ public class WorldDataHolder {
}
/**
- * Check if a group exists.
- * Its the same of getGroup, but check if it is null.
+ * 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.
@@ -272,8 +274,7 @@ public class WorldDataHolder {
}
/**
- * Creates a new User with the given name
- * and adds it to this holder.
+ * 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
@@ -291,8 +292,7 @@ public class WorldDataHolder {
}
/**
- * Creates a new Group with the given name
- * and adds it to this holder
+ * 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
@@ -319,7 +319,8 @@ public class WorldDataHolder {
* @return a collection of the groups
*/
public Collection<Group> getGroupList() {
- synchronized(getGroups()) {
+
+ synchronized (getGroups()) {
return new ArrayList<Group>(getGroups().values());
}
}
@@ -329,7 +330,8 @@ public class WorldDataHolder {
* @return a collection of the users
*/
public Collection<User> getUserList() {
- synchronized(getUsers()) {
+
+ synchronized (getUsers()) {
return new ArrayList<User>(getUsers().values());
}
}
@@ -510,7 +512,7 @@ public class WorldDataHolder {
} catch (Exception ex) {
throw new IllegalArgumentException("Your " + groupsFile.getPath() + " file is invalid. See console for details.", ex);
}
-
+
if (allGroupsNode == null) {
throw new IllegalArgumentException("You have no groups in " + groupsFile.getPath() + ".");
}
@@ -520,8 +522,7 @@ public class WorldDataHolder {
Integer groupCount = 0;
/*
- * loop each group entry
- * and process it's data.
+ * loop each group entry and process it's data.
*/
while (groupItr.hasNext()) {
@@ -545,8 +546,7 @@ public class WorldDataHolder {
}
/*
- * Create a new group with this name
- * in the assigned data source.
+ * Create a new group with this name in the assigned data source.
*/
Group thisGrp = ph.createGroup(groupKey);
@@ -569,8 +569,8 @@ public class WorldDataHolder {
*/
} else if ((Boolean.parseBoolean(nodeData.toString()))) {
/*
- * Set this as the default group.
- * Warn if some other group has already claimed that position.
+ * 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.");
@@ -590,8 +590,7 @@ public class WorldDataHolder {
if (nodeData == null) {
/*
- * If no permissions node is found, or it's empty
- * do nothing.
+ * If no permissions node is found, or it's empty do nothing.
*/
} else {
/*
@@ -677,8 +676,8 @@ public class WorldDataHolder {
if (nodeData == null || nodeData instanceof List) {
if (nodeData == null) {
/*
- * If no inheritance node is found, or it's empty
- * do nothing.
+ * If no inheritance node is found, or it's empty do
+ * nothing.
*/
} else if (nodeData instanceof List) {
@@ -790,10 +789,10 @@ public class WorldDataHolder {
// Attempt to fetch the next user name.
node = usersItr.next();
if (node instanceof Integer)
- usersKey = Integer.toString((Integer)node);
+ usersKey = Integer.toString((Integer) node);
else
usersKey = node.toString();
-
+
} catch (Exception ex) {
throw new IllegalArgumentException("Invalid node type for user entry (" + userCount + ") in file: " + usersFile.getPath(), ex);
}
@@ -821,8 +820,8 @@ public class WorldDataHolder {
if (nodeData == null) {
/*
- * If no permissions node is found, or it's empty
- * do nothing.
+ * If no permissions node is found, or it's empty do
+ * nothing.
*/
} else {
if (nodeData instanceof List) {
@@ -858,8 +857,7 @@ public class WorldDataHolder {
if (nodeData == null) {
/*
- * If no subgroups node is found, or it's empty
- * do nothing.
+ * If no subgroups node is found, or it's empty do nothing.
*/
} else if (nodeData instanceof List) {
for (Object o : ((List) nodeData)) {
@@ -894,8 +892,7 @@ public class WorldDataHolder {
if (nodeData == null) {
/*
- * If no info node is found, or it's empty
- * do nothing.
+ * If no info node is found, or it's empty do nothing.
*/
} else if (nodeData instanceof Map) {
thisUser.setVariables((Map<String, Object>) nodeData);
@@ -946,29 +943,29 @@ public class WorldDataHolder {
Map<String, Object> groupsMap = new HashMap<String, Object>();
root.put("groups", groupsMap);
- synchronized(ph.getGroups()) {
- for (String groupKey : ph.getGroups().keySet()) {
- Group group = ph.getGroups().get(groupKey);
+ synchronized (ph.getGroups()) {
+ for (String groupKey : ph.getGroups().keySet()) {
+ Group group = ph.getGroups().get(groupKey);
- Map<String, Object> aGroupMap = new HashMap<String, Object>();
- groupsMap.put(group.getName(), aGroupMap);
+ Map<String, Object> aGroupMap = new HashMap<String, Object>();
+ 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()));
+ if (ph.getDefaultGroup() == null) {
+ GroupManager.logger.severe("There is no default group for world: " + ph.getName());
+ }
+ aGroupMap.put("default", group.equals(ph.getDefaultGroup()));
- Map<String, Object> infoMap = new HashMap<String, Object>();
- aGroupMap.put("info", infoMap);
+ Map<String, Object> infoMap = new HashMap<String, Object>();
+ aGroupMap.put("info", infoMap);
- for (String infoKey : group.getVariables().getVarKeyList()) {
- infoMap.put(infoKey, group.getVariables().getVarObject(infoKey));
- }
+ for (String infoKey : group.getVariables().getVarKeyList()) {
+ infoMap.put(infoKey, group.getVariables().getVarObject(infoKey));
+ }
- aGroupMap.put("inheritance", group.getInherits());
+ aGroupMap.put("inheritance", group.getInherits());
- aGroupMap.put("permissions", group.getPermissionList());
- }
+ aGroupMap.put("permissions", group.getPermissionList());
+ }
}
if (!root.isEmpty()) {
@@ -1008,18 +1005,9 @@ public class WorldDataHolder {
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) {
- * }
- * }
+ * 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) { } }
*/
}
@@ -1032,39 +1020,45 @@ public class WorldDataHolder {
public static void writeUsers(WorldDataHolder ph, File usersFile) {
Map<String, Object> root = new HashMap<String, Object>();
-
- Map<String, Object> usersMap = new HashMap<String, Object>();
+ LinkedHashMap<String, Object> usersMap = new LinkedHashMap<String, Object>();
+
root.put("users", usersMap);
- synchronized(ph.getUsers()) {
- 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;
- }
+ synchronized (ph.getUsers()) {
+
+ // A sorted list of users.
+ for (String userKey : new TreeSet<String>(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<String, Object> aUserMap = new HashMap<String, Object>();
- usersMap.put(user.getName(), aUserMap);
+ LinkedHashMap<String, Object> aUserMap = new LinkedHashMap<String, Object>();
+ 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<String, Object> infoMap = new HashMap<String, Object>();
- aUserMap.put("info", infoMap);
- for (String infoKey : user.getVariables().getVarKeyList()) {
- infoMap.put(infoKey, user.getVariables().getVarObject(infoKey));
+ // GROUP NODE
+ if (user.getGroup() == null) {
+ aUserMap.put("group", ph.getDefaultGroup().getName());
+ } else {
+ aUserMap.put("group", user.getGroup().getName());
}
- }
- // END USER INFO NODE - BETA
- aUserMap.put("permissions", user.getPermissionList());
- // SUBGROUPS NODE - BETA
- aUserMap.put("subgroups", user.subGroupListStringCopy());
- // END SUBGROUPS NODE - BETA
- }
+ // SUBGROUPS NODE
+ aUserMap.put("subgroups", user.subGroupListStringCopy());
+
+ // PERMISSIONS NODE
+ aUserMap.put("permissions", user.getPermissionList());
+
+ // USER INFO NODE - BETA
+ if (user.getVariables().getSize() > 0) {
+ Map<String, Object> infoMap = new HashMap<String, Object>();
+ aUserMap.put("info", infoMap);
+ for (String infoKey : user.getVariables().getVarKeyList()) {
+ infoMap.put(infoKey, user.getVariables().getVarObject(infoKey));
+ }
+ }
+ // END USER INFO NODE - BETA
+
+ }
}
if (!root.isEmpty()) {
@@ -1090,32 +1084,20 @@ public class WorldDataHolder {
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) {
- * }
- * }
+ * 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.
+ * 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.
+ * 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
@@ -1165,13 +1147,13 @@ public class WorldDataHolder {
if (users.HaveUsersChanged()) {
return true;
}
- synchronized(users.getUsers()) {
- for (User u : users.getUsers().values()) {
- if (u.isChanged()) {
- return true;
+ synchronized (users.getUsers()) {
+ for (User u : users.getUsers().values()) {
+ if (u.isChanged()) {
+ return true;
+ }
}
}
- }
return false;
}
@@ -1192,13 +1174,13 @@ public class WorldDataHolder {
if (groups.HaveGroupsChanged()) {
return true;
}
- synchronized(groups.getGroups()) {
- for (Group g : groups.getGroups().values()) {
- if (g.isChanged()) {
- return true;
+ synchronized (groups.getGroups()) {
+ for (Group g : groups.getGroups().values()) {
+ if (g.isChanged()) {
+ return true;
+ }
}
}
- }
return false;
}
@@ -1208,10 +1190,10 @@ public class WorldDataHolder {
public void removeUsersChangedFlag() {
setUsersChanged(false);
- synchronized(getUsers()) {
- for (User u : getUsers().values()) {
- u.flagAsSaved();
- }
+ synchronized (getUsers()) {
+ for (User u : getUsers().values()) {
+ u.flagAsSaved();
+ }
}
}
@@ -1221,10 +1203,10 @@ public class WorldDataHolder {
public void removeGroupsChangedFlag() {
setGroupsChanged(false);
- synchronized(getGroups()) {
- for (Group g : getGroups().values()) {
- g.flagAsSaved();
- }
+ synchronized (getGroups()) {
+ for (Group g : getGroups().values()) {
+ g.flagAsSaved();
+ }
}
}
@@ -1281,11 +1263,13 @@ public class WorldDataHolder {
* Resets Users
*/
public void resetUsers() {
+
users.resetUsers();
}
/**
* Note: Iteration over this object has to be synchronized!
+ *
* @return the groups
*/
public Map<String, Group> getGroups() {
@@ -1295,6 +1279,7 @@ public class WorldDataHolder {
/**
* Note: Iteration over this object has to be synchronized!
+ *
* @return the users
*/
public Map<String, User> getUsers() {
diff --git a/EssentialsGroupManager/src/users.yml b/EssentialsGroupManager/src/users.yml
index 72a7b652f..19496ad84 100644
--- a/EssentialsGroupManager/src/users.yml
+++ b/EssentialsGroupManager/src/users.yml
@@ -1,15 +1,15 @@
# "For a more advanced configuration example utilizing the advanced features of GroupManager, see http://pastebin.com/a8ZA0j5G"
users:
snowleo:
+ group: Builder
subgroups: []
permissions: []
- group: Builder
KHobbits:
+ group: Moderator
subgroups: []
permissions: []
- group: Moderator
ElgarL:
+ group: Moderator
subgroups: []
permissions: []
- group: Moderator