Merge branch 'refs/heads/master' into release

This commit is contained in:
snowleo 2011-11-27 20:59:19 +01:00
commit 0ed7f87ee0
66 changed files with 1733 additions and 873 deletions

View File

@ -42,7 +42,11 @@ public class AlternativeCommandsHandler
PluginCommand reg = ess.getServer().getPluginCommand(pluginName + ":" + pc.getName().toLowerCase(Locale.ENGLISH)); PluginCommand reg = ess.getServer().getPluginCommand(pluginName + ":" + pc.getName().toLowerCase(Locale.ENGLISH));
if (reg == null) if (reg == null)
{ {
reg = Bukkit.getServer().getPluginCommand(pc.getName().toLowerCase(Locale.ENGLISH)); reg = ess.getServer().getPluginCommand(pc.getName().toLowerCase(Locale.ENGLISH));
}
if (reg == null || !reg.getPlugin().equals(plugin))
{
continue;
} }
for (String label : labels) for (String label : labels)
{ {
@ -78,7 +82,7 @@ public class AlternativeCommandsHandler
while (pcIterator.hasNext()) while (pcIterator.hasNext())
{ {
final PluginCommand pc = pcIterator.next(); final PluginCommand pc = pcIterator.next();
if (pc.getPlugin().equals(plugin)) if (pc.getPlugin() == null || pc.getPlugin().equals(plugin))
{ {
pcIterator.remove(); pcIterator.remove();
} }

View File

@ -23,6 +23,7 @@ import com.earth2me.essentials.commands.EssentialsCommand;
import com.earth2me.essentials.commands.IEssentialsCommand; import com.earth2me.essentials.commands.IEssentialsCommand;
import com.earth2me.essentials.commands.NoChargeException; import com.earth2me.essentials.commands.NoChargeException;
import com.earth2me.essentials.commands.NotEnoughArgumentsException; import com.earth2me.essentials.commands.NotEnoughArgumentsException;
import com.earth2me.essentials.craftbukkit.ItemDupeFix;
import com.earth2me.essentials.perm.PermissionsHandler; import com.earth2me.essentials.perm.PermissionsHandler;
import com.earth2me.essentials.register.payment.Methods; import com.earth2me.essentials.register.payment.Methods;
import com.earth2me.essentials.signs.SignBlockListener; import com.earth2me.essentials.signs.SignBlockListener;
@ -56,7 +57,7 @@ import org.bukkit.scheduler.BukkitScheduler;
public class Essentials extends JavaPlugin implements IEssentials public class Essentials extends JavaPlugin implements IEssentials
{ {
public static final int BUKKIT_VERSION = 1467; public static final int BUKKIT_VERSION = 1518;
private static final Logger LOGGER = Logger.getLogger("Minecraft"); private static final Logger LOGGER = Logger.getLogger("Minecraft");
private transient ISettings settings; private transient ISettings settings;
private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this);
@ -177,10 +178,11 @@ public class Essentials extends JavaPlugin implements IEssentials
pm.registerEvent(Type.PLAYER_MOVE, playerListener, Priority.High, this); pm.registerEvent(Type.PLAYER_MOVE, playerListener, Priority.High, this);
pm.registerEvent(Type.PLAYER_LOGIN, playerListener, Priority.High, this); pm.registerEvent(Type.PLAYER_LOGIN, playerListener, Priority.High, this);
pm.registerEvent(Type.PLAYER_TELEPORT, playerListener, Priority.High, this); pm.registerEvent(Type.PLAYER_TELEPORT, playerListener, Priority.High, this);
pm.registerEvent(Type.PLAYER_INTERACT, playerListener, Priority.High, this);
pm.registerEvent(Type.PLAYER_EGG_THROW, playerListener, Priority.High, this); pm.registerEvent(Type.PLAYER_EGG_THROW, playerListener, Priority.High, this);
pm.registerEvent(Type.PLAYER_BUCKET_EMPTY, playerListener, Priority.High, this); pm.registerEvent(Type.PLAYER_BUCKET_EMPTY, playerListener, Priority.High, this);
pm.registerEvent(Type.PLAYER_ANIMATION, playerListener, Priority.High, this); pm.registerEvent(Type.PLAYER_ANIMATION, playerListener, Priority.High, this);
pm.registerEvent(Type.PLAYER_CHANGED_WORLD, playerListener, Priority.Normal, this);
pm.registerEvent(Type.PLAYER_TELEPORT, new ItemDupeFix(), Priority.Monitor, this);
final EssentialsBlockListener blockListener = new EssentialsBlockListener(this); final EssentialsBlockListener blockListener = new EssentialsBlockListener(this);
pm.registerEvent(Type.BLOCK_PLACE, blockListener, Priority.Lowest, this); pm.registerEvent(Type.BLOCK_PLACE, blockListener, Priority.Lowest, this);
@ -343,6 +345,9 @@ public class Essentials extends JavaPlugin implements IEssentials
{ {
sender.sendMessage(command.getDescription()); sender.sendMessage(command.getDescription());
sender.sendMessage(command.getUsage().replaceAll("<command>", commandLabel)); sender.sendMessage(command.getUsage().replaceAll("<command>", commandLabel));
if (!ex.getMessage().isEmpty()) {
sender.sendMessage(ex.getMessage());
}
return true; return true;
} }
catch (Throwable ex) catch (Throwable ex)

View File

@ -2,7 +2,10 @@ package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n._;
import java.io.*; import java.io.*;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -10,6 +13,7 @@ import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.util.config.Configuration; import org.bukkit.util.config.Configuration;
@ -224,13 +228,25 @@ public class EssentialsConf extends Configuration
public ItemStack getItemStack(final String path) public ItemStack getItemStack(final String path)
{ {
return new ItemStack( final ItemStack stack = new ItemStack(
Material.valueOf(getString(path + ".type", "AIR")), Material.valueOf(getString(path + ".type", "AIR")),
getInt(path + ".amount", 1), getInt(path + ".amount", 1),
(short)getInt(path + ".damage", 0)/* (short)getInt(path + ".damage", 0));
List<String> enchants = getKeys(path + ".enchant");
for (String enchant : enchants)
{
Enchantment enchantment = Enchantment.getByName(enchant.toUpperCase(Locale.ENGLISH));
if (enchantment == null) {
continue;
}
int level = getInt(path+ ".enchant."+enchant, enchantment.getStartLevel());
stack.addUnsafeEnchantment(enchantment, level);
}
return stack;
/*
* , * ,
* (byte)getInt(path + ".data", 0) * (byte)getInt(path + ".data", 0)
*/); */
} }
public void setProperty(final String path, final ItemStack stack) public void setProperty(final String path, final ItemStack stack)
@ -239,6 +255,16 @@ public class EssentialsConf extends Configuration
map.put("type", stack.getType().toString()); map.put("type", stack.getType().toString());
map.put("amount", stack.getAmount()); map.put("amount", stack.getAmount());
map.put("damage", stack.getDurability()); map.put("damage", stack.getDurability());
Map<Enchantment, Integer> enchantments = stack.getEnchantments();
if (!enchantments.isEmpty())
{
Map<String, Integer> enchant = new HashMap<String, Integer>();
for (Map.Entry<Enchantment, Integer> entry : enchantments.entrySet())
{
enchant.put(entry.getKey().getName().toLowerCase(Locale.ENGLISH), entry.getValue());
}
map.put("enchant", enchant);
}
// getData().getData() is broken // getData().getData() is broken
//map.put("data", stack.getDurability()); //map.put("data", stack.getDurability());
setProperty(path, map); setProperty(path, map);

View File

@ -3,6 +3,8 @@ package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n._;
import java.util.List; import java.util.List;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.bukkit.Material;
import org.bukkit.entity.Animals;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
@ -49,6 +51,18 @@ public class EssentialsEntityListener extends EntityListener
} }
} }
} }
if (eDefend instanceof Animals && eAttack instanceof Player)
{
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);
}
}
} }
if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled()) if (event.getEntity() instanceof Player && ess.getUser(event.getEntity()).isGodModeEnabled())
{ {

View File

@ -1,5 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import com.earth2me.essentials.craftbukkit.EnchantmentFix;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.textreader.IText; import com.earth2me.essentials.textreader.IText;
import com.earth2me.essentials.textreader.KeywordReplacer; import com.earth2me.essentials.textreader.KeywordReplacer;
@ -16,7 +17,6 @@ import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerLoginEvent.Result; import org.bukkit.event.player.PlayerLoginEvent.Result;
import org.bukkit.event.player.*; import org.bukkit.event.player.*;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -115,7 +115,7 @@ public class EssentialsPlayerListener extends PlayerListener
} }
if (user.getSavedInventory() != null) if (user.getSavedInventory() != null)
{ {
user.getInventory().setContents(user.getSavedInventory()); EnchantmentFix.setContents(user.getInventory(), user.getSavedInventory());
user.setSavedInventory(null); user.setSavedInventory(null);
} }
user.updateActivity(false); user.updateActivity(false);
@ -172,13 +172,20 @@ public class EssentialsPlayerListener extends PlayerListener
{ {
final IText input = new TextInput(user, "motd", true, ess); final IText input = new TextInput(user, "motd", true, ess);
final IText output = new KeywordReplacer(input, user, ess); final IText output = new KeywordReplacer(input, user, ess);
final TextPager pager = new TextPager(output, false); final TextPager pager = new TextPager(output, true);
pager.showPage("1", null, user); pager.showPage("1", null, user);
} }
catch (IOException ex) catch (IOException ex)
{
if (ess.getSettings().isDebug())
{ {
LOGGER.log(Level.WARNING, ex.getMessage(), ex); LOGGER.log(Level.WARNING, ex.getMessage(), ex);
} }
else
{
LOGGER.log(Level.WARNING, ex.getMessage());
}
}
} }
if (!ess.getSettings().isCommandDisabled("mail") && user.isAuthorized("essentials.mail")) if (!ess.getSettings().isCommandDisabled("mail") && user.isAuthorized("essentials.mail"))
@ -231,12 +238,14 @@ public class EssentialsPlayerListener extends PlayerListener
private void updateCompass(final User user) private void updateCompass(final User user)
{ {
try Location loc = user.getHome(user.getLocation());
if (loc == null)
{ {
user.setCompassTarget(user.getHome(user.getLocation())); loc = user.getBedSpawnLocation();
} }
catch (Exception ex) if (loc != null)
{ {
user.setCompassTarget(loc);
} }
} }
@ -255,32 +264,6 @@ public class EssentialsPlayerListener extends PlayerListener
updateCompass(user); updateCompass(user);
} }
@Override
public void onPlayerInteract(final PlayerInteractEvent event)
{
if (event.isCancelled())
{
return;
}
if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
{
return;
}
if (ess.getSettings().getBedSetsHome() && event.getClickedBlock().getType() == Material.BED_BLOCK)
{
try
{
final User user = ess.getUser(event.getPlayer());
user.setHome();
user.sendMessage(_("homeSetToBed"));
}
catch (Throwable ex)
{
}
}
}
@Override @Override
public void onPlayerEggThrow(final PlayerEggThrowEvent event) public void onPlayerEggThrow(final PlayerEggThrowEvent event)
{ {
@ -385,4 +368,17 @@ public class EssentialsPlayerListener extends PlayerListener
user.updateActivity(true); user.updateActivity(true);
} }
} }
@Override
public void onPlayerChangedWorld(final PlayerChangedWorldEvent event)
{
if (ess.getSettings().getNoGodWorlds().contains(event.getPlayer().getLocation().getWorld().getName()))
{
User user = ess.getUser(event.getPlayer());
if (user.isGodModeEnabledRaw())
{
user.sendMessage(_("noGodWorldWarning"));
}
}
}
} }

View File

@ -19,7 +19,7 @@ public class FakeInventory implements Inventory
{ {
continue; continue;
} }
this.items[i] = new ItemStack(items[i].getTypeId(), items[i].getAmount(), items[i].getDurability()); this.items[i] = items[i].clone();
} }
} }

View File

@ -1,5 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import java.io.File;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import org.bukkit.*; import org.bukkit.*;
@ -515,4 +516,10 @@ public class FakeWorld implements World
{ {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
@Override
public File getWorldFolder()
{
throw new UnsupportedOperationException("Not supported yet.");
}
} }

View File

@ -3,12 +3,12 @@ package com.earth2me.essentials;
import com.earth2me.essentials.commands.IEssentialsCommand; import com.earth2me.essentials.commands.IEssentialsCommand;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
public interface ISettings extends IConf public interface ISettings extends IConf
{ {
boolean areSignsDisabled(); boolean areSignsDisabled();
String format(String format, IUser user); String format(String format, IUser user);
@ -21,8 +21,6 @@ public interface ISettings extends IConf
long getBackupInterval(); long getBackupInterval();
boolean getBedSetsHome();
String getChatFormat(String group); String getChatFormat(String group);
int getChatRadius(); int getChatRadius();
@ -138,4 +136,6 @@ public interface ISettings extends IConf
boolean areDeathMessagesEnabled(); boolean areDeathMessagesEnabled();
public void setDebug(boolean debug); public void setDebug(boolean debug);
Set<String> getNoGodWorlds();
} }

View File

@ -1,5 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import com.earth2me.essentials.craftbukkit.EnchantmentFix;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.bukkit.Location; import org.bukkit.Location;
@ -34,7 +35,7 @@ public final class InventoryWorkaround
{ {
continue; continue;
} }
if (item.getTypeId() == cItem.getTypeId() && (!forceAmount || item.getAmount() == cItem.getAmount()) && (!forceDurability || cItem.getDurability() == item.getDurability())) if (item.getTypeId() == cItem.getTypeId() && (!forceAmount || item.getAmount() == cItem.getAmount()) && (!forceDurability || cItem.getDurability() == item.getDurability()) && cItem.getEnchantments().equals(item.getEnchantments()))
{ {
return i; return i;
} }
@ -56,7 +57,7 @@ public final class InventoryWorkaround
{ {
continue; continue;
} }
if (item.getTypeId() == cItem.getTypeId() && cItem.getAmount() < cItem.getType().getMaxStackSize() && (!forceDurability || cItem.getDurability() == item.getDurability())) if (item.getTypeId() == cItem.getTypeId() && cItem.getAmount() < cItem.getType().getMaxStackSize() && (!forceDurability || cItem.getDurability() == item.getDurability()) && cItem.getEnchantments().equals(item.getEnchantments()))
{ {
return i; return i;
} }
@ -79,6 +80,11 @@ public final class InventoryWorkaround
} }
public static Map<Integer, ItemStack> addItem(final Inventory cinventory, final boolean forceDurability, final ItemStack... items) public static Map<Integer, ItemStack> addItem(final Inventory cinventory, final boolean forceDurability, final ItemStack... items)
{
return addItem(cinventory, forceDurability, false, null, items);
}
public static Map<Integer, ItemStack> addItem(final Inventory cinventory, final boolean forceDurability, final boolean dontBreakStacks, final IEssentials ess, final ItemStack... items)
{ {
final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>(); final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
@ -101,10 +107,10 @@ public final class InventoryWorkaround
{ {
if (combined[j] == null) if (combined[j] == null)
{ {
combined[j] = new ItemStack(items[i].getType(), items[i].getAmount(), items[i].getDurability()); combined[j] = items[i].clone();
break; break;
} }
if (combined[j].getTypeId() == items[i].getTypeId() && (!forceDurability || combined[j].getDurability() == items[i].getDurability())) if (combined[j].getTypeId() == items[i].getTypeId() && (!forceDurability || combined[j].getDurability() == items[i].getDurability()) && combined[j].getEnchantments().equals(items[i].getEnchantments()))
{ {
combined[j].setAmount(combined[j].getAmount() + items[i].getAmount()); combined[j].setAmount(combined[j].getAmount() + items[i].getAmount());
break; break;
@ -141,15 +147,17 @@ public final class InventoryWorkaround
else else
{ {
// More than a single stack! // More than a single stack!
if (item.getAmount() > item.getType().getMaxStackSize()) if (item.getAmount() > (dontBreakStacks ? ess.getSettings().getDefaultStackSize() : item.getType().getMaxStackSize()))
{ {
cinventory.setItem(firstFree, new ItemStack(item.getTypeId(), item.getType().getMaxStackSize(), item.getDurability())); ItemStack stack = item.clone();
stack.setAmount(dontBreakStacks ? ess.getSettings().getDefaultStackSize() : item.getType().getMaxStackSize());
EnchantmentFix.setItem(cinventory, firstFree, stack);
item.setAmount(item.getAmount() - item.getType().getMaxStackSize()); item.setAmount(item.getAmount() - item.getType().getMaxStackSize());
} }
else else
{ {
// Just store it // Just store it
cinventory.setItem(firstFree, item); EnchantmentFix.setItem(cinventory, firstFree, item);
break; break;
} }
} }
@ -161,7 +169,7 @@ public final class InventoryWorkaround
final int amount = item.getAmount(); final int amount = item.getAmount();
final int partialAmount = partialItem.getAmount(); final int partialAmount = partialItem.getAmount();
final int maxAmount = partialItem.getType().getMaxStackSize(); final int maxAmount = dontBreakStacks ? ess.getSettings().getDefaultStackSize() : partialItem.getType().getMaxStackSize();
// Check if it fully fits // Check if it fully fits
if (amount + partialAmount <= maxAmount) if (amount + partialAmount <= maxAmount)
@ -228,7 +236,7 @@ public final class InventoryWorkaround
{ {
// split the stack and store // split the stack and store
itemStack.setAmount(amount - toDelete); itemStack.setAmount(amount - toDelete);
cinventory.setItem(first, itemStack); EnchantmentFix.setItem(cinventory, first, itemStack);
toDelete = 0; toDelete = 0;
} }
} }
@ -256,10 +264,10 @@ public final class InventoryWorkaround
{ {
if (combined[j] == null) if (combined[j] == null)
{ {
combined[j] = new ItemStack(items[i].getType(), items[i].getAmount(), items[i].getDurability()); combined[j] = items[i].clone();
break; break;
} }
if (combined[j].getTypeId() == items[i].getTypeId() && (!forceDurability || combined[j].getDurability() == items[i].getDurability())) if (combined[j].getTypeId() == items[i].getTypeId() && (!forceDurability || combined[j].getDurability() == items[i].getDurability()) && combined[j].getEnchantments().equals(items[i].getEnchantments()))
{ {
combined[j].setAmount(combined[j].getAmount() + items[i].getAmount()); combined[j].setAmount(combined[j].getAmount() + items[i].getAmount());
break; break;
@ -318,14 +326,18 @@ public final class InventoryWorkaround
final int maxStackSize = itm.getType().getMaxStackSize(); final int maxStackSize = itm.getType().getMaxStackSize();
final int stacks = itm.getAmount() / maxStackSize; final int stacks = itm.getAmount() / maxStackSize;
final int leftover = itm.getAmount() % maxStackSize; final int leftover = itm.getAmount() % maxStackSize;
Item[] itemStacks = new Item[stacks + (leftover > 0 ? 1 : 0)]; final Item[] itemStacks = new Item[stacks + (leftover > 0 ? 1 : 0)];
for (int i = 0; i < stacks; i++) for (int i = 0; i < stacks; i++)
{ {
itemStacks[i] = loc.getWorld().dropItem(loc, new ItemStack(itm.getType(), maxStackSize, itm.getDurability())); final ItemStack stack = itm.clone();
stack.setAmount(maxStackSize);
itemStacks[i] = loc.getWorld().dropItem(loc, stack);
} }
if (leftover > 0) if (leftover > 0)
{ {
itemStacks[stacks] = loc.getWorld().dropItem(loc, new ItemStack(itm.getType(), leftover, itm.getDurability())); final ItemStack stack = itm.clone();
stack.setAmount(leftover);
itemStacks[stacks] = loc.getWorld().dropItem(loc, stack);
} }
return itemStacks; return itemStacks;
} }

View File

@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.bukkit.Location; import org.bukkit.Location;
@ -67,6 +68,10 @@ public enum Mob
} }
} }
public static Set<String> getMobList() {
return hashMap.keySet();
}
public LivingEntity spawn(final Player player, final Server server, final Location loc) throws MobException public LivingEntity spawn(final Player player, final Server server, final Location loc) throws MobException
{ {

View File

@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import lombok.Delegate; import lombok.Delegate;

View File

@ -4,9 +4,12 @@ import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.commands.IEssentialsCommand; import com.earth2me.essentials.commands.IEssentialsCommand;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -33,12 +36,6 @@ public class Settings implements ISettings
return config.getBoolean("respawn-at-home", false); return config.getBoolean("respawn-at-home", false);
} }
@Override
public boolean getBedSetsHome()
{
return config.getBoolean("bed-sethome", false);
}
@Override @Override
public List<String> getMultipleHomes() public List<String> getMultipleHomes()
{ {
@ -237,7 +234,7 @@ public class Settings implements ISettings
try try
{ {
return ChatColor.valueOf(colorName.toUpperCase()); return ChatColor.valueOf(colorName.toUpperCase(Locale.ENGLISH));
} }
catch (IllegalArgumentException ex) catch (IllegalArgumentException ex)
{ {
@ -341,6 +338,7 @@ public class Settings implements ISettings
public void reloadConfig() public void reloadConfig()
{ {
config.load(); config.load();
noGodWorlds = new HashSet<String>(config.getStringList("no-god-in-worlds",Collections.<String>emptyList()));
} }
@Override @Override
@ -544,6 +542,14 @@ public class Settings implements ISettings
return config.getBoolean("death-messages", true); return config.getBoolean("death-messages", true);
} }
Set <String> noGodWorlds = new HashSet<String>();
@Override
public Set<String> getNoGodWorlds()
{
return noGodWorlds;
}
@Override @Override
public void setDebug(final boolean debug) public void setDebug(final boolean debug)
{ {

View File

@ -513,7 +513,13 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
@Override @Override
public boolean isGodModeEnabled() public boolean isGodModeEnabled()
{ {
return super.isGodModeEnabled() || (isAfk() && ess.getSettings().getFreezeAfkPlayers()); return (super.isGodModeEnabled() && !ess.getSettings().getNoGodWorlds().contains(getLocation().getWorld().getName()))
|| (isAfk() && ess.getSettings().getFreezeAfkPlayers());
}
public boolean isGodModeEnabledRaw()
{
return super.isGodModeEnabled();
} }
public String getGroup() public String getGroup()

View File

@ -130,7 +130,9 @@ public abstract class UserData extends PlayerExtension implements IConf
return loc; return loc;
} }
public Location getHome(Location world) throws Exception public Location getHome(final Location world)
{
try
{ {
Location loc; Location loc;
for (String home : getHomes()) for (String home : getHomes())
@ -145,12 +147,15 @@ public abstract class UserData extends PlayerExtension implements IConf
loc = config.getLocation("homes." + getHomes().get(0), getServer()); loc = config.getLocation("homes." + getHomes().get(0), getServer());
return loc; return loc;
} }
catch (Exception ex)
{
return null;
}
}
public List<String> getHomes() public List<String> getHomes()
{ {
List<String> list = new ArrayList(homes.keySet()); return new ArrayList(homes.keySet());
return list;
} }
public void setHome(String name, Location loc) public void setHome(String name, Location loc)

View File

@ -240,7 +240,8 @@ public class Util
AIR_MATERIALS.add(Material.PUMPKIN_STEM.getId()); AIR_MATERIALS.add(Material.PUMPKIN_STEM.getId());
AIR_MATERIALS.add(Material.MELON_STEM.getId()); AIR_MATERIALS.add(Material.MELON_STEM.getId());
AIR_MATERIALS.add(Material.VINE.getId()); AIR_MATERIALS.add(Material.VINE.getId());
//TODO: Add 1.9 materials AIR_MATERIALS.add(Material.NETHER_WARTS.getId());
AIR_MATERIALS.add(Material.WATER_LILY.getId());
for (Integer integer : AIR_MATERIALS) for (Integer integer : AIR_MATERIALS)
{ {

View File

@ -1,6 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import java.util.Locale;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -24,7 +25,7 @@ public class Commandeco extends EssentialsCommand
double amount; double amount;
try try
{ {
cmd = EcoCommands.valueOf(args[0].toUpperCase()); cmd = EcoCommands.valueOf(args[0].toUpperCase(Locale.ENGLISH));
amount = Double.parseDouble(args[2].replaceAll("[^0-9\\.]", "")); amount = Double.parseDouble(args[2].replaceAll("[^0-9\\.]", ""));
} }
catch (Exception ex) catch (Exception ex)

View File

@ -0,0 +1,148 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import com.earth2me.essentials.craftbukkit.EnchantmentFix;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.regex.Pattern;
import org.bukkit.Server;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import static com.earth2me.essentials.I18n._;
public class Commandenchant extends EssentialsCommand
{
private static final Map<String, Enchantment> ENCHANTMENTS = new HashMap<String, Enchantment>();
private static final transient Pattern NUMPATTERN = Pattern.compile("\\d+");
static
{
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("expprot", Enchantment.PROTECTION_EXPLOSIONS);
ENCHANTMENTS.put("blastprotection", Enchantment.PROTECTION_EXPLOSIONS);
ENCHANTMENTS.put("fallprotection", Enchantment.PROTECTION_FALL);
ENCHANTMENTS.put("fallprot", 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);
}
public Commandenchant()
{
super("enchant");
}
@Override
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
final ItemStack stack = user.getItemInHand();
if (stack == null)
{
throw new Exception(_("nothingInHand"));
}
if (args.length == 0)
{
final Set<String> enchantmentslist = new TreeSet<String>();
for (Map.Entry<String, Enchantment> entry : ENCHANTMENTS.entrySet())
{
final String enchantmentName = entry.getValue().getName().toLowerCase(Locale.ENGLISH);
if (enchantmentslist.contains(enchantmentName) || user.isAuthorized("essentials.enchant." + enchantmentName))
{
enchantmentslist.add(entry.getKey());
//enchantmentslist.add(enchantmentName);
}
}
throw new NotEnoughArgumentsException(_("enchantments", Util.joinList(enchantmentslist.toArray())));
}
int level = -1;
if (args.length > 1)
{
try
{
level = Integer.parseInt(args[1]);
}
catch (NumberFormatException ex)
{
level = -1;
}
}
Enchantment enchantment = getEnchantment(args[0], user);
if (level < 0 || level > enchantment.getMaxLevel())
{
level = enchantment.getMaxLevel();
}
if (level == 0) {
stack.removeEnchantment(enchantment);
} else {
stack.addEnchantment(enchantment, level);
}
EnchantmentFix.setItemInHand(user.getInventory(), stack);
user.updateInventory();
final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH);
if (level == 0) {
user.sendMessage(_("enchantmentRemoved", enchantmentName.replace('_', ' ')));
} else {
user.sendMessage(_("enchantmentApplied", enchantmentName.replace('_', ' ')));
}
}
public static Enchantment getEnchantment(final String name, final User user) throws Exception
{
Enchantment enchantment;
if (NUMPATTERN.matcher(name).matches()) {
enchantment = Enchantment.getById(Integer.parseInt(name));
} else {
enchantment = Enchantment.getByName(name.toUpperCase(Locale.ENGLISH));
}
if (enchantment == null)
{
enchantment = ENCHANTMENTS.get(name.toLowerCase(Locale.ENGLISH));
}
if (enchantment == null)
{
throw new Exception(_("enchantmentNotFound"));
}
final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH);
if (user != null && !user.isAuthorized("essentials.enchant." + enchantmentName))
{
throw new Exception(_("enchantmentPerm", enchantmentName));
}
return enchantment;
}
}

View File

@ -1,11 +1,13 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.InventoryWorkaround;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import java.util.Locale; import java.util.Locale;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -44,6 +46,29 @@ public class Commandgive extends EssentialsCommand
stack.setAmount(Integer.parseInt(args[2])); stack.setAmount(Integer.parseInt(args[2]));
} }
if (args.length > 3)
{
for (int i = 3; i < args.length; i++)
{
final String[] split = args[i].split("[:+',;.]", 2);
if (split.length < 1)
{
continue;
}
final Enchantment enchantment = Commandenchant.getEnchantment(split[0], sender instanceof Player ? ess.getUser(sender) : null);
int level;
if (split.length > 1)
{
level = Integer.parseInt(split[1]);
}
else
{
level = enchantment.getMaxLevel();
}
stack.addEnchantment(enchantment, level);
}
}
if (stack.getType() == Material.AIR) if (stack.getType() == Material.AIR)
{ {
throw new Exception(ChatColor.RED + "You can't give air."); throw new Exception(ChatColor.RED + "You can't give air.");
@ -52,7 +77,7 @@ public class Commandgive extends EssentialsCommand
final User giveTo = getPlayer(server, args, 0); final User giveTo = getPlayer(server, args, 0);
final String itemName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' '); final String itemName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' ');
sender.sendMessage(ChatColor.BLUE + "Giving " + stack.getAmount() + " of " + itemName + " to " + giveTo.getDisplayName() + "."); sender.sendMessage(ChatColor.BLUE + "Giving " + stack.getAmount() + " of " + itemName + " to " + giveTo.getDisplayName() + ".");
giveTo.getInventory().addItem(stack); InventoryWorkaround.addItem(giveTo.getInventory(), true, true, ess, stack);
giveTo.updateInventory(); giveTo.updateInventory();
} }
} }

View File

@ -6,6 +6,7 @@ import com.earth2me.essentials.User;
import com.earth2me.essentials.Util; import com.earth2me.essentials.Util;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import org.bukkit.Location;
import org.bukkit.Server; import org.bukkit.Server;
@ -33,7 +34,7 @@ public class Commandhome extends EssentialsCommand
} }
else else
{ {
player = getPlayer(server, nameParts[0].split(" "), 0, true); player = getPlayer(server, nameParts, 0, true);
if (nameParts.length > 1) if (nameParts.length > 1)
{ {
homeName = nameParts[1]; homeName = nameParts[1];
@ -42,15 +43,33 @@ public class Commandhome extends EssentialsCommand
} }
try try
{ {
if ("bed".equalsIgnoreCase(homeName)) {
final Location bed = player.getBedSpawnLocation();
if (bed != null)
{
user.getTeleport().teleport(bed, charge);
}
}
user.getTeleport().home(player, homeName.toLowerCase(Locale.ENGLISH), charge); user.getTeleport().home(player, homeName.toLowerCase(Locale.ENGLISH), charge);
} }
catch (NotEnoughArgumentsException e) catch (NotEnoughArgumentsException e)
{ {
final List<String> homes = player.getHomes(); final List<String> homes = player.getHomes();
if (homes.isEmpty() && player.equals(user) && ess.getSettings().spawnIfNoHome()) if (homes.isEmpty() && player.equals(user))
{
final Location loc = player.getBedSpawnLocation();
if (loc == null)
{
if (ess.getSettings().spawnIfNoHome())
{ {
user.getTeleport().respawn(ess.getSpawn(), charge); user.getTeleport().respawn(ess.getSpawn(), charge);
} }
}
else
{
user.getTeleport().teleport(loc, charge);
}
}
else if (homes.isEmpty()) else if (homes.isEmpty())
{ {
throw new Exception(player == user ? _("noHomeSet") : _("noHomeSetPlayer")); throw new Exception(player == user ? _("noHomeSet") : _("noHomeSetPlayer"));
@ -61,6 +80,7 @@ public class Commandhome extends EssentialsCommand
} }
else else
{ {
homes.add("bed");
user.sendMessage(_("homes", Util.joinList(homes))); user.sendMessage(_("homes", Util.joinList(homes)));
} }
} }

View File

@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.craftbukkit.EnchantmentFix;
import java.util.Arrays; import java.util.Arrays;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -29,7 +30,7 @@ public class Commandinvsee extends EssentialsCommand
} }
if (invUser == user && user.getSavedInventory() != null) if (invUser == user && user.getSavedInventory() != null)
{ {
invUser.getInventory().setContents(user.getSavedInventory()); EnchantmentFix.setContents(invUser.getInventory(), user.getSavedInventory());
user.setSavedInventory(null); user.setSavedInventory(null);
user.sendMessage(_("invRestored")); user.sendMessage(_("invRestored"));
throw new NoChargeException(); throw new NoChargeException();
@ -49,7 +50,7 @@ public class Commandinvsee extends EssentialsCommand
{ {
throw new Exception(_("invBigger")); throw new Exception(_("invBigger"));
} }
user.getInventory().setContents(invUserStack); EnchantmentFix.setContents(user.getInventory(), invUserStack);
user.sendMessage(_("invSee", invUser.getDisplayName())); user.sendMessage(_("invSee", invUser.getDisplayName()));
user.sendMessage(_("invSeeHelp")); user.sendMessage(_("invSeeHelp"));
throw new NoChargeException(); throw new NoChargeException();

View File

@ -1,10 +1,12 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.InventoryWorkaround;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import java.util.Locale; import java.util.Locale;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -40,6 +42,29 @@ public class Commanditem extends EssentialsCommand
stack.setAmount(Integer.parseInt(args[1])); stack.setAmount(Integer.parseInt(args[1]));
} }
if (args.length > 2)
{
for (int i = 2; i < args.length; i++)
{
final String[] split = args[i].split("[:+',;.]", 2);
if (split.length < 1)
{
continue;
}
final Enchantment enchantment = Commandenchant.getEnchantment(split[0], user);
int level;
if (split.length > 1)
{
level = Integer.parseInt(split[1]);
}
else
{
level = enchantment.getMaxLevel();
}
stack.addEnchantment(enchantment, level);
}
}
if (stack.getType() == Material.AIR) if (stack.getType() == Material.AIR)
{ {
throw new Exception(_("cantSpawnItem", "Air")); throw new Exception(_("cantSpawnItem", "Air"));
@ -47,7 +72,7 @@ public class Commanditem extends EssentialsCommand
final String displayName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' '); final String displayName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' ');
user.sendMessage(_("itemSpawn", stack.getAmount(), displayName)); user.sendMessage(_("itemSpawn", stack.getAmount(), displayName));
user.getInventory().addItem(stack); InventoryWorkaround.addItem(user.getInventory(), true, true, ess, stack);
user.updateInventory(); user.updateInventory();
} }
} }

View File

@ -1,5 +1,6 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.InventoryWorkaround;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Trade; import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
@ -113,7 +114,7 @@ public class Commandkit extends EssentialsCommand
final int id = Material.getMaterial(Integer.parseInt(parts[0])).getId(); 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 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 short data = parts.length > 2 ? Short.parseShort(parts[1]) : 0;
final HashMap<Integer, ItemStack> overfilled = user.getInventory().addItem(new ItemStack(id, amount, data)); final Map<Integer, ItemStack> overfilled = InventoryWorkaround.addItem(user.getInventory(), true, new ItemStack(id, amount, data));
for (ItemStack itemStack : overfilled.values()) for (ItemStack itemStack : overfilled.values())
{ {
user.getWorld().dropItemNaturally(user.getLocation(), itemStack); user.getWorld().dropItemNaturally(user.getLocation(), itemStack);

View File

@ -3,7 +3,6 @@ package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import java.util.*; import java.util.*;
import org.bukkit.ChatColor;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -39,16 +38,15 @@ public class Commandlist extends EssentialsCommand
playerHidden++; playerHidden++;
} }
} }
//TODO: move these to messages file
final StringBuilder online = new StringBuilder(); String online;
online.append(ChatColor.BLUE).append("There are ").append(ChatColor.RED).append(server.getOnlinePlayers().length - playerHidden);
if (showhidden && playerHidden > 0) if (showhidden && playerHidden > 0)
{ {
online.append(ChatColor.GRAY).append("/").append(playerHidden); online = _("listAmountHidden", server.getOnlinePlayers().length - playerHidden, playerHidden, server.getMaxPlayers());
} else {
online = _("listAmount",server.getOnlinePlayers().length - playerHidden, server.getMaxPlayers());
} }
online.append(ChatColor.BLUE).append(" out of a maximum ").append(ChatColor.RED).append(server.getMaxPlayers()); sender.sendMessage(online);
online.append(ChatColor.BLUE).append(" players online.");
sender.sendMessage(online.toString());
if (ess.getSettings().getSortListByGroups()) if (ess.getSettings().getSortListByGroups())
{ {
@ -90,11 +88,11 @@ public class Commandlist extends EssentialsCommand
} }
if (user.isAfk()) if (user.isAfk())
{ {
groupString.append("§7[AFK]§f"); groupString.append(_("listAfkTag"));
} }
if (user.isHidden()) if (user.isHidden())
{ {
groupString.append("§7[HIDDEN]§f"); groupString.append(_("listHiddenTag"));
} }
groupString.append(user.getDisplayName()); groupString.append(user.getDisplayName());
groupString.append("§f"); groupString.append("§f");
@ -131,11 +129,11 @@ public class Commandlist extends EssentialsCommand
} }
if (user.isAfk()) if (user.isAfk())
{ {
onlineUsers.append("§7[AFK]§f"); onlineUsers.append(_("listAfkTag"));
} }
if (user.isHidden()) if (user.isHidden())
{ {
onlineUsers.append("§7[HIDDEN]§f"); onlineUsers.append(_("listHiddenTag"));
} }
onlineUsers.append(user.getDisplayName()); onlineUsers.append(user.getDisplayName());
onlineUsers.append("§f"); onlineUsers.append("§f");

View File

@ -149,6 +149,7 @@ public class Commandsell extends EssentialsCommand
} }
} }
//TODO: Prices for Enchantments
final ItemStack ris = new ItemStack(is.getType(), amount, is.getDurability()); final ItemStack ris = new ItemStack(is.getType(), amount, is.getDurability());
InventoryWorkaround.removeItem(user.getInventory(), true, ris); InventoryWorkaround.removeItem(user.getInventory(), true, ris);
user.updateInventory(); user.updateInventory();

View File

@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Mob; import com.earth2me.essentials.Mob;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.Util; import com.earth2me.essentials.Util;
import java.util.Locale;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Server; import org.bukkit.Server;
@ -23,8 +24,7 @@ public class Commandspawner extends EssentialsCommand
{ {
if (args.length < 1 || args[0].length() < 2) if (args.length < 1 || args[0].length() < 2)
{ {
throw new NotEnoughArgumentsException(); throw new NotEnoughArgumentsException(_("mobsAvailable", Util.joinList(Mob.getMobList())));
//TODO: user.sendMessage("§7Mobs: Zombie PigZombie Skeleton Slime Chicken Pig Monster Spider Creeper Ghast Squid Giant Cow Sheep Wolf");
} }
final Location target = Util.getTarget(user); final Location target = Util.getTarget(user);
@ -44,6 +44,14 @@ public class Commandspawner extends EssentialsCommand
user.sendMessage(_("invalidMob")); user.sendMessage(_("invalidMob"));
return; return;
} }
if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH)))
{
throw new Exception(_("unableToSpawnMob"));
}
if (!user.isAuthorized("essentials.spawner." + mob.name.toLowerCase()))
{
throw new Exception(_("unableToSpawnMob"));
}
((CreatureSpawner)target.getBlock().getState()).setCreatureType(mob.getType()); ((CreatureSpawner)target.getBlock().getState()).setCreatureType(mob.getType());
user.sendMessage(_("setSpawner", mob.name)); user.sendMessage(_("setSpawner", mob.name));
} }

View File

@ -26,8 +26,7 @@ public class Commandspawnmob extends EssentialsCommand
{ {
if (args.length < 1) if (args.length < 1)
{ {
throw new NotEnoughArgumentsException(); throw new NotEnoughArgumentsException(_("mobsAvailable", Util.joinList(Mob.getMobList())));
//TODO: user.sendMessage("§7Mobs: Zombie PigZombie Skeleton Slime Chicken Pig Monster Spider Creeper Ghast Squid Giant Cow Sheep Wolf");
} }
@ -67,6 +66,10 @@ public class Commandspawnmob extends EssentialsCommand
{ {
throw new Exception(_("unableToSpawnMob")); throw new Exception(_("unableToSpawnMob"));
} }
if (!user.isAuthorized("essentials.spawnmob." + mob.name.toLowerCase()))
{
throw new Exception(_("unableToSpawnMob"));
}
final Block block = Util.getTarget(user).getBlock(); final Block block = Util.getTarget(user).getBlock();
if (block == null) if (block == null)
@ -97,6 +100,10 @@ public class Commandspawnmob extends EssentialsCommand
{ {
throw new Exception(_("unableToSpawnMob")); throw new Exception(_("unableToSpawnMob"));
} }
if (!user.isAuthorized("essentials.spawnmob." + mobMount.name.toLowerCase()))
{
throw new Exception(_("unableToSpawnMob"));
}
try try
{ {
spawnedMount = mobMount.spawn(user, server, loc); spawnedMount = mobMount.spawn(user, server, loc);
@ -185,6 +192,16 @@ public class Commandspawnmob extends EssentialsCommand
throw new Exception(_("slimeMalformedSize"), e); throw new Exception(_("slimeMalformedSize"), e);
} }
} }
if (("Sheep".equalsIgnoreCase(type)
|| "Cow".equalsIgnoreCase(type)
|| "Chicken".equalsIgnoreCase(type)
|| "Pig".equalsIgnoreCase(type)
|| "Wolf".equalsIgnoreCase(type))
&& data.equalsIgnoreCase("baby"))
{
((Animals)spawned).setAge(-24000);
return;
}
if ("Sheep".equalsIgnoreCase(type)) if ("Sheep".equalsIgnoreCase(type))
{ {
try try
@ -196,7 +213,7 @@ public class Commandspawnmob extends EssentialsCommand
} }
else else
{ {
((Sheep)spawned).setColor(DyeColor.valueOf(data.toUpperCase())); ((Sheep)spawned).setColor(DyeColor.valueOf(data.toUpperCase(Locale.ENGLISH)));
} }
} }
catch (Exception e) catch (Exception e)
@ -204,16 +221,26 @@ public class Commandspawnmob extends EssentialsCommand
throw new Exception(_("sheepMalformedColor"), e); throw new Exception(_("sheepMalformedColor"), e);
} }
} }
if ("Wolf".equalsIgnoreCase(type) && data.equalsIgnoreCase("tamed")) if ("Wolf".equalsIgnoreCase(type)
&& data.toLowerCase(Locale.ENGLISH).startsWith("tamed"))
{ {
final Wolf wolf = ((Wolf)spawned); final Wolf wolf = ((Wolf)spawned);
wolf.setTamed(true); wolf.setTamed(true);
wolf.setOwner(user); wolf.setOwner(user);
wolf.setSitting(true); wolf.setSitting(true);
if (data.equalsIgnoreCase("tamedbaby"))
{
((Animals)spawned).setAge(-24000);
} }
if ("Wolf".equalsIgnoreCase(type) && data.equalsIgnoreCase("angry")) }
if ("Wolf".equalsIgnoreCase(type)
&& data.toLowerCase(Locale.ENGLISH).startsWith("angry"))
{ {
((Wolf)spawned).setAngry(true); ((Wolf)spawned).setAngry(true);
if (data.equalsIgnoreCase("angrybaby"))
{
((Animals)spawned).setAge(-24000);
}
} }
if ("Creeper".equalsIgnoreCase(type) && data.equalsIgnoreCase("powered")) if ("Creeper".equalsIgnoreCase(type) && data.equalsIgnoreCase("powered"))
{ {

View File

@ -28,7 +28,7 @@ public class Commandtppos extends EssentialsCommand
final Location location = new Location(user.getWorld(), x, y, z); final Location location = new Location(user.getWorld(), x, y, z);
if (args.length > 3) if (args.length > 3)
{ {
location.setYaw(Float.parseFloat(args[3])); location.setYaw((Float.parseFloat(args[3]) + 180 + 360) % 360);
} }
if (args.length > 4) if (args.length > 4)
{ {

View File

@ -1,6 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -19,7 +20,14 @@ public class Commandunbanip extends EssentialsCommand
{ {
throw new NotEnoughArgumentsException(); throw new NotEnoughArgumentsException();
} }
try
{
final User user = getPlayer(server, args, 0, true);
ess.getServer().unbanIP(user.getLastLoginAddress());
}
catch (Exception ex)
{
}
ess.getServer().unbanIP(args[0]); ess.getServer().unbanIP(args[0]);
sender.sendMessage(_("unbannedIP")); sender.sendMessage(_("unbannedIP"));
} }

View File

@ -47,6 +47,10 @@ public abstract class EssentialsCommand implements IEssentialsCommand
{ {
throw new NotEnoughArgumentsException(); throw new NotEnoughArgumentsException();
} }
if (args[pos].isEmpty())
{
throw new NoSuchFieldException(_("playerNotFound"));
}
final User user = ess.getUser(args[pos]); final User user = ess.getUser(args[pos]);
if (user != null) if (user != null)
{ {

View File

@ -5,11 +5,16 @@ public class NotEnoughArgumentsException extends Exception
{ {
public NotEnoughArgumentsException() public NotEnoughArgumentsException()
{ {
super(); super("");
}
public NotEnoughArgumentsException(final String string)
{
super(string);
} }
public NotEnoughArgumentsException(final Throwable ex) public NotEnoughArgumentsException(final Throwable ex)
{ {
super(ex); super("", ex);
} }
} }

View File

@ -0,0 +1,66 @@
package com.earth2me.essentials.craftbukkit;
import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
public class EnchantmentFix
{
public static void setContents(Inventory inventory, ItemStack[] items)
{
CraftInventory cInventory = (CraftInventory)inventory;
if (cInventory.getContents().length != items.length)
{
throw new IllegalArgumentException("Invalid inventory size; expected " + cInventory.getContents().length);
}
net.minecraft.server.ItemStack[] mcItems = cInventory.getInventory().getContents();
for (int i = 0; i < items.length; i++)
{
ItemStack item = items[i];
if (item == null || item.getTypeId() <= 0)
{
mcItems[i] = null;
}
else
{
mcItems[i] = new net.minecraft.server.ItemStack(item.getTypeId(), item.getAmount(), item.getDurability());
new CraftItemStack(mcItems[i]).addUnsafeEnchantments(item.getEnchantments());
}
}
}
public static void setItem(Inventory inventory, int index, ItemStack item)
{
CraftInventory cInventory = (CraftInventory)inventory;
if (item == null)
{
cInventory.getInventory().setItem(index, null);
}
else
{
net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(item.getTypeId(), item.getAmount(), item.getDurability());
new CraftItemStack(stack).addUnsafeEnchantments(item.getEnchantments());
cInventory.getInventory().setItem(index, stack);
}
}
public static void setItemInHand(Inventory inventory, ItemStack item)
{
CraftInventoryPlayer cInventory = (CraftInventoryPlayer)inventory;
if (item == null)
{
cInventory.getInventory().setItem(cInventory.getInventory().itemInHandIndex, null);
}
else
{
net.minecraft.server.ItemStack stack = new net.minecraft.server.ItemStack(item.getTypeId(), item.getAmount(), item.getDurability());
new CraftItemStack(stack).addUnsafeEnchantments(item.getEnchantments());
cInventory.getInventory().setItem(cInventory.getInventory().itemInHandIndex, stack);
}
}
}

View File

@ -0,0 +1,25 @@
package com.earth2me.essentials.craftbukkit;
import net.minecraft.server.EntityPlayer;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.event.player.PlayerListener;
import org.bukkit.event.player.PlayerTeleportEvent;
public class ItemDupeFix extends PlayerListener
{
@Override
public void onPlayerTeleport(final PlayerTeleportEvent event)
{
if (event.isCancelled())
{
return;
}
final CraftPlayer player = (CraftPlayer)event.getPlayer();
final EntityPlayer entity = player.getHandle();
if (entity.activeContainer != entity.defaultContainer)
{
entity.closeInventory();
}
}
}

View File

@ -1,5 +1,6 @@
package com.earth2me.essentials.settings; package com.earth2me.essentials.settings;
import com.earth2me.essentials.storage.EnchantmentLevel;
import com.earth2me.essentials.storage.MapKeyType; import com.earth2me.essentials.storage.MapKeyType;
import com.earth2me.essentials.storage.MapValueType; import com.earth2me.essentials.storage.MapValueType;
import com.earth2me.essentials.storage.StorageObject; import com.earth2me.essentials.storage.StorageObject;
@ -8,6 +9,7 @@ import java.util.Map;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.material.MaterialData; import org.bukkit.material.MaterialData;
@ -21,6 +23,9 @@ public class Worth implements StorageObject
@MapKeyType(MaterialData.class) @MapKeyType(MaterialData.class)
@MapValueType(Double.class) @MapValueType(Double.class)
private Map<MaterialData, Double> buy = new HashMap<MaterialData, Double>(); private Map<MaterialData, Double> buy = new HashMap<MaterialData, Double>();
@MapKeyType(EnchantmentLevel.class)
@MapValueType(Double.class)
private Map<EnchantmentLevel, Double> enchantmentMultiplier = new HashMap<EnchantmentLevel, Double>();
public Worth() public Worth()
{ {

View File

@ -4,7 +4,7 @@ import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.*; import com.earth2me.essentials.*;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
//TODO: Sell Enchantment on Trade signs?
public class SignTrade extends EssentialsSign public class SignTrade extends EssentialsSign
{ {
public SignTrade() public SignTrade()
@ -70,13 +70,16 @@ public class SignTrade extends EssentialsSign
final Trade trade = getTrade(sign, 2, false, false, ess); final Trade trade = getTrade(sign, 2, false, false, ess);
if (trade.getItemStack() != null && player.getItemInHand() != null if (trade.getItemStack() != null && player.getItemInHand() != null
&& trade.getItemStack().getTypeId() == player.getItemInHand().getTypeId() && trade.getItemStack().getTypeId() == player.getItemInHand().getTypeId()
&& trade.getItemStack().getDurability() == player.getItemInHand().getDurability()) && trade.getItemStack().getDurability() == player.getItemInHand().getDurability()
&& trade.getItemStack().getEnchantments().equals(player.getItemInHand().getEnchantments()))
{ {
int amount = player.getItemInHand().getAmount(); int amount = player.getItemInHand().getAmount();
amount -= amount % trade.getItemStack().getAmount(); amount -= amount % trade.getItemStack().getAmount();
if (amount > 0) if (amount > 0)
{ {
final Trade store = new Trade(new ItemStack(player.getItemInHand().getTypeId(), amount, player.getItemInHand().getDurability()), ess); final ItemStack stack = player.getItemInHand().clone();
stack.setAmount(amount);
final Trade store = new Trade(stack, ess);
addAmount(sign, 2, store, ess); addAmount(sign, 2, store, ess);
store.charge(player); store.charge(player);
return store; return store;

View File

@ -1,10 +1,12 @@
package com.earth2me.essentials.storage; package com.earth2me.essentials.storage;
import java.util.Locale;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData; import org.bukkit.material.MaterialData;
import org.yaml.snakeyaml.constructor.Constructor; import org.yaml.snakeyaml.constructor.Constructor;
@ -69,6 +71,10 @@ public class BukkitConstructor extends Constructor
{ {
mat = Material.matchMaterial(split[0]); mat = Material.matchMaterial(split[0]);
} }
if (mat == null)
{
return null;
}
byte data = 0; byte data = 0;
if (split.length == 2 && NUMPATTERN.matcher(split[1]).matches()) if (split.length == 2 && NUMPATTERN.matcher(split[1]).matches())
{ {
@ -83,7 +89,7 @@ public class BukkitConstructor extends Constructor
{ {
return null; return null;
} }
final String[] split1 = val.split("\\W", 2); final String[] split1 = val.split("\\W");
if (split1.length == 0) if (split1.length == 0)
{ {
return null; return null;
@ -103,17 +109,102 @@ public class BukkitConstructor extends Constructor
{ {
mat = Material.matchMaterial(split2[0]); mat = Material.matchMaterial(split2[0]);
} }
if (mat == null)
{
return null;
}
short data = 0; short data = 0;
if (split2.length == 2 && NUMPATTERN.matcher(split2[1]).matches()) if (split2.length == 2 && NUMPATTERN.matcher(split2[1]).matches())
{ {
data = Short.parseShort(split2[1]); data = Short.parseShort(split2[1]);
} }
int size = mat.getMaxStackSize(); int size = mat.getMaxStackSize();
if (split1.length == 2 && NUMPATTERN.matcher(split1[1]).matches()) if (split1.length > 1 && NUMPATTERN.matcher(split1[1]).matches())
{ {
size = Integer.parseInt(split1[1]); size = Integer.parseInt(split1[1]);
} }
return new ItemStack(mat, size, data); final ItemStack stack = new ItemStack(mat, size, data);
if (split1.length > 2)
{
for (int i = 2; i < split1.length; i++)
{
final String[] split3 = split1[0].split("[:+',;.]", 2);
if (split3.length < 1)
{
continue;
}
Enchantment enchantment;
if (NUMPATTERN.matcher(split3[0]).matches())
{
final int enchantId = Integer.parseInt(split3[0]);
enchantment = Enchantment.getById(enchantId);
}
else
{
enchantment = Enchantment.getByName(split3[0].toUpperCase(Locale.ENGLISH));
}
if (enchantment == null)
{
continue;
}
int level = enchantment.getStartLevel();
if (split3.length == 2 && NUMPATTERN.matcher(split3[1]).matches())
{
level = Integer.parseInt(split3[1]);
}
if (level < enchantment.getStartLevel())
{
level = enchantment.getStartLevel();
}
if (level > enchantment.getMaxLevel())
{
level = enchantment.getMaxLevel();
}
stack.addUnsafeEnchantment(enchantment, level);
}
}
return stack;
}
if (node.getType().equals(EnchantmentLevel.class))
{
final String val = (String)constructScalar((ScalarNode)node);
if (val.isEmpty())
{
return null;
}
final String[] split = val.split("[:+',;.]", 2);
if (split.length == 0)
{
return null;
}
Enchantment enchant;
if (NUMPATTERN.matcher(split[0]).matches())
{
final int typeId = Integer.parseInt(split[0]);
enchant = Enchantment.getById(typeId);
}
else
{
enchant = Enchantment.getByName(split[0].toUpperCase(Locale.ENGLISH));
}
if (enchant == null)
{
return null;
}
int level = enchant.getStartLevel();
if (split.length == 2 && NUMPATTERN.matcher(split[1]).matches())
{
level = Integer.parseInt(split[1]);
}
if (level < enchant.getStartLevel())
{
level = enchant.getStartLevel();
}
if (level > enchant.getMaxLevel())
{
level = enchant.getMaxLevel();
}
return new EnchantmentLevel(enchant, level);
} }
return super.construct(node); return super.construct(node);
} }

View File

@ -0,0 +1,80 @@
package com.earth2me.essentials.storage;
import java.util.Map.Entry;
import org.bukkit.enchantments.Enchantment;
public class EnchantmentLevel implements Entry<Enchantment, Integer>
{
private Enchantment enchantment;
private int level;
public EnchantmentLevel(final Enchantment enchantment, final int level)
{
this.enchantment = enchantment;
this.level = level;
}
public Enchantment getEnchantment()
{
return enchantment;
}
public void setEnchantment(final Enchantment enchantment)
{
this.enchantment = enchantment;
}
public int getLevel()
{
return level;
}
public void setLevel(final int level)
{
this.level = level;
}
@Override
public Enchantment getKey()
{
return enchantment;
}
@Override
public Integer getValue()
{
return level;
}
@Override
public Integer setValue(final Integer v)
{
int t = level;
level = v;
return t;
}
@Override
public int hashCode()
{
return enchantment.hashCode() ^ level;
}
@Override
public boolean equals(final Object obj)
{
if (obj instanceof Entry)
{
final Entry entry = (Entry)obj;
if (entry.getKey() instanceof Enchantment
&& entry.getValue() instanceof Integer)
{
final Enchantment enchantment = (Enchantment)entry.getKey();
final Integer level = (Integer)entry.getValue();
return this.enchantment.equals(enchantment) && this.level == level.intValue();
}
}
return false;
}
}

View File

@ -5,6 +5,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.logging.Level; import java.util.logging.Level;
@ -12,6 +13,7 @@ import java.util.logging.Logger;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData; import org.bukkit.material.MaterialData;
import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.Yaml;
@ -217,20 +219,23 @@ public class YamlStorageWriter implements IStorageWriter
} }
else if (data instanceof Material) else if (data instanceof Material)
{ {
writer.println(data.toString().toLowerCase()); writeMaterial(data);
writer.println();
} }
else if (data instanceof MaterialData) else if (data instanceof MaterialData)
{ {
final MaterialData matData = (MaterialData)data; writeMaterialData(data);
writer.println(matData.getItemType().toString().toLowerCase() writer.println();
+ (matData.getData() > 0 ? ":" + matData.getData() : ""));
} }
else if (data instanceof ItemStack) else if (data instanceof ItemStack)
{ {
final ItemStack itemStack = (ItemStack)data; writeItemStack(data);
writer.println(itemStack.getType().toString().toLowerCase() writer.println();
+ (itemStack.getDurability() > 0 ? ":" + itemStack.getDurability() : "") }
+ " " + itemStack.getAmount()); else if (data instanceof EnchantmentLevel)
{
writeEnchantmentLevel(data);
writer.println();
} }
else else
{ {
@ -256,13 +261,15 @@ public class YamlStorageWriter implements IStorageWriter
} }
else if (data instanceof Material) else if (data instanceof Material)
{ {
writer.print(data.toString().toLowerCase()); writeMaterial(data);
} }
else if (data instanceof MaterialData) else if (data instanceof MaterialData)
{ {
final MaterialData matData = (MaterialData)data; writeMaterialData(data);
writer.print(matData.getItemType().toString().toLowerCase() }
+ (matData.getData() > 0 ? ":" + matData.getData() : "")); else if (data instanceof EnchantmentLevel)
{
writeEnchantmentLevel(data);
} }
else else
{ {
@ -270,6 +277,43 @@ public class YamlStorageWriter implements IStorageWriter
} }
} }
private void writeMaterial(final Object data)
{
writer.print(data.toString().toLowerCase(Locale.ENGLISH));
}
private void writeMaterialData(final Object data)
{
final MaterialData matData = (MaterialData)data;
writeMaterial(matData.getItemType());
if (matData.getData() > 0)
{
writer.print(':');
writer.print(matData.getData());
}
}
private void writeItemStack(final Object data)
{
final ItemStack itemStack = (ItemStack)data;
writeMaterialData(itemStack.getData());
writer.print(' ');
writer.print(itemStack.getAmount());
for (Entry<Enchantment, Integer> entry : itemStack.getEnchantments().entrySet())
{
writer.print(' ');
writeEnchantmentLevel(entry);
}
}
private void writeEnchantmentLevel(Object data)
{
final Entry<Enchantment, Integer> enchLevel = (Entry<Enchantment, Integer>)data;
writer.print(enchLevel.getKey().getName().toLowerCase(Locale.ENGLISH));
writer.print(':');
writer.print(enchLevel.getValue());
}
private void writeLocation(final Location entry, final int depth) private void writeLocation(final Location entry, final int depth)
{ {
writer.println(); writer.println();

View File

@ -10,17 +10,17 @@ import org.bukkit.command.CommandSender;
public class TextPager public class TextPager
{ {
private final transient IText text; private final transient IText text;
private final transient boolean showHeader; private final transient boolean onePage;
public TextPager(final IText text) public TextPager(final IText text)
{ {
this(text, true); this(text, false);
} }
public TextPager(final IText text, final boolean showHeader) public TextPager(final IText text, final boolean onePage)
{ {
this.text = text; this.text = text;
this.showHeader = showHeader; this.onePage = onePage;
} }
public void showPage(final String pageStr, final String chapterPageStr, final CommandSender sender) public void showPage(final String pageStr, final String chapterPageStr, final CommandSender sender)
@ -40,17 +40,18 @@ public class TextPager
{ {
page = 1; page = 1;
} }
if (page < 1) { if (page < 1)
{
page = 1; page = 1;
} }
int start = (page - 1) * 9; int start = onePage ? 0 : (page - 1) * 9;
if (showHeader) if (!onePage)
{ {
int pages = lines.size() / 9 + (lines.size() % 9 > 0 ? 1 : 0); int pages = lines.size() / 9 + (lines.size() % 9 > 0 ? 1 : 0);
sender.sendMessage(_("infoPages", page, pages)); sender.sendMessage(_("infoPages", page, pages));
} }
for (int i = start; i < lines.size() && i < start + 9; i++) for (int i = start; i < lines.size() && i < start + (onePage ? 20 : 9); i++)
{ {
sender.sendMessage(lines.get(i)); sender.sendMessage(lines.get(i));
} }
@ -61,7 +62,7 @@ public class TextPager
{ {
if (lines.get(0).startsWith("#")) if (lines.get(0).startsWith("#"))
{ {
if (!showHeader) if (onePage)
{ {
return; return;
} }
@ -91,8 +92,12 @@ public class TextPager
{ {
page = 1; page = 1;
} }
if (page < 1)
{
page = 1;
}
int start = (page - 1) * 9; int start = onePage ? 0 : (page - 1) * 9;
int end; int end;
for (end = 0; end < lines.size(); end++) for (end = 0; end < lines.size(); end++)
{ {
@ -103,12 +108,12 @@ public class TextPager
} }
} }
if (showHeader) if (!onePage)
{ {
int pages = end / 9 + (end % 9 > 0 ? 1 : 0); int pages = end / 9 + (end % 9 > 0 ? 1 : 0);
sender.sendMessage(_("infoPages", page, pages)); sender.sendMessage(_("infoPages", page, pages));
} }
for (int i = start; i < end && i < start + 9; i++) for (int i = start; i < end && i < start + (onePage ? 20 : 9); i++)
{ {
sender.sendMessage(lines.get(i)); sender.sendMessage(lines.get(i));
} }
@ -127,6 +132,10 @@ public class TextPager
{ {
chapterpage = 0; chapterpage = 0;
} }
if (chapterpage < 0)
{
chapterpage = 0;
}
} }
if (!bookmarks.containsKey(pageStr.toLowerCase(Locale.ENGLISH))) if (!bookmarks.containsKey(pageStr.toLowerCase(Locale.ENGLISH)))
@ -144,15 +153,15 @@ public class TextPager
break; break;
} }
} }
final int start = chapterstart + chapterpage * 9; final int start = chapterstart + (onePage ? 0 : chapterpage * 9);
if (showHeader) if (!onePage)
{ {
final int page = chapterpage + 1; final int page = chapterpage + 1;
final int pages = (chapterend - chapterstart) / 9 + ((chapterend - chapterstart) % 9 > 0 ? 1 : 0); final int pages = (chapterend - chapterstart) / 9 + ((chapterend - chapterstart) % 9 > 0 ? 1 : 0);
sender.sendMessage(_("infoChapterPages", pageStr, page, pages)); sender.sendMessage(_("infoChapterPages", pageStr, page, pages));
} }
for (int i = start; i < chapterend && i < start + 9; i++) for (int i = start; i < chapterend && i < start + (onePage ? 20 : 9); i++)
{ {
sender.sendMessage(lines.get(i)); sender.sendMessage(lines.get(i));
} }

View File

@ -76,9 +76,6 @@ permission-based-item-spawn: false
# HOWEVER, it is known to cause lag upon users logging OUT, so beware! # HOWEVER, it is known to cause lag upon users logging OUT, so beware!
reclaim-onlogout: false reclaim-onlogout: false
# Should primitive spawn protection be enabled? For most servers, this should be flase; it is better to use a third-party plugin to protect it.
spawn-protection: false
# Mob limit on spawnmob # Mob limit on spawnmob
spawnmob-limit: 10 spawnmob-limit: 10
@ -229,21 +226,21 @@ freeze-afk-players: false
# You can disable the death messages of minecraft here # You can disable the death messages of minecraft here
death-messages: true death-messages: true
# Add worlds to this list, if you want to automatically disable god mode there
no-god-in-worlds:
# - world_nether
############################################################ ############################################################
# +------------------------------------------------------+ # # +------------------------------------------------------+ #
# | EssentialsHome | # # | EssentialsHome | #
# +------------------------------------------------------+ # # +------------------------------------------------------+ #
############################################################ ############################################################
# When users die, should they respawn at their homes, instead of the spawnpoint? # When users die, should they respawn at their first home, instead of the spawnpoint or bed?
respawn-at-home: false respawn-at-home: false
# When a user interacts with a bed, should their home be set to that location? # If no home is set send you to bed or spawn when /home is used
# If you enable this and remove default user access to the /sethome command, you can make beds the only way for players to set their home location. spawn-if-no-home: true
bed-sethome: false
# If no home is set send you to spawn when /home is used
spawn-if-no-home: false
# Allow players to have multiple homes. # Allow players to have multiple homes.
# Define different amounts of multiple homes for different permissions, e.g. essentials.sethome.multiple.vip # Define different amounts of multiple homes for different permissions, e.g. essentials.sethome.multiple.vip
@ -336,7 +333,7 @@ chat:
protect: protect:
# Database settings for sign/rail protection # Database settings for sign/rail protection
# get mysql.jar and sqlite and place it in your serverroot/lib directory from here: # get mysql.jar and sqlite and place it in your serverroot/lib directory from here:
# http://java.net/projects/essentials/sources/svn/show/lib?rev=435 # https://github.com/essentials/Essentials/blob/master/lib/mysql.jar
# mysql, sqlite or none # mysql, sqlite or none
datatype: 'sqlite' datatype: 'sqlite'

View File

@ -68,6 +68,11 @@ downloadingGeoIp=Downloading GeoIP database ... this might take a while (country
duplicatedUserdata=Duplicated userdata: {0} and {1} duplicatedUserdata=Duplicated userdata: {0} and {1}
enableUnlimited=\u00a77Giving unlimited amount of {0} to {1}. enableUnlimited=\u00a77Giving unlimited amount of {0} to {1}.
enabled=enabled 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}
enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item in hand.
enchantments = \u00a77Enchantments: {0}
errorCallingCommand=Error calling command /{0} errorCallingCommand=Error calling command /{0}
errorWithMessage=\u00a7cError: {0} errorWithMessage=\u00a7cError: {0}
essentialsReload=\u00a77Essentials Reloaded {0} essentialsReload=\u00a77Essentials Reloaded {0}
@ -153,6 +158,10 @@ kitTimed=\u00a7cYou can''t use that kit again for another {0}.
kits=\u00a77Kits: {0} kits=\u00a77Kits: {0}
lightningSmited=\u00a77You have just been smited lightningSmited=\u00a77You have just been smited
lightningUse=\u00a77Smiting {0} 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.
listHiddenTag = \u00a77[HIDDEN]\u00a7f
loadWarpError=Failed to load warp {0} loadWarpError=Failed to load warp {0}
loadinfo=Loaded {0} build {1} by: {2} loadinfo=Loaded {0} build {1} by: {2}
localFormat=Local: <{0}> {1} localFormat=Local: <{0}> {1}
@ -196,6 +205,7 @@ nickSet=\u00a77Your nickname is now \u00a7c{0}
noAccessCommand=\u00a7cYou do not have access to that command. noAccessCommand=\u00a7cYou do not have access to that command.
noAccessPermission=\u00a7cYou do not have permission to access that {0}. noAccessPermission=\u00a7cYou do not have permission to access that {0}.
noDestroyPermission=\u00a7cYou do not have permission to destroy that {0}. noDestroyPermission=\u00a7cYou do not have permission to destroy that {0}.
noGodWorldWarning=\u00a7cWarning! God mode in this world disabled.
noHelpFound=\u00a7cNo matching commands. noHelpFound=\u00a7cNo matching commands.
noHomeSet=You have not set a home. noHomeSet=You have not set a home.
noHomeSetPlayer=Player has not set a home. noHomeSetPlayer=Player has not set a home.
@ -216,6 +226,7 @@ notAllowedToShout=\u00a7cYou are not authorized to shout.
notEnoughMoney=You do not have sufficient funds. 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. notSupportedYet=Not supported yet.
nothingInHand = \u00a7cYou have nothing in your hand.
now=now now=now
numberRequired=A number goes there, silly. numberRequired=A number goes there, silly.
onlyDayNight=/time only supports day/night. onlyDayNight=/time only supports day/night.

View File

@ -68,6 +68,11 @@ downloadingGeoIp=Downloader GeoIP database ... det her kan tage et stykke tid (l
duplicatedUserdata=Duplikerede userdata: {0} og {1} duplicatedUserdata=Duplikerede userdata: {0} og {1}
enableUnlimited=\u00a77Giver ubegr\u00e6nset m\u00e6ngde af {0} til {1}. enableUnlimited=\u00a77Giver ubegr\u00e6nset m\u00e6ngde af {0} til {1}.
enabled=aktiveret enabled=aktiveret
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}
enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item in hand.
enchantments = \u00a77Enchantments: {0}
errorCallingCommand=Fejl ved opkald af kommando /{0} errorCallingCommand=Fejl ved opkald af kommando /{0}
errorWithMessage=\u00a7cFejl: {0} errorWithMessage=\u00a7cFejl: {0}
essentialsReload=\u00a77Essentials Genindl\u00e6st {0} essentialsReload=\u00a77Essentials Genindl\u00e6st {0}
@ -153,6 +158,10 @@ kitTimed=\u00a7cDu kan ikke den pakke igen f\u00f8r om {0}.
kits=\u00a77Pakker: {0} kits=\u00a77Pakker: {0}
lightningSmited=\u00a77Du er blevet sl\u00e5et lightningSmited=\u00a77Du er blevet sl\u00e5et
lightningUse=\u00a77Sl\u00e5r {0} lightningUse=\u00a77Sl\u00e5r {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.
listHiddenTag = \u00a77[HIDDEN]\u00a7f
loadWarpError=Kunne ikke indl\u00e6se warp {0} loadWarpError=Kunne ikke indl\u00e6se warp {0}
loadinfo=Indl\u00e6ste {0} byg {1} af {2} loadinfo=Indl\u00e6ste {0} byg {1} af {2}
localFormat=Lokal: <{0}> {1} localFormat=Lokal: <{0}> {1}
@ -197,6 +206,7 @@ noAccessCommand=\u00a7cDu har ikke adgang til den kommando.
noAccessPermission=\u00a7cDu har ikke tilladelse til at f\u00e5 adgang til det {0}. noAccessPermission=\u00a7cDu har ikke tilladelse til at f\u00e5 adgang til det {0}.
noDestroyPermission=\u00a7cDu har ikke tilladelse til at \u00f8del\u00e6gge det {0}. noDestroyPermission=\u00a7cDu har ikke tilladelse til at \u00f8del\u00e6gge det {0}.
noHelpFound=\u00a7cNo matching commands. noHelpFound=\u00a7cNo matching commands.
noGodWorldWarning=\u00a7cWarning! God mode in this world disabled.
noHomeSet=Du har sat et nyt hjem. noHomeSet=Du har sat et nyt hjem.
noHomeSetPlayer=Spiller har ikke sat et hjem. noHomeSetPlayer=Spiller har ikke sat et hjem.
noKitPermission=\u00a7cDu har brug for \u00a7c{0}\u00a7c tilladelsen for at bruge den pakke. noKitPermission=\u00a7cDu har brug for \u00a7c{0}\u00a7c tilladelsen for at bruge den pakke.
@ -216,6 +226,7 @@ notAllowedToShout=\u00a7cDu er ikke autoriseret til at r\u00e5be.
notEnoughMoney=Du har ikke tilstr\u00e6kkelig penge. notEnoughMoney=Du har ikke tilstr\u00e6kkelig penge.
notRecommendedBukkit=Bukkit version er ikke den anbefalede byg for Essentials. notRecommendedBukkit=Bukkit version er ikke den anbefalede byg for Essentials.
notSupportedYet=Ikke underst\u00f8ttet endnu. notSupportedYet=Ikke underst\u00f8ttet endnu.
nothingInHand = \u00a7cYou have nothing in your hand.
now=nu now=nu
numberRequired=Der skal v\u00e6re et nummer, fjolle. numberRequired=Der skal v\u00e6re et nummer, fjolle.
onlyDayNight=/time underst\u00f8tter kun day/night. onlyDayNight=/time underst\u00f8tter kun day/night.

View File

@ -68,6 +68,11 @@ downloadingGeoIp=Lade GeoIP-Datenbank ... dies kann etwas dauern (country: 0.6 M
duplicatedUserdata=Doppelte Datei in userdata: {0} und {1} duplicatedUserdata=Doppelte Datei in userdata: {0} und {1}
enableUnlimited=\u00a77Gebe {1} unendliche Mengen von {0}. enableUnlimited=\u00a77Gebe {1} unendliche Mengen von {0}.
enabled=aktiviert enabled=aktiviert
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}
enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item in hand.
enchantments = \u00a77Enchantments: {0}
errorCallingCommand=Fehler beim Aufrufen des Befehls /{0} errorCallingCommand=Fehler beim Aufrufen des Befehls /{0}
errorWithMessage=\u00a7cFehler: {0} errorWithMessage=\u00a7cFehler: {0}
essentialsReload=\u00a77Essentials neu geladen {0} essentialsReload=\u00a77Essentials neu geladen {0}
@ -153,6 +158,10 @@ kitTimed=\u00a7cDu kannst diese Ausr\u00fcstung nicht innerhalb von {0} anforder
kits=\u00a77Ausr\u00fcstungen: {0} kits=\u00a77Ausr\u00fcstungen: {0}
lightningSmited=\u00a77Du wurdest gepeinigt. lightningSmited=\u00a77Du wurdest gepeinigt.
lightningUse=\u00a77Peinige {0} 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.
listHiddenTag = \u00a77[Versteckt]\u00a7f
loadWarpError=Fehler beim Laden von Warp-Punkt {0} loadWarpError=Fehler beim Laden von Warp-Punkt {0}
loadinfo=Plugin {0} Version {1} geladen, erstellt von {2}, \u00fcbersetzt von snowleo loadinfo=Plugin {0} Version {1} geladen, erstellt von {2}, \u00fcbersetzt von snowleo
localFormat=Lokal: <{0}> {1} localFormat=Lokal: <{0}> {1}
@ -196,6 +205,7 @@ nickSet=\u00a77Dein Nickname ist nun \u00a7c{0}
noAccessCommand=\u00a7cDu hast keinen Zugriff auf diesen Befehl. noAccessCommand=\u00a7cDu hast keinen Zugriff auf diesen Befehl.
noAccessPermission=\u00a7cDu hast keine Rechte, den Block {0} zu \u00f6ffnen. noAccessPermission=\u00a7cDu hast keine Rechte, den Block {0} zu \u00f6ffnen.
noDestroyPermission=\u00a7cDu hast keine Rechte, den Block {0} zu zerst\u00f6ren. noDestroyPermission=\u00a7cDu hast keine Rechte, den Block {0} zu zerst\u00f6ren.
noGodWorldWarning=\u00a7cWarning! God mode in this world disabled.
noHelpFound=\u00a7cKeine \u00fcbereinstimmenden Kommandos. noHelpFound=\u00a7cKeine \u00fcbereinstimmenden Kommandos.
noHomeSet=Du hast kein Zuhause gesetzt. noHomeSet=Du hast kein Zuhause gesetzt.
noHomeSetPlayer=Spieler hat kein Zuhause gesetzt. noHomeSetPlayer=Spieler hat kein Zuhause gesetzt.
@ -216,6 +226,7 @@ notAllowedToShout=\u00a7cDu bist nicht berechtigt zu schreien.
notEnoughMoney=Du hast nicht genug Geld. notEnoughMoney=Du hast nicht genug Geld.
notRecommendedBukkit=Die verwendete Bukkit-Version ist nicht f\u00fcr Essentials empfohlen. notRecommendedBukkit=Die verwendete Bukkit-Version ist nicht f\u00fcr Essentials empfohlen.
notSupportedYet=Noch nicht verf\u00fcgbar. notSupportedYet=Noch nicht verf\u00fcgbar.
nothingInHand = \u00a7cYou have nothing in your hand.
now=jetzt now=jetzt
numberRequired=Ein Zahl wird ben\u00f6tigt. numberRequired=Ein Zahl wird ben\u00f6tigt.
onlyDayNight=/time unterst\u00fctzt nur day und night. onlyDayNight=/time unterst\u00fctzt nur day und night.

View File

@ -68,6 +68,11 @@ downloadingGeoIp=Downloading GeoIP database ... this might take a while (country
duplicatedUserdata=Duplicated userdata: {0} and {1} duplicatedUserdata=Duplicated userdata: {0} and {1}
enableUnlimited=\u00a77Giving unlimited amount of {0} to {1}. enableUnlimited=\u00a77Giving unlimited amount of {0} to {1}.
enabled=enabled 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}
enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item in hand.
enchantments = \u00a77Enchantments: {0}
errorCallingCommand=Error calling command /{0} errorCallingCommand=Error calling command /{0}
errorWithMessage=\u00a7cError: {0} errorWithMessage=\u00a7cError: {0}
essentialsReload=\u00a77Essentials Reloaded {0} essentialsReload=\u00a77Essentials Reloaded {0}
@ -153,6 +158,10 @@ kitTimed=\u00a7cYou can''t use that kit again for another {0}.
kits=\u00a77Kits: {0} kits=\u00a77Kits: {0}
lightningSmited=\u00a77You have just been smited lightningSmited=\u00a77You have just been smited
lightningUse=\u00a77Smiting {0} 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.
listHiddenTag = \u00a77[HIDDEN]\u00a7f
loadWarpError=Failed to load warp {0} loadWarpError=Failed to load warp {0}
loadinfo=Loaded {0} build {1} by: {2} loadinfo=Loaded {0} build {1} by: {2}
localFormat=Local: <{0}> {1} localFormat=Local: <{0}> {1}
@ -196,6 +205,7 @@ nickSet=\u00a77Your nickname is now \u00a7c{0}
noAccessCommand=\u00a7cYou do not have access to that command. noAccessCommand=\u00a7cYou do not have access to that command.
noAccessPermission=\u00a7cYou do not have permission to access that {0}. noAccessPermission=\u00a7cYou do not have permission to access that {0}.
noDestroyPermission=\u00a7cYou do not have permission to destroy that {0}. noDestroyPermission=\u00a7cYou do not have permission to destroy that {0}.
noGodWorldWarning=\u00a7cWarning! God mode in this world disabled.
noHelpFound=\u00a7cNo matching commands. noHelpFound=\u00a7cNo matching commands.
noHomeSet=You have not set a home. noHomeSet=You have not set a home.
noHomeSetPlayer=Player has not set a home. noHomeSetPlayer=Player has not set a home.
@ -216,6 +226,7 @@ notAllowedToShout=\u00a7cYou are not authorized to shout.
notEnoughMoney=You do not have sufficient funds. 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. notSupportedYet=Not supported yet.
nothingInHand = \u00a7cYou have nothing in your hand.
now=now now=now
numberRequired=A number goes there, silly. numberRequired=A number goes there, silly.
onlyDayNight=/time only supports day/night. onlyDayNight=/time only supports day/night.

View File

@ -68,6 +68,11 @@ downloadingGeoIp=Descargando base de datos de GeoIP ... puede llevar un tiempo (
duplicatedUserdata=Datos de usuario duplicados: {0} y {1} duplicatedUserdata=Datos de usuario duplicados: {0} y {1}
enableUnlimited=\u00a77Dando cantidad ilimitada de {0} a {1}. enableUnlimited=\u00a77Dando cantidad ilimitada de {0} a {1}.
enabled=activado 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}
enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item in hand.
enchantments = \u00a77Enchantments: {0}
errorCallingCommand=Error al ejecutar el comando /{0} errorCallingCommand=Error al ejecutar el comando /{0}
errorWithMessage=\u00a7cError: {0} errorWithMessage=\u00a7cError: {0}
essentialsReload=\u00a77Essentials Recargado {0} essentialsReload=\u00a77Essentials Recargado {0}
@ -153,6 +158,10 @@ kitTimed=\u00a7c No puedes usar ese kit de nuevo para otro{0}.
kits=\u00a77Kits: {0} kits=\u00a77Kits: {0}
lightningSmited=\u00a77Acabas de ser golpeado lightningSmited=\u00a77Acabas de ser golpeado
lightningUse=\u00a77Golpeando a {0} 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.
listHiddenTag = \u00a77[HIDDEN]\u00a7f
loadWarpError=Error al cargar el tenetransporte {0} loadWarpError=Error al cargar el tenetransporte {0}
loadinfo=Cargado {0}, construido {1} por: {2} loadinfo=Cargado {0}, construido {1} por: {2}
localFormat=Local: <{0}> {1} localFormat=Local: <{0}> {1}
@ -196,6 +205,7 @@ nickSet=\u00a77Tu nombre es ahora \u00a7c{0}
noAccessCommand=\u00a7cNo tienes acceso a ese comando. noAccessCommand=\u00a7cNo tienes acceso a ese comando.
noAccessPermission=\u00a7cNo tienes permisos para hacer eso {0}. noAccessPermission=\u00a7cNo tienes permisos para hacer eso {0}.
noDestroyPermission=\u00a7cNo tienes permisos para destrozar eso {0}. noDestroyPermission=\u00a7cNo tienes permisos para destrozar eso {0}.
noGodWorldWarning=\u00a7cWarning! God mode in this world disabled.
noHelpFound=\u00a7cNo hay comandos relacionados. noHelpFound=\u00a7cNo hay comandos relacionados.
noHomeSet=No has establecido un hogar. noHomeSet=No has establecido un hogar.
noHomeSetPlayer=El jugador no ha establecido un hogar. noHomeSetPlayer=El jugador no ha establecido un hogar.
@ -216,6 +226,7 @@ notAllowedToShout=\u00a7cNo estas autorizado para gritar.
notEnoughMoney=No tienes el dinero suficiente. notEnoughMoney=No tienes el dinero suficiente.
notRecommendedBukkit=La version de bukkit no es la recomendada para esta version de Essentials. notRecommendedBukkit=La version de bukkit no es la recomendada para esta version de Essentials.
notSupportedYet=No esta soportado aun. notSupportedYet=No esta soportado aun.
nothingInHand = \u00a7cYou have nothing in your hand.
now=ahora now=ahora
numberRequired=Un numero es necesario, amigo. numberRequired=Un numero es necesario, amigo.
onlyDayNight=/time solo soporta day/night. (dia/noche) onlyDayNight=/time solo soporta day/night. (dia/noche)

View File

@ -3,21 +3,21 @@
# Translations start here # Translations start here
# by: # by:
action=* {0} {1} action=* {0} {1}
addedToAccount=\u00a7a{0} a \u00e9t\u00e9 rajout\u00e9 a votre compte. 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} a \u00e9t\u00e9 ajout\u00e9 \u00e0 {1} compte.
alertBroke=a cass\u00e9: alertBroke=a cass\u00e9 :
alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} \u00e0:{3} alertFormat=\u00a73[{0}] \u00a7f {1} \u00a76 {2} \u00e0:{3}
alertPlaced=a plac\u00e9: alertPlaced=a plac\u00e9 :
alertUsed=a utilis\u00e9: alertUsed=a utilis\u00e9 :
autoAfkKickReason=You have been kicked for idling more than {0} minutes. 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. backAfterDeath=\u00a77Utilisez la commande /back pour retourner \u00e0 l''endroit ou vous \u00eates mort.
backUsageMsg=\u00a77Retour a votre emplacement pr\u00e9c\u00e8dent. backUsageMsg=\u00a77Retour \u00e0 votre emplacement pr\u00e9c\u00c3\u00a8dent.
backupFinished=Backup termin\u00e9 backupFinished=Sauvegarde termin\u00e9
backupStarted=D\u00e9but du backup backupStarted=D\u00e9but de la sauvegarde
balance=\u00a77Solde: {0} balance=\u00a77Solde : {0}
balanceTop=\u00a77 Top {0} soldes balanceTop=\u00a77 Meilleurs {0} soldes
banExempt=\u00a77Vous ne pouvez pas interdire ce joueur. banExempt=\u00a77Vous ne pouvez pas bannir ce joueur.
banIpAddress=\u00a77Adresse IP banni banIpAddress=\u00a77Adresse IP bannie
bannedIpsFileError=Erreur de lecture de banned-ips.txt bannedIpsFileError=Erreur de lecture de banned-ips.txt
bannedIpsFileNotFound=Fichier banned-ips.txt introuvable bannedIpsFileNotFound=Fichier banned-ips.txt introuvable
bannedPlayersFileError=Erreur lors de la lecture de banned-players.txt bannedPlayersFileError=Erreur lors de la lecture de banned-players.txt
@ -30,32 +30,32 @@ bukkitFormatChanged=Le format de la version de Bukkit a \u00e9t\u00e9 chang\u00e
burnMsg=\u00a77Vous avez enflamm\u00e9 {0} pour {1} seconde(s). burnMsg=\u00a77Vous avez enflamm\u00e9 {0} pour {1} seconde(s).
canTalkAgain=\u00a77Vous pouvez de nouveau parler. canTalkAgain=\u00a77Vous pouvez de nouveau parler.
cantFindGeoIpDB=N''arrive pas \u00e0 trouver la base de donn\u00e9es GeoIP! cantFindGeoIpDB=N''arrive pas \u00e0 trouver la base de donn\u00e9es GeoIP!
cantReadGeoIpDB=Echec de la lecture de la base de donn\u00e9s GeoIP! cantReadGeoIpDB=Echec de la lecture de la base de donn\u00e9es GeoIP!
cantSpawnItem=\u00a7cVous n''avez pas le droit de faire apparaitre {0} cantSpawnItem=\u00a7cVous n''avez pas le droit de faire appara\u00c3\u00aetre {0}
commandFailed=\u00c9chec de la commande {0}: commandFailed=\u00c9chec de la commande {0} :
commandHelpFailedForPlugin=Erreur d'obtention d'aider \u00e0: {0} commandHelpFailedForPlugin=Erreur d''obtention d''aide pour : {0}
commandNotLoaded=\u00a7cLa commande {0} a \u00e9t\u00e9 mal charg\u00e9e. commandNotLoaded=\u00a7cLa commande {0} a \u00e9t\u00e9 mal charg\u00e9e.
compassBearing=\u00a77Orientation: {0} ({1} degr\u00e9s). compassBearing=\u00a77Orientation : {0} ({1} degr\u00e9s).
configFileMoveError=\u00c9chec du d\u00e9placement de config.yml vers l''emplacement de backup. configFileMoveError=\u00c9chec du d\u00e9placement de config.yml vers l''emplacement de sauvegarde.
configFileRenameError=\u00c9chec du changement de nom du fichier temp de config.yml configFileRenameError=\u00c9chec du changement de nom du fichier temporaire de config.yml
connectedPlayers=Joueurs connect\u00e9s: connectedPlayers=Joueurs connect\u00e9s :
connectionFailed=\u00c9chec de l''ouverture de la connexion. connectionFailed=\u00c9chec de l''ouverture de la connexion.
cooldownWithMessage=\u00a7cRefroidissement: {0} cooldownWithMessage=\u00a7cR\u00e9utilisation : {0}
corruptNodeInConfig=\u00a74Annonce: Votre fichier de configuration a un {0} n\u0153ud corrompu. corruptNodeInConfig=\u00a74Annonce : Votre fichier de configuration a un {0} n\u0153ud corrompu.
couldNotFindTemplate=Le mod\u00e8le {0} est introuvable couldNotFindTemplate=Le mod\u00c3\u00a8le {0} est introuvable
creatingConfigFromTemplate=Cr\u00e9ation de la configuration \u00e0 partir du mod\u00e8le : {0} creatingConfigFromTemplate=Cr\u00e9ation de la configuration \u00e0 partir du mod\u00c3\u00a8le : {0}
creatingEmptyConfig=Cr\u00e9ation d''une configuration vierge : {0} creatingEmptyConfig=Cr\u00e9ation d''une configuration vierge : {0}
creative=creative creative=cr\u00e9atif
day=jour day=jour
days=jours days=jours
defaultBanReason=Le marteau du ban a frapp\u00e9! defaultBanReason=Le marteau du bannissement a frapp\u00e9 !
deleteFileError=Le fichier n''a pas pu \u00eatre supprim\u00e9: {0} deleteFileError=Le fichier {0} n''a pas pu \u00eatre supprim\u00e9
deleteHome=\u00a77Home {0} has been removed. deleteHome=\u00a77La r\u00e9sidence {0} a \u00e9t\u00e9 supprim\u00e9e.
deleteJail=\u00a77La prison {0} a \u00e9t\u00e9 supprim\u00e9e. deleteJail=\u00a77La prison {0} a \u00e9t\u00e9 supprim\u00e9e.
deleteWarp=\u00a77Warp {0} supprim\u00e9. deleteWarp=\u00a77Warp {0} supprim\u00e9.
deniedAccessCommand=L''acc\u00e8s \u00e0 la commande a \u00e9t\u00e9 refus\u00e9 pour {0}. deniedAccessCommand=L''acc\u00c3\u00a8s \u00e0 la commande a \u00e9t\u00e9 refus\u00e9 pour {0}.
dependancyDownloaded=[Essentials] Fichier {0} correctement t\u00e9l\u00e9charg\u00e9. dependancyDownloaded=[Essentials] Fichier {0} correctement t\u00e9l\u00e9charg\u00e9.
dependancyException=[Essentials] Une erreur est survenue lors de la tentative de t\u00e9l\u00e9chargement dependancyException=[Essentials] Une erreur est survenue lors de la tentative de t\u00e9l\u00e9chargement.
dependancyNotFound=[Essentials] Une d\u00e9pendance requise n''a pas \u00e9t\u00e9 trouv\u00e9e, t\u00e9l\u00e9chargement en cours. dependancyNotFound=[Essentials] Une d\u00e9pendance requise n''a pas \u00e9t\u00e9 trouv\u00e9e, t\u00e9l\u00e9chargement en cours.
depth=\u00a77Vous \u00eates au niveau de la mer. depth=\u00a77Vous \u00eates au niveau de la mer.
depthAboveSea=\u00a77Vous \u00eates \u00e0 {0} bloc(s) au-dessus du niveau de la mer. depthAboveSea=\u00a77Vous \u00eates \u00e0 {0} bloc(s) au-dessus du niveau de la mer.
@ -64,49 +64,54 @@ destinationNotSet=Destination non d\u00e9finie
disableUnlimited=\u00a77D\u00e9sactivation du placement illimit\u00e9 de {0} pour {1}. disableUnlimited=\u00a77D\u00e9sactivation du placement illimit\u00e9 de {0} pour {1}.
disabled=d\u00e9sactiv\u00e9 disabled=d\u00e9sactiv\u00e9
dontMoveMessage=\u00a77La t\u00e9l\u00e9portation commence dans {0}. Ne bougez pas. dontMoveMessage=\u00a77La t\u00e9l\u00e9portation commence dans {0}. Ne bougez pas.
downloadingGeoIp=T\u00e9l\u00e9chargement de la base de donn\u00e9es GeoIP ... cela peut prendre un moment (campagne : 0.6 Mo, ville : 20Mo) downloadingGeoIp=T\u00e9l\u00e9chargement de la base de donn\u00e9es GeoIP ... Cela peut prendre un moment (campagne : 0.6 Mo, ville : 20Mo)
duplicatedUserdata=Donn\u00e9e utilisateur dupliqu\u00e9e: {0} et {1} duplicatedUserdata=Donn\u00e9e utilisateur dupliqu\u00e9e : {0} et {1}
enableUnlimited=\u00a77Donner un nombre illimit\u00e9 de {0} \u00e0 {1}. enableUnlimited=\u00a77Quantit\u00e9 illimit\u00e9e de {0} \u00e0 {1}.
enabled=activ\u00e9 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}.
enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item in hand.
enchantments = \u00a77Enchantments : {0}
errorCallingCommand=Erreur en appelant la commande /{0} errorCallingCommand=Erreur en appelant la commande /{0}
errorWithMessage=\u00a7cErreur: {0} errorWithMessage=\u00a7cErreur : {0}
essentialsReload=\u00a77Essentials Recharg\u00e9 {0} essentialsReload=\u00a77Essentials Recharg\u00e9 {0}
extinguish=\u00a77Vous vous \u00eates \u00e9teint. extinguish=\u00a77Vous cessez de br\u00fbler.
extinguishOthers=\u00a77Vous avez \u00e9teint {0}. extinguishOthers=\u00a77Vous avez \u00e9teint la combustion de {0}.
failedToCloseConfig=Echec de la fermeture de la configuration {0} failedToCloseConfig=Echec de la fermeture de la configuration {0}
failedToCreateConfig=Echec de la cr\u00e9ation de la configuration {0} failedToCreateConfig=Echec de la cr\u00e9ation de la configuration {0}
failedToWriteConfig=\u00c9chec de l''\u00e9criture de la configuration {0} failedToWriteConfig=\u00c9chec de l''\u00e9criture de la configuration {0}
false=false false=faux
fileRenameError=Echec du changement de nom de {0}. fileRenameError=Echec du changement de nom de {0}
foreverAlone=\u00a7cVous n''avez personne \u00e0 qui r\u00e9pondre. foreverAlone=\u00a7cVous n''avez personne \u00e0 qui r\u00e9pondre
freedMemory=A lib\u00e9r\u00e9 {0} Mo. freedMemory=A lib\u00e9r\u00e9 {0} Mo.
gameMode=\u00a77Set game mode {0} for {1}. gameMode=\u00a77Mode de jeu {0} pour {1}.
gcchunks=chunks, gcchunks=portions,
gcentities=entit\u00e9s gcentities=entit\u00e9s
gcfree=Free memory: {0} Mo gcfree=M\u00e9moire libre : {0} Mo
gcmax=M\u00e9moire maximale: {0} Mo gcmax=M\u00e9moire maximale : {0} Mo
gctotal=Allocated memory: {0} Mo gctotal=M\u00e9moire utilis\u00e9e : {0} Mo
geoIpUrlEmpty=L''url de t\u00e9l\u00e9chargement de GeoIP est vide. geoIpUrlEmpty=L''URL de t\u00e9l\u00e9chargement de GeoIP est vide.
geoIpUrlInvalid=L''url de t\u00e9l\u00e9chargement de GeoIP est invalide. geoIpUrlInvalid=L''URL de t\u00e9l\u00e9chargement de GeoIP est invalide.
geoipJoinFormat=Joueur {0} vient de {1} geoipJoinFormat=Joueur {0} vient de {1}
godDisabledFor=d\u00e9sactive pour {0} godDisabledFor=d\u00e9sactiv\u00e9 pour {0}
godEnabledFor=activ\u00e9 pour {0} godEnabledFor=activ\u00e9 pour {0}
godMode=\u00a77Mode Dieu {0}. godMode=\u00a77Mode Dieu {0}.
haveBeenReleased=\u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9 haveBeenReleased=\u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9.
heal=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9. heal=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
healOther=\u00a77{0} a \u00e9t\u00e9 soign\u00e9. healOther=\u00a77{0} a \u00e9t\u00e9 soign\u00e9.
helpConsole=Pour voir l''aide tapez ? helpConsole=Pour voir l''aide tapez ?
helpOp=\u00a7c[Aide Admin]\u00a7f \u00a77{0}:\u00a7f {1} helpOp=\u00a7c[Aide Admin]\u00a7f \u00a77{0}:\u00a7f {1}
helpPages=Page \u00a7c{0}\u00a7f sur \u00a7c{1}\u00a7f. helpPages=Page \u00a7c{0}\u00a7f sur \u00a7c{1}\u00a7f.
holeInFloor=Trou dans le Sol. holeInFloor=Trou dans le Sol.
homeSet=\u00a77Home d\u00e9fini. homeSet=\u00a77R\u00e9sidence d\u00e9finie.
homeSetToBed=\u00a77Votre home est d\u00e9sormais d\u00e9fini sur ce lit. homeSetToBed=\u00a77Votre r\u00e9sidence est d\u00e9sormais li\u00e9e \u00e0 ce lit.
homes=Homes: {0} homes=R\u00e9sidences : {0}
hour=heure hour=heure
hours=heures hours=heures
ignorePlayer=Vous ignorez d\u00e9sormais {0}. ignorePlayer=Vous ignorez d\u00e9sormais {0}.
illegalDate=Format de date ill\u00e9gal. illegalDate=Format de date ill\u00e9gal.
infoChapter=S\u00e9lectionner le chapitre : infoChapter=S\u00e9lectionnez le chapitre :
infoChapterPages=Chapitre {0}, page \u00a7c{1}\u00a7f sur \u00a7c{2}\u00a7f: 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. 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=Page \u00a7c{0}\u00a7f de \u00a7c{1}\u00a7f.
@ -115,7 +120,7 @@ invBigger=Les inventaires des autres joueurs sont plus gros que le v\u00f4tre.
invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu. invRestored=Votre inventaire vous a \u00e9t\u00e9 rendu.
invSee=Vous voyez l''inventaire de {0}. invSee=Vous voyez l''inventaire de {0}.
invSeeHelp=Utilisez /invsee pour voir l''inventaire de quelqu''un. invSeeHelp=Utilisez /invsee pour voir l''inventaire de quelqu''un.
invalidCharge=\u00a7cInvalide charge. invalidCharge=\u00a7cCharge invalide.
invalidMob=Mauvias type de monstre. invalidMob=Mauvias type de monstre.
invalidServer=Serveur non valide. invalidServer=Serveur non valide.
invalidSignLine=La ligne {0} du panneau est invalide. invalidSignLine=La ligne {0} du panneau est invalide.
@ -128,17 +133,17 @@ itemMustBeStacked=Cet objet doit \u00eatre vendu par 64. Une quantit\u00e9 de 2
itemNotEnough1=\u00a7cVous n''avez pas assez de cet objet pour le vendre. 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 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. itemNotEnough3=\u00a77/sell nomObjet -1 vendra tout sauf un objet, etc.
itemSellAir=Vous vouliez vraiment vendre de l''air? Mettez un objet dans votre main. 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) 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) itemSoldConsole={0} vendu {1} pour \u00a77{2} \u00a77({3} objet(s) \u00e0 {4} chacun)
itemSpawn=\u00a77Donne {0} de {1} itemSpawn=\u00a77Donne {0} de {1}
itemsCsvNotLoaded=N''a pas pu charger items.csv. itemsCsvNotLoaded=N''a pas pu charger items.csv.
jailAlreadyIncarcerated=\u00a7cPerson is already in jail: {0} jailAlreadyIncarcerated=\u00a7cJoueur d\u00e9j\u00e0 emprisonn\u00e9 : {0}
jailMessage=\u00a7cVous avez commis un crime, vous en payez le prix. jailMessage=\u00a7cVous avez commis un crime, vous en payez le prix.
jailNotExist=Cette prison n''existe pas. jailNotExist=Cette prison n''existe pas.
jailReleased=\u00a77Player \u00a7e{0}\u00a77 unjailed. jailReleased=\u00a77Joueur \u00a7e{0}\u00a77 lib\u00e9r\u00e9.
jailReleasedPlayerNotify=\u00a77You have been released! jailReleasedPlayerNotify=\u00a77Vous avez \u00e9t\u00e9 lib\u00e9r\u00e9 !
jailSentenceExtended=Jail time extend to: {0) jailSentenceExtended=Dur\u00e9e d''emprisonnement rallong\u00e9e de : {0)
jailSet=\u00a77La prison {0} a \u00e9t\u00e9 cr\u00e9\u00e9. jailSet=\u00a77La prison {0} a \u00e9t\u00e9 cr\u00e9\u00e9.
jumpError=\u00c7a aurait pu faire mal au cerveau de votre ordinateur. jumpError=\u00c7a aurait pu faire mal au cerveau de votre ordinateur.
kickDefault=Kick\u00e9 du serveur kickDefault=Kick\u00e9 du serveur
@ -146,33 +151,37 @@ kickExempt=\u00a77Vous ne pouvez pas lancer ce joueur.
kill=\u00a77Tu\u00e9 {0}. kill=\u00a77Tu\u00e9 {0}.
kitError=\u00a7cIl n''y a pas de kits valides. kitError=\u00a7cIl n''y a pas de kits valides.
kitError2=\u00a7cCe kit n''existe pas ou a \u00e9t\u00e9 mal d\u00e9fini. kitError2=\u00a7cCe kit n''existe pas ou a \u00e9t\u00e9 mal d\u00e9fini.
kitErrorHelp=\u00a7cPeut-\u00eatre qu''un objet manque d''une quantit\u00e9 dans la configuration? kitErrorHelp=\u00a7cPeut-\u00eatre qu''un objet manque d''une quantit\u00e9 dans la configuration ?
kitGive=\u00a77Donner le kit {0}. kitGive=\u00a77Donner le kit {0}.
kitInvFull=\u00a7cVotre inventaire \u00e9tait plein, le kit est Parre-terre. kitInvFull=\u00a7cVotre inventaire \u00e9tait plein, le kit est parre-terre.
kitTimed=\u00a7cVous ne pouvez pas utiliser ce kit pendant encore {0}. kitTimed=\u00a7cVous ne pouvez pas utiliser ce kit pendant encore {0}.
kits=\u00a77Kits:{0} kits=\u00a77Kits :{0}
lightningSmited=\u00a77Vous venez d''\u00eatre foudroy\u00e9 lightningSmited=\u00a77Vous venez d''\u00eatre foudroy\u00e9.
lightningUse=\u00a77{0} a \u00e9t\u00e9 foudroy\u00e9 lightningUse=\u00a77{0} a \u00e9t\u00e9 foudroy\u00e9.
loadWarpError=\u00c9chec du chargement du warp {0} 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.
listHiddenTag = \u00a77[MASQU\u00c9]\u00a7f
loadWarpError=\u00c9chec du chargement du raccourci {0}
loadinfo={0} version {1} par {2} a \u00e9t\u00e9 charg\u00e9 loadinfo={0} version {1} par {2} a \u00e9t\u00e9 charg\u00e9
localFormat=Local:<{0}> {1} localFormat=Locale :<{0}> {1}
mailClear=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear mailClear=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear
mailCleared=\u00a77Mail supprim\u00e9 ! mailCleared=\u00a77Courrier supprim\u00e9 !
mailSent=\u00a77Courrier envoy\u00e9 ! mailSent=\u00a77Courrier envoy\u00e9 !
markMailAsRead=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear markMailAsRead=\u00a7cPour marquer votre courrier en tant que lu, entrez /mail clear
markedAsAway=\u00a77Vous \u00eates d\u00e9sormais AFK. markedAsAway=\u00a77Vous \u00eates d\u00e9sormais AFK.
markedAsNotAway=\u00a77Vous n''\u00eates d\u00e9sormais plus AFK. markedAsNotAway=\u00a77Vous n''\u00eates d\u00e9sormais plus AFK.
maxHomes=You cannot set more than {0} homes. maxHomes=Vous ne pouvez pas cr\u00e9er plus de {0} r\u00e9sidences.
mayNotJail=\u00a7cVous ne pouvez pas emprisonner cette personne. mayNotJail=\u00a7cVous ne pouvez pas emprisonner cette personne.
me=moi me=moi
minute=minute minute=minute
minutes=minutes minutes=minutes
missingItems=Vous n''avez pas {0} x {1}. missingItems=Vous n''avez pas {0} x {1}.
missingPrefixSuffix=Pr\u00e9fixe ou Suffixe manquant pour {0} missingPrefixSuffix=Pr\u00e9fixe ou Suffixe manquant pour {0}
mobSpawnError=Erreur lors du changement du spawner de monstres. mobSpawnError=Erreur lors du changement du g\u00e9n\u00e9rateur de monstres.
mobSpawnLimit=Quantit\u00e9 de monstres limit\u00e9 \u00e0 la limite du serveur. mobSpawnLimit=Quantit\u00e9 de monstres limit\u00e9 \u00e0 au maximum du serveur.
mobSpawnTarget=Le bloc cible doit \u00eatre un spawner de monstres. mobSpawnTarget=Le bloc cible doit \u00eatre un g\u00e9n\u00e9rateur de monstres.
mobsAvailable=\u00a77Mobs: {0} mobsAvailable=\u00a77Monstres : {0}
moneyRecievedFrom=\u00a7a{0} a \u00e9t\u00e9 re\u00e7u de {1} moneyRecievedFrom=\u00a7a{0} a \u00e9t\u00e9 re\u00e7u de {1}
moneySentTo=\u00a7a{0} a \u00e9t\u00e9 envoy\u00e9 \u00e0 {1} moneySentTo=\u00a7a{0} a \u00e9t\u00e9 envoy\u00e9 \u00e0 {1}
moneyTaken={0} pr\u00e9lev\u00e9(s) de votre compte bancaire. moneyTaken={0} pr\u00e9lev\u00e9(s) de votre compte bancaire.
@ -180,25 +189,26 @@ month=mois
months=mois months=mois
moreThanZero=Les Quantit\u00e9s doivent \u00eatre sup\u00e9rieures \u00e0 z\u00e9ro. moreThanZero=Les Quantit\u00e9s doivent \u00eatre sup\u00e9rieures \u00e0 z\u00e9ro.
msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2} msgFormat=\u00a77[{0}\u00a77 -> {1}\u00a77] \u00a7f{2}
muteExempt=\u00a7cYou may not mute that player. muteExempt=\u00a7cVous ne pouvez pas r\u00e9duire ce joueur au silence.
mutedPlayer=Le joueur {0} est d\u00e9sormais muet. mutedPlayer=Le joueur {0} est d\u00e9sormais muet.
mutedPlayerFor={0} a \u00e9t\u00e9 mute pour {1}. mutedPlayerFor={0} a \u00e9t\u00e9 muet pour {1}.
mutedUserSpeaks={0} a essay\u00e9 de parler mais est muet. mutedUserSpeaks={0} a essay\u00e9 de parler mais est muet.
needTpohere=Vous avez besoin de l''acc\u00e8s \u00e0 /tpohere pour t\u00e9l\u00e9porter d''autres joueurs. 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. negativeBalanceError=L''utilisateur n''est pas autoris\u00e9 \u00e0 avoir un solde n\u00e9gatif.
nickChanged=Pseudo modifi\u00e9. nickChanged=surnom modifi\u00e9.
nickDisplayName=\u00a77You have to enable change-displayname in Essentials config. nickDisplayName=\u00a77Vous devez activer change-displayname dans la configuration Essentials.
nickInUse=\u00a7cCe nom est d\u00e9j\u00e0 utilis\u00e9. nickInUse=\u00a7cCe nom est d\u00e9j\u00e0 utilis\u00e9.
nickNamesAlpha=\u00a7cLes pseudos doivent \u00eatre alphanum\u00e9riques. nickNamesAlpha=\u00a7cLes surnoms doivent \u00eatre alphanum\u00e9riques.
nickNoMore=\u00a7Vous n''avez plus de surnom. nickNoMore=\u00a7Vous n''avez plus de surnom.
nickOthersPermission=\u00a7cVous n''avez pas la permission de changer le pseudo des autres. nickOthersPermission=\u00a7cVous n''avez pas la permission de changer le surnom des autres.
nickSet=\u00a77Votre pseudo est maintenant \u00a7c{0} nickSet=\u00a77Votre surnom est maintenant \u00a7c{0}
noAccessCommand=\u00a7cVous n''avez pas acc\u00e8s \u00e0 cette commande. noAccessCommand=\u00a7cVous n''avez pas acc\u00c3\u00a8s \u00e0 cette commande.
noAccessPermission=\u00a7cVous n''avez pas la permissions d''acc\u00e9der \u00e0 cette {0} noAccessPermission=\u00a7cVous n''avez pas la permissions d''acc\u00e9der \u00e0 cette {0}
noDestroyPermission=\u00a7cVous n''avez pas la permission de d\u00e9truire ce {0}. noDestroyPermission=\u00a7cVous n''avez pas la permission de d\u00e9truire ce {0}.
noHelpFound=\u00a7cNo matching commands. noGodWorldWarning=\u00a7cWarning! Le mode Dieu est d\u00e9sactiv\u00e9 dans ce monde.
noHomeSet=Vous n''avez pas d\u00e9fini de home. noHelpFound=\u00a7cAucune commande correspondante.
noHomeSetPlayer=Le joueur n''a pas d\u00e9fini son home. noHomeSet=Vous n''avez pas d\u00e9fini de r\u00e9sidence.
noHomeSetPlayer=Le joueur n''a pas d\u00e9fini sa r\u00e9sidence.
noKitPermission=\u00a7cVous avez besoin de la permission \u00a7c{0}\u00a7c pour utiliser ce kit. noKitPermission=\u00a7cVous avez besoin de la permission \u00a7c{0}\u00a7c pour utiliser ce kit.
noKits=\u00a77Il n''y a pas encore de kits disponibles. noKits=\u00a77Il n''y a pas encore de kits disponibles.
noMail=Vous n''avez pas de courrier noMail=Vous n''avez pas de courrier
@ -206,66 +216,67 @@ noMailSendPerm=\u00a7cVous n''avez pas la permission \u00a7fessentials.mail.send
noMotd=\u00a7cIl n''y a pas de message su jour. noMotd=\u00a7cIl n''y a pas de message su jour.
noNewMail=\u00a77Vous n''avez pas de courrier. noNewMail=\u00a77Vous n''avez pas de courrier.
noPendingRequest=Vous n''avez pas de requ\u00eate non lue. noPendingRequest=Vous n''avez pas de requ\u00eate non lue.
noPlacePermission=\u00a7cYou do not have permission to place a block near that sign. noPlacePermission=\u00a7cVous n''avez pas la permission de placer un bloc pr\u00c3\u00a8 de cette pancarte.
noPowerTools=You have no power tools assigned. noPowerTools=Vous n''avez pas d''outil automatique associ\u00e9.
noRules=\u00a7cIl n''y a pas encore de r\u00e8gles d\u00e9finies. noRules=\u00a7cIl n''y a pas encore de r\u00c3\u00a8gles d\u00e9finies.
noWarpsDefined=Aucun warps d\u00e9finis. noWarpsDefined=Aucun raccourci d\u00e9fini.
none=aucun none=aucun
notAllowedToQuestion=\u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 poser des questions. notAllowedToQuestion=\u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 poser des questions.
notAllowedToShout=\u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 crier. notAllowedToShout=\u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 crier.
notEnoughMoney=Vous n''avez pas les fonds n\u00e9cessaires. notEnoughMoney=Vous n''avez pas les fonds n\u00e9cessaires.
notRecommendedBukkit=La version de Bukkit n''est pas celle qui est recommand\u00e9 pour cette version de Essentials. notRecommendedBukkit=La version de Bukkit n''est pas celle qui est recommand\u00e9 pour cette version de Essentials.
notSupportedYet=Pas encore pris en charge. notSupportedYet=Pas encore pris en charge.
nothingInHand = \u00a7cVous n''avez rien en main.
now=maintenant now=maintenant
numberRequired=On a besoin d''un nombre ici, idiot. numberRequired=Il faut fournir un nombre ici.
onlyDayNight=/time ne supporte que (jour) day/night (nuit). onlyDayNight=/time ne supporte que (jour) day/night (nuit).
onlyPlayers=Seulement les joueurs en jeu peuvent utiliser {0}. onlyPlayers=Seulement les joueurs en jeu peuvent utiliser {0}.
onlySunStorm=/weather only supports sun/storm. onlySunStorm=/weather ne supporte que (soleil) sun/storm (temp\u00eate).
pTimeCurrent=\u00a7e{0}''s\u00a7f time is {1}. pTimeCurrent=\u00a7e{0}''s\u00a7f l''heure est {1}.
pTimeCurrentFixed=\u00a7e{0}''s\u00a7f time is fixed to {1}. pTimeCurrentFixed=\u00a7e{0}''s\u00a7f l''heure est fix\u00e9e \u00e0 {1}.
pTimeNormal=\u00a7e{0}''s\u00a7f time is normal and matches the server. pTimeNormal=\u00a7e{0}''s\u00a7f l''heure est normale et correspond au server.
pTimeOthersPermission=\u00a7cYou are not authorized to set other players'' time. pTimeOthersPermission=\u00a7cVous n''etes pas autoris\u00e9 \u00e0 changer l''heure des autres joueurs.
pTimePlayers=These players have their own time: pTimePlayers=Ces joueurs ont leur propre horraire :
pTimeReset=Player time has been reset for: \u00a7e{0} pTimeReset=l''heure a \u00e9t\u00e9 r\u00e9initialis\u00e9e \u00e0 : \u00a7e{0}
pTimeSet=Player time is set to \u00a73{0}\u00a7f for: \u00a7e{1} pTimeSet=l''heure du joueur a \u00e9t\u00e9 r\u00e9egl\u00e9ee \u00e0 \u00a73{0}\u00a7f pour : \u00a7e{1}
pTimeSetFixed=Player time is fixed to \u00a73{0}\u00a7f for: \u00a7e{1} pTimeSetFixed=l''heure du joueur a \u00e9t\u00e9 fix\u00e9e \u00e0 : \u00a7e{1}
parseError=Erreur de conversion {0} \u00e0 la ligne {1} parseError=Erreur de conversion {0} \u00e0 la ligne {1}
pendingTeleportCancelled=\u00a7cRequete de t\u00e9l\u00e9portation annul\u00e9e. pendingTeleportCancelled=\u00a7cRequete de t\u00e9l\u00e9portation annul\u00e9e.
permissionsError=Permissions/GroupManager manquant, les pr\u00e9fixes et suffixes ne seront pas affich\u00e9s. permissionsError=Permissions/GroupManager manquant, les pr\u00e9fixes et suffixes ne seront pas affich\u00e9s.
playerBanned=\u00a7cPlayer {0} banned {1} for {2} playerBanned=\u00a7cJoueur {0} banni {1} pour {2}
playerInJail=\u00a7cLe joueur est d\u00e9j\u00e0 dans la prison {0}. playerInJail=\u00a7cLe joueur est d\u00e9j\u00e0 dans la prison {0}.
playerJailed=\u00a77Le joueur {0} a \u00e9t\u00e9 emprisonn\u00e9. playerJailed=\u00a77Le joueur {0} a \u00e9t\u00e9 emprisonn\u00e9.
playerJailedFor=\u00a77{0} a \u00e9t\u00e9 emprisonn\u00e9 pour {1}. playerJailedFor=\u00a77{0} a \u00e9t\u00e9 emprisonn\u00e9 pour {1}.
playerKicked=\u00a7cPlayer {0} kicked {1} for {2} playerKicked=\u00a7cPlayer {0} kicked {1} for {2}
playerMuted=\u00a77You have been muted playerMuted=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duis au silence.
playerMutedFor=\u00a77You have been muted for {0} playerMutedFor=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duis au silence pour {0}
playerNeverOnServer=\u00a7cLe joueur {0} n''a jamais \u00e9t\u00e9 sur le serveur. playerNeverOnServer=\u00a7cLe joueur {0} n''a jamais \u00e9t\u00e9 sur le serveur.
playerNotFound=\u00a7cLe joueur est introuvable. playerNotFound=\u00a7cLe joueur est introuvable.
playerUnmuted=\u00a77You have been unmuted playerUnmuted=\u00a77Vous avez de nouveau la parole.
pong=Pong! pong=Pong !
possibleWorlds=\u00a77Les mondes possibles sont les nombres 0 par {0}. possibleWorlds=\u00a77Les mondes possibles sont les nombres de 0 \u00e0 {0}.
powerToolAir=La commande ne peut pas \u00eatre attach\u00e9e \u00e0 l''air. powerToolAir=La commande ne peut pas \u00eatre assign\u00e9e \u00e0 l''air.
powerToolAlreadySet=Command \u00a7c{0}\u00a7f is already assigned to {1}. powerToolAlreadySet=La commande \u00a7c{0}\u00a7f est d\u00e9j\u00e0 assign\u00e9e \u00e0 {1}.
powerToolAttach=\u00a7c{0}\u00a7f command assigned to {1}. powerToolAttach=Commande \u00a7c{0}\u00a7f assign\u00e9e \u00e0 {1}.
powerToolClearAll=All powertool commands have been cleared. powerToolClearAll=Toutes les commandes assign\u00e9es ont \u00e9et\u00e9e retir\u00e9ees.
powerToolList={1} has the following commands: \u00a7c{0}\u00a7f. powerToolList={1} assign\u00e9s aux commandes : \u00a7c{0}\u00a7f.
powerToolListEmpty={0} has no commands assigned. powerToolListEmpty={0} n''a pas de commande assign\u00e9e.
powerToolNoSuchCommandAssigned=Command \u00a7c{0}\u00a7f has not been assigned to {1}. powerToolNoSuchCommandAssigned=La commande \u00a7c{0}\u00a7f n''a pas \u00e9t\u00e9 assign\u00e9e \u00e0 {1}.
powerToolRemove=Command \u00a7c{0}\u00a7f removed from {1}. powerToolRemove=Command \u00a7c{0}\u00a7f retir\u00e9e de {1}.
powerToolRemoveAll=All commands removed from {0}. powerToolRemoveAll=Toutes les commandes retir\u00e9es de {0}.
powerToolsDisabled=All of your power tools have been disabled. powerToolsDisabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 retir\u00e9es.
powerToolsEnabled=All of your power tools have been enabled. powerToolsEnabled=Toutes vos commandes assign\u00e9es ont \u00e9t\u00e9 activ\u00e9es.
protectionOwner=\u00a76[EssentialsProtect] Propri\u00e9taire de la protection : {0} protectionOwner=\u00a76[EssentialsProtect] Propri\u00e9taire de la protection : {0}
questionFormat=\u00a77[Question]\u00a7f {0} questionFormat=\u00a77[Question]\u00a7f {0}
reloadAllPlugins=\u00a77Tous les plugins ont \u00e9t\u00e9 recharg\u00e9s. reloadAllPlugins=\u00a77Toutes les extensions ont \u00e9t\u00e9 recharg\u00e9es.
repair=You have successfully repaired your: \u00a7e{0}. repair=Vous avez r\u00e9par\u00e9 votre : \u00a7e{0}.
repairAlreadyFixed=\u00a77This item does not need repairing. repairAlreadyFixed=\u00a77Cet objet n''a pas besoin de r\u00e9paration.
repairInvalidType=\u00a7cThis item cannot be repaired. repairInvalidType=\u00a7cCet objet ne peut \u00eatre r\u00e9par\u00e9.
repairNone=There were no items that needing repairing. repairNone=Aucun objet n''a besoin d''\u00eatre r\u00e9par\u00e9.
requestAccepted=\u00a77Demande de t\u00e9l\u00e9portation accept\u00e9e. requestAccepted=\u00a77Demande de t\u00e9l\u00e9portation accept\u00e9e.
requestAcceptedFrom=\u00a77{0} accepted your teleport request. requestAcceptedFrom=\u00a77{0} a accept\u00e9 votre demande de t\u00e9l\u00e9portation.
requestDenied=\u00a77Demande de t\u00e9l\u00e9portation refus\u00e9e. requestDenied=\u00a77Demande de t\u00e9l\u00e9portation refus\u00e9e.
requestDeniedFrom=\u00a77{0} denied your teleport request. requestDeniedFrom=\u00a77{0} a refus\u00e9 votre demande de t\u00e9l\u00e9portation.
requestSent=\u00a77Requ\u00eate envoy\u00e9e \u00e0 {0}\u00a77. requestSent=\u00a77Requ\u00eate envoy\u00e9e \u00e0 {0}\u00a77.
returnPlayerToJailError=Erreur survenue lors de la tentative d''emprisonner de nouveau un joueur. returnPlayerToJailError=Erreur survenue lors de la tentative d''emprisonner de nouveau un joueur.
second=seconde second=seconde
@ -273,59 +284,59 @@ seconds=secondes
seenOffline=Le joueur {0} est hors ligne depuis {1} seenOffline=Le joueur {0} est hors ligne depuis {1}
seenOnline=Le joueur {0} est en ligne depuis {1} seenOnline=Le joueur {0} est en ligne depuis {1}
serverFull=Le serveur est plein. serverFull=Le serveur est plein.
setSpawner=Changed spawner type to {0} setSpawner=Type de g\u00e9n\u00e9rateur chang\u00e9 en {0}
sheepMalformedColor=Couleur mal form\u00e9e. sheepMalformedColor=Couleur mal form\u00e9e.
shoutFormat=\u00a77[Crie]\u00a7f {0} shoutFormat=\u00a77[Crie]\u00a7f {0}
signFormatFail=\u00a74[{0}] signFormatFail=\u00a74[{0}]
signFormatSuccess=\u00a71[{0}] signFormatSuccess=\u00a71[{0}]
signFormatTemplate=[{0}] signFormatTemplate=[{0}]
signProtectInvalidLocation=\u00a74You are not allowed to create sign here. signProtectInvalidLocation=\u00a74Vous n''avez pas l''autorisation de cr\u00e9er une pancarte ici.
similarWarpExist=Un warp avec un nom similaire existe d\u00e9j\u00e0. similarWarpExist=Un raccourci avec un nom similaire existe d\u00e9j\u00e0.
slimeMalformedSize=Taille mal form\u00e9e. slimeMalformedSize=Taille mal form\u00e9e.
soloMob=Ce monstre aime \u00eatre seul. soloMob=Ce monstre aime \u00eatre seul.
spawnSet=\u00a77Le point de spawn a \u00e9t\u00e9 d\u00e9fini pour le groupe {0}. spawnSet=\u00a77Le point de spawn a \u00e9t\u00e9 d\u00e9fini pour le groupe {0}.
spawned=spawn\u00e9 spawned=invoqu\u00e9(s)
suicideMessage=\u00a77Au revoir monde cruel... suicideMessage=\u00a77Au revoir monde cruel...
suicideSuccess=\u00a77{0} a pris sa propre vie. suicideSuccess=\u00a77{0} s''est suiscid\u00e9.
survival=survival survival=survie
takenFromAccount=\u00a7c{0} ont \u00e9t\u00e9 pris de votre compte. takenFromAccount=\u00a7c{0} ont \u00e9t\u00e9 retir\u00e9 de votre compte.
takenFromOthersAccount=\u00a7c{0} a \u00e9t\u00e9 prise de {1} compte. takenFromOthersAccount=\u00a7c{0} a \u00e9t\u00e9 r\u00e9tir\u00e9 du compte de {1}.
teleportAAll=\u00a77Teleporting request sent to all players... teleportAAll=\u00a77Demande de t\u00e9l\u00e9portation envoy\u00e9e \u00e0 tous les joueurs...
teleportAll=\u00a77T\u00e9l\u00e9poration de tous les joueurs. teleportAll=\u00a77T\u00e9l\u00e9poration de tous les joueurs.
teleportAtoB=\u00a77{0}\u00a77 vous a t\u00e9l\u00e9port\u00e9 \u00e0 {1}\u00a77. teleportAtoB=\u00a77{0}\u00a77 vous a t\u00e9l\u00e9port\u00e9 \u00e0 {1}\u00a77.
teleportDisabled={0} a la t\u00e9l\u00e9portation d\u00e9sactiv\u00e9. 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. teleportHereRequest=\u00a7c{0}\u00a7c Vous a demand\u00e9 de vous t\u00e9l\u00e9porter \u00e0 lui/elle.
teleportNewPlayerError=\u00c9chec de la t\u00e9l\u00e9portation du nouveau joueur. teleportNewPlayerError=\u00c9chec de la t\u00e9l\u00e9portation du nouveau joueur.
teleportRequest=\u00a7c{0}\u00a7c vous demande s''il peut se t\u00e9l\u00e9porter sur vous. teleportRequest=\u00a7c{0}\u00a7c vous demande s''il peut se t\u00e9l\u00e9porter vers vous.
teleportTop=\u00a77T\u00e9l\u00e9portation vers le haut. teleportTop=\u00a77T\u00e9l\u00e9portation vers le haut.
teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation.... teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation...
teleportationDisabled=\u00a77T\u00e9l\u00e9poration d\u00e9sactiv\u00e9. teleportationDisabled=\u00a77T\u00e9l\u00e9poration d\u00e9sactiv\u00e9.
teleportationEnabled=\u00a77T\u00e9l\u00e9portation activ\u00e9e. teleportationEnabled=\u00a77T\u00e9l\u00e9portation activ\u00e9e.
teleporting=\u00a77T\u00e9l\u00e9poration en cours... teleporting=\u00a77T\u00e9l\u00e9poration en cours...
teleportingPortal=\u00a77T\u00e9l\u00e9portation via portail. teleportingPortal=\u00a77T\u00e9l\u00e9portation via portail.
tempBanned=Banni temporairement du serveur pour {0} tempBanned=Banni temporairement du serveur pour {0}
tempbanExempt=\u00a77You may not tempban that player tempbanExempt=\u00a77Vous ne pouvez pas bannir temporairement ce joueur.
thunder=Vous avez {0} la foudre dans votre monde. thunder=Vous avez {0} la foudre dans votre monde.
thunderDuration=Vous avez {0} la foudre dans le serveur {1} secondes. thunderDuration=Vous avez {0} la foudre dans le serveur pendant {1} secondes.
timeBeforeHeal=Temps avant le prochain soin : {0} timeBeforeHeal=Temps avant le prochain soin : {0}
timeBeforeTeleport=Temps avant prochaine t\u00e9l\u00e9portation {0} timeBeforeTeleport=Temps avant prochaine t\u00e9l\u00e9portation {0}
timeFormat=\u00a73{0}\u00a7f or \u00a73{1}\u00a7f or \u00a73{2}\u00a7f timeFormat=\u00a73{0}\u00a7f ou \u00a73{1}\u00a7f ou \u00a73{2}\u00a7f
timePattern=(?:([0-9]+)\\\\s*[ya][a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*mo[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*(?:sem|w)[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*[dj][a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*h[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*m[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*(?:s[a-z]*)?)? timePattern=(?:([0-9]+)\\\\s*[ya][a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*mo[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*(?:sem|w)[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*[dj][a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*h[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*m[a-z]*[,\\\\s]*)?(?:([0-9]+)\\\\s*(?:s[a-z]*)?)?
timeSet=Heure modifi\u00e9e dans tous les mondes. timeSet=Heure r\u00e9gl\u00e9e dans tous les mondes.
timeSetPermission=\u00a7cYou are not authorized to set the time. timeSetPermission=\u00a7cVous n''\u00eates pas autoris\u00e9 \u00e0 r\u00e9gler l''heure.
timeWorldCurrent=The current time in {0} is \u00a73{1} timeWorldCurrent=Il est \u00a73{1}\u00a77 dans \u00a7c{0}.
timeWorldSet=The time was set to {0} in: \u00a7c{1} timeWorldSet=L''heure a \u00e9t\u00e9 r\u00e9gl\u00e9e \u00e0 {0} dans : \u00a7c{1}
tradeCompleted=\u00a77\u00c9change termin\u00e9. tradeCompleted=\u00a77\u00c9change termin\u00e9.
tradeSignEmpty=Le panneau de vente n''as pas encore assez de stock. tradeSignEmpty=Le panneau de vente n''as pas encore assez de stock.
tradeSignEmptyOwner=There is nothing to collect from this trade sign. tradeSignEmptyOwner=Il n''y a rien \u00e0 collecter de cette pancarte d''\u00e9change commercial.
treeFailure=\u00a7cEchec de la g\u00e9n\u00e9ration de l''arbre. Essayez de nouveau sur de l''herbe ou de la terre. treeFailure=\u00a7cEchec de la g\u00e9n\u00e9ration de l''arbre. Essayez de nouveau sur de l''herbe ou de la terre.
treeSpawned=\u00a77Arbre cr\u00e9\u00e9. treeSpawned=\u00a77Arbre cr\u00e9\u00e9.
true=true true=vrai
typeTpaccept=\u00a77Pour le t\u00e9l\u00e9porter, tapez \u00a7c/tpaccept\u00a77. typeTpaccept=\u00a77Pour le t\u00e9l\u00e9porter, tapez \u00a7c/tpaccept\u00a77.
typeTpdeny=\u00a77Pour d\u00e9cliner cette demande, entrez \u00a7c/tpdeny\u00a77. typeTpdeny=\u00a77Pour d\u00e9cliner cette demande, entrez \u00a7c/tpdeny\u00a77.
typeWorldName=\u00a77Vous pouvez aussi taper le nom d''un monde sp\u00e9cifique. typeWorldName=\u00a77Vous pouvez aussi taper le nom d''un monde sp\u00e9cifique.
unableToSpawnMob=Incapable de spawner un monstre. unableToSpawnMob=Incapable d''invoquer un monstre.
unbannedIP=Adresse IP d\u00e9banni. unbannedIP=Adresse IP d\u00e9bannie.
unbannedPlayer=Joueur d\u00e9banni. unbannedPlayer=Joueur d\u00e9banni.
unignorePlayer=Vous n''ignorez plus {0}. unignorePlayer=Vous n''ignorez plus {0}.
unknownItemId=Num\u00e9ro d''objet inconnu : {0} unknownItemId=Num\u00e9ro d''objet inconnu : {0}
@ -340,39 +351,39 @@ userIsAway={0} s''est mis en AFK
userIsNotAway={0} n''est plus inactif userIsNotAway={0} n''est plus inactif
userJailed=\u00a77Vous avez \u00e9t\u00e9 emprisonn\u00e9 userJailed=\u00a77Vous avez \u00e9t\u00e9 emprisonn\u00e9
userUsedPortal={0} a utilis\u00e9 un portail existant. userUsedPortal={0} a utilis\u00e9 un portail existant.
userdataMoveBackError=Echec du d\u00e9placement de userdata/{0}.tmp \u00e0 userdata/{1} userdataMoveBackError=Echec du d\u00e9placement de userdata/{0}.tmp vers userdata/{1}
userdataMoveError=Echec du d\u00e9placement de userdata/{0} \u00e0 userdata/{1}.tmp userdataMoveError=Echec du d\u00e9placement de userdata/{0} vers userdata/{1}.tmp
usingTempFolderForTesting=Utilise un fichier temporaire pour un test. usingTempFolderForTesting=Utilise un fichier temporaire pour un test.
versionMismatch=Versions diff\u00e9rentes! Mettez s''il vous pla\u00eet {0} \u00e0 la m\u00eame version. 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 Essentiels de version identique. versionMismatchAll=Mauvaise version ! S''il vous plait mettez des jars Essentials de version identique.
voiceSilenced=\u00a77Votre voix a \u00e9t\u00e9 r\u00e9duite au silence voiceSilenced=\u00a77Vous avez \u00e9t\u00e9 r\u00e9duit au silence.
warpDeleteError=Probl\u00e8me concernant la suppression du fichier warp. warpDeleteError=Probl\u00c3\u00a8me concernant la suppression du fichier warp.
warpListPermission=\u00a7cVous n''avez pas la permission d''afficher la liste des warps. warpListPermission=\u00a7cVous n''avez pas la permission d''afficher la liste des warps.
warpNotExist=Ce warp n''existe pas. warpNotExist=Ce raccourci n''existe pas.
warpSet=\u00a77Le warp {0} a \u00e9t\u00e9 cr\u00e9\u00e9. warpSet=\u00a77Le raccourci {0} a \u00e9t\u00e9 cr\u00e9\u00e9.
warpUsePermission=\u00a7cVous n''avez pas la permission d''utiliser ce warp. warpUsePermission=\u00a7cVous n''avez pas la permission d''utiliser ce warp.
warpingTo=\u00a77T\u00e9l\u00e9portation au warp {0}. warpingTo=\u00a77T\u00e9l\u00e9portation au warp {0}.
warps=Warps: {0} warps=Raccourcis : {0}
warpsCount=\u00a77There are {0} warps. Showing page {1} of {2}. warpsCount=\u00a77Il y a {0} raccourcis. Page {1} sur {2}.
weatherStorm=\u00a77Vous avez d\u00e9fini l''orage dans {0} weatherStorm=\u00a77Vous avez programm\u00e9 l''orage dans {0}
weatherStormFor=\u00a77Vous avez d\u00e9fini l''orage dans {0} pour {1} secondes. weatherStormFor=\u00a77Vous avez programm\u00e9 l''orage dans {0} pour {1} secondes.
weatherSun=\u00a77Vous avez mis le beau temps dans {0} weatherSun=\u00a77Vous avez programm\u00e9 le beau temps dans {0}
weatherSunFor=\u00a77Vous avez mis le beau temps dans {0} pour {1} secondes. weatherSunFor=\u00a77Vous avez programm\u00e9 le beau temps dans {0} pour {1} secondes.
whoisGamemode=\u00a79 - Gamemode: {0} whoisGamemode=\u00a79 - Mode de jeu : {0}
whoisGeoLocation=\u00a79 - Emplacement: {0} whoisGeoLocation=\u00a79 - Emplacement : {0}
whoisGod=\u00a79 - God mode: {0} whoisGod=\u00a79 - Mode Dieu : {0}
whoisHealth=\u00a79 - Vie: {0} / 20 whoisHealth=\u00a79 - Vie : {0} / 20
whoisIPAddress=\u00a79 - Adresse IP: {0} whoisIPAddress=\u00a79 - Adresse IP : {0}
whoisIs={0} est {1} whoisIs={0} est {1}
whoisLocation=\u00a79 - Emplacement: ({0}, {1}, {2}, {3}) whoisLocation=\u00a79 - Emplacement : ({0}, {1}, {2}, {3})
whoisMoney=\u00a79 - Argent: {0} whoisMoney=\u00a79 - Argent : {0}
whoisOP=\u00a79 - OP: {0} whoisOP=\u00a79 - OP : {0}
whoisStatusAvailable=\u00a79 - Statut: Disponible whoisStatusAvailable=\u00a79 - Statut : Disponible
whoisStatusAway=\u00a79 - Statut: \u00a7cAilleurs\u00a7f whoisStatusAway=\u00a79 - Statut : \u00a7cAilleurs\u00a7f
worth=\u00a77Un stack de {0} vaut \u00a7c{1}\u00a77 ({2} objet(s) \u00e0 {3} chacun) worth=\u00a77Une pile de {0} vaut \u00a7c{1}\u00a77 ({2} objet(s) \u00e0 {3} chacun)
worthMeta=\u00a77Un stack de {0} avec la m\u00e9tadonn\u00e9e de {1} vaut \u00a7c{2}\u00a77 ({3} objet(s) \u00e0 {4} chacun) worthMeta=\u00a77Une pile de {0} avec la m\u00e9tadonn\u00e9e de {1} vaut \u00a7c{2}\u00a77 ({3} objet(s) \u00e0 {4} chacun)
worthSet=Valeur cr\u00e9e worthSet=Valeur cr\u00e9e
year=ann\u00e9e year=ann\u00e9e
years=ann\u00e9es years=ann\u00e9es
youAreHealed=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9. youAreHealed=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
youHaveNewMail=\u00a7cVous avez {0} messages! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier. youHaveNewMail=\u00a7cVous avez {0} messages ! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier.

View File

@ -68,6 +68,11 @@ downloadingGeoIp=Bezig met downloaden van GeoIP database ... Dit kan een tijdje
duplicatedUserdata=Dubbele userdata: {0} en {1}. duplicatedUserdata=Dubbele userdata: {0} en {1}.
enableUnlimited=\u00a77Oneindig aantal {0} aan {1} gegeven. enableUnlimited=\u00a77Oneindig aantal {0} aan {1} gegeven.
enabled=ingeschakeld 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}
enchantmentRemoved = \u00a77The enchantment {0} has been removed from your item in hand.
enchantments = \u00a77Enchantments: {0}
errorCallingCommand=Fout bij het aanroepen van de opdracht /{0} errorCallingCommand=Fout bij het aanroepen van de opdracht /{0}
errorWithMessage=\u00a7cFout: {0} errorWithMessage=\u00a7cFout: {0}
essentialsReload=\u00a77Essentials is herladen {0} essentialsReload=\u00a77Essentials is herladen {0}
@ -153,6 +158,10 @@ kitTimed=\u00a7cJe kan die kit pas weer gebruiken over {0}.
kits=\u00a77Kits: {0} kits=\u00a77Kits: {0}
lightningSmited=\u00a77Je bent zojuist verbrand lightningSmited=\u00a77Je bent zojuist verbrand
lightningUse=\u00a77Brand {0} 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.
listHiddenTag = \u00a77[HIDDEN]\u00a7f
loadWarpError=Fout bij het laden van warp {0} loadWarpError=Fout bij het laden van warp {0}
loadinfo=Build {1} geladen {0} van {2} loadinfo=Build {1} geladen {0} van {2}
localFormat=Local: <{0}> {1} localFormat=Local: <{0}> {1}
@ -196,6 +205,7 @@ nickSet=\u00a77Je nickname is nu \u00a7c{0}
noAccessCommand=\u00a7cJe hebt geen toegang tot die opdracht. noAccessCommand=\u00a7cJe hebt geen toegang tot die opdracht.
noAccessPermission=\u00a7cJe hebt hier geen toegang voor {0}. noAccessPermission=\u00a7cJe hebt hier geen toegang voor {0}.
noDestroyPermission=\u00a7cJe hebt geen toegang om dat te vernietigen {0}. noDestroyPermission=\u00a7cJe hebt geen toegang om dat te vernietigen {0}.
noGodWorldWarning=\u00a7cWarning! God mode in this world disabled.
noHelpFound=\u00a7cNo matching commands. noHelpFound=\u00a7cNo matching commands.
noHomeSet=Je hebt geen home gemaakt. noHomeSet=Je hebt geen home gemaakt.
noHomeSetPlayer=Speler heeft geen home. noHomeSetPlayer=Speler heeft geen home.
@ -216,6 +226,7 @@ notAllowedToShout=\u00a7cJe bent niet bevoegd om de roep functie te gebruiken.
notEnoughMoney=Je hebt niet voldoende middelen. notEnoughMoney=Je hebt niet voldoende middelen.
notRecommendedBukkit=De Bukkit versie is niet de aangeraden build voor Essentials. notRecommendedBukkit=De Bukkit versie is niet de aangeraden build voor Essentials.
notSupportedYet=Nog niet ondersteund. notSupportedYet=Nog niet ondersteund.
nothingInHand = \u00a7cYou have nothing in your hand.
now=nu now=nu
numberRequired=Er moet daar een nummer, grapjas. numberRequired=Er moet daar een nummer, grapjas.
onlyDayNight=/time ondersteund alleen day/night. onlyDayNight=/time ondersteund alleen day/night.

View File

@ -79,6 +79,10 @@ commands:
description: Manages the server economy. description: Manages the server economy.
usage: /<command> <give|take|reset> <player> <amount> usage: /<command> <give|take|reset> <player> <amount>
aliases: [economy,eeco,eeconomy] aliases: [economy,eeco,eeconomy]
enchant:
description: Enchants the item the user is holding.
usage: /<command> <enchantmentname> [level]
aliases: [enchantment]
essentials: essentials:
description: Reloads essentials. description: Reloads essentials.
usage: /<command> usage: /<command>
@ -104,7 +108,7 @@ commands:
aliases: [mem,memory,egc,emem,ememory] aliases: [mem,memory,egc,emem,ememory]
give: give:
description: Give a player an item. description: Give a player an item.
usage: /<command> <player> <item|numeric> [amount] usage: /<command> <player> <item|numeric> [amount <enchantmentname[:level]> ...]
aliases: [egive] aliases: [egive]
god: god:
description: Enables your godly powers. description: Enables your godly powers.
@ -140,7 +144,7 @@ commands:
aliases: [einvsee] aliases: [einvsee]
item: item:
description: Spawn an item. description: Spawn an item.
usage: /<command> <item|numeric> [amount] usage: /<command> <item|numeric> [amount <enchantmentname[:level]> ...]
aliases: [i,eitem] aliases: [i,eitem]
jails: jails:
description: List all jails. description: List all jails.

View File

@ -586,4 +586,10 @@ public class FakeServer implements Server
{ {
return "Essentials Fake-Server"; return "Essentials Fake-Server";
} }
@Override
public File getWorldContainer()
{
throw new UnsupportedOperationException("Not supported yet.");
}
} }

View File

@ -54,9 +54,9 @@ public class UserTest extends TestCase
user.setHome(); user.setHome();
OfflinePlayer base2 = server.createPlayer(base1.getName(), ess); OfflinePlayer base2 = server.createPlayer(base1.getName(), ess);
User user2 = ess.getUser(base2); User user2 = ess.getUser(base2);
try
{
Location home = user2.getHome(loc); Location home = user2.getHome(loc);
assertNotNull(home);
assertEquals(loc.getWorld().getName(), home.getWorld().getName()); assertEquals(loc.getWorld().getName(), home.getWorld().getName());
assertEquals(loc.getX(), home.getX()); assertEquals(loc.getX(), home.getX());
assertEquals(loc.getY(), home.getY()); assertEquals(loc.getY(), home.getY());
@ -64,12 +64,6 @@ public class UserTest extends TestCase
assertEquals(loc.getYaw(), home.getYaw()); assertEquals(loc.getYaw(), home.getYaw());
assertEquals(loc.getPitch(), home.getPitch()); assertEquals(loc.getPitch(), home.getPitch());
} }
catch (Exception ex)
{
fail("Exception");
}
}
public void testMoney() public void testMoney()
{ {

View File

@ -2,6 +2,7 @@ package com.earth2me.essentials.chat;
import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.event.player.PlayerChatEvent; import org.bukkit.event.player.PlayerChatEvent;
@ -30,6 +31,6 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer
{ {
event.setMessage(event.getMessage().replaceAll("&([0-9a-f])", "\u00a7$1")); event.setMessage(event.getMessage().replaceAll("&([0-9a-f])", "\u00a7$1"));
} }
event.setFormat(ess.getSettings().getChatFormat(user.getGroup()).replace('&', '\u00a7').replace("\u00a7\u00a7", "&").replace("{DISPLAYNAME}", "%1$s").replace("{GROUP}", user.getGroup()).replace("{MESSAGE}", "%2$s").replace("{WORLDNAME}", user.getWorld().getName()).replace("{SHORTWORLDNAME}", user.getWorld().getName().substring(0, 1).toUpperCase())); event.setFormat(ess.getSettings().getChatFormat(user.getGroup()).replace('&', '\u00a7').replace("\u00a7\u00a7", "&").replace("{DISPLAYNAME}", "%1$s").replace("{GROUP}", user.getGroup()).replace("{MESSAGE}", "%2$s").replace("{WORLDNAME}", user.getWorld().getName()).replace("{SHORTWORLDNAME}", user.getWorld().getName().substring(0, 1).toUpperCase(Locale.ENGLISH)));
} }
} }

View File

@ -4,6 +4,7 @@ import com.earth2me.essentials.ChargeException;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.event.player.PlayerChatEvent; import org.bukkit.event.player.PlayerChatEvent;
@ -50,7 +51,7 @@ public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer
format.append(chatType).append("Format"); format.append(chatType).append("Format");
StringBuilder errorMsg = new StringBuilder(); StringBuilder errorMsg = new StringBuilder();
errorMsg.append("notAllowedTo").append(chatType.substring(0, 1).toUpperCase()).append(chatType.substring(1)); errorMsg.append("notAllowedTo").append(chatType.substring(0, 1).toUpperCase(Locale.ENGLISH)).append(chatType.substring(1));
if (user.isAuthorized(permission.toString())) if (user.isAuthorized(permission.toString()))
{ {

View File

@ -521,10 +521,10 @@ public class NijikoPermissionsProxy extends PermissionHandler {
@Override @Override
public boolean has(String world, String playerName, String permission) { public boolean has(String world, String playerName, String permission) {
if (permission == null || permission.equals("")) { if (permission == null || permission.isEmpty()) {
return false; return false;
} }
if (playerName == null || playerName == "") { if (playerName == null || playerName.isEmpty()) {
GroupManager.logger.severe("A plugin is asking permission '" + permission + "' for a null player... Which plugin does that? Bastards!"); GroupManager.logger.severe("A plugin is asking permission '" + permission + "' for a null player... Which plugin does that? Bastards!");
return false; return false;
} }

View File

@ -76,3 +76,7 @@ v 1.5:
v 1.6: v 1.6:
- Prevent Group.equals tests throwing a NullPointerException for GlobalGroups. - Prevent Group.equals tests throwing a NullPointerException for GlobalGroups.
- Stop throwing errors on an empty users file. - Stop throwing errors on an empty users file.
- Optimize sorting to speedup permission tests.
- Fix superperms to pass all tests http://dev.bukkit.org/server-mods/superpermstest/
- Optimizations include changing the return of comparePermissionString.
- Added file details in error messages for loading groups/users.

View File

@ -6,6 +6,8 @@ package org.anjocaido.groupmanager.data;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List;
import org.anjocaido.groupmanager.GroupManager; import org.anjocaido.groupmanager.GroupManager;
import org.anjocaido.groupmanager.dataholder.WorldDataHolder; import org.anjocaido.groupmanager.dataholder.WorldDataHolder;
import org.anjocaido.groupmanager.utils.StringPermissionComparator; import org.anjocaido.groupmanager.utils.StringPermissionComparator;
@ -18,7 +20,7 @@ public abstract class DataUnit {
private WorldDataHolder dataSource; private WorldDataHolder dataSource;
private String name; private String name;
private boolean changed; private boolean changed, sorted = false;
private ArrayList<String> permissions = new ArrayList<String>(); private ArrayList<String> permissions = new ArrayList<String>();
public DataUnit(WorldDataHolder dataSource, String name) { public DataUnit(WorldDataHolder dataSource, String name) {
@ -91,6 +93,7 @@ public abstract class DataUnit {
// for(StackTraceElement st: Thread.currentThread().getStackTrace()){ // for(StackTraceElement st: Thread.currentThread().getStackTrace()){
// GroupManager.logger.finest(st.toString()); // GroupManager.logger.finest(st.toString());
// } // }
sorted = false;
changed = true; changed = true;
} }
@ -132,11 +135,18 @@ public abstract class DataUnit {
* You can't edit the permissions using the returned ArrayList instance * You can't edit the permissions using the returned ArrayList instance
* @return a copy of the permission list * @return a copy of the permission list
*/ */
public ArrayList<String> getPermissionList() { public List<String> getPermissionList() {
return new ArrayList<String>(permissions); return Collections.unmodifiableList(permissions);
}
public boolean isSorted() {
return this.sorted;
} }
public void sortPermissions() { public void sortPermissions() {
if (!isSorted()) {
Collections.sort(permissions, StringPermissionComparator.getInstance()); Collections.sort(permissions, StringPermissionComparator.getInstance());
sorted = true;
}
} }
} }

View File

@ -7,6 +7,8 @@ package org.anjocaido.groupmanager.data;
import org.anjocaido.groupmanager.GroupManager; import org.anjocaido.groupmanager.GroupManager;
import org.anjocaido.groupmanager.dataholder.WorldDataHolder; import org.anjocaido.groupmanager.dataholder.WorldDataHolder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -92,13 +94,13 @@ public class Group extends DataUnit implements Cloneable {
} }
/** /**
* a COPY of inherits list * an unmodifiable list of inherits list
* You can't manage the list by here * You can't manage the list by here
* Lol... version 0.6 had a problem because this. * Lol... version 0.6 had a problem because this.
* @return the inherits * @return the inherits
*/ */
public ArrayList<String> getInherits() { public List<String> getInherits() {
return new ArrayList<String>(inherits); return Collections.unmodifiableList(inherits);
} }
/** /**

View File

@ -10,6 +10,9 @@ import java.util.ArrayList;
import org.anjocaido.groupmanager.GroupManager; import org.anjocaido.groupmanager.GroupManager;
import org.anjocaido.groupmanager.dataholder.WorldDataHolder; import org.anjocaido.groupmanager.dataholder.WorldDataHolder;
import java.util.Map; import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
/** /**
* *
@ -23,11 +26,11 @@ public class User extends DataUnit implements Cloneable {
private String group = null; private String group = null;
private ArrayList<String> subGroups = new ArrayList<String>(); private ArrayList<String> subGroups = new ArrayList<String>();
/** /**
*This one holds the fields in INFO node. * This one holds the fields in INFO node. like prefix = 'c' or build =
* like prefix = 'c' * false
* or build = false
*/ */
private UserVariables variables = new UserVariables(this); private UserVariables variables = new UserVariables(this);
private transient Player bukkitPlayer = null;
/** /**
* *
@ -49,13 +52,14 @@ public class User extends DataUnit implements Cloneable {
for (String perm : this.getPermissionList()) { for (String perm : this.getPermissionList()) {
clone.addPermission(perm); clone.addPermission(perm);
} }
//clone.variables = this.variables.clone(); // clone.variables = this.variables.clone();
//clone.flagAsChanged(); // clone.flagAsChanged();
return clone; return clone;
} }
/** /**
* Use this to deliver a user from one WorldDataHolder to another * Use this to deliver a user from one WorldDataHolder to another
*
* @param dataSource * @param dataSource
* @return null if given dataSource already contains the same user * @return null if given dataSource already contains the same user
*/ */
@ -72,7 +76,7 @@ public class User extends DataUnit implements Cloneable {
for (String perm : this.getPermissionList()) { for (String perm : this.getPermissionList()) {
clone.addPermission(perm); clone.addPermission(perm);
} }
//clone.variables = this.variables.clone(); // clone.variables = this.variables.clone();
clone.flagAsChanged(); clone.flagAsChanged();
return clone; return clone;
} }
@ -98,19 +102,21 @@ public class User extends DataUnit implements Cloneable {
} }
/** /**
* @param group the group to set * @param group
* the group to set
*/ */
@Deprecated @Deprecated
public void setGroup(String group) { public void setGroup(String group) {
this.group = group; this.group = group;
flagAsChanged(); flagAsChanged();
if (GroupManager.isLoaded()) if (GroupManager.isLoaded())
if(GroupManager.BukkitPermissions.player_join = false) if (GroupManager.BukkitPermissions.player_join = false)
GroupManager.BukkitPermissions.updateAllPlayers(); GroupManager.BukkitPermissions.updateAllPlayers();
} }
/** /**
* @param group the group to set * @param group
* the group to set
*/ */
public void setGroup(Group group) { public void setGroup(Group group) {
if (!this.getDataSource().groupExists(group.getName())) { if (!this.getDataSource().groupExists(group.getName())) {
@ -127,10 +133,12 @@ public class User extends DataUnit implements Cloneable {
// Do we notify of the group change? // Do we notify of the group change?
String defaultGroupName = getDataSource().getDefaultGroup().getName(); String defaultGroupName = getDataSource().getDefaultGroup().getName();
// if we were not in the default group // if we were not in the default group
// or we were in the default group and the move is to a different group. // or we were in the default group and the move is to a different
boolean notify = (!oldGroup.equalsIgnoreCase(defaultGroupName)) || ((oldGroup.equalsIgnoreCase(defaultGroupName)) && (!this.group.equalsIgnoreCase(defaultGroupName))) ; // group.
boolean notify = (!oldGroup.equalsIgnoreCase(defaultGroupName)) || ((oldGroup.equalsIgnoreCase(defaultGroupName)) && (!this.group.equalsIgnoreCase(defaultGroupName)));
if (notify) GroupManager.notify(this.getName(), String.format(" moved to the group %s.", group.getName())); if (notify)
GroupManager.notify(this.getName(), String.format(" moved to the group %s.", group.getName()));
} }
} }
@ -215,4 +223,19 @@ public class User extends DataUnit implements Cloneable {
if (GroupManager.BukkitPermissions.player_join = false) if (GroupManager.BukkitPermissions.player_join = false)
GroupManager.BukkitPermissions.updateAllPlayers(); GroupManager.BukkitPermissions.updateAllPlayers();
} }
public User updatePlayer(Player player) {
if (player != null) {
bukkitPlayer = player;
}
return this;
}
public Player getBukkitPlayer() {
if (bukkitPlayer == null) {
bukkitPlayer = Bukkit.getPlayer(this.getName());
}
return bukkitPlayer;
}
} }

View File

@ -44,12 +44,13 @@ public class OverloadedWorldHolder extends WorldDataHolder {
@Override @Override
public User getUser(String userName) { public User getUser(String userName) {
//OVERLOADED CODE //OVERLOADED CODE
if (overloadedUsers.containsKey(userName.toLowerCase())) { String userNameLowered = userName.toLowerCase();
return overloadedUsers.get(userName.toLowerCase()); if (overloadedUsers.containsKey(userNameLowered)) {
return overloadedUsers.get(userNameLowered);
} }
//END CODE //END CODE
if (users.containsKey(userName.toLowerCase())) { if (users.containsKey(userNameLowered)) {
return users.get(userName.toLowerCase()); return users.get(userNameLowered);
} }
User newUser = createUser(userName); User newUser = createUser(userName);
haveUsersChanged = true; haveUsersChanged = true;

View File

@ -595,7 +595,7 @@ public class WorldDataHolder {
Map<String, Object> thisGroupNode = (Map<String, Object>) allGroupsNode.get(groupKey); Map<String, Object> thisGroupNode = (Map<String, Object>) allGroupsNode.get(groupKey);
Group thisGrp = ph.createGroup(groupKey); Group thisGrp = ph.createGroup(groupKey);
if (thisGrp == null) { if (thisGrp == null) {
throw new IllegalArgumentException("I think this user was declared more than once: " + groupKey); throw new IllegalArgumentException("I think this user was declared more than once: " + groupKey + " in file: " + groupsFile.getPath());
} }
if (thisGroupNode.get("default") == null) { if (thisGroupNode.get("default") == null) {
thisGroupNode.put("default", false); thisGroupNode.put("default", false);
@ -603,7 +603,7 @@ public class WorldDataHolder {
if ((Boolean.parseBoolean(thisGroupNode.get("default").toString()))) { if ((Boolean.parseBoolean(thisGroupNode.get("default").toString()))) {
if (ph.getDefaultGroup() != null) { 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("The group " + thisGrp.getName() + " is claiming to be default where" + ph.getDefaultGroup().getName() + " already was.");
GroupManager.logger.warning("Overriding first request."); GroupManager.logger.warning("Overriding first request for file: " + groupsFile.getPath());
} }
ph.setDefaultGroup(thisGrp); ph.setDefaultGroup(thisGrp);
} }
@ -619,7 +619,7 @@ public class WorldDataHolder {
} else if (thisGroupNode.get("permissions") instanceof String) { } else if (thisGroupNode.get("permissions") instanceof String) {
thisGrp.addPermission((String) thisGroupNode.get("permissions")); thisGrp.addPermission((String) thisGroupNode.get("permissions"));
} else { } else {
throw new IllegalArgumentException("Unknown type of permissions node(Should be String or List<String>) for group: " + thisGrp.getName()); throw new IllegalArgumentException("Unknown type of permissions node(Should be String or List<String>) for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath());
} }
//INFO NODE //INFO NODE
@ -629,7 +629,7 @@ public class WorldDataHolder {
thisGrp.setVariables(infoNode); thisGrp.setVariables(infoNode);
} }
} else } else
throw new IllegalArgumentException("Unknown entry found in Info section for group: " + thisGrp.getName()); throw new IllegalArgumentException("Unknown entry found in Info section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath());
//END INFO NODE //END INFO NODE
@ -650,14 +650,14 @@ public class WorldDataHolder {
} }
} }
}else }else
throw new IllegalArgumentException("Unknown entry found in inheritance section for group: " + thisGrp.getName()); throw new IllegalArgumentException("Unknown entry found in inheritance section for group: " + thisGrp.getName() + " in file: " + groupsFile.getPath());
} }
//} catch (Exception ex) { //} catch (Exception ex) {
// ex.printStackTrace(); // ex.printStackTrace();
// throw new IllegalArgumentException("Your Permissions config file is invalid. See console for details."); // throw new IllegalArgumentException("Your Permissions config file is invalid. See console for details.");
//} //}
if (ph.defaultGroup == null) { if (ph.defaultGroup == null) {
throw new IllegalArgumentException("There was no Default Group declared."); throw new IllegalArgumentException("There was no Default Group declared in file: " + groupsFile.getPath());
} }
for (String groupKey : inheritance.keySet()) { for (String groupKey : inheritance.keySet()) {
List<String> inheritedList = inheritance.get(groupKey); List<String> inheritedList = inheritance.get(groupKey);
@ -717,7 +717,7 @@ public class WorldDataHolder {
Map<String, Object> thisUserNode = (Map<String, Object>) allUsersNode.get(usersKey); Map<String, Object> thisUserNode = (Map<String, Object>) allUsersNode.get(usersKey);
User thisUser = ph.createUser(usersKey); User thisUser = ph.createUser(usersKey);
if (thisUser == null) { if (thisUser == null) {
throw new IllegalArgumentException("I think this user was declared more than once: " + usersKey); throw new IllegalArgumentException("I think this user was declared more than once: " + usersKey + " in file: " + usersFile.getPath());
} }
if (thisUserNode.get("permissions") == null) { if (thisUserNode.get("permissions") == null) {
thisUserNode.put("permissions", new ArrayList<String>()); thisUserNode.put("permissions", new ArrayList<String>());
@ -740,7 +740,7 @@ public class WorldDataHolder {
if (subGrp != null) { if (subGrp != null) {
thisUser.addSubGroup(subGrp); thisUser.addSubGroup(subGrp);
} else { } else {
GroupManager.logger.warning("Subgroup " + o.toString() + " not found for user " + thisUser.getName() + ". Ignoring entry."); 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) { } else if (thisUserNode.get("subgroups") instanceof String) {
@ -748,7 +748,7 @@ public class WorldDataHolder {
if (subGrp != null) { if (subGrp != null) {
thisUser.addSubGroup(subGrp); thisUser.addSubGroup(subGrp);
} else { } else {
GroupManager.logger.warning("Subgroup " + thisUserNode.get("subgroups").toString() + " not found for user " + thisUser.getName() + ". Ignoring entry."); GroupManager.logger.warning("Subgroup " + thisUserNode.get("subgroups").toString() + " not found for user " + thisUser.getName() + ". Ignoring entry in file: " + usersFile.getPath());
} }
} }
@ -765,7 +765,7 @@ public class WorldDataHolder {
if (thisUserNode.get("group") != null) { if (thisUserNode.get("group") != null) {
Group hisGroup = ph.getGroup(thisUserNode.get("group").toString()); Group hisGroup = ph.getGroup(thisUserNode.get("group").toString());
if (hisGroup == null) { 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() + "'."); 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.defaultGroup; hisGroup = ph.defaultGroup;
//throw new IllegalArgumentException("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName()); //throw new IllegalArgumentException("There is no group " + thisUserNode.get("group").toString() + ", as stated for player " + thisUser.getName());
} }

View File

@ -268,9 +268,10 @@ public class WorldsHolder {
* @return OverloadedWorldHolder * @return OverloadedWorldHolder
*/ */
public OverloadedWorldHolder getWorldData(String worldName) { public OverloadedWorldHolder getWorldData(String worldName) {
OverloadedWorldHolder data = worldsData.get(worldName.toLowerCase()); String worldNameLowered = worldName.toLowerCase();
if (mirrors.containsKey(worldName.toLowerCase())) { OverloadedWorldHolder data = worldsData.get(worldNameLowered);
String realOne = mirrors.get(worldName.toLowerCase()); if (mirrors.containsKey(worldNameLowered)) {
String realOne = mirrors.get(worldNameLowered);
data = worldsData.get(realOne.toLowerCase()); data = worldsData.get(realOne.toLowerCase());
} }
if (data == null) { if (data == null) {

View File

@ -8,7 +8,7 @@ import java.util.ArrayList;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.StringTokenizer;
import org.anjocaido.groupmanager.GroupManager; import org.anjocaido.groupmanager.GroupManager;
import org.anjocaido.groupmanager.data.Group; import org.anjocaido.groupmanager.data.Group;
import org.anjocaido.groupmanager.dataholder.WorldDataHolder; import org.anjocaido.groupmanager.dataholder.WorldDataHolder;
@ -17,6 +17,7 @@ import org.anjocaido.groupmanager.utils.PermissionCheckResult;
import org.anjocaido.groupmanager.utils.PermissionCheckResult.Type; import org.anjocaido.groupmanager.utils.PermissionCheckResult.Type;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission;
/** /**
* Everything here maintains the model created by Nijikokun * Everything here maintains the model created by Nijikokun
@ -62,7 +63,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
*/ */
@Override @Override
public boolean permission(Player player, String permission) { public boolean permission(Player player, String permission) {
return checkUserPermission(ph.getUser(player.getName()), permission); return checkUserPermission(ph.getUser(player.getName()).updatePlayer(player), permission);
} }
/** /**
@ -97,43 +98,60 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
@Override @Override
public List<String> getAllPlayersPermissions(String userName) { public List<String> getAllPlayersPermissions(String userName) {
List<String> playerPermArray = new ArrayList<String>(ph.getUser(userName).getPermissionList()); List<String> playerPermArray = new ArrayList<String>();
for (String perm : ph.getUser(userName).getPermissionList()) {
if ((!playerPermArray.contains(perm)) && (!playerPermArray.contains("-" + perm))) {
playerPermArray.add(perm);
Map<String, Boolean> children = GroupManager.BukkitPermissions.getAllChildren(perm, playerPermArray);
if (children != null) {
for (String child : children.keySet()) {
if (children.get(child))
if ((!playerPermArray.contains(child)) && (!playerPermArray.contains("-" + child))) {
playerPermArray.add(child);
}
}
}
}
}
for (String group : getGroups(userName)) { for (String group : getGroups(userName)) {
if (group.startsWith("g:") && GroupManager.getGlobalGroups().hasGroup(group)) { if (group.startsWith("g:") && GroupManager.getGlobalGroups().hasGroup(group)) {
for (String perm : GroupManager.getGlobalGroups().getGroupsPermissions(group)) { for (String perm : GroupManager.getGlobalGroups().getGroupsPermissions(group)) {
if ((!playerPermArray.contains(perm)) && (!playerPermArray.contains("-" + perm))) { if ((!playerPermArray.contains(perm)) && (!playerPermArray.contains("-" + perm))) {
playerPermArray.add(perm); playerPermArray.add(perm);
Map<String, Boolean> children = GroupManager.BukkitPermissions.getChildren(perm); Map<String, Boolean> children = GroupManager.BukkitPermissions.getAllChildren(perm, playerPermArray);
if (children != null) { if (children != null) {
for (String child : children.keySet()) { for (String child : children.keySet()) {
if (children.get(child)) if (children.get(child))
if ((!playerPermArray.contains(perm)) && (!playerPermArray.contains("-" + perm))) if ((!playerPermArray.contains(child)) && (!playerPermArray.contains("-" + child)))
playerPermArray.add(child); playerPermArray.add(child);
} }
} }
} }
} }
} else { } else {
for (String perm : ph.getGroup(group).getPermissionList()) { for (String perm : ph.getGroup(group).getPermissionList()) {
if ((!playerPermArray.contains(perm)) && (!playerPermArray.contains("-" + perm))) { if ((!playerPermArray.contains(perm)) && (!playerPermArray.contains("-" + perm))) {
playerPermArray.add(perm); playerPermArray.add(perm);
Map<String, Boolean> children = GroupManager.BukkitPermissions.getChildren(perm); Map<String, Boolean> children = GroupManager.BukkitPermissions.getAllChildren(perm, playerPermArray);
if (children != null) { if (children != null) {
for (String child : children.keySet()) { for (String child : children.keySet()) {
if (children.get(child)) if (children.get(child))
if ((!playerPermArray.contains(perm)) && (!playerPermArray.contains("-" + perm))) if ((!playerPermArray.contains(child)) && (!playerPermArray.contains("-" + child))) {
playerPermArray.add(child); playerPermArray.add(child);
} }
} }
} }
} }
} }
} }
}
// Collections.sort(playerPermArray,
// StringPermissionComparator.getInstance());
return playerPermArray; return playerPermArray;
} }
@ -227,7 +245,8 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
/** /**
* Check if user can build. Checks inheritance and subgroups. * Check if user can build. Checks inheritance and subgroups.
* *
* @param userName Player's name * @param userName
* Player's name
* @return true if the user can build * @return true if the user can build
*/ */
public boolean canUserBuild(String userName) { public boolean canUserBuild(String userName) {
@ -267,8 +286,8 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
} }
/** /**
* Checks the specified group for the Info Build node. * Checks the specified group for the Info Build node. Does NOT check
* Does NOT check inheritance * inheritance
* *
* @param groupName * @param groupName
* @return true if can build * @return true if can build
@ -599,15 +618,8 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
result.askedPermission = permission; result.askedPermission = permission;
result.owner = user; result.owner = user;
for (String access : user.getPermissionList()) { for (String access : user.getPermissionList()) {
if (comparePermissionString(access, permission)) { result.resultType = comparePermissionString(access, permission);
result.accessLevel = access; if (result.resultType != PermissionCheckResult.Type.NOTFOUND) {
if (access.startsWith("-")) {
result.resultType = PermissionCheckResult.Type.NEGATION;
} else if (access.startsWith("+")) {
result.resultType = PermissionCheckResult.Type.EXCEPTION;
} else {
result.resultType = PermissionCheckResult.Type.FOUND;
}
return result; return result;
} }
} }
@ -629,15 +641,8 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
result.owner = group; result.owner = group;
result.askedPermission = permission; result.askedPermission = permission;
for (String access : group.getPermissionList()) { for (String access : group.getPermissionList()) {
if (comparePermissionString(access, permission)) { result.resultType = comparePermissionString(access, permission);
result.accessLevel = access; if (result.resultType != PermissionCheckResult.Type.NOTFOUND) {
if (access.startsWith("-")) {
result.resultType = PermissionCheckResult.Type.NEGATION;
} else if (access.startsWith("+")) {
result.resultType = PermissionCheckResult.Type.EXCEPTION;
} else {
result.resultType = PermissionCheckResult.Type.FOUND;
}
return result; return result;
} }
} }
@ -653,12 +658,10 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
* @return true if permission was found. false if not, or was negated. * @return true if permission was found. false if not, or was negated.
*/ */
public boolean checkUserPermission(User user, String permission) { public boolean checkUserPermission(User user, String permission) {
PermissionCheckResult result = checkFullUserPermission(user, permission); PermissionCheckResult result = checkFullGMPermission(user, permission, true);
if (result.resultType.equals(PermissionCheckResult.Type.EXCEPTION) || result.resultType.equals(PermissionCheckResult.Type.FOUND)) { if (result.resultType == PermissionCheckResult.Type.EXCEPTION || result.resultType == PermissionCheckResult.Type.FOUND) {
return true; return true;
} }
if ((Bukkit.getPlayer(user.getName()) != null) && (Bukkit.getPlayer(user.getName()).hasPermission(permission)))
return true;
return false; return false;
} }
@ -672,39 +675,59 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
* @return PermissionCheckResult * @return PermissionCheckResult
*/ */
public PermissionCheckResult checkFullUserPermission(User user, String targetPermission) { public PermissionCheckResult checkFullUserPermission(User user, String targetPermission) {
return checkFullGMPermission(user, targetPermission, true);
}
/**
* Check user and groups with inheritance and Bukkit if bukkit = true return
* a PermissionCheckResult.
*
* @param user
* @param targetPermission
* @param checkBukkit
* @return PermissionCheckResult
*/
public PermissionCheckResult checkFullGMPermission(User user, String targetPermission, Boolean checkBukkit) {
PermissionCheckResult result = new PermissionCheckResult(); PermissionCheckResult result = new PermissionCheckResult();
result.askedPermission = targetPermission; result.accessLevel = targetPermission;
result.resultType = PermissionCheckResult.Type.NOTFOUND; result.resultType = PermissionCheckResult.Type.NOTFOUND;
if (user == null || targetPermission == null || targetPermission.isEmpty()) { if (user == null || targetPermission == null || targetPermission.isEmpty()) {
return result; return result;
} }
if (checkBukkit) {
// 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;
result.owner = user;
return result;
}
}
PermissionCheckResult resultUser = checkUserOnlyPermission(user, targetPermission); PermissionCheckResult resultUser = checkUserOnlyPermission(user, targetPermission);
if (!resultUser.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) { if (resultUser.resultType != PermissionCheckResult.Type.NOTFOUND) {
return resultUser; return resultUser;
} }
// IT ONLY CHECKS GROUPS PERMISSIONS IF RESULT FOR USER IS NOT FOUND // IT ONLY CHECKS GROUPS PERMISSIONS IF RESULT FOR USER IS NOT FOUND
PermissionCheckResult resultGroup = checkGroupPermissionWithInheritance(user.getGroup(), targetPermission); PermissionCheckResult resultGroup = checkGroupPermissionWithInheritance(user.getGroup(), targetPermission);
if (!resultGroup.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) { if (resultGroup.resultType != PermissionCheckResult.Type.NOTFOUND) {
return resultGroup; return resultGroup;
} }
// SUBGROUPS CHECK // SUBGROUPS CHECK
for (Group subGroup : user.subGroupListCopy()) { for (Group subGroup : user.subGroupListCopy()) {
PermissionCheckResult resultSubGroup = checkGroupPermissionWithInheritance(subGroup, targetPermission); PermissionCheckResult resultSubGroup = checkGroupPermissionWithInheritance(subGroup, targetPermission);
if (!resultSubGroup.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) { if (resultSubGroup.resultType != PermissionCheckResult.Type.NOTFOUND) {
return resultSubGroup; return resultSubGroup;
} }
} }
if ((Bukkit.getPlayer(user.getName()) != null) && (Bukkit.getPlayer(user.getName()).hasPermission(targetPermission))) {
result.resultType = PermissionCheckResult.Type.FOUND;
result.owner = user;
return result;
}
// THEN IT RETURNS A NOT FOUND // THEN IT RETURNS A NOT FOUND
return result; return result;
} }
@ -960,53 +983,43 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
* Every '-' or '+' in the beginning is ignored. It will match only node * Every '-' or '+' in the beginning is ignored. It will match only node
* names. * names.
* *
* @param userAcessLevel * @param userAccessLevel
* @param fullPermissionName * @param fullPermissionName
* @return true if found a matching token. false if not. * @return PermissionCheckResult.Type
*/ */
public boolean comparePermissionString(String userAcessLevel, String fullPermissionName) { public PermissionCheckResult.Type comparePermissionString(String userAccessLevel, String fullPermissionName) {
if (userAcessLevel == null || fullPermissionName == null) { int userAccessLevelLength;
return false; if (userAccessLevel == null || fullPermissionName == null || fullPermissionName.length() == 0 || (userAccessLevelLength = userAccessLevel.length()) == 0) {
} return PermissionCheckResult.Type.NOTFOUND;
GroupManager.logger.finest("COMPARING " + userAcessLevel + " WITH " + fullPermissionName);
if (userAcessLevel.startsWith("+")) {
userAcessLevel = userAcessLevel.substring(1);
} else if (userAcessLevel.startsWith("-")) {
userAcessLevel = userAcessLevel.substring(1);
} }
if (fullPermissionName.startsWith("+")) { PermissionCheckResult.Type result = PermissionCheckResult.Type.FOUND;
fullPermissionName = fullPermissionName.substring(1); int userAccessLevelOffset = 0;
} else if (fullPermissionName.startsWith("-")) { if (userAccessLevel.charAt(0) == '+') {
fullPermissionName = fullPermissionName.substring(1); userAccessLevelOffset = 1;
result = PermissionCheckResult.Type.EXCEPTION;
} else if (userAccessLevel.charAt(0) == '-') {
userAccessLevelOffset = 1;
result = PermissionCheckResult.Type.NEGATION;
} }
if ("*".regionMatches(0, userAccessLevel, userAccessLevelOffset, userAccessLevelLength - userAccessLevelOffset)) {
StringTokenizer levelATokenizer = new StringTokenizer(userAcessLevel, "."); return result;
StringTokenizer levelBTokenizer = new StringTokenizer(fullPermissionName, ".");
while (levelATokenizer.hasMoreTokens() && levelBTokenizer.hasMoreTokens()) {
String levelA = levelATokenizer.nextToken();
String levelB = levelBTokenizer.nextToken();
GroupManager.logger.finest("ROUND " + levelA + " AGAINST " + levelB);
if (levelA.contains("*")) {
GroupManager.logger.finest("WIN");
return true;
} }
if (levelA.equalsIgnoreCase(levelB)) { int fullPermissionNameOffset;
if (!levelATokenizer.hasMoreTokens() && !levelBTokenizer.hasMoreTokens()) { if (fullPermissionName.charAt(0) == '+' || fullPermissionName.charAt(0) == '-') {
GroupManager.logger.finest("WIN"); fullPermissionNameOffset = 1;
return true;
}
GroupManager.logger.finest("NEXT");
continue;
} else { } else {
GroupManager.logger.finest("FAIL"); fullPermissionNameOffset = 0;
return false;
} }
if (userAccessLevel.charAt(userAccessLevel.length() - 1) == '*') {
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;
} }
GroupManager.logger.finest("FAIL");
return false;
} }
/** /**

View File

@ -18,14 +18,14 @@ package org.anjocaido.groupmanager.permissions;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import org.anjocaido.groupmanager.GroupManager; import org.anjocaido.groupmanager.GroupManager;
import org.anjocaido.groupmanager.data.User; import org.anjocaido.groupmanager.data.User;
import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder;
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -57,7 +57,7 @@ import org.bukkit.plugin.PluginManager;
public class BukkitPermissions { public class BukkitPermissions {
protected Map<Player, PermissionAttachment> attachments = new HashMap<Player, PermissionAttachment>(); protected Map<Player, PermissionAttachment> attachments = new HashMap<Player, PermissionAttachment>();
protected Set<Permission> registeredPermissions = new HashSet<Permission>(); protected LinkedList<Permission> registeredPermissions = new LinkedList<Permission>();
protected GroupManager plugin; protected GroupManager plugin;
protected boolean dumpAllPermissions = true; protected boolean dumpAllPermissions = true;
protected boolean dumpMatchedPermissions = true; protected boolean dumpMatchedPermissions = true;
@ -96,12 +96,12 @@ public class BukkitPermissions {
public void collectPermissions() { public void collectPermissions() {
registeredPermissions.clear(); registeredPermissions.clear();
for (Plugin bukkitPlugin : Bukkit.getServer().getPluginManager().getPlugins()) { for (Plugin bukkitPlugin : Bukkit.getServer().getPluginManager().getPlugins()) {
for(Permission permission : bukkitPlugin.getDescription().getPermissions()) for (Permission permission : bukkitPlugin.getDescription().getPermissions())
registeredPermissions.add(permission); registeredPermissions.push(permission);
} }
} }
public void updatePermissions(Player player){ public void updatePermissions(Player player) {
this.updatePermissions(player, null); this.updatePermissions(player, null);
} }
@ -114,7 +114,7 @@ public class BukkitPermissions {
this.attachments.put(player, player.addAttachment(plugin)); this.attachments.put(player, player.addAttachment(plugin));
} }
if(world == null){ if (world == null) {
world = player.getWorld().getName(); world = player.getWorld().getName();
} }
@ -132,41 +132,53 @@ public class BukkitPermissions {
/* /*
* find matching permissions * find matching permissions
* *
* and base bukkit perms if we are set to allow bukkit permissions to override. * and base bukkit perms if we are set to allow bukkit permissions to
* override.
*/ */
Boolean value; Boolean value = false;
for (Permission permission : registeredPermissions) { for (Permission permission : registeredPermissions) {
value = worldData.getPermissionsHandler().checkUserPermission(user, permission.getName()); PermissionCheckResult result = worldData.getPermissionsHandler().checkFullGMPermission(user, permission.getName(), false);
// Only check bukkit override IF we don't have the permission directly. // Only check bukkit override IF we don't have the permission
if (value = false) { // directly.
if (result.resultType == PermissionCheckResult.Type.NOTFOUND) {
PermissionDefault permDefault = permission.getDefault(); PermissionDefault permDefault = permission.getDefault();
if ((plugin.getGMConfig().isBukkitPermsOverride()) if ((plugin.getGMConfig().isBukkitPermsOverride()) && ((permDefault == PermissionDefault.TRUE)
&& ((permDefault == PermissionDefault.TRUE)
|| ((permDefault == PermissionDefault.NOT_OP) && !player.isOp()) || ((permDefault == PermissionDefault.NOT_OP) && !player.isOp())
|| ((permDefault == PermissionDefault.OP) && player.isOp()))) || ((permDefault == PermissionDefault.OP) && player.isOp()))) {
value = true;
} else {
value = false;
}
} else if (result.resultType == PermissionCheckResult.Type.NEGATION) {
value = false;
} else {
value = true; value = true;
} }
if (value == true){
// Set the root permission // Set the root permission
if ((value == true) || (result.resultType == PermissionCheckResult.Type.NEGATION)) {
attachment.setPermission(permission, value); attachment.setPermission(permission, value);
}
/*
if ((value == true) || (result.resultType == PermissionCheckResult.Type.NOTFOUND)) {
// fetch and set all children of this permission node // fetch and set all children of this permission node
Map<String, Boolean> children = permission.getChildren(); Map<String, Boolean> children = permission.getChildren();
if (children != null) { if (children != null) {
for (String child : children.keySet()) { for (String child : children.keySet()) {
if (children.get(child)) if (children.get(child))
attachment.setPermission(child, true); attachment.setPermission(child, value);
} }
} }
}*/
} }
}
// Add any missing permissions for this player (non bukkit plugins) // Add any missing permissions for this player (non bukkit plugins and child nodes)
List<String> playerPermArray = new ArrayList<String>(worldData.getPermissionsHandler().getAllPlayersPermissions(player.getName())); List<String> playerPermArray = worldData.getPermissionsHandler().getAllPlayersPermissions(player.getName());
for (String permission : playerPermArray) { for (String permission : playerPermArray) {
value = true; value = true;
@ -183,7 +195,41 @@ public class BukkitPermissions {
} }
/** /**
* Returns a map of the child permissions as defined by the supplying plugin * Returns a map of the ALL child permissions as defined by the supplying plugin
* null is empty
*
* @param node
* @return Map of child permissions
*/
public Map<String, Boolean> getAllChildren(String node, List<String> playerPermArray) {
LinkedList<String> stack = new LinkedList<String>();
Map<String, Boolean> alreadyVisited = new HashMap<String, Boolean>();
stack.push(node);
alreadyVisited.put(node, true);
while (!stack.isEmpty()) {
String now = stack.pop();
Map<String, Boolean> children = getChildren(now);
if ((children != null) && (!playerPermArray.contains("-"+now))) {
for (String childName : children.keySet()) {
if (!alreadyVisited.containsKey(childName)) {
stack.push(childName);
alreadyVisited.put(childName, children.get(childName));
}
}
}
}
alreadyVisited.remove(node);
if (!alreadyVisited.isEmpty()) return alreadyVisited;
return null;
}
/**
* Returns a map of the child permissions (1 node deep) as defined by the supplying plugin
* null is empty * null is empty
* *
* @param node * @param node
@ -191,10 +237,11 @@ public class BukkitPermissions {
*/ */
public Map<String, Boolean> getChildren(String node) { public Map<String, Boolean> getChildren(String node) {
for (Permission permission : registeredPermissions) { for (Permission permission : registeredPermissions) {
if (permission.getName() == node) { if (permission.getName().equalsIgnoreCase(node)) {
return permission.getChildren(); return permission.getChildren();
} }
} }
return null; return null;
} }
@ -202,18 +249,17 @@ public class BukkitPermissions {
List<String> perms = new ArrayList<String>(); List<String> perms = new ArrayList<String>();
/* /*
// All permissions registered with Bukkit for this player * // All permissions registered with Bukkit for this player
PermissionAttachment attachment = this.attachments.get(player); * PermissionAttachment attachment = this.attachments.get(player);
*
// List perms for this player * // List perms for this player perms.add("Attachment Permissions:");
perms.add("Attachment Permissions:"); * for(Map.Entry<String, Boolean> entry :
for(Map.Entry<String, Boolean> entry : attachment.getPermissions().entrySet()){ * attachment.getPermissions().entrySet()){ perms.add(" " +
perms.add(" " + entry.getKey() + " = " + entry.getValue()); * entry.getKey() + " = " + entry.getValue()); }
}
*/ */
perms.add("Effective Permissions:"); perms.add("Effective Permissions:");
for(PermissionAttachmentInfo info : player.getEffectivePermissions()){ for (PermissionAttachmentInfo info : player.getEffectivePermissions()) {
if (info.getValue() == true) if (info.getValue() == true)
perms.add(" " + info.getPermission() + " = " + info.getValue()); perms.add(" " + info.getPermission() + " = " + info.getValue());
} }
@ -232,7 +278,7 @@ public class BukkitPermissions {
public void onPlayerJoin(PlayerJoinEvent event) { public void onPlayerJoin(PlayerJoinEvent event) {
player_join = true; player_join = true;
Player player = event.getPlayer(); Player player = event.getPlayer();
//force GM to create the player if they are not already listed. // force GM to create the player if they are not already listed.
if (plugin.getWorldsHolder().getWorldData(player.getWorld().getName()).getUser(player.getName()) != null) { if (plugin.getWorldsHolder().getWorldData(player.getWorld().getName()).getUser(player.getName()) != null) {
player_join = false; player_join = false;
updatePermissions(event.getPlayer()); updatePermissions(event.getPlayer());
@ -242,7 +288,7 @@ public class BukkitPermissions {
@Override @Override
public void onPlayerPortal(PlayerPortalEvent event) { // will portal into another world public void onPlayerPortal(PlayerPortalEvent event) { // will portal into another world
if(event.getTo() != null && !event.getFrom().getWorld().equals(event.getTo().getWorld())){ // only if world actually changed if (event.getTo() != null && !event.getFrom().getWorld().equals(event.getTo().getWorld())) { // only if world actually changed
updatePermissions(event.getPlayer(), event.getTo().getWorld().getName()); updatePermissions(event.getPlayer(), event.getTo().getWorld().getName());
} }
} }
@ -286,8 +332,8 @@ public class BukkitPermissions {
@Override @Override
public void onPluginDisable(PluginDisableEvent event) { public void onPluginDisable(PluginDisableEvent event) {
//collectPermissions(); // collectPermissions();
//updateAllPlayers(); // updateAllPlayers();
} }
} }

View File

@ -15,8 +15,9 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
{ {
private final transient IEssentials ess; private final transient IEssentials ess;
public EssentialsSpawnPlayerListener(IEssentials ess) public EssentialsSpawnPlayerListener(final IEssentials ess)
{ {
super();
this.ess = ess; this.ess = ess;
} }
@ -25,36 +26,32 @@ public class EssentialsSpawnPlayerListener extends PlayerListener
{ {
final User user = ess.getUser(event.getPlayer()); final User user = ess.getUser(event.getPlayer());
try
{
if (ess.getSettings().getRespawnAtHome()) if (ess.getSettings().getRespawnAtHome())
{ {
Location home = user.getHome(user.getLocation()); Location home = user.getHome(user.getLocation());
if (home == null) if (home == null)
{ {
throw new Exception(); home = user.getBedSpawnLocation();
} }
if (home != null)
{
event.setRespawnLocation(home); event.setRespawnLocation(home);
return; return;
} }
} }
catch (Throwable ex) final Location spawn = ess.getSpawn().getSpawn(user.getGroup());
if (spawn != null)
{ {
}
Location spawn = ess.getSpawn().getSpawn(user.getGroup());
if (spawn == null)
{
return;
}
event.setRespawnLocation(spawn); event.setRespawnLocation(spawn);
} }
}
@Override @Override
public void onPlayerJoin(final PlayerJoinEvent event) public void onPlayerJoin(final PlayerJoinEvent event)
{ {
final User user = ess.getUser(event.getPlayer()); final User user = ess.getUser(event.getPlayer());
if (!user.isNew()) if (!user.isNew() || user.getBedSpawnLocation() != null)
{ {
return; return;
} }

View File

@ -774,7 +774,7 @@ public abstract class PircBot implements ReplyConstants {
} }
} }
command = command.toUpperCase(); command = command.toUpperCase(Locale.ENGLISH);
if (sourceNick.startsWith(":")) { if (sourceNick.startsWith(":")) {
sourceNick = sourceNick.substring(1); sourceNick = sourceNick.substring(1);
} }

View File

@ -187,7 +187,7 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager
final String level = config.getString("log-level", "info"); final String level = config.getString("log-level", "info");
try try
{ {
logLevel = Level.parse(level.toUpperCase()); logLevel = Level.parse(level.toUpperCase(Locale.ENGLISH));
} }
catch (IllegalArgumentException e) catch (IllegalArgumentException e)
{ {

Binary file not shown.

Binary file not shown.