This commit is contained in:
Iaccidentally 2012-12-25 18:12:42 -05:00
commit 26306f6fa3
58 changed files with 1093 additions and 657 deletions

View File

@ -68,7 +68,6 @@ file.reference.BOSEconomy7.jar=../lib/BOSEconomy7.jar
file.reference.bPermissions.jar=../lib/bPermissions.jar file.reference.bPermissions.jar=../lib/bPermissions.jar
file.reference.bpermissions2.jar=../lib/bpermissions2.jar file.reference.bpermissions2.jar=../lib/bpermissions2.jar
file.reference.bukkit.jar=../lib/bukkit.jar file.reference.bukkit.jar=../lib/bukkit.jar
file.reference.craftbukkit.jar=../lib/craftbukkit.jar
file.reference.iCo4.jar=../lib/iCo4.jar file.reference.iCo4.jar=../lib/iCo4.jar
file.reference.iCo5.jar=../lib/iCo5.jar file.reference.iCo5.jar=../lib/iCo5.jar
file.reference.iCo6.jar=../lib/iCo6.jar file.reference.iCo6.jar=../lib/iCo6.jar
@ -96,12 +95,11 @@ javac.classpath=\
${file.reference.lombok.jar}:\ ${file.reference.lombok.jar}:\
${reference.EssentialsGroupManager.jar}:\ ${reference.EssentialsGroupManager.jar}:\
${file.reference.bukkit.jar}:\ ${file.reference.bukkit.jar}:\
${file.reference.craftbukkit.jar}:\
${file.reference.Vault.jar}:\ ${file.reference.Vault.jar}:\
${file.reference.Privileges.jar}:\ ${file.reference.Privileges.jar}:\
${file.reference.bpermissions2.jar} ${file.reference.bpermissions2.jar}
# Space-separated list of extra javac options # Space-separated list of extra javac options
javac.compilerargs= javac.compilerargs=-Xlint:unchecked
javac.deprecation=false javac.deprecation=false
javac.processorpath=\ javac.processorpath=\
${javac.classpath} ${javac.classpath}

View File

@ -121,13 +121,14 @@ public class AlternativeCommandsHandler
return commands.get(0); return commands.get(0);
} }
public void executed(final String label, final String otherLabel) public void executed(final String label, final PluginCommand pc)
{ {
final String altString = pc.getPlugin().getName() + ":" + pc.getLabel();
if (ess.getSettings().isDebug()) if (ess.getSettings().isDebug())
{ {
LOGGER.log(Level.INFO, "Essentials: Alternative command " + label + " found, using " + otherLabel); LOGGER.log(Level.INFO, "Essentials: Alternative command " + label + " found, using " + altString);
} }
disabledList.put(label, otherLabel); disabledList.put(label, altString);
} }
public Map<String, String> disabledCommands() public Map<String, String> disabledCommands()

View File

@ -65,7 +65,7 @@ import org.yaml.snakeyaml.error.YAMLException;
public class Essentials extends JavaPlugin implements IEssentials public class Essentials extends JavaPlugin implements IEssentials
{ {
public static final int BUKKIT_VERSION = 2455; public static final int BUKKIT_VERSION = 2543;
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);
@ -308,7 +308,7 @@ public class Essentials extends JavaPlugin implements IEssentials
final PluginCommand pc = alternativeCommandsHandler.getAlternative(commandLabel); final PluginCommand pc = alternativeCommandsHandler.getAlternative(commandLabel);
if (pc != null) if (pc != null)
{ {
alternativeCommandsHandler.executed(commandLabel, pc.getLabel()); alternativeCommandsHandler.executed(commandLabel, pc);
try try
{ {
return pc.execute(sender, commandLabel, args); return pc.execute(sender, commandLabel, args);
@ -368,6 +368,19 @@ public class Essentials extends JavaPlugin implements IEssentials
return true; return true;
} }
if (user != null && user.isJailed() && !user.isAuthorized(cmd, "essentials.jail.allow."))
{
if (user.getJailTimeout() > 0)
{
user.sendMessage(_("playerJailedFor", user.getName(), Util.formatDateDiff(user.getJailTimeout())));
}
else
{
user.sendMessage(_("jailMessage"));
}
return true;
}
// Run the command // Run the command
try try
{ {
@ -471,7 +484,7 @@ public class Essentials extends JavaPlugin implements IEssentials
} }
return null; return null;
} }
@Override @Override
public User getOfflineUser(final String name) public User getOfflineUser(final String name)
{ {

View File

@ -60,6 +60,12 @@ public class EssentialsPlayerListener implements Listener
user.sendMessage(_("playerMuted")); user.sendMessage(_("playerMuted"));
LOGGER.info(_("mutedUserSpeaks", user.getName())); LOGGER.info(_("mutedUserSpeaks", user.getName()));
} }
if(ess.getSettings().isChatPermEnabled() && !user.isAuthorized("essentials.chat.allowed"))
{
event.setCancelled(true);
user.sendMessage(_("playerChatDenied"));
LOGGER.info(_("mutedUserSpeaks", user.getName()));
}
final Iterator<Player> it = event.getRecipients().iterator(); final Iterator<Player> it = event.getRecipients().iterator();
while (it.hasNext()) while (it.hasNext())
{ {
@ -335,14 +341,13 @@ public class EssentialsPlayerListener implements Listener
}); });
} }
} }
private final static List<String> COMMANDS = Arrays.asList("msg", "r", "mail", "m", "t", "whisper", "emsg", "tell", "er", "reply", "ereply", "email", "action", "describe", "eme", "eaction", "edescribe", "etell", "ewhisper", "pm");
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event) public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event)
{ {
final Player player = event.getPlayer(); final Player player = event.getPlayer();
final String cmd = event.getMessage().toLowerCase(Locale.ENGLISH).split(" ")[0].replace("/", "").toLowerCase(Locale.ENGLISH); final String cmd = event.getMessage().toLowerCase(Locale.ENGLISH).split(" ")[0].replace("/", "").toLowerCase(Locale.ENGLISH);
if (COMMANDS.contains(cmd)) if (ess.getSettings().getSocialSpyCommands().contains(cmd))
{ {
for (Player onlinePlayer : ess.getServer().getOnlinePlayers()) for (Player onlinePlayer : ess.getServer().getOnlinePlayers())
{ {
@ -417,6 +422,7 @@ public class EssentialsPlayerListener implements Listener
if (event.getItem() != null && event.getItem().getTypeId() != AIR) if (event.getItem() != null && event.getItem().getTypeId() != AIR)
{ {
final User user = ess.getUser(event.getPlayer()); final User user = ess.getUser(event.getPlayer());
user.updateActivity(true);
if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getTypeId())) if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getTypeId()))
{ {
event.setCancelled(true); event.setCancelled(true);
@ -537,6 +543,14 @@ public class EssentialsPlayerListener implements Listener
event.setCancelled(true); event.setCancelled(true);
} }
} }
else if (event.getView().getTopInventory().getType() == InventoryType.WORKBENCH)
{
User user = ess.getUser(event.getWhoClicked());
if (user.isRecipeSee())
{
event.setCancelled(true);
}
}
} }
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
@ -552,12 +566,21 @@ public class EssentialsPlayerListener implements Listener
final User user = ess.getUser(event.getPlayer()); final User user = ess.getUser(event.getPlayer());
user.setEnderSee(false); user.setEnderSee(false);
} }
if (event.getView().getTopInventory().getType() == InventoryType.WORKBENCH)
{
final User user = ess.getUser(event.getPlayer());
if(user.isRecipeSee())
{
user.setRecipeSee(false);
event.getView().getTopInventory().clear();
}
}
} }
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPlayerFishEvent(final PlayerFishEvent event) public void onPlayerFishEvent(final PlayerFishEvent event)
{ {
final User user = ess.getUser(event.getPlayer()); final User user = ess.getUser(event.getPlayer());
user.updateActivity(true); user.updateActivity(true);
} }
} }

View File

@ -42,6 +42,8 @@ public interface ISettings extends IConf
double getHealCooldown(); double getHealCooldown();
Set<String> getSocialSpyCommands();
Map<String, Object> getKit(String name); Map<String, Object> getKit(String name);
ConfigurationSection getKits(); ConfigurationSection getKits();
@ -183,4 +185,8 @@ public interface ISettings extends IConf
public int getMailsPerMinute(); public int getMailsPerMinute();
public void setEssentialsChatActive(boolean b); public void setEssentialsChatActive(boolean b);
long getMaxTempban();
boolean isChatPermEnabled();
} }

View File

@ -44,4 +44,8 @@ public interface IUser extends Player
void setJail(String jail); void setJail(String jail);
boolean isIgnoreExempt(); boolean isIgnoreExempt();
boolean isAfk();
void setAfk(final boolean set);
} }

View File

@ -158,11 +158,11 @@ public class Kit
final Map<Integer, ItemStack> overfilled; final Map<Integer, ItemStack> overfilled;
if (user.isAuthorized("essentials.oversizedstacks")) if (user.isAuthorized("essentials.oversizedstacks"))
{ {
overfilled = InventoryWorkaround.addItem(user.getInventory(), true, ess.getSettings().getOversizedStackSize(), stack); overfilled = InventoryWorkaround.addOversizedItems(user.getInventory(), ess.getSettings().getOversizedStackSize(), stack);
} }
else else
{ {
overfilled = InventoryWorkaround.addItem(user.getInventory(), true, 0, stack); overfilled = InventoryWorkaround.addItems(user.getInventory(), stack);
} }
for (ItemStack itemStack : overfilled.values()) for (ItemStack itemStack : overfilled.values())
{ {

View File

@ -11,11 +11,8 @@ import org.bukkit.conversations.ConversationAbandonedEvent;
import org.bukkit.entity.*; import org.bukkit.entity.*;
import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.*;
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.InventoryView.Property; import org.bukkit.inventory.InventoryView.Property;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.map.MapView; import org.bukkit.map.MapView;
import org.bukkit.metadata.MetadataValue; import org.bukkit.metadata.MetadataValue;
import org.bukkit.permissions.Permission; import org.bukkit.permissions.Permission;
@ -1117,4 +1114,40 @@ public class OfflinePlayer implements Player
{ {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
@Override
public boolean getRemoveWhenFarAway()
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void setRemoveWhenFarAway(boolean bln)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public EntityEquipment getEquipment()
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void setCanPickupItems(boolean bln)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean getCanPickupItems()
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public Location getLocation(Location lctn)
{
throw new UnsupportedOperationException("Not supported yet.");
}
} }

View File

@ -12,6 +12,7 @@ import java.util.*;
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;
import org.bukkit.command.PluginCommand;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.MemoryConfiguration; import org.bukkit.configuration.MemoryConfiguration;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
@ -189,6 +190,11 @@ public class Settings implements ISettings
final ConfigurationSection newSection = new MemoryConfiguration(); final ConfigurationSection newSection = new MemoryConfiguration();
for (String command : section.getKeys(false)) for (String command : section.getKeys(false))
{ {
PluginCommand cmd = ess.getServer().getPluginCommand(command);
if (command.charAt(0) == '/')
{
ess.getLogger().warning("Invalid command cost. '" + command + "' should not start with '/'.");
}
if (section.isDouble(command)) if (section.isDouble(command))
{ {
newSection.set(command.toLowerCase(Locale.ENGLISH), section.getDouble(command)); newSection.set(command.toLowerCase(Locale.ENGLISH), section.getDouble(command));
@ -197,6 +203,24 @@ public class Settings implements ISettings
{ {
newSection.set(command.toLowerCase(Locale.ENGLISH), (double)section.getInt(command)); newSection.set(command.toLowerCase(Locale.ENGLISH), (double)section.getInt(command));
} }
else if (section.isString(command))
{
String costString = section.getString(command);
try
{
double cost = Double.parseDouble(costString.trim().replace(getCurrencySymbol(), "").replaceAll("\\W", ""));
newSection.set(command.toLowerCase(Locale.ENGLISH), cost);
}
catch (NumberFormatException ex)
{
ess.getLogger().warning("Invalid command cost for: " + command + " (" + costString + ")");
}
}
else
{
ess.getLogger().warning("Invalid command cost for: " + command);
}
} }
return newSection; return newSection;
} }
@ -213,6 +237,31 @@ public class Settings implements ISettings
} }
return 0.0; return 0.0;
} }
private Set<String> socialSpyCommands = new HashSet<String>();
public Set<String> _getSocialSpyCommands()
{
Set<String> socialspyCommands = new HashSet<String>();
if (config.isConfigurationSection("socialspy-commands"))
{
for (String c : config.getStringList("socialspy-commands"))
{
socialspyCommands.add(c.toLowerCase(Locale.ENGLISH));
}
}
else
{
socialspyCommands.addAll(Arrays.asList("msg", "r", "mail", "m", "whisper", "emsg", "t", "tell", "er", "reply", "ereply", "email", "action", "describe", "eme", "eaction", "edescribe", "etell", "ewhisper", "pm"));
}
return socialspyCommands;
}
public Set<String> getSocialSpyCommands()
{
return socialSpyCommands;
}
private String nicknamePrefix = "~"; private String nicknamePrefix = "~";
private String _getNicknamePrefix() private String _getNicknamePrefix()
@ -438,6 +487,7 @@ public class Settings implements ISettings
disableSuffix = _disableSuffix(); disableSuffix = _disableSuffix();
chatRadius = _getChatRadius(); chatRadius = _getChatRadius();
commandCosts = _getCommandCosts(); commandCosts = _getCommandCosts();
socialSpyCommands = _getSocialSpyCommands();
warnOnBuildDisallow = _warnOnBuildDisallow(); warnOnBuildDisallow = _warnOnBuildDisallow();
mailsPerMinute = _getMailsPerMinute(); mailsPerMinute = _getMailsPerMinute();
} }
@ -946,15 +996,28 @@ public class Settings implements ISettings
double maxSpeed = config.getDouble("max-walk-speed", 0.8); double maxSpeed = config.getDouble("max-walk-speed", 0.8);
return maxSpeed > 1.0 ? 1.0 : Math.abs(maxSpeed); return maxSpeed > 1.0 ? 1.0 : Math.abs(maxSpeed);
} }
private int mailsPerMinute; private int mailsPerMinute;
private int _getMailsPerMinute() { private int _getMailsPerMinute()
{
return config.getInt("mails-per-minute", 1000); return config.getInt("mails-per-minute", 1000);
} }
@Override @Override
public int getMailsPerMinute() public int getMailsPerMinute()
{ {
return mailsPerMinute; return mailsPerMinute;
} }
@Override
public long getMaxTempban()
{
return config.getLong("max-tempban-time", -1);
}
@Override
public boolean isChatPermEnabled()
{
return config.getBoolean("enable-chat-perm", false);
}
} }

View File

@ -12,6 +12,7 @@ import org.bukkit.Server;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.*; import org.bukkit.entity.*;
import org.bukkit.entity.Skeleton.SkeletonType;
import org.bukkit.material.Colorable; import org.bukkit.material.Colorable;
@ -34,20 +35,20 @@ public class SpawnMob
} }
return Util.joinList(availableList); return Util.joinList(availableList);
} }
public static String[] mobData(final String mobString) public static String[] mobData(final String mobString)
{ {
String[] returnString = new String[4]; String[] returnString = new String[4];
final String[] parts = mobString.split(","); final String[] parts = mobString.split(",");
String[] mobParts = parts[0].split(":"); String[] mobParts = parts[0].split(":");
returnString[0] = mobParts[0]; returnString[0] = mobParts[0];
if (mobParts.length == 2) if (mobParts.length == 2)
{ {
returnString[1] = mobParts[1]; returnString[1] = mobParts[1];
} }
if (parts.length > 1) if (parts.length > 1)
{ {
String[] mountParts = parts[1].split(":"); String[] mountParts = parts[1].split(":");
@ -57,8 +58,8 @@ public class SpawnMob
returnString[3] = mountParts[1]; returnString[3] = mountParts[1];
} }
} }
return returnString; return returnString;
} }
// This method spawns a mob where the user is looking, owned by user // This method spawns a mob where the user is looking, owned by user
@ -71,7 +72,7 @@ public class SpawnMob
} }
spawnmob(ess, server, user, user, block.getLocation(), Data, mobCount); spawnmob(ess, server, user, user, block.getLocation(), Data, mobCount);
} }
// This method spawns a mob at loc, owned by noone // This method spawns a mob at loc, owned by noone
public static void spawnmob(final IEssentials ess, final Server server, final CommandSender sender, final Location loc, final String[] Data, int mobCount) throws Exception public static void spawnmob(final IEssentials ess, final Server server, final CommandSender sender, final Location loc, final String[] Data, int mobCount) throws Exception
{ {
@ -83,7 +84,7 @@ public class SpawnMob
{ {
spawnmob(ess, server, sender, target, target.getLocation(), Data, mobCount); spawnmob(ess, server, sender, target, target.getLocation(), Data, mobCount);
} }
// This method spawns a mob at loc, owned by target // This method spawns a mob at loc, owned by target
public static void spawnmob(final IEssentials ess, final Server server, final CommandSender sender, final User target, final Location loc, final String[] Data, int mobCount) throws Exception public static void spawnmob(final IEssentials ess, final Server server, final CommandSender sender, final User target, final Location loc, final String[] Data, int mobCount) throws Exception
{ {
@ -91,7 +92,7 @@ public class SpawnMob
final String mobType = Data[0]; final String mobType = Data[0];
final String mobData = Data[1]; final String mobData = Data[1];
final String mountType = Data[2]; final String mountType = Data[2];
final String mountData = Data[3]; final String mountData = Data[3];
Mob mob = Mob.fromName(mobType); Mob mob = Mob.fromName(mobType);
Mob mobMount = null; Mob mobMount = null;
@ -137,7 +138,7 @@ public class SpawnMob
{ {
Entity spawnedMob = mob.spawn(sloc.getWorld(), server, sloc); Entity spawnedMob = mob.spawn(sloc.getWorld(), server, sloc);
Entity spawnedMount = null; Entity spawnedMount = null;
if (mobMount != null) if (mobMount != null)
{ {
spawnedMount = mobMount.spawn(sloc.getWorld(), server, sloc); spawnedMount = mobMount.spawn(sloc.getWorld(), server, sloc);
@ -186,14 +187,16 @@ public class SpawnMob
throw new Exception(_("slimeMalformedSize"), e); throw new Exception(_("slimeMalformedSize"), e);
} }
} }
if (spawned instanceof Ageable && data.contains("baby"))
if ((spawned instanceof Ageable) && data.contains("baby"))
{ {
((Ageable)spawned).setBaby(); ((Ageable)spawned).setBaby();
return; data = data.replace("baby", "");
} }
if (spawned instanceof Colorable) if (spawned instanceof Colorable)
{ {
final String color = data.toUpperCase(Locale.ENGLISH).replace("BABY", ""); final String color = data.toUpperCase(Locale.ENGLISH);
try try
{ {
if (color.equals("RANDOM")) if (color.equals("RANDOM"))
@ -201,7 +204,7 @@ public class SpawnMob
final Random rand = new Random(); final Random rand = new Random();
((Colorable)spawned).setColor(DyeColor.values()[rand.nextInt(DyeColor.values().length)]); ((Colorable)spawned).setColor(DyeColor.values()[rand.nextInt(DyeColor.values().length)]);
} }
else else if (color.length() > 1)
{ {
((Colorable)spawned).setColor(DyeColor.valueOf(color)); ((Colorable)spawned).setColor(DyeColor.valueOf(color));
} }
@ -211,21 +214,28 @@ public class SpawnMob
throw new Exception(_("sheepMalformedColor"), e); throw new Exception(_("sheepMalformedColor"), e);
} }
} }
if (spawned instanceof Tameable && data.contains("tamed") && target != null) if (spawned instanceof Tameable && data.contains("tamed") && target != null)
{ {
final Tameable tameable = ((Tameable)spawned); final Tameable tameable = ((Tameable)spawned);
tameable.setTamed(true); tameable.setTamed(true);
tameable.setOwner(target.getBase()); tameable.setOwner(target.getBase());
data = data.replace("tamed", "");
} }
if (type == EntityType.WOLF
&& data.contains("angry")) if (type == EntityType.WOLF)
{ {
((Wolf)spawned).setAngry(true); if (data.contains("angry"))
{
((Wolf)spawned).setAngry(true);
}
} }
if (type == EntityType.CREEPER && data.contains("powered")) if (type == EntityType.CREEPER && data.contains("powered"))
{ {
((Creeper)spawned).setPowered(true); ((Creeper)spawned).setPowered(true);
} }
if (type == EntityType.OCELOT) if (type == EntityType.OCELOT)
{ {
if (data.contains("siamese")) if (data.contains("siamese"))
@ -241,6 +251,7 @@ public class SpawnMob
((Ocelot)spawned).setCatType(Ocelot.Type.BLACK_CAT); ((Ocelot)spawned).setCatType(Ocelot.Type.BLACK_CAT);
} }
} }
if (type == EntityType.VILLAGER) if (type == EntityType.VILLAGER)
{ {
for (Villager.Profession prof : Villager.Profession.values()) for (Villager.Profession prof : Villager.Profession.values())
@ -251,5 +262,26 @@ public class SpawnMob
} }
} }
} }
if (spawned instanceof Zombie)
{
if (data.contains("villager"))
{
((Zombie)spawned).setVillager(true);
}
if (data.contains("baby"))
{
((Zombie)spawned).setBaby(true);
}
}
if (type == EntityType.SKELETON)
{
if (data.contains("wither"))
{
((Skeleton)spawned).setSkeletonType(SkeletonType.WITHER);
}
}
} }
} }

View File

@ -2,10 +2,12 @@ package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.api.ITeleport; import com.earth2me.essentials.api.ITeleport;
import com.earth2me.essentials.commands.NoChargeException;
import java.util.Calendar; import java.util.Calendar;
import java.util.GregorianCalendar; import java.util.GregorianCalendar;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
@ -56,6 +58,7 @@ public class Teleport implements Runnable, ITeleport
private long initY; private long initY;
private long initZ; private long initZ;
private Target teleportTarget; private Target teleportTarget;
private boolean respawn;
private Trade chargeFor; private Trade chargeFor;
private final IEssentials ess; private final IEssentials ess;
private static final Logger logger = Logger.getLogger("Minecraft"); private static final Logger logger = Logger.getLogger("Minecraft");
@ -63,10 +66,10 @@ public class Teleport implements Runnable, ITeleport
private void initTimer(long delay, Target target, Trade chargeFor, TeleportCause cause) private void initTimer(long delay, Target target, Trade chargeFor, TeleportCause cause)
{ {
initTimer(delay, user, target, chargeFor, cause); initTimer(delay, user, target, chargeFor, cause, false);
} }
private void initTimer(long delay, IUser teleportUser, Target target, Trade chargeFor, TeleportCause cause) private void initTimer(long delay, IUser teleportUser, Target target, Trade chargeFor, TeleportCause cause, boolean respawn)
{ {
this.started = System.currentTimeMillis(); this.started = System.currentTimeMillis();
this.tpdelay = delay; this.tpdelay = delay;
@ -78,6 +81,7 @@ public class Teleport implements Runnable, ITeleport
this.teleportTarget = target; this.teleportTarget = target;
this.chargeFor = chargeFor; this.chargeFor = chargeFor;
this.cause = cause; this.cause = cause;
this.respawn = respawn;
} }
@Override @Override
@ -115,8 +119,12 @@ public class Teleport implements Runnable, ITeleport
teleportUser.sendMessage(_("teleportationCommencing")); teleportUser.sendMessage(_("teleportationCommencing"));
try try
{ {
if (respawn) {
teleportUser.getTeleport().now(teleportTarget, cause); teleportUser.getTeleport().respawn(cause);
}
else {
teleportUser.getTeleport().now(teleportTarget, cause);
}
cancel(false); cancel(false);
if (chargeFor != null) if (chargeFor != null)
{ {
@ -241,7 +249,7 @@ public class Teleport implements Runnable, ITeleport
{ {
teleport(loc, chargeFor, TeleportCause.PLUGIN); teleport(loc, chargeFor, TeleportCause.PLUGIN);
} }
public void teleport(Location loc, Trade chargeFor, TeleportCause cause) throws Exception public void teleport(Location loc, Trade chargeFor, TeleportCause cause) throws Exception
{ {
teleport(new Target(loc), chargeFor, cause); teleport(new Target(loc), chargeFor, cause);
@ -283,7 +291,6 @@ public class Teleport implements Runnable, ITeleport
public void teleportToMe(User otherUser, Trade chargeFor, TeleportCause cause) throws Exception public void teleportToMe(User otherUser, Trade chargeFor, TeleportCause cause) throws Exception
{ {
Target target = new Target(user); Target target = new Target(user);
double delay = ess.getSettings().getTeleportDelay(); double delay = ess.getSettings().getTeleportDelay();
if (chargeFor != null) if (chargeFor != null)
@ -304,8 +311,7 @@ public class Teleport implements Runnable, ITeleport
cancel(false); cancel(false);
warnUser(otherUser, delay); warnUser(otherUser, delay);
initTimer((long)(delay * 1000.0), otherUser, target, chargeFor, cause); initTimer((long)(delay * 1000.0), otherUser, target, chargeFor, cause, false);
teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10); teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
} }
@ -319,12 +325,43 @@ public class Teleport implements Runnable, ITeleport
//The respawn function is a wrapper used to handle tp fallback, on /jail and /home //The respawn function is a wrapper used to handle tp fallback, on /jail and /home
public void respawn(final Trade chargeFor, TeleportCause cause) throws Exception public void respawn(final Trade chargeFor, TeleportCause cause) throws Exception
{
double delay = ess.getSettings().getTeleportDelay();
if (chargeFor != null)
{
chargeFor.isAffordableFor(user);
}
cooldown(true);
if (delay <= 0 || user.isAuthorized("essentials.teleport.timer.bypass"))
{
cooldown(false);
respawn(cause);
if (chargeFor != null)
{
chargeFor.charge(user);
}
return;
}
cancel(false);
initTimer((long)(delay * 1000.0), user, null, chargeFor, cause, true);
teleTimer = ess.scheduleSyncRepeatingTask(this, 10, 10);
}
public void respawn(TeleportCause cause) throws Exception
{ {
final Player player = user.getBase(); final Player player = user.getBase();
final Location bed = player.getBedSpawnLocation(); Location bed = player.getBedSpawnLocation();
final PlayerRespawnEvent pre = new PlayerRespawnEvent(player, bed == null ? player.getWorld().getSpawnLocation() : bed, bed != null); if (bed != null && bed.getBlock().getType() != Material.BED_BLOCK)
ess.getServer().getPluginManager().callEvent(pre); {
teleport(new Target(pre.getRespawnLocation()), chargeFor, cause); now(new Target(bed), cause);
}
else
{
final PlayerRespawnEvent pre = new PlayerRespawnEvent(player, player.getWorld().getSpawnLocation(), false);
ess.getServer().getPluginManager().callEvent(pre);
now(new Target(pre.getRespawnLocation()), cause);
}
} }
//The warp function is a wrapper used to teleport a player to a /warp //The warp function is a wrapper used to teleport a player to a /warp
@ -332,7 +369,7 @@ public class Teleport implements Runnable, ITeleport
{ {
Location loc = ess.getWarps().getWarp(warp); Location loc = ess.getWarps().getWarp(warp);
user.sendMessage(_("warpingTo", warp)); user.sendMessage(_("warpingTo", warp));
teleport(new Target(loc), chargeFor, cause); teleport(new Target(loc), chargeFor, cause);
} }
//The back function is a wrapper used to teleport a player /back to their previous location. //The back function is a wrapper used to teleport a player /back to their previous location.

View File

@ -77,7 +77,7 @@ public class Trade
} }
if (getItemStack() != null if (getItemStack() != null
&& !InventoryWorkaround.containsItem(user.getInventory(), true, true, itemStack)) && !user.getInventory().containsAtLeast(itemStack, itemStack.getAmount()))
{ {
throw new ChargeException(_("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " "))); throw new ChargeException(_("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " ")));
} }
@ -113,7 +113,7 @@ public class Trade
{ {
if (dropItems) if (dropItems)
{ {
final Map<Integer, ItemStack> leftOver = InventoryWorkaround.addItem(user.getInventory(), true, getItemStack()); final Map<Integer, ItemStack> leftOver = InventoryWorkaround.addItems(user.getInventory(), getItemStack());
final Location loc = user.getLocation(); final Location loc = user.getLocation();
for (ItemStack itemStack : leftOver.values()) for (ItemStack itemStack : leftOver.values())
{ {
@ -137,7 +137,7 @@ public class Trade
} }
else else
{ {
success = InventoryWorkaround.addAllItems(user.getInventory(), true, getItemStack()); success = InventoryWorkaround.addAllItems(user.getInventory(), getItemStack());
} }
user.updateInventory(); user.updateInventory();
} }
@ -165,11 +165,11 @@ public class Trade
} }
if (getItemStack() != null) if (getItemStack() != null)
{ {
if (!InventoryWorkaround.containsItem(user.getInventory(), true, true, itemStack)) if (!user.getInventory().containsAtLeast(itemStack, itemStack.getAmount()))
{ {
throw new ChargeException(_("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " "))); throw new ChargeException(_("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " ")));
} }
InventoryWorkaround.removeItem(user.getInventory(), true, true, getItemStack()); user.getInventory().removeItem(getItemStack());
user.updateInventory(); user.updateInventory();
} }
if (command != null) if (command != null)

View File

@ -29,6 +29,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
private boolean rightClickJump = false; private boolean rightClickJump = false;
private transient Location afkPosition = null; private transient Location afkPosition = null;
private boolean invSee = false; private boolean invSee = false;
private boolean recipeSee = false;
private boolean enderSee = false; private boolean enderSee = false;
private static final Logger logger = Logger.getLogger("Minecraft"); private static final Logger logger = Logger.getLogger("Minecraft");
@ -79,11 +80,6 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
return false; return false;
} }
if (isJailed())
{
return false;
}
try try
{ {
return ess.getPermissionsHandler().hasPermission(base, node); return ess.getPermissionsHandler().hasPermission(base, node);
@ -743,4 +739,14 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
{ {
return this.isAuthorized("essentials.chat.ignoreexempt"); return this.isAuthorized("essentials.chat.ignoreexempt");
} }
public boolean isRecipeSee()
{
return recipeSee;
}
public void setRecipeSee(boolean recipeSee)
{
this.recipeSee = recipeSee;
}
} }

View File

@ -94,11 +94,11 @@ public class Commandgive extends EssentialsCommand
sender.sendMessage(_("giveSpawn", stack.getAmount(), itemName, giveTo.getDisplayName())); sender.sendMessage(_("giveSpawn", stack.getAmount(), itemName, giveTo.getDisplayName()));
if (giveTo.isAuthorized("essentials.oversizedstacks")) if (giveTo.isAuthorized("essentials.oversizedstacks"))
{ {
InventoryWorkaround.addItem(giveTo.getInventory(), true, ess.getSettings().getOversizedStackSize(), stack); InventoryWorkaround.addOversizedItems(giveTo.getInventory(), ess.getSettings().getOversizedStackSize(), stack);
} }
else else
{ {
InventoryWorkaround.addItem(giveTo.getInventory(), true, stack); InventoryWorkaround.addItems(giveTo.getInventory(), stack);
} }
giveTo.updateInventory(); giveTo.updateInventory();
} }

View File

@ -31,7 +31,7 @@ public class Commandhat extends EssentialsCommand
{ {
final ItemStack air = new ItemStack(Material.AIR); final ItemStack air = new ItemStack(Material.AIR);
inv.setHelmet(air); inv.setHelmet(air);
InventoryWorkaround.addItem(user.getInventory(), true, head); InventoryWorkaround.addItems(user.getInventory(), head);
user.sendMessage(_("hatRemoved")); user.sendMessage(_("hatRemoved"));
} }
} }

View File

@ -65,13 +65,7 @@ public class Commandhome extends EssentialsCommand
final List<String> homes = player.getHomes(); final List<String> homes = player.getHomes();
if (homes.isEmpty() && player.equals(user)) if (homes.isEmpty() && player.equals(user))
{ {
if (bed != null)
{
user.getTeleport().teleport(bed, charge, TeleportCause.COMMAND);
throw new NoChargeException();
}
user.getTeleport().respawn(charge, TeleportCause.COMMAND); user.getTeleport().respawn(charge, TeleportCause.COMMAND);
} }
else if (homes.isEmpty()) else if (homes.isEmpty())
{ {

View File

@ -87,11 +87,11 @@ public class Commanditem extends EssentialsCommand
user.sendMessage(_("itemSpawn", stack.getAmount(), displayName)); user.sendMessage(_("itemSpawn", stack.getAmount(), displayName));
if (user.isAuthorized("essentials.oversizedstacks")) if (user.isAuthorized("essentials.oversizedstacks"))
{ {
InventoryWorkaround.addItem(user.getInventory(), true, ess.getSettings().getOversizedStackSize(), stack); InventoryWorkaround.addOversizedItems(user.getInventory(), ess.getSettings().getOversizedStackSize(), stack);
} }
else else
{ {
InventoryWorkaround.addItem(user.getInventory(), true, stack); InventoryWorkaround.addItems(user.getInventory(), stack);
} }
user.updateInventory(); user.updateInventory();
} }

View File

@ -25,7 +25,7 @@ public class Commandmore extends EssentialsCommand
if (stack.getAmount() >= ((user.isAuthorized("essentials.oversizedstacks")) if (stack.getAmount() >= ((user.isAuthorized("essentials.oversizedstacks"))
? ess.getSettings().getOversizedStackSize() : stack.getMaxStackSize())) ? ess.getSettings().getOversizedStackSize() : stack.getMaxStackSize()))
{ {
throw new NoChargeException(); throw new Exception(_("fullStack"));
} }
final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""); final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
if (ess.getSettings().permissionBasedItemSpawn() if (ess.getSettings().permissionBasedItemSpawn()

View File

@ -0,0 +1,189 @@
package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.FurnaceRecipe;
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.Recipe;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe;
public class Commandrecipe extends EssentialsCommand
{
public Commandrecipe()
{
super("recipe");
}
@Override
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
final ItemStack itemType = ess.getItemDb().get(args[0]);
int recipeNo = 0;
if (args.length > 1)
{
if (Util.isInt(args[1]))
{
recipeNo = Integer.parseInt(args[1]) - 1;
}
else
{
throw new Exception(_("invalidNumber"));
}
}
final List<Recipe> recipesOfType = ess.getServer().getRecipesFor(itemType);
if (recipesOfType.size() < 1)
{
throw new Exception(_("recipeNone", getMaterialName(itemType)));
}
if (recipeNo < 0 || recipeNo >= recipesOfType.size())
{
throw new Exception(_("recipeBadIndex"));
}
final Recipe selectedRecipe = recipesOfType.get(recipeNo);
sender.sendMessage(_("recipe", getMaterialName(itemType), recipeNo + 1, recipesOfType.size()));
if (selectedRecipe instanceof FurnaceRecipe)
{
furnaceRecipe(sender, (FurnaceRecipe)selectedRecipe);
}
else if (selectedRecipe instanceof ShapedRecipe)
{
shapedRecipe(sender, (ShapedRecipe)selectedRecipe);
}
else if (selectedRecipe instanceof ShapelessRecipe)
{
shapelessRecipe(sender, (ShapelessRecipe)selectedRecipe);
}
if (recipesOfType.size() > 1 && args.length == 1)
{
sender.sendMessage(_("recipeMore", commandLabel, args[0], getMaterialName(itemType)));
}
}
public void furnaceRecipe(final CommandSender sender, final FurnaceRecipe recipe)
{
sender.sendMessage(_("recipeFurnace", getMaterialName(recipe.getInput())));
}
public void shapedRecipe(final CommandSender sender, final ShapedRecipe recipe)
{
final Map<Character, ItemStack> recipeMap = recipe.getIngredientMap();
if (sender instanceof Player)
{
final User user = ess.getUser(sender);
user.setRecipeSee(true);
final InventoryView view = user.openWorkbench(null, true);
final String shapeMap = recipe.getShape().length == 2 ? " abecdfghi" : " abcdefghi";
for (Entry<Character, ItemStack> e : ((ShapedRecipe)recipe).getIngredientMap().entrySet())
{
e.getValue().setAmount(0);
view.setItem(shapeMap.indexOf(e.getKey()), e.getValue());
}
}
else
{
final HashMap<Material, String> colorMap = new HashMap<Material, String>();
int i = 1;
for (Character c : "abcdefghi".toCharArray())
{
ItemStack item = recipeMap.get(c);
if (!colorMap.containsKey(item == null ? null : item.getType()))
{
colorMap.put(item == null ? null : item.getType(), String.valueOf(i++));
}
}
final Material[][] materials = new Material[3][3];
for (int j = 0; j < recipe.getShape().length; j++)
{
for (int k = 0; k < recipe.getShape()[j].length(); k++)
{
ItemStack item = recipe.getIngredientMap().get(recipe.getShape()[j].toCharArray()[k]);
materials[j][k] = item == null ? null : item.getType();
}
}
sender.sendMessage(_("recipeGrid", colorMap.get(materials[0][0]), colorMap.get(materials[0][1]), colorMap.get(materials[0][2])));
sender.sendMessage(_("recipeGrid", colorMap.get(materials[1][0]), colorMap.get(materials[1][1]), colorMap.get(materials[1][2])));
sender.sendMessage(_("recipeGrid", colorMap.get(materials[2][0]), colorMap.get(materials[2][1]), colorMap.get(materials[2][2])));
StringBuilder s = new StringBuilder();
for (Material items : colorMap.keySet().toArray(new Material[colorMap.size()]))
{
s.append(_("recipeGridItem", colorMap.get(items), getMaterialName(items)));
}
sender.sendMessage(_("recipeWhere", s.toString()));
}
}
public void shapelessRecipe(final CommandSender sender, final ShapelessRecipe recipe)
{
final List<ItemStack> ingredients = recipe.getIngredientList();
if (sender instanceof Player)
{
final User user = ess.getUser(sender);
user.setRecipeSee(true);
final InventoryView view = user.openWorkbench(null, true);
for (int i = 0; i < ingredients.size(); i++)
{
view.setItem(i + 1, ingredients.get(i));
}
}
else
{
StringBuilder s = new StringBuilder();
for (int i = 0; i < ingredients.size(); i++)
{
s.append(getMaterialName(ingredients.get(i)));
if (i != ingredients.size() - 1)
{
s.append(",");
}
s.append(" ");
}
sender.sendMessage(_("recipeShapeless", s.toString()));
}
}
public String getMaterialName(final ItemStack stack)
{
if (stack == null)
{
return _("recipeNothing");
}
return getMaterialName(stack.getType());
}
public String getMaterialName(final Material type)
{
if (type == null)
{
return _("recipeNothing");
}
return type.toString().replace("_", " ").toLowerCase(Locale.ENGLISH);
}
}

View File

@ -35,12 +35,28 @@ public class Commandseen extends EssentialsCommand
} }
try try
{ {
User player = getPlayer(server, args, 0); User user = getPlayer(server, args, 0);
player.setDisplayNick(); user.setDisplayNick();
sender.sendMessage(_("seenOnline", player.getDisplayName(), Util.formatDateDiff(player.getLastLogin()))); sender.sendMessage(_("seenOnline", user.getDisplayName(), Util.formatDateDiff(user.getLastLogin())));
if (user.isAfk())
{
sender.sendMessage(_("whoisAFK", _("true")));
}
if (user.isJailed())
{
sender.sendMessage(_("whoisJail", (user.getJailTimeout() > 0
? Util.formatDateDiff(user.getJailTimeout())
: _("true"))));
}
if (user.isMuted())
{
sender.sendMessage(_("whoisMuted", (user.getMuteTimeout() > 0
? Util.formatDateDiff(user.getMuteTimeout())
: _("true"))));
}
if (extra) if (extra)
{ {
sender.sendMessage(_("whoisIPAddress", player.getAddress().getAddress().toString())); sender.sendMessage(_("whoisIPAddress", user.getAddress().getAddress().toString()));
} }
} }
catch (NoSuchFieldException e) catch (NoSuchFieldException e)
@ -60,7 +76,8 @@ public class Commandseen extends EssentialsCommand
{ {
sender.sendMessage(_("whoisIPAddress", player.getLastLoginAddress())); sender.sendMessage(_("whoisIPAddress", player.getLastLoginAddress()));
final Location loc = player.getLastLocation(); final Location loc = player.getLastLocation();
if (loc != null) { if (loc != null)
{
sender.sendMessage(_("whoisLocation", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); sender.sendMessage(_("whoisLocation", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
} }
} }

View File

@ -22,6 +22,8 @@ public class Commandsell extends EssentialsCommand
@Override @Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{ {
double totalWorth = 0.0;
String type = "";
if (args.length < 1) if (args.length < 1)
{ {
throw new NotEnoughArgumentsException(); throw new NotEnoughArgumentsException();
@ -41,12 +43,16 @@ public class Commandsell extends EssentialsCommand
} }
try try
{ {
sellItem(user, stack, args, true); totalWorth += sellItem(user, stack, args, true);
} }
catch (Exception e) catch (Exception e)
{ {
} }
} }
if (totalWorth > 0)
{
user.sendMessage(_("totalWorthAll", type, Util.displayCurrency(totalWorth, ess)));
}
return; return;
} }
else if (args[0].equalsIgnoreCase("blocks")) else if (args[0].equalsIgnoreCase("blocks"))
@ -59,12 +65,16 @@ public class Commandsell extends EssentialsCommand
} }
try try
{ {
sellItem(user, stack, args, true); totalWorth += sellItem(user, stack, args, true);
} }
catch (Exception e) catch (Exception e)
{ {
} }
} }
if (totalWorth > 0)
{
user.sendMessage(_("totalWorthBlocks", type, Util.displayCurrency(totalWorth, ess)));
}
return; return;
} }
if (is == null) if (is == null)
@ -74,7 +84,7 @@ public class Commandsell extends EssentialsCommand
sellItem(user, is, args, false); sellItem(user, is, args, false);
} }
private void sellItem(User user, ItemStack is, String[] args, boolean isBulkSell) throws Exception private double sellItem(User user, ItemStack is, String[] args, boolean isBulkSell) throws Exception
{ {
if (is == null || is.getType() == Material.AIR) if (is == null || is.getType() == Material.AIR)
{ {
@ -149,19 +159,19 @@ public class Commandsell extends EssentialsCommand
} }
else else
{ {
return; return worth * amount;
} }
} }
//TODO: Prices for Enchantments //TODO: Prices for Enchantments
final ItemStack ris = is.clone(); final ItemStack ris = is.clone();
ris.setAmount(amount); ris.setAmount(amount);
InventoryWorkaround.removeItem(user.getInventory(), true, true, ris); user.getInventory().removeItem(ris);
user.updateInventory(); user.updateInventory();
Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(worth * amount, ess), user.getLocation(), ess); Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(worth * amount, ess), user.getLocation(), ess);
user.giveMoney(worth * amount); user.giveMoney(worth * amount);
user.sendMessage(_("itemSold", Util.displayCurrency(worth * amount, ess), amount, is.getType().toString().toLowerCase(Locale.ENGLISH), Util.displayCurrency(worth, ess))); user.sendMessage(_("itemSold", Util.displayCurrency(worth * amount, ess), amount, is.getType().toString().toLowerCase(Locale.ENGLISH), Util.displayCurrency(worth, ess)));
logger.log(Level.INFO, _("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(Locale.ENGLISH), Util.displayCurrency(worth * amount, ess), amount, Util.displayCurrency(worth, ess))); logger.log(Level.INFO, _("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(Locale.ENGLISH), Util.displayCurrency(worth * amount, ess), amount, Util.displayCurrency(worth, ess)));
return worth * amount;
} }
} }

View File

@ -4,6 +4,8 @@ import com.earth2me.essentials.Console;
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.Util; import com.earth2me.essentials.Util;
import java.util.Calendar;
import java.util.GregorianCalendar;
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;
@ -35,7 +37,7 @@ public class Commandtempban extends EssentialsCommand
} }
else else
{ {
if (user.isAuthorized("essentials.tempban.exempt")) if (user.isAuthorized("essentials.tempban.exempt") && sender instanceof Player)
{ {
sender.sendMessage(_("tempbanExempt")); sender.sendMessage(_("tempbanExempt"));
return; return;
@ -44,6 +46,13 @@ public class Commandtempban extends EssentialsCommand
final String time = getFinalArg(args, 1); final String time = getFinalArg(args, 1);
final long banTimestamp = Util.parseDateDiff(time, true); final long banTimestamp = Util.parseDateDiff(time, true);
final long maxBanLength = ess.getSettings().getMaxTempban() * 1000;
if(maxBanLength > 0 && ((banTimestamp - GregorianCalendar.getInstance().getTimeInMillis()) > maxBanLength) && ess.getUser(sender).isAuthorized("essentials.tempban.unlimited"))
{
sender.sendMessage(_("oversizedTempban"));
throw new NoChargeException();
}
final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME; final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
final String banReason = _("tempBanned", Util.formatDateDiff(banTimestamp), senderName); final String banReason = _("tempBanned", Util.formatDateDiff(banTimestamp), senderName);
user.setBanReason(banReason); user.setBanReason(banReason);

View File

@ -4,6 +4,7 @@ import com.earth2me.essentials.Console;
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;
import org.bukkit.Location;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
@ -40,13 +41,34 @@ public class Commandtp extends EssentialsCommand
charge.isAffordableFor(user); charge.isAffordableFor(user);
user.getTeleport().teleport(player, charge, TeleportCause.COMMAND); user.getTeleport().teleport(player, charge, TeleportCause.COMMAND);
throw new NoChargeException(); throw new NoChargeException();
case 4:
if (!user.isAuthorized("essentials.tp.others"))
{
throw new Exception(_("noPerm", "essentials.tp.others"));
}
final User target2 = getPlayer(server, args, 0);
final double x = args[1].startsWith("~") ? target2.getLocation().getX() + Integer.parseInt(args[1].substring(1)) : Integer.parseInt(args[1]);
final double y = args[2].startsWith("~") ? target2.getLocation().getY() + Integer.parseInt(args[2].substring(1)) : Integer.parseInt(args[2]);
final double z = args[3].startsWith("~") ? target2.getLocation().getZ() + Integer.parseInt(args[3].substring(1)) : Integer.parseInt(args[3]);
if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000)
{
throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //todo: I18n
}
final Location location = new Location(target2.getWorld(), x, y, z);
if (!target2.isTeleportEnabled())
{
throw new Exception(_("teleportDisabled", target2.getDisplayName()));
}
target2.getTeleport().now(location, false, TeleportCause.COMMAND);
user.sendMessage(_("teleporting"));
target2.sendMessage(_("teleporting"));
break;
case 2:
default: default:
if (!user.isAuthorized("essentials.tp.others")) if (!user.isAuthorized("essentials.tp.others"))
{ {
throw new Exception(_("noPerm", "essentials.tp.others")); throw new Exception(_("noPerm", "essentials.tp.others"));
} }
user.sendMessage(_("teleporting"));
final User target = getPlayer(server, args, 0); final User target = getPlayer(server, args, 0);
final User toPlayer = getPlayer(server, args, 1); final User toPlayer = getPlayer(server, args, 1);
if (!target.isTeleportEnabled()) if (!target.isTeleportEnabled())
@ -63,6 +85,7 @@ public class Commandtp extends EssentialsCommand
throw new Exception(_("noPerm", "essentials.worlds." + toPlayer.getWorld().getName())); throw new Exception(_("noPerm", "essentials.worlds." + toPlayer.getWorld().getName()));
} }
target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND); target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND);
user.sendMessage(_("teleporting"));
target.sendMessage(_("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName())); target.sendMessage(_("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName()));
break; break;
} }
@ -76,10 +99,28 @@ public class Commandtp extends EssentialsCommand
throw new NotEnoughArgumentsException(); throw new NotEnoughArgumentsException();
} }
sender.sendMessage(_("teleporting"));
final User target = getPlayer(server, args, 0); final User target = getPlayer(server, args, 0);
final User toPlayer = getPlayer(server, args, 1); if (args.length == 2)
target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND); {
target.sendMessage(_("teleportAtoB", Console.NAME, toPlayer.getDisplayName())); final User toPlayer = getPlayer(server, args, 1);
target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND);
target.sendMessage(_("teleportAtoB", Console.NAME, toPlayer.getDisplayName()));
}
else if (args.length > 3)
{
final double x = args[1].startsWith("~") ? target.getLocation().getX() + Integer.parseInt(args[1].substring(1)) : Integer.parseInt(args[1]);
final double y = args[2].startsWith("~") ? target.getLocation().getY() + Integer.parseInt(args[2].substring(1)) : Integer.parseInt(args[2]);
final double z = args[3].startsWith("~") ? target.getLocation().getZ() + Integer.parseInt(args[3].substring(1)) : Integer.parseInt(args[3]);
if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000)
{
throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //todo: I18n
}
final Location location = new Location(target.getWorld(), x, y, z);
target.getTeleport().now(location, false, TeleportCause.COMMAND);
target.sendMessage(_("teleporting"));
} else {
throw new NotEnoughArgumentsException();
}
sender.sendMessage(_("teleporting"));
} }
} }

View File

@ -1,5 +1,6 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.ChargeException;
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;
@ -52,24 +53,24 @@ public class Commandtpaccept extends EssentialsCommand
} }
final Trade charge = new Trade(this.getName(), ess); final Trade charge = new Trade(this.getName(), ess);
if (user.isTpRequestHere())
{
charge.isAffordableFor(user);
}
else
{
charge.isAffordableFor(target);
}
user.sendMessage(_("requestAccepted")); user.sendMessage(_("requestAccepted"));
target.sendMessage(_("requestAcceptedFrom", user.getDisplayName())); target.sendMessage(_("requestAcceptedFrom", user.getDisplayName()));
if (user.isTpRequestHere()) try
{ {
target.getTeleport().teleportToMe(user, charge, TeleportCause.COMMAND); if (user.isTpRequestHere())
{
target.getTeleport().teleportToMe(user, charge, TeleportCause.COMMAND);
}
else
{
target.getTeleport().teleport(user, charge, TeleportCause.COMMAND);
}
} }
else catch (ChargeException ex)
{ {
target.getTeleport().teleport(user, charge, TeleportCause.COMMAND); user.sendMessage(_("pendingTeleportCancelled"));
ess.showError(target, ex, commandLabel);
} }
user.requestTeleport(null, false); user.requestTeleport(null, false);
throw new NoChargeException(); throw new NoChargeException();

View File

@ -24,9 +24,9 @@ public class Commandtppos extends EssentialsCommand
throw new NotEnoughArgumentsException(); throw new NotEnoughArgumentsException();
} }
final int x = Integer.parseInt(args[0]); final double x = args[0].startsWith("~") ? user.getLocation().getX() + Integer.parseInt(args[0].substring(1)) : Integer.parseInt(args[0]);
final int y = Integer.parseInt(args[1]); final double y = args[1].startsWith("~") ? user.getLocation().getY() + Integer.parseInt(args[1].substring(1)) : Integer.parseInt(args[1]);
final int z = Integer.parseInt(args[2]); final double z = args[2].startsWith("~") ? user.getLocation().getZ() + Integer.parseInt(args[2].substring(1)) : Integer.parseInt(args[2]);
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)
{ {
@ -36,7 +36,7 @@ public class Commandtppos extends EssentialsCommand
{ {
location.setPitch(Float.parseFloat(args[4])); location.setPitch(Float.parseFloat(args[4]));
} }
if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000) if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000)
{ {
throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //todo: I18n throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //todo: I18n
} }
@ -56,9 +56,9 @@ public class Commandtppos extends EssentialsCommand
} }
User user = ess.getUser(server.getPlayer(args[0])); User user = ess.getUser(server.getPlayer(args[0]));
final int x = Integer.parseInt(args[1]); final double x = args[1].startsWith("~") ? user.getLocation().getX() + Integer.parseInt(args[1].substring(1)) : Integer.parseInt(args[1]);
final int y = Integer.parseInt(args[2]); final double y = args[2].startsWith("~") ? user.getLocation().getY() + Integer.parseInt(args[2].substring(1)) : Integer.parseInt(args[2]);
final int z = Integer.parseInt(args[3]); final double z = args[3].startsWith("~") ? user.getLocation().getZ() + Integer.parseInt(args[3].substring(1)) : Integer.parseInt(args[3]);
final Location location = new Location(user.getWorld(), x, y, z); final Location location = new Location(user.getWorld(), x, y, z);
if (args.length > 4) if (args.length > 4)
{ {
@ -68,13 +68,13 @@ public class Commandtppos extends EssentialsCommand
{ {
location.setPitch(Float.parseFloat(args[5])); location.setPitch(Float.parseFloat(args[5]));
} }
if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000) if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000)
{ {
throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //todo: I18n throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //todo: I18n
} }
sender.sendMessage(_("teleporting")); sender.sendMessage(_("teleporting"));
user.sendMessage(_("teleporting")); user.sendMessage(_("teleporting"));
user.getTeleport().teleport(location, null, TeleportCause.COMMAND); user.getTeleport().teleport(location, null, TeleportCause.COMMAND);
} }
} }

View File

@ -103,7 +103,7 @@ public class Commandunlimited extends EssentialsCommand
{ {
message = "enableUnlimited"; message = "enableUnlimited";
enableUnlimited = true; enableUnlimited = true;
if (!InventoryWorkaround.containsItem(target.getInventory(), true, true, stack)) if (!target.getInventory().containsAtLeast(stack, stack.getAmount()))
{ {
target.getInventory().addItem(stack); target.getInventory().addItem(stack);
} }

View File

@ -1,243 +0,0 @@
package com.earth2me.essentials.craftbukkit;
import java.util.HashMap;
import java.util.List;
import java.util.ListIterator;
import org.bukkit.Material;
import org.bukkit.entity.HumanEntity;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
public class FakeInventory implements Inventory
{
ItemStack[] items;
public FakeInventory(ItemStack[] items)
{
this.items = new ItemStack[items.length];
for (int i = 0; i < items.length; i++)
{
if (items[i] == null)
{
continue;
}
this.items[i] = items[i].clone();
}
}
@Override
public int getSize()
{
return items.length;
}
@Override
public String getName()
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ItemStack getItem(int i)
{
return items[i];
}
@Override
public void setItem(int i, ItemStack is)
{
items[i] = is;
}
@Override
public HashMap<Integer, ItemStack> addItem(ItemStack... iss)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public HashMap<Integer, ItemStack> removeItem(ItemStack... iss)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ItemStack[] getContents()
{
return items;
}
@Override
public void setContents(ItemStack[] iss)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean contains(int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean contains(Material mtrl)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean contains(ItemStack is)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean contains(int i, int i1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean contains(Material mtrl, int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean contains(ItemStack is, int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public HashMap<Integer, ? extends ItemStack> all(int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public HashMap<Integer, ? extends ItemStack> all(Material mtrl)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public HashMap<Integer, ? extends ItemStack> all(ItemStack is)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int first(int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int first(Material mtrl)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int first(ItemStack is)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int firstEmpty()
{
for (int i = 0; i < items.length; i++)
{
if (items[i] == null || items[i].getTypeId() == 0) {
return i;
}
}
return -1;
}
@Override
public void remove(int i)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void remove(Material mtrl)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void remove(ItemStack is)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void clear(int i)
{
items[i] = null;
}
@Override
public void clear()
{
for (int i = 0; i < items.length; i++)
{
items[i] = null;
}
}
@Override
public List<HumanEntity> getViewers()
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public String getTitle()
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public InventoryType getType()
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public InventoryHolder getHolder()
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ListIterator<ItemStack> iterator()
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int getMaxStackSize()
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void setMaxStackSize(int size)
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ListIterator<ItemStack> iterator(int index)
{
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -735,4 +735,10 @@ public class FakeWorld implements World
{ {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
@Override
public boolean createExplosion(double d, double d1, double d2, float f, boolean bln, boolean bln1)
{
throw new UnsupportedOperationException("Not supported yet.");
}
} }

View File

@ -2,6 +2,7 @@ package com.earth2me.essentials.craftbukkit;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -15,49 +16,17 @@ public final class InventoryWorkaround
{ {
} }
public static int first(final Inventory inventory, final ItemStack item, final boolean enforceDurability, final boolean enforceAmount, final boolean enforceEnchantments) private static int firstPartial(final Inventory inventory, final ItemStack item, final int maxAmount)
{
return next(inventory, item, 0, enforceDurability, enforceAmount, enforceEnchantments);
}
public static int next(final Inventory cinventory, final ItemStack item, final int start, final boolean enforceDurability, final boolean enforceAmount, final boolean enforceEnchantments)
{
final ItemStack[] inventory = cinventory.getContents();
for (int i = start; i < inventory.length; i++)
{
final ItemStack cItem = inventory[i];
if (cItem == null)
{
continue;
}
if (item.getTypeId() == cItem.getTypeId() && (!enforceAmount || item.getAmount() == cItem.getAmount()) && (!enforceDurability || cItem.getDurability() == item.getDurability()) && (!enforceEnchantments || cItem.getEnchantments().equals(item.getEnchantments())))
{
return i;
}
}
return -1;
}
public static int firstPartial(final Inventory cinventory, final ItemStack item, final boolean enforceDurability)
{
return firstPartial(cinventory, item, enforceDurability, item.getType().getMaxStackSize());
}
public static int firstPartial(final Inventory cinventory, final ItemStack item, final boolean enforceDurability, final int maxAmount)
{ {
if (item == null) if (item == null)
{ {
return -1; return -1;
} }
final ItemStack[] inventory = cinventory.getContents(); final ItemStack[] stacks = inventory.getContents();
for (int i = 0; i < inventory.length; i++) for (int i = 0; i < stacks.length; i++)
{ {
final ItemStack cItem = inventory[i]; final ItemStack cItem = stacks[i];
if (cItem == null) if (cItem != null && cItem.getAmount() < maxAmount && cItem.isSimilar(item))
{
continue;
}
if (item.getTypeId() == cItem.getTypeId() && cItem.getAmount() < maxAmount && (!enforceDurability || cItem.getDurability() == item.getDurability()) && cItem.getEnchantments().equals(item.getEnchantments()))
{ {
return i; return i;
} }
@ -65,26 +34,24 @@ public final class InventoryWorkaround
return -1; return -1;
} }
public static boolean addAllItems(final Inventory cinventory, final boolean enforceDurability, final ItemStack... items) public static boolean addAllItems(final Inventory inventory, final ItemStack... items)
{ {
final Inventory fake = new FakeInventory(cinventory.getContents()); final Inventory fakeInventory = Bukkit.getServer().createInventory(null, inventory.getType());
if (addItem(fake, enforceDurability, items).isEmpty()) fakeInventory.setContents(inventory.getContents());
if (addItems(fakeInventory, items).isEmpty())
{ {
addItem(cinventory, enforceDurability, items); addItems(inventory, items);
return true; return true;
} }
else return false;
{
return false;
}
} }
public static Map<Integer, ItemStack> addItem(final Inventory cinventory, final boolean forceDurability, final ItemStack... items) public static Map<Integer, ItemStack> addItems(final Inventory inventory, final ItemStack... items)
{ {
return addItem(cinventory, forceDurability, 0, items); return addOversizedItems(inventory, 0, items);
} }
public static Map<Integer, ItemStack> addItem(final Inventory cinventory, final boolean enforceDurability, final int oversizedStacks, final ItemStack... items) public static Map<Integer, ItemStack> addOversizedItems(final Inventory inventory, final int oversizedStacks, final ItemStack... items)
{ {
final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>(); final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
@ -95,7 +62,7 @@ public final class InventoryWorkaround
// combine items // combine items
ItemStack[] combined = new ItemStack[items.length]; final ItemStack[] combined = new ItemStack[items.length];
for (int i = 0; i < items.length; i++) for (int i = 0; i < items.length; i++)
{ {
if (items[i] == null || items[i].getAmount() < 1) if (items[i] == null || items[i].getAmount() < 1)
@ -109,7 +76,7 @@ public final class InventoryWorkaround
combined[j] = items[i].clone(); combined[j] = items[i].clone();
break; break;
} }
if (combined[j].getTypeId() == items[i].getTypeId() && (!enforceDurability || combined[j].getDurability() == items[i].getDurability()) && combined[j].getEnchantments().equals(items[i].getEnchantments())) if (combined[j].isSimilar(items[i]))
{ {
combined[j].setAmount(combined[j].getAmount() + items[i].getAmount()); combined[j].setAmount(combined[j].getAmount() + items[i].getAmount());
break; break;
@ -130,13 +97,13 @@ public final class InventoryWorkaround
{ {
// Do we already have a stack of it? // Do we already have a stack of it?
final int maxAmount = oversizedStacks > item.getType().getMaxStackSize() ? oversizedStacks : item.getType().getMaxStackSize(); final int maxAmount = oversizedStacks > item.getType().getMaxStackSize() ? oversizedStacks : item.getType().getMaxStackSize();
final int firstPartial = firstPartial(cinventory, item, enforceDurability, maxAmount); final int firstPartial = firstPartial(inventory, item, maxAmount);
// Drat! no partial stack // Drat! no partial stack
if (firstPartial == -1) if (firstPartial == -1)
{ {
// Find a free spot! // Find a free spot!
final int firstFree = cinventory.firstEmpty(); final int firstFree = inventory.firstEmpty();
if (firstFree == -1) if (firstFree == -1)
{ {
@ -151,13 +118,13 @@ public final class InventoryWorkaround
{ {
final ItemStack stack = item.clone(); final ItemStack stack = item.clone();
stack.setAmount(maxAmount); stack.setAmount(maxAmount);
cinventory.setItem(firstFree, stack); inventory.setItem(firstFree, stack);
item.setAmount(item.getAmount() - maxAmount); item.setAmount(item.getAmount() - maxAmount);
} }
else else
{ {
// Just store it // Just store it
cinventory.setItem(firstFree, item); inventory.setItem(firstFree, item);
break; break;
} }
} }
@ -165,7 +132,7 @@ public final class InventoryWorkaround
else else
{ {
// So, apparently it might only partially fit, well lets do just that // So, apparently it might only partially fit, well lets do just that
final ItemStack partialItem = cinventory.getItem(firstPartial); final ItemStack partialItem = inventory.getItem(firstPartial);
final int amount = item.getAmount(); final int amount = item.getAmount();
final int partialAmount = partialItem.getAmount(); final int partialAmount = partialItem.getAmount();
@ -185,138 +152,4 @@ public final class InventoryWorkaround
} }
return leftover; return leftover;
} }
public static Map<Integer, ItemStack> removeItem(final Inventory cinventory, final boolean enforceDurability, final boolean enforceEnchantments, final ItemStack... items)
{
final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
// TODO: optimization
for (int i = 0; i < items.length; i++)
{
final ItemStack item = items[i];
if (item == null)
{
continue;
}
int toDelete = item.getAmount();
while (true)
{
// Bail when done
if (toDelete <= 0)
{
break;
}
// get first Item, ignore the amount
final int first = first(cinventory, item, enforceDurability, false, enforceEnchantments);
// Drat! we don't have this type in the inventory
if (first == -1)
{
item.setAmount(toDelete);
leftover.put(i, item);
break;
}
else
{
final ItemStack itemStack = cinventory.getItem(first);
final int amount = itemStack.getAmount();
if (amount <= toDelete)
{
toDelete -= amount;
// clear the slot, all used up
cinventory.clear(first);
}
else
{
// split the stack and store
itemStack.setAmount(amount - toDelete);
cinventory.setItem(first, itemStack);
toDelete = 0;
}
}
}
}
return leftover;
}
public static boolean containsItem(final Inventory cinventory, final boolean enforceDurability, final boolean enforceEnchantments, final ItemStack... items)
{
final Map<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>();
// TODO: optimization
// combine items
ItemStack[] combined = new ItemStack[items.length];
for (int i = 0; i < items.length; i++)
{
if (items[i] == null)
{
continue;
}
for (int j = 0; j < combined.length; j++)
{
if (combined[j] == null)
{
combined[j] = items[i].clone();
break;
}
if (combined[j].getTypeId() == items[i].getTypeId() && (!enforceDurability || combined[j].getDurability() == items[i].getDurability()) && (!enforceEnchantments || combined[j].getEnchantments().equals(items[i].getEnchantments())))
{
combined[j].setAmount(combined[j].getAmount() + items[i].getAmount());
break;
}
}
}
for (int i = 0; i < combined.length; i++)
{
final ItemStack item = combined[i];
if (item == null)
{
continue;
}
int mustHave = item.getAmount();
int position = 0;
while (true)
{
// Bail when done
if (mustHave <= 0)
{
break;
}
final int slot = next(cinventory, item, position, enforceDurability, false, enforceEnchantments);
// Drat! we don't have this type in the inventory
if (slot == -1)
{
leftover.put(i, item);
break;
}
else
{
final ItemStack itemStack = cinventory.getItem(slot);
final int amount = itemStack.getAmount();
if (amount <= mustHave)
{
mustHave -= amount;
}
else
{
mustHave = 0;
}
position = slot + 1;
}
}
}
return leftover.isEmpty();
}
} }

View File

@ -35,6 +35,7 @@ import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.scheduler.BukkitTask;
/** /**
@ -51,7 +52,7 @@ public class Metrics
/** /**
* The current revision number * The current revision number
*/ */
private final static int REVISION = 5; private final static int REVISION = 6;
/** /**
* The base url of the metrics domain * The base url of the metrics domain
*/ */
@ -60,10 +61,6 @@ public class Metrics
* The url used to report a server's status * The url used to report a server's status
*/ */
private static final String REPORT_URL = "/report/%s"; private static final String REPORT_URL = "/report/%s";
/**
* The file where guid and opt out is stored in
*/
private static final String CONFIG_FILE = "plugins/PluginMetrics/config.yml";
/** /**
* The separator to use for custom data. This MUST NOT change unless you are hosting your own version of metrics and * The separator to use for custom data. This MUST NOT change unless you are hosting your own version of metrics and
* want to change it. * want to change it.
@ -97,14 +94,18 @@ public class Metrics
* Unique server id * Unique server id
*/ */
private final String guid; private final String guid;
/**
* Debug mode
*/
private final boolean debug;
/** /**
* Lock for synchronization * Lock for synchronization
*/ */
private final Object optOutLock = new Object(); private final Object optOutLock = new Object();
/** /**
* Id of the scheduled task * The scheduled task
*/ */
private volatile int taskId = -1; private volatile BukkitTask task = null;
public Metrics(final Plugin plugin) throws IOException public Metrics(final Plugin plugin) throws IOException
{ {
@ -116,29 +117,31 @@ public class Metrics
this.plugin = plugin; this.plugin = plugin;
// load the config // load the config
configurationFile = new File(CONFIG_FILE); configurationFile = getConfigFile();
configuration = YamlConfiguration.loadConfiguration(configurationFile); configuration = YamlConfiguration.loadConfiguration(configurationFile);
// add some defaults // add some defaults
configuration.addDefault("opt-out", false); configuration.addDefault("opt-out", false);
configuration.addDefault("guid", UUID.randomUUID().toString()); configuration.addDefault("guid", UUID.randomUUID().toString());
configuration.addDefault("debug", false);
// Do we need to create the file? // Do we need to create the file?
if (configuration.get("guid", null) == null) if (configuration.get("guid", null) == null)
{ {
configuration.options().header("http://metrics.griefcraft.com").copyDefaults(true); configuration.options().header("http://mcstats.org").copyDefaults(true);
configuration.save(configurationFile); configuration.save(configurationFile);
} }
// Load the guid then // Load the guid then
guid = configuration.getString("guid"); guid = configuration.getString("guid");
debug = configuration.getBoolean("debug", false);
} }
/** /**
* Construct and create a Graph that can be used to separate specific plotters to their own graphs on the metrics * Construct and create a Graph that can be used to separate specific plotters to their own graphs on the metrics
* website. Plotters can be added to the graph object returned. * website. Plotters can be added to the graph object returned.
* *
* @param name * @param name The name of the graph
* @return Graph object created. Will never return NULL under normal circumstances unless bad parameters are given * @return Graph object created. Will never return NULL under normal circumstances unless bad parameters are given
*/ */
public Graph createGraph(final String name) public Graph createGraph(final String name)
@ -161,7 +164,7 @@ public class Metrics
/** /**
* Adds a custom data plotter to the default graph * Adds a custom data plotter to the default graph
* *
* @param plotter * @param plotter The plotter to use to plot custom data
*/ */
public void addCustomData(final Plotter plotter) public void addCustomData(final Plotter plotter)
{ {
@ -193,7 +196,7 @@ public class Metrics
} }
// Begin hitting the server with glorious data // Begin hitting the server with glorious data
taskId = plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable() task = plugin.getServer().getScheduler().runTaskTimerAsynchronously(plugin, new Runnable()
{ {
private boolean firstPost = true; private boolean firstPost = true;
@ -205,10 +208,15 @@ public class Metrics
synchronized (optOutLock) synchronized (optOutLock)
{ {
// Disable Task, if it is running and the server owner decided to opt-out // Disable Task, if it is running and the server owner decided to opt-out
if (isOptOut() && taskId > 0) if (isOptOut() && task != null)
{ {
plugin.getServer().getScheduler().cancelTask(taskId); task.cancel();
taskId = -1; task = null;
// Tell all plotters to stop gathering information.
for (Graph graph : graphs)
{
graph.onOptOut();
}
} }
} }
@ -223,7 +231,10 @@ public class Metrics
} }
catch (IOException e) catch (IOException e)
{ {
Bukkit.getLogger().log(Level.FINE, "[Metrics] " + e.getMessage()); if (debug)
{
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + e.getMessage());
}
} }
} }
}, 0, PING_INTERVAL * 1200); }, 0, PING_INTERVAL * 1200);
@ -233,7 +244,7 @@ public class Metrics
/** /**
* Has the server owner denied plugin metrics? * Has the server owner denied plugin metrics?
* *
* @return * @return true if metrics should be opted out of it
*/ */
public boolean isOptOut() public boolean isOptOut()
{ {
@ -242,16 +253,22 @@ public class Metrics
try try
{ {
// Reload the metrics file // Reload the metrics file
configuration.load(CONFIG_FILE); configuration.load(getConfigFile());
} }
catch (IOException ex) catch (IOException ex)
{ {
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage()); if (debug)
{
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage());
}
return true; return true;
} }
catch (InvalidConfigurationException ex) catch (InvalidConfigurationException ex)
{ {
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage()); if (debug)
{
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage());
}
return true; return true;
} }
return configuration.getBoolean("opt-out", false); return configuration.getBoolean("opt-out", false);
@ -276,7 +293,7 @@ public class Metrics
} }
// Enable Task, if it is not running // Enable Task, if it is not running
if (taskId < 0) if (task == null)
{ {
start(); start();
} }
@ -297,35 +314,81 @@ public class Metrics
if (!isOptOut()) if (!isOptOut())
{ {
configuration.set("opt-out", true); configuration.set("opt-out", true);
final File file = new File(CONFIG_FILE); configuration.save(configurationFile);
configuration.save(file);
} }
// Disable Task, if it is running // Disable Task, if it is running
if (taskId >= 0) if (task != null)
{ {
this.plugin.getServer().getScheduler().cancelTask(taskId); task.cancel();
taskId = -1; task = null;
} }
} }
} }
/**
* Gets the File object of the config file that should be used to store data such as the GUID and opt-out status
*
* @return the File object for the config file
*/
public File getConfigFile()
{
// I believe the easiest way to get the base folder (e.g craftbukkit set via -P) for plugins to use
// is to abuse the plugin object we already have
// plugin.getDataFolder() => base/plugins/PluginA/
// pluginsFolder => base/plugins/
// The base is not necessarily relative to the startup directory.
File pluginsFolder = plugin.getDataFolder().getParentFile();
// return => base/plugins/PluginMetrics/config.yml
return new File(new File(pluginsFolder, "PluginMetrics"), "config.yml");
}
/** /**
* Generic method that posts a plugin to the metrics website * Generic method that posts a plugin to the metrics website
*/ */
private void postPlugin(final boolean isPing) throws IOException private void postPlugin(final boolean isPing) throws IOException
{ {
// The plugin's description file containg all of the plugin data such as name, version, author, etc // Server software specific section
final PluginDescriptionFile description = plugin.getDescription(); PluginDescriptionFile description = plugin.getDescription();
String pluginName = description.getName();
boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled
String pluginVersion = description.getVersion();
String serverVersion = Bukkit.getVersion();
int playersOnline = Bukkit.getServer().getOnlinePlayers().length;
// END server software specific section -- all code below does not use any code outside of this class / Java
// Construct the post data // Construct the post data
final StringBuilder data = new StringBuilder(); final StringBuilder data = new StringBuilder();
// The plugin's description file containg all of the plugin data such as name, version, author, etc
data.append(encode("guid")).append('=').append(encode(guid)); data.append(encode("guid")).append('=').append(encode(guid));
encodeDataPair(data, "version", description.getVersion()); encodeDataPair(data, "version", pluginVersion);
encodeDataPair(data, "server", Bukkit.getVersion()); encodeDataPair(data, "server", serverVersion);
encodeDataPair(data, "players", Integer.toString(Bukkit.getServer().getOnlinePlayers().length)); encodeDataPair(data, "players", Integer.toString(playersOnline));
encodeDataPair(data, "revision", String.valueOf(REVISION)); encodeDataPair(data, "revision", String.valueOf(REVISION));
// New data as of R6
String osname = System.getProperty("os.name");
String osarch = System.getProperty("os.arch");
String osversion = System.getProperty("os.version");
String java_version = System.getProperty("java.version");
int coreCount = Runtime.getRuntime().availableProcessors();
// normalize os arch .. amd64 -> x86_64
if (osarch.equals("amd64"))
{
osarch = "x86_64";
}
encodeDataPair(data, "osname", osname);
encodeDataPair(data, "osarch", osarch);
encodeDataPair(data, "osversion", osversion);
encodeDataPair(data, "cores", Integer.toString(coreCount));
encodeDataPair(data, "online-mode", Boolean.toString(onlineMode));
encodeDataPair(data, "java_version", java_version);
// If we're pinging, append it // If we're pinging, append it
if (isPing) if (isPing)
{ {
@ -342,10 +405,6 @@ public class Metrics
{ {
final Graph graph = iter.next(); final Graph graph = iter.next();
// Because we have a lock on the graphs set already, it is reasonable to assume
// that our lock transcends down to the individual plotters in the graphs also.
// Because our methods are private, no one but us can reasonably access this list
// without reflection so this is a safe assumption without adding more code.
for (Plotter plotter : graph.getPlotters()) for (Plotter plotter : graph.getPlotters())
{ {
// The key name to send to the metrics server // The key name to send to the metrics server
@ -364,7 +423,7 @@ public class Metrics
} }
// Create the url // Create the url
final URL url = new URL(BASE_URL + String.format(REPORT_URL, description.getName())); URL url = new URL(BASE_URL + String.format(REPORT_URL, encode(pluginName)));
// Connect to the website // Connect to the website
URLConnection connection; URLConnection connection;
@ -420,13 +479,12 @@ public class Metrics
} }
} }
} }
//if (response.startsWith("OK")) - We should get "OK" followed by an optional description if everything goes right
} }
/** /**
* Check if mineshafter is present. If it is, we need to bypass it to send POST requests * Check if mineshafter is present. If it is, we need to bypass it to send POST requests
* *
* @return * @return true if mineshafter is installed on the server
*/ */
private boolean isMineshafterPresent() private boolean isMineshafterPresent()
{ {
@ -450,10 +508,9 @@ public class Metrics
* encodeDataPair(data, "version", description.getVersion()); * encodeDataPair(data, "version", description.getVersion());
* </code> * </code>
* *
* @param buffer * @param buffer the stringbuilder to append the data pair onto
* @param key * @param key the key value
* @param value * @param value the value
* @return
*/ */
private static void encodeDataPair(final StringBuilder buffer, final String key, final String value) throws UnsupportedEncodingException private static void encodeDataPair(final StringBuilder buffer, final String key, final String value) throws UnsupportedEncodingException
{ {
@ -463,8 +520,8 @@ public class Metrics
/** /**
* Encode text as UTF-8 * Encode text as UTF-8
* *
* @param text * @param text the text to encode
* @return * @return the encoded text, as UTF-8
*/ */
private static String encode(final String text) throws UnsupportedEncodingException private static String encode(final String text) throws UnsupportedEncodingException
{ {
@ -495,7 +552,7 @@ public class Metrics
/** /**
* Gets the graph's name * Gets the graph's name
* *
* @return * @return the Graph's name
*/ */
public String getName() public String getName()
{ {
@ -505,7 +562,7 @@ public class Metrics
/** /**
* Add a plotter to the graph, which will be used to plot entries * Add a plotter to the graph, which will be used to plot entries
* *
* @param plotter * @param plotter the plotter to add to the graph
*/ */
public void addPlotter(final Plotter plotter) public void addPlotter(final Plotter plotter)
{ {
@ -515,7 +572,7 @@ public class Metrics
/** /**
* Remove a plotter from the graph * Remove a plotter from the graph
* *
* @param plotter * @param plotter the plotter to remove from the graph
*/ */
public void removePlotter(final Plotter plotter) public void removePlotter(final Plotter plotter)
{ {
@ -525,7 +582,7 @@ public class Metrics
/** /**
* Gets an <b>unmodifiable</b> set of the plotter objects in the graph * Gets an <b>unmodifiable</b> set of the plotter objects in the graph
* *
* @return * @return an unmodifiable {@link Set} of the plotter objects
*/ */
public Set<Plotter> getPlotters() public Set<Plotter> getPlotters()
{ {
@ -549,6 +606,13 @@ public class Metrics
final Graph graph = (Graph)object; final Graph graph = (Graph)object;
return graph.name.equals(name); return graph.name.equals(name);
} }
/**
* Called when the server owner decides to opt-out of Metrics while the server is running.
*/
protected void onOptOut()
{
}
} }
@ -573,7 +637,7 @@ public class Metrics
/** /**
* Construct a plotter with a specific plot name * Construct a plotter with a specific plot name
* *
* @param name * @param name the name of the plotter to use, which will show up on the website
*/ */
public Plotter(final String name) public Plotter(final String name)
{ {
@ -581,9 +645,11 @@ public class Metrics
} }
/** /**
* Get the current value for the plotted point * Get the current value for the plotted point. Since this function defers to an external function it may or may
* not return immediately thus cannot be guaranteed to be thread friendly or safe. This function can be called
* from any thread so care should be taken when accessing resources that need to be synchronized.
* *
* @return * @return the current value for the point to be plotted.
*/ */
public abstract int getValue(); public abstract int getValue();
@ -607,7 +673,7 @@ public class Metrics
@Override @Override
public int hashCode() public int hashCode()
{ {
return getColumnName().hashCode() + getValue(); return getColumnName().hashCode();
} }
@Override @Override

View File

@ -134,6 +134,14 @@ public class MetricsStarter implements Runnable
{ {
enabledGraph.addPlotter(new SimplePlotter("Warps")); enabledGraph.addPlotter(new SimplePlotter("Warps"));
} }
if (ess.getSettings().getTeleportCooldown() > 0)
{
enabledGraph.addPlotter(new SimplePlotter("TeleportCooldown"));
}
if (ess.getSettings().getTeleportDelay() > 0)
{
enabledGraph.addPlotter(new SimplePlotter("TeleportDelay"));
}
if (!ess.getSettings().areSignsDisabled()) if (!ess.getSettings().areSignsDisabled())
{ {
enabledGraph.addPlotter(new SimplePlotter("Signs")); enabledGraph.addPlotter(new SimplePlotter("Signs"));
@ -142,6 +150,14 @@ public class MetricsStarter implements Runnable
{ {
enabledGraph.addPlotter(new SimplePlotter("AutoAFK")); enabledGraph.addPlotter(new SimplePlotter("AutoAFK"));
} }
if (ess.getSettings().changePlayerListName())
{
enabledGraph.addPlotter(new SimplePlotter("PlayerListName"));
}
if (ess.getSettings().getOperatorColor() != null)
{
enabledGraph.addPlotter(new SimplePlotter("OpColour"));
}
if (ess.getSettings().changeDisplayName()) if (ess.getSettings().changeDisplayName())
{ {
enabledGraph.addPlotter(new SimplePlotter("DisplayName")); enabledGraph.addPlotter(new SimplePlotter("DisplayName"));

View File

@ -35,7 +35,7 @@ public class BPermissions2Handler extends SuperpermsHandler
@Override @Override
public boolean inGroup(final Player base, final String group) public boolean inGroup(final Player base, final String group)
{ {
return ApiLayer.hasGroup(base.getWorld().getName(), CalculableType.USER, base.getName(), group); return ApiLayer.hasGroupRecursive(base.getWorld().getName(), CalculableType.USER, base.getName(), group);
} }
@Override @Override

View File

@ -13,22 +13,22 @@ 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.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPluginLoader;
import org.yaml.snakeyaml.TypeDescription; import org.yaml.snakeyaml.TypeDescription;
import org.yaml.snakeyaml.constructor.Constructor; import org.yaml.snakeyaml.constructor.Constructor;
import org.yaml.snakeyaml.constructor.CustomClassLoaderConstructor;
import org.yaml.snakeyaml.error.YAMLException; import org.yaml.snakeyaml.error.YAMLException;
import org.yaml.snakeyaml.introspector.Property; import org.yaml.snakeyaml.introspector.Property;
import org.yaml.snakeyaml.nodes.*; import org.yaml.snakeyaml.nodes.*;
public class BukkitConstructor extends Constructor public class BukkitConstructor extends CustomClassLoaderConstructor
{ {
private final transient Pattern NUMPATTERN = Pattern.compile("\\d+"); private final transient Pattern NUMPATTERN = Pattern.compile("\\d+");
private final transient Plugin plugin; private final transient Plugin plugin;
public BukkitConstructor(final Class clazz, final Plugin plugin) public BukkitConstructor(final Class clazz, final Plugin plugin)
{ {
super(clazz); super(clazz, plugin.getClass().getClassLoader());
this.plugin = plugin; this.plugin = plugin;
yamlClassConstructors.put(NodeId.scalar, new ConstructBukkitScalar()); yamlClassConstructors.put(NodeId.scalar, new ConstructBukkitScalar());
yamlClassConstructors.put(NodeId.mapping, new ConstructBukkitMapping()); yamlClassConstructors.put(NodeId.mapping, new ConstructBukkitMapping());
@ -276,6 +276,7 @@ public class BukkitConstructor extends Constructor
return super.construct(node); return super.construct(node);
} }
@Override
protected Object constructJavaBean2ndStep(final MappingNode node, final Object object) protected Object constructJavaBean2ndStep(final MappingNode node, final Object object)
{ {
Map<Class<? extends Object>, TypeDescription> typeDefinitions; Map<Class<? extends Object>, TypeDescription> typeDefinitions;
@ -284,7 +285,8 @@ public class BukkitConstructor extends Constructor
final Field typeDefField = Constructor.class.getDeclaredField("typeDefinitions"); final Field typeDefField = Constructor.class.getDeclaredField("typeDefinitions");
typeDefField.setAccessible(true); typeDefField.setAccessible(true);
typeDefinitions = (Map<Class<? extends Object>, TypeDescription>)typeDefField.get((Constructor)BukkitConstructor.this); typeDefinitions = (Map<Class<? extends Object>, TypeDescription>)typeDefField.get((Constructor)BukkitConstructor.this);
if (typeDefinitions == null) { if (typeDefinitions == null)
{
throw new NullPointerException(); throw new NullPointerException();
} }
} }
@ -402,29 +404,4 @@ public class BukkitConstructor extends Constructor
return object; return object;
} }
} }
@Override
protected Class<?> getClassForNode(final Node node)
{
Class<?> clazz;
final String name = node.getTag().getClassName();
if (plugin == null)
{
clazz = super.getClassForNode(node);
}
else
{
final JavaPluginLoader jpl = (JavaPluginLoader)plugin.getPluginLoader();
clazz = jpl.getClassByName(name);
}
if (clazz == null)
{
throw new YAMLException("Class not found: " + name);
}
else
{
return clazz;
}
}
} }

View File

@ -47,6 +47,7 @@ public class HelpInput implements IText
newLines.clear(); newLines.clear();
lines.add(_("helpFrom", p.getDescription().getName())); lines.add(_("helpFrom", p.getDescription().getName()));
} }
final boolean isOnWhitelist = user.isAuthorized("essentials.help." + pluginNameLow);
for (Map.Entry<String, Map<String, Object>> k : cmds.entrySet()) for (Map.Entry<String, Map<String, Object>> k : cmds.entrySet())
{ {
@ -81,7 +82,7 @@ public class HelpInput implements IText
{ {
permissions = value.get(PERMISSIONS); permissions = value.get(PERMISSIONS);
} }
if (user.isAuthorized("essentials.help." + pluginNameLow)) if (isOnWhitelist || user.isAuthorized("essentials.help." + pluginNameLow + "." + k.getKey()))
{ {
pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION)));
} }

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.textreader;
import com.earth2me.essentials.DescParseTickFormat; import com.earth2me.essentials.DescParseTickFormat;
import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.IEssentials;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.text.DateFormat; import java.text.DateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
@ -42,7 +43,7 @@ public class KeywordReplacer implements IText
userName = user.getName(); userName = user.getName();
ipAddress = user.getAddress() == null || user.getAddress().getAddress() == null ? "" : user.getAddress().getAddress().toString(); ipAddress = user.getAddress() == null || user.getAddress().getAddress() == null ? "" : user.getAddress().getAddress().toString();
address = user.getAddress() == null ? "" : user.getAddress().toString(); address = user.getAddress() == null ? "" : user.getAddress().toString();
balance = Double.toString(user.getMoney()); balance = Util.displayCurrency(user.getMoney(), ess);
mails = Integer.toString(user.getMails().size()); mails = Integer.toString(user.getMails().size());
world = user.getLocation() == null || user.getLocation().getWorld() == null ? "" : user.getLocation().getWorld().getName(); world = user.getLocation() == null || user.getLocation().getWorld() == null ? "" : user.getLocation().getWorld().getName();
worldTime12 = DescParseTickFormat.format12(user.getWorld() == null ? 0 : user.getWorld().getTime()); worldTime12 = DescParseTickFormat.format12(user.getWorld() == null ? 0 : user.getWorld().getTime());

View File

@ -32,11 +32,10 @@ change-displayname: true
# The value of change-displayname (above) has to be true. # The value of change-displayname (above) has to be true.
#change-playerlist: true #change-playerlist: true
# Adds the prefix and suffix to the displayname of the player, so it will be displayed in messages and lists. # When essentialschat.jar isnt used, force essentials to add the prefix and suffix from permission plugins to displayname
# The prefix/suffix can be set using Permissions, Group Manager or PermissionsEx. # This setting is ignored if essentialschat.jar is used, and defaults to 'true'
# The value of change-displayname (above) has to be true. # The value of change-displayname (above) has to be true.
# If you don't set this, it will default to true if essentials chat is installed. # Do not edit this setting unless you know what you are doing!
# Don't forget to remove the # in front of the line
#add-prefix-suffix: false #add-prefix-suffix: false
# The delay, in seconds, required between /home, /tp, etc. # The delay, in seconds, required between /home, /tp, etc.
@ -65,6 +64,7 @@ item-spawn-blacklist:
# - essentials.give.item-all # - essentials.give.item-all
# - essentials.give.item-[itemname] # - essentials.give.item-[itemname]
# - essentials.give.item-[itemid] # - essentials.give.item-[itemid]
# For more information, visit http://wiki.ess3.net/wiki/Command_Reference/ICheat#Item.2FGive
permission-based-item-spawn: false permission-based-item-spawn: false
# Mob limit on the /spawnmob command per execution # Mob limit on the /spawnmob command per execution
@ -76,7 +76,7 @@ warn-on-smite: true
# motd and rules are now configured in the files motd.txt and rules.txt # motd and rules are now configured in the files motd.txt and rules.txt
# When a command conflicts with another plugin, by default, Essentials will try to force the OTHER plugin to take priority. # When a command conflicts with another plugin, by default, Essentials will try to force the OTHER plugin to take priority.
# Commands in in this list, will tell Essentials to 'not give up' the command to other plugins. # Commands in this list, will tell Essentials to 'not give up' the command to other plugins.
# In this state, which plugin 'wins' appears to be almost random. # In this state, which plugin 'wins' appears to be almost random.
# #
# If you have two plugin with the same command and you wish to force Essentials to take over, you need an alias. # If you have two plugin with the same command and you wish to force Essentials to take over, you need an alias.
@ -91,6 +91,32 @@ overridden-commands:
disabled-commands: disabled-commands:
# - nick # - nick
# These commands will be shown to players with socialSpy enabled
# You can add commands from other plugins you may want to track or
# remove commands that are used for something you dont want to spy on
socialspy-commands:
- msg
- w
- r
- mail
- m
- t
- whisper
- emsg
- tell
- er
- reply
- ereply
- email
- action
- describe
- eme
- eaction
- edescribe
- etell
- ewhisper
- pm
# If you do not wish to use a permission system, you can define a list of 'player perms' below. # If you do not wish to use a permission system, you can define a list of 'player perms' below.
# This list has no effect if you are using a supported permissions system. # This list has no effect if you are using a supported permissions system.
# If you are using an unsupported permissions system simply delete this section. # If you are using an unsupported permissions system simply delete this section.
@ -181,6 +207,7 @@ player-commands:
# All kit names should be lower case, and will be treated as lower in permissions/costs. # All kit names should be lower case, and will be treated as lower in permissions/costs.
# Syntax: - itemID[:DataValue] Amount [Enchantment:Level].. # Syntax: - itemID[:DataValue] Amount [Enchantment:Level]..
# 'delay' refers to the cooldown between how often you can use each kit, measured in seconds. # 'delay' refers to the cooldown between how often you can use each kit, measured in seconds.
# For more information, visit http://wiki.ess3.net/wiki/Command_Reference/ICheat#kits
kits: kits:
dtools: dtools:
delay: 10 delay: 10
@ -246,8 +273,10 @@ debug: false
# Set the locale for all messages # Set the locale for all messages
# If you don't set this, the default locale of the server will be used. # If you don't set this, the default locale of the server will be used.
# For example, to set language to English, set locale to en, to use the file "messages_en.properties"
# Don't forget to remove the # in front of the line # Don't forget to remove the # in front of the line
#locale: de_DE # For more information, visit http://wiki.ess3.net/wiki/Locale
#locale: en
# Turn off god mode when people exit # Turn off god mode when people exit
remove-god-on-disconnect: false remove-god-on-disconnect: false
@ -318,6 +347,13 @@ max-fly-speed: 0.8
#Set the maximum amount of mail that can be sent within a minute. #Set the maximum amount of mail that can be sent within a minute.
mails-per-minute: 1000 mails-per-minute: 1000
# Set the maximum time /tempban can be used for in seconds.
# Set to -1 to disable, and essentials.tempban.unlimited can be used to override.
max-tempban-time: -1
# Require users have essentials.chat before they can speak? Any users without this node will not be able to speak
enable-chat-perm: false
############################################################ ############################################################
# +------------------------------------------------------+ # # +------------------------------------------------------+ #
# | EssentialsHome | # # | EssentialsHome | #
@ -336,6 +372,7 @@ world-home-permissions: false
# Players need essentials.sethome.multiple before they can have more than 1 home, defaults to 'default' below. # Players need essentials.sethome.multiple before they can have more than 1 home, defaults to 'default' below.
# 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
# People with essentials.sethome.multiple.unlimited are not limited by these numbers. # People with essentials.sethome.multiple.unlimited are not limited by these numbers.
# For more information, visit http://wiki.ess3.net/wiki/Multihome
sethome-multiple: sethome-multiple:
default: 3 default: 3
# essentials.sethome.multiple.vip # essentials.sethome.multiple.vip
@ -353,6 +390,8 @@ tpa-accept-cancellation: 0
# +------------------------------------------------------+ # # +------------------------------------------------------+ #
############################################################ ############################################################
# For more information, visit http://wiki.ess3.net/wiki/Essentials_Economy
# Defines the balance with which new players begin. Defaults to 0. # Defines the balance with which new players begin. Defaults to 0.
starting-balance: 0 starting-balance: 0
@ -371,7 +410,7 @@ command-costs:
currency-symbol: '$' currency-symbol: '$'
# Set the maximum amount of money a player can have # Set the maximum amount of money a player can have
# The amount is always limited to 10 trillions because of the limitations of a java double # The amount is always limited to 10 trillion because of the limitations of a java double
max-money: 10000000000000 max-money: 10000000000000
# Set the minimum amount of money a player can have (must be above the negative of max-money). # Set the minimum amount of money a player can have (must be above the negative of max-money).
@ -573,6 +612,7 @@ protect:
############################################################ ############################################################
# Disable various default physics and behaviors # Disable various default physics and behaviors
# For more information, visit http://wiki.ess3.net/wiki/AntiBuild
# Should people with build: false in permissions be allowed to build # Should people with build: false in permissions be allowed to build
# Set true to disable building for those people # Set true to disable building for those people

View File

@ -1878,17 +1878,23 @@ dwart,115,0
dplant,115,0 dplant,115,0
dcrop,115,0 dcrop,115,0
enchantmenttable,116,0 enchantmenttable,116,0
magictable,116,0 enchantingtable,116,0
enchanttable,116,0
etable,116,0 etable,116,0
booktable,116,0 magicaltable,116,0
magicdesk,116,0 magictable,116,0
mtable,116,0
enchantmentdesk,116,0 enchantmentdesk,116,0
enchantingdesk,116,0
enchantdesk,116,0
edesk,116,0 edesk,116,0
magicaldesk,116,0
magicdesk,116,0
mdesk,116,0
booktable,116,0
bookdesk,116,0 bookdesk,116,0
btable,116,0 btable,116,0
bdesk,116,0 bdesk,116,0
mtable,116,0
mdesk,116,0
brewingstandblock,117,0 brewingstandblock,117,0
brewerblock,117,0 brewerblock,117,0
potionstandblock,117,0 potionstandblock,117,0
@ -5625,6 +5631,31 @@ pumpkincake,400,0
ppie,400,0 ppie,400,0
pcake,400,0 pcake,400,0
pie,400,0 pie,400,0
fireworkrocket,401,0
fireworkmissle,401,0
firework,401,0
fworkrocket,401,0
fworkmissle,401,0
fwork,401,0
fwrocket,401,0
fwmissle,401,0
fireworkstar,402,0
fworkstar,402,0
fwstar,402,0
fireworkball,402,0
fworkball,402,0
fwball,402,0
fireworkpowder,402,0
fworkpowder,402,0
fwpowder,402,0
enchantmentbook,403,0
enchantedbook,403,0
enchantingbook,403,0
enchantbook,403,0
magicalbook,403,0
magicbook,403,0
ebook,403,0
mbook,403,0
goldmusicrecord,2256,0 goldmusicrecord,2256,0
goldmusicdisk,2256,0 goldmusicdisk,2256,0
goldmusicdisc,2256,0 goldmusicdisc,2256,0
@ -6164,4 +6195,4 @@ cd11,2266,0
11record,2266,0 11record,2266,0
11disk,2266,0 11disk,2266,0
11disc,2266,0 11disc,2266,0
11cd,2266,0 11cd,2266,0

1 #version: TeamCity
1878 dplant,115,0
1879 dcrop,115,0
1880 enchantmenttable,116,0
1881 magictable,116,0 enchantingtable,116,0
1882 enchanttable,116,0
1883 etable,116,0
1884 booktable,116,0 magicaltable,116,0
1885 magicdesk,116,0 magictable,116,0
1886 mtable,116,0
1887 enchantmentdesk,116,0
1888 enchantingdesk,116,0
1889 enchantdesk,116,0
1890 edesk,116,0
1891 magicaldesk,116,0
1892 magicdesk,116,0
1893 mdesk,116,0
1894 booktable,116,0
1895 bookdesk,116,0
1896 btable,116,0
1897 bdesk,116,0
mtable,116,0
mdesk,116,0
1898 brewingstandblock,117,0
1899 brewerblock,117,0
1900 potionstandblock,117,0
5631 ppie,400,0
5632 pcake,400,0
5633 pie,400,0
5634 fireworkrocket,401,0
5635 fireworkmissle,401,0
5636 firework,401,0
5637 fworkrocket,401,0
5638 fworkmissle,401,0
5639 fwork,401,0
5640 fwrocket,401,0
5641 fwmissle,401,0
5642 fireworkstar,402,0
5643 fworkstar,402,0
5644 fwstar,402,0
5645 fireworkball,402,0
5646 fworkball,402,0
5647 fwball,402,0
5648 fireworkpowder,402,0
5649 fworkpowder,402,0
5650 fwpowder,402,0
5651 enchantmentbook,403,0
5652 enchantedbook,403,0
5653 enchantingbook,403,0
5654 enchantbook,403,0
5655 magicalbook,403,0
5656 magicbook,403,0
5657 ebook,403,0
5658 mbook,403,0
5659 goldmusicrecord,2256,0
5660 goldmusicdisk,2256,0
5661 goldmusicdisc,2256,0
6195 11record,2266,0
6196 11disk,2266,0
6197 11disc,2266,0
6198 11cd,2266,0

View File

@ -194,7 +194,7 @@ listAmountHidden= \u00a76There are \u00a7c{0}\u00a76/{1}\u00a76 out of maximum \
listGroupTag={0}\u00a7r: listGroupTag={0}\u00a7r:
listHiddenTag= \u00a77[HIDDEN]\u00a7r listHiddenTag= \u00a77[HIDDEN]\u00a7r
loadWarpError=\u00a74Failed to load warp {0} loadWarpError=\u00a74Failed to load warp {0}
localFormat=Local: <{0}> {1} localFormat=[L]<{0}> {1}
mailClear=\u00a76To mark your mail as read, type\u00a7c /mail clear mailClear=\u00a76To mark your mail as read, type\u00a7c /mail clear
mailCleared=\u00a76Mail Cleared! mailCleared=\u00a76Mail Cleared!
mailSent=\u00a76Mail sent! mailSent=\u00a76Mail sent!
@ -373,6 +373,8 @@ timeSet=\u00a76Time set in all worlds.
timeSetPermission=\u00a74You are not authorized to set the time. timeSetPermission=\u00a74You are not authorized to set the time.
timeWorldCurrent=\u00a76The current time in\u00a7c {0} \u00a76is \u00a7c{1} timeWorldCurrent=\u00a76The current time in\u00a7c {0} \u00a76is \u00a7c{1}
timeWorldSet=\u00a76The time was set to\u00a7c {0} \u00a76in: \u00a7c{1} timeWorldSet=\u00a76The time was set to\u00a7c {0} \u00a76in: \u00a7c{1}
totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=\u00a76Current TPS = {0} tps=\u00a76Current TPS = {0}
tradeCompleted=\u00a7aTrade completed. tradeCompleted=\u00a7aTrade completed.
tradeSignEmpty=\u00a74The trade sign has nothing available for you. tradeSignEmpty=\u00a74The trade sign has nothing available for you.
@ -463,3 +465,17 @@ userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this s
teleportationEnabledFor=\u00a76Teleportation enabled for {0} teleportationEnabledFor=\u00a76Teleportation enabled for {0}
teleportationDisabledFor=\u00a76Teleportation disabled for {0} teleportationDisabledFor=\u00a76Teleportation disabled for {0}
kitOnce=\u00a74You can't use that kit again. kitOnce=\u00a74You can't use that kit again.
fullStack=\u00a74You already have a full stack
oversizedTempban=\u00a74You may not ban a player for this period of time.
recipeNone=No recipes exist for {0}
invalidNumber=Invalid Number
recipeBadIndex=There is no recipe by that number
recipeNothing=nothing
recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
recipeFurnace=\u00a76Smelt \u00a7c{0}
recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -376,6 +376,8 @@ timeSet=Cas nastaven ve vsech svetech.
timeSetPermission=\u00a7cNejsi autorizovany ke zmene casu. timeSetPermission=\u00a7cNejsi autorizovany ke zmene casu.
timeWorldCurrent=Ve svete {0} je prave \u00a73{1} timeWorldCurrent=Ve svete {0} je prave \u00a73{1}
timeWorldSet=Cas byl nastaven na {0} ve: \u00a7c{1} timeWorldSet=Cas byl nastaven na {0} ve: \u00a7c{1}
totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Current TPS = {0} tps=Current TPS = {0}
tradeCompleted=\u00a77Vymena kompletni. tradeCompleted=\u00a77Vymena kompletni.
tradeSignEmpty=Tato cedule jiz nema dostupny material na vymenu. tradeSignEmpty=Tato cedule jiz nema dostupny material na vymenu.
@ -466,3 +468,17 @@ userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this s
teleportationEnabledFor=\u00a76Teleportation enabled for {0} teleportationEnabledFor=\u00a76Teleportation enabled for {0}
teleportationDisabledFor=\u00a76Teleportation disabled for {0} teleportationDisabledFor=\u00a76Teleportation disabled for {0}
kitOnce=\u00a74You can't use that kit again. kitOnce=\u00a74You can't use that kit again.
fullStack=\u00a74You already have a full stack
oversizedTempban=\u00a74You may not ban a player for this period of time.
recipeNone=No recipes exist for {0}
invalidNumber=Invalid Number
recipeBadIndex=There is no recipe by that number
recipeNothing=nothing
recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
recipeFurnace=\u00a76Smelt \u00a7c{0}
recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -373,6 +373,8 @@ timeSet=Tid \u00c3\u00a6ndret i alle verdener.
timeSetPermission=\u00a7cDu har ikke tilladelse til at \u00c3\u00a6ndre tiden. timeSetPermission=\u00a7cDu har ikke tilladelse til at \u00c3\u00a6ndre tiden.
timeWorldCurrent=Tiden p\u00c3\u00a5 nuv\u00c3\u00a6rende tidspunkt i {0} er \u00a73{1} timeWorldCurrent=Tiden p\u00c3\u00a5 nuv\u00c3\u00a6rende tidspunkt i {0} er \u00a73{1}
timeWorldSet=Tiden blev \u00c3\u00a6ndret til {0} i: \u00a7c{1} timeWorldSet=Tiden blev \u00c3\u00a6ndret til {0} i: \u00a7c{1}
totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Current TPS = {0} tps=Current TPS = {0}
tradeCompleted=\u00a77Handel gennemf\u00f8rt. tradeCompleted=\u00a77Handel gennemf\u00f8rt.
tradeSignEmpty=Handelsskiltet har udsolgt! tradeSignEmpty=Handelsskiltet har udsolgt!
@ -463,3 +465,17 @@ userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this s
teleportationEnabledFor=\u00a76Teleportation enabled for {0} teleportationEnabledFor=\u00a76Teleportation enabled for {0}
teleportationDisabledFor=\u00a76Teleportation disabled for {0} teleportationDisabledFor=\u00a76Teleportation disabled for {0}
kitOnce=\u00a74You can't use that kit again. kitOnce=\u00a74You can't use that kit again.
fullStack=\u00a74You already have a full stack
oversizedTempban=\u00a74You may not ban a player for this period of time.
recipeNone=No recipes exist for {0}
invalidNumber=Invalid Number
recipeBadIndex=There is no recipe by that number
recipeNothing=nothing
recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
recipeFurnace=\u00a76Smelt \u00a7c{0}
recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -373,6 +373,8 @@ timeSet=Zeit in allen Welten gesetzt.
timeSetPermission=\u00a7cDu hast keine Berechtigung die Zeit zu \u00e4ndern. timeSetPermission=\u00a7cDu hast keine Berechtigung die Zeit zu \u00e4ndern.
timeWorldCurrent=Die momentane Zeit in {0} ist \u00a73{1} timeWorldCurrent=Die momentane Zeit in {0} ist \u00a73{1}
timeWorldSet=Die Zeit in \u00a7c{1}\u00a7f wurde zu {0} gesetzt. timeWorldSet=Die Zeit in \u00a7c{1}\u00a7f wurde zu {0} gesetzt.
totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Current TPS = {0} tps=Current TPS = {0}
tradeCompleted=\u00a77Handel abgeschlossen. tradeCompleted=\u00a77Handel abgeschlossen.
tradeSignEmpty=Der Bestand des Trade-Schild ist aufgebraucht. tradeSignEmpty=Der Bestand des Trade-Schild ist aufgebraucht.
@ -463,3 +465,17 @@ userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this s
teleportationEnabledFor=\u00a76Teleportation enabled for {0} teleportationEnabledFor=\u00a76Teleportation enabled for {0}
teleportationDisabledFor=\u00a76Teleportation disabled for {0} teleportationDisabledFor=\u00a76Teleportation disabled for {0}
kitOnce=\u00a74You can't use that kit again. kitOnce=\u00a74You can't use that kit again.
fullStack=\u00a74You already have a full stack
oversizedTempban=\u00a74You may not ban a player for this period of time.
recipeNone=No recipes exist for {0}
invalidNumber=Invalid Number
recipeBadIndex=There is no recipe by that number
recipeNothing=nothing
recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
recipeFurnace=\u00a76Smelt \u00a7c{0}
recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -194,7 +194,7 @@ listAmountHidden= \u00a76There are \u00a7c{0}\u00a76/{1}\u00a76 out of maximum \
listGroupTag={0}\u00a7r: listGroupTag={0}\u00a7r:
listHiddenTag= \u00a77[HIDDEN]\u00a7r listHiddenTag= \u00a77[HIDDEN]\u00a7r
loadWarpError=\u00a74Failed to load warp {0} loadWarpError=\u00a74Failed to load warp {0}
localFormat=Local: <{0}> {1} localFormat=[L]<{0}> {1}
mailClear=\u00a76To mark your mail as read, type\u00a7c /mail clear mailClear=\u00a76To mark your mail as read, type\u00a7c /mail clear
mailCleared=\u00a76Mail Cleared! mailCleared=\u00a76Mail Cleared!
mailSent=\u00a76Mail sent! mailSent=\u00a76Mail sent!
@ -373,6 +373,8 @@ timeSet=\u00a76Time set in all worlds.
timeSetPermission=\u00a74You are not authorized to set the time. timeSetPermission=\u00a74You are not authorized to set the time.
timeWorldCurrent=\u00a76The current time in\u00a7c {0} \u00a76is \u00a7c{1} timeWorldCurrent=\u00a76The current time in\u00a7c {0} \u00a76is \u00a7c{1}
timeWorldSet=\u00a76The time was set to\u00a7c {0} \u00a76in: \u00a7c{1} timeWorldSet=\u00a76The time was set to\u00a7c {0} \u00a76in: \u00a7c{1}
totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=\u00a76Current TPS = {0} tps=\u00a76Current TPS = {0}
tradeCompleted=\u00a7aTrade completed. tradeCompleted=\u00a7aTrade completed.
tradeSignEmpty=\u00a74The trade sign has nothing available for you. tradeSignEmpty=\u00a74The trade sign has nothing available for you.
@ -463,3 +465,17 @@ userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this s
teleportationEnabledFor=\u00a76Teleportation enabled for {0} teleportationEnabledFor=\u00a76Teleportation enabled for {0}
teleportationDisabledFor=\u00a76Teleportation disabled for {0} teleportationDisabledFor=\u00a76Teleportation disabled for {0}
kitOnce=\u00a74You can't use that kit again. kitOnce=\u00a74You can't use that kit again.
fullStack=\u00a74You already have a full stack
oversizedTempban=\u00a74You may not ban a player for this period of time.
recipeNone=No recipes exist for {0}
invalidNumber=Invalid Number
recipeBadIndex=There is no recipe by that number
recipeNothing=nothing
recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
recipeFurnace=\u00a76Smelt \u00a7c{0}
recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -373,6 +373,8 @@ timeSet=Tiempo establecido en todos los mundos.
timeSetPermission=\u00a7cNo estas autorizado para establecer la hora. timeSetPermission=\u00a7cNo estas autorizado para establecer la hora.
timeWorldCurrent=La hora actual en {0} es \u00a73{1} timeWorldCurrent=La hora actual en {0} es \u00a73{1}
timeWorldSet=La hora ha sido establecida a {0} en: \u00a7c{1} timeWorldSet=La hora ha sido establecida a {0} en: \u00a7c{1}
totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=TPS actual = {0} tps=TPS actual = {0}
tradeCompleted=\u00a77Intercambio completado. tradeCompleted=\u00a77Intercambio completado.
tradeSignEmpty=Esta tienda no tiene nada disponible para ti. tradeSignEmpty=Esta tienda no tiene nada disponible para ti.
@ -463,3 +465,17 @@ userUnknown=\u00a74Peligro: El jugador '\u00a7c{0}\u00a74' Nunca a ingresado a e
teleportationEnabledFor=\u00a76Teleportation enabled for {0} teleportationEnabledFor=\u00a76Teleportation enabled for {0}
teleportationDisabledFor=\u00a76Teleportation disabled for {0} teleportationDisabledFor=\u00a76Teleportation disabled for {0}
kitOnce=\u00a74You can't use that kit again. kitOnce=\u00a74You can't use that kit again.
fullStack=\u00a74You already have a full stack
oversizedTempban=\u00a74You may not ban a player for this period of time.
recipeNone=No recipes exist for {0}
invalidNumber=Invalid Number
recipeBadIndex=There is no recipe by that number
recipeNothing=nothing
recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
recipeFurnace=\u00a76Smelt \u00a7c{0}
recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -373,6 +373,8 @@ timeSet=Aika asetettu kaikissa maailmoissa.
timeSetPermission=\u00a7cSinulla ei ole lupaa vaihtaa aikaa. timeSetPermission=\u00a7cSinulla ei ole lupaa vaihtaa aikaa.
timeWorldCurrent=T\u00e4m\u00e4nhetkinen aika maailmassa {0} on \u00a73{1} timeWorldCurrent=T\u00e4m\u00e4nhetkinen aika maailmassa {0} on \u00a73{1}
timeWorldSet=Aika vaihdettiin {0} maailmassa: \u00a7c{1} timeWorldSet=Aika vaihdettiin {0} maailmassa: \u00a7c{1}
totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=T\u00e4m\u00e4nhetkinen TPS = {0} tps=T\u00e4m\u00e4nhetkinen TPS = {0}
tradeCompleted=\u00a77Vaihto suoritettu. tradeCompleted=\u00a77Vaihto suoritettu.
tradeSignEmpty=Vaihtokyltill\u00e4 ei ole mit\u00e4\u00e4n tarjolla sinulle. tradeSignEmpty=Vaihtokyltill\u00e4 ei ole mit\u00e4\u00e4n tarjolla sinulle.
@ -463,3 +465,17 @@ userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this s
teleportationEnabledFor=\u00a76Teleportation enabled for {0} teleportationEnabledFor=\u00a76Teleportation enabled for {0}
teleportationDisabledFor=\u00a76Teleportation disabled for {0} teleportationDisabledFor=\u00a76Teleportation disabled for {0}
kitOnce=\u00a74You can't use that kit again. kitOnce=\u00a74You can't use that kit again.
fullStack=\u00a74You already have a full stack
oversizedTempban=\u00a74You may not ban a player for this period of time.
recipeNone=No recipes exist for {0}
invalidNumber=Invalid Number
recipeBadIndex=There is no recipe by that number
recipeNothing=nothing
recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
recipeFurnace=\u00a76Smelt \u00a7c{0}
recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -373,6 +373,8 @@ timeSet=Heure r\u00e9gl\u00e9e dans tous les mondes.
timeSetPermission=\u00a7cVous n'\u00eates pas autoris\u00e9 \u00e0 r\u00e9gler l'heure. timeSetPermission=\u00a7cVous n'\u00eates pas autoris\u00e9 \u00e0 r\u00e9gler l'heure.
timeWorldCurrent=Il est \u00a73{1}\u00a77 dans \u00a7c{0}. timeWorldCurrent=Il est \u00a73{1}\u00a77 dans \u00a7c{0}.
timeWorldSet=L''heure a \u00e9t\u00e9 r\u00e9gl\u00e9e \u00e0 {0} dans : \u00a7c{1} timeWorldSet=L''heure a \u00e9t\u00e9 r\u00e9gl\u00e9e \u00e0 {0} dans : \u00a7c{1}
totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Current TPS = {0} tps=Current TPS = {0}
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.
@ -463,3 +465,17 @@ userUnknown=\u00a74Attention : Le joueur '\u00a7c{0}\u00a74' n'est jamais venu s
teleportationEnabledFor=\u00a76Teleportation enabled for {0} teleportationEnabledFor=\u00a76Teleportation enabled for {0}
teleportationDisabledFor=\u00a76Teleportation disabled for {0} teleportationDisabledFor=\u00a76Teleportation disabled for {0}
kitOnce=\u00a74You can't use that kit again. kitOnce=\u00a74You can't use that kit again.
fullStack=\u00a74You already have a full stack
oversizedTempban=\u00a74You may not ban a player for this period of time.
recipeNone=No recipes exist for {0}
invalidNumber=Invalid Number
recipeBadIndex=There is no recipe by that number
recipeNothing=nothing
recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
recipeFurnace=\u00a76Smelt \u00a7c{0}
recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -373,6 +373,8 @@ timeSet=Orario definito in tutti i mondi.
timeSetPermission=\u00a7cNon sei autorizzato a regolare l''orario. timeSetPermission=\u00a7cNon sei autorizzato a regolare l''orario.
timeWorldCurrent=L''orario attuale in {0} e'' \u00a73{1} timeWorldCurrent=L''orario attuale in {0} e'' \u00a73{1}
timeWorldSet=L''orario e'' stato regolato alle {0} in: \u00a7c{1} timeWorldSet=L''orario e'' stato regolato alle {0} in: \u00a7c{1}
totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Current TPS = {0} tps=Current TPS = {0}
tradeCompleted=\u00a77Affare concluso. tradeCompleted=\u00a77Affare concluso.
tradeSignEmpty=L''insegna non dispone di forniture sufficienti. tradeSignEmpty=L''insegna non dispone di forniture sufficienti.
@ -463,3 +465,17 @@ userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this s
teleportationEnabledFor=\u00a76Teleportation enabled for {0} teleportationEnabledFor=\u00a76Teleportation enabled for {0}
teleportationDisabledFor=\u00a76Teleportation disabled for {0} teleportationDisabledFor=\u00a76Teleportation disabled for {0}
kitOnce=\u00a74You can't use that kit again. kitOnce=\u00a74You can't use that kit again.
fullStack=\u00a74You already have a full stack
oversizedTempban=\u00a74You may not ban a player for this period of time.
recipeNone=No recipes exist for {0}
invalidNumber=Invalid Number
recipeBadIndex=There is no recipe by that number
recipeNothing=nothing
recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
recipeFurnace=\u00a76Smelt \u00a7c{0}
recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -373,6 +373,8 @@ timeSet=Tijd ingesteld in alle werelden.
timeSetPermission=\u00a7cJe bent niet bevoegd om de tijd te veranderen. timeSetPermission=\u00a7cJe bent niet bevoegd om de tijd te veranderen.
timeWorldCurrent=De actuele tijd in {0} is \u00a73{1} timeWorldCurrent=De actuele tijd in {0} is \u00a73{1}
timeWorldSet=De tijd was veranderd naar {0} in: \u00a7c{1} timeWorldSet=De tijd was veranderd naar {0} in: \u00a7c{1}
totalWorthAll=\u00a7aAlle spullen verkocht voor een totale waarde van {1}.
totalWorthBlocks=\u00a7aAlle blokken verkocht voor een totale waarde van {1}.
tps=Huidige TPS = {0} tps=Huidige TPS = {0}
tradeCompleted=\u00a77Ruil verricht. tradeCompleted=\u00a77Ruil verricht.
tradeSignEmpty=Dit handelsbord heeft een te kleine voorraad. tradeSignEmpty=Dit handelsbord heeft een te kleine voorraad.
@ -463,3 +465,17 @@ userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this s
teleportationEnabledFor=\u00a76Teleportation enabled for {0} teleportationEnabledFor=\u00a76Teleportation enabled for {0}
teleportationDisabledFor=\u00a76Teleportation disabled for {0} teleportationDisabledFor=\u00a76Teleportation disabled for {0}
kitOnce=\u00a74You can't use that kit again. kitOnce=\u00a74You can't use that kit again.
fullStack=\u00a74You already have a full stack
oversizedTempban=\u00a74You may not ban a player for this period of time.
recipeNone=No recipes exist for {0}
invalidNumber=Invalid Number
recipeBadIndex=There is no recipe by that number
recipeNothing=nothing
recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
recipeFurnace=\u00a76Smelt \u00a7c{0}
recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -373,6 +373,8 @@ timeSet=Czas ustawiono we wszystkich swiatach.
timeSetPermission=\u00a7cNie masz uprawnien do ustawiania czasu. timeSetPermission=\u00a7cNie masz uprawnien do ustawiania czasu.
timeWorldCurrent=Obecny czas {0} to \u00a73{1}. timeWorldCurrent=Obecny czas {0} to \u00a73{1}.
timeWorldSet=Czas ustawiono {0} w: \u00a7c{1}. timeWorldSet=Czas ustawiono {0} w: \u00a7c{1}.
totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Current TPS = {0} tps=Current TPS = {0}
tradeCompleted=\u00a77Handel zakonczono. tradeCompleted=\u00a77Handel zakonczono.
tradeSignEmpty=Tabliczka handlowa nie jest dostepna dla Ciebie. tradeSignEmpty=Tabliczka handlowa nie jest dostepna dla Ciebie.
@ -463,3 +465,17 @@ userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this s
teleportationEnabledFor=\u00a76Teleportation enabled for {0} teleportationEnabledFor=\u00a76Teleportation enabled for {0}
teleportationDisabledFor=\u00a76Teleportation disabled for {0} teleportationDisabledFor=\u00a76Teleportation disabled for {0}
kitOnce=\u00a74You can't use that kit again. kitOnce=\u00a74You can't use that kit again.
fullStack=\u00a74You already have a full stack
oversizedTempban=\u00a74You may not ban a player for this period of time.
recipeNone=No recipes exist for {0}
invalidNumber=Invalid Number
recipeBadIndex=There is no recipe by that number
recipeNothing=nothing
recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
recipeFurnace=\u00a76Smelt \u00a7c{0}
recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -373,6 +373,8 @@ timeSet=Horario definido em todos os mundos.
timeSetPermission=\u00a7cVoc\u00ea nao tem autoriza\u00e7ao para modificar o hor\u00e1rio. timeSetPermission=\u00a7cVoc\u00ea nao tem autoriza\u00e7ao para modificar o hor\u00e1rio.
timeWorldCurrent=O hor\u00e1rio atual no mundo {0} e \u00a73{1} timeWorldCurrent=O hor\u00e1rio atual no mundo {0} e \u00a73{1}
timeWorldSet=O hor\u00e1rio foi definido para {0} no: \u00a7c{1} timeWorldSet=O hor\u00e1rio foi definido para {0} no: \u00a7c{1}
totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Current TPS = {0} tps=Current TPS = {0}
tradeCompleted=\u00a77Compra concluida. tradeCompleted=\u00a77Compra concluida.
tradeSignEmpty=A placa de troca nao tem abastecimento suficiente. tradeSignEmpty=A placa de troca nao tem abastecimento suficiente.
@ -463,3 +465,17 @@ userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this s
teleportationEnabledFor=\u00a76Teleportation enabled for {0} teleportationEnabledFor=\u00a76Teleportation enabled for {0}
teleportationDisabledFor=\u00a76Teleportation disabled for {0} teleportationDisabledFor=\u00a76Teleportation disabled for {0}
kitOnce=\u00a74You can't use that kit again. kitOnce=\u00a74You can't use that kit again.
fullStack=\u00a74You already have a full stack
oversizedTempban=\u00a74You may not ban a player for this period of time.
recipeNone=No recipes exist for {0}
invalidNumber=Invalid Number
recipeBadIndex=There is no recipe by that number
recipeNothing=nothing
recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
recipeFurnace=\u00a76Smelt \u00a7c{0}
recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -373,6 +373,8 @@ timeSet=Tid inst\u00e4lld i alla v\u00e4rldar.
timeSetPermission=\u00a7cDu har inte tillst\u00e5nd att st\u00e4lla in tiden. timeSetPermission=\u00a7cDu har inte tillst\u00e5nd att st\u00e4lla in tiden.
timeWorldCurrent=Den nuvarande tiden i {0} \u00e4r \u00a73{1} timeWorldCurrent=Den nuvarande tiden i {0} \u00e4r \u00a73{1}
timeWorldSet=Tiden \u00e4r nu {0} i: \u00a7c{1} timeWorldSet=Tiden \u00e4r nu {0} i: \u00a7c{1}
totalWorthAll=\u00a7aSold all items and blocks for a total worth of {1}.
totalWorthBlocks=\u00a7aSold all blocks for a total worth of {1}.
tps=Nuvarande TPS = {0} tps=Nuvarande TPS = {0}
tradeCompleted=\u00a77K\u00f6p avslutat. tradeCompleted=\u00a77K\u00f6p avslutat.
tradeSignEmpty=K\u00f6pskylten har inget tillg\u00e4ngligt f\u00f6r dig. tradeSignEmpty=K\u00f6pskylten har inget tillg\u00e4ngligt f\u00f6r dig.
@ -463,3 +465,17 @@ userUnknown=\u00a74Warning: The user '\u00a7c{0}\u00a74' has never joined this s
teleportationEnabledFor=\u00a76Teleportation enabled for {0} teleportationEnabledFor=\u00a76Teleportation enabled for {0}
teleportationDisabledFor=\u00a76Teleportation disabled for {0} teleportationDisabledFor=\u00a76Teleportation disabled for {0}
kitOnce=\u00a74You can't use that kit again. kitOnce=\u00a74You can't use that kit again.
fullStack=\u00a74You already have a full stack
oversizedTempban=\u00a74You may not ban a player for this period of time.
recipeNone=No recipes exist for {0}
invalidNumber=Invalid Number
recipeBadIndex=There is no recipe by that number
recipeNothing=nothing
recipe=\u00a76Recipe for \u00a7c{0}\u00a76 ({1} of {2})
recipeFurnace=\u00a76Smelt \u00a7c{0}
recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
recipeWhere=\u00a76Where: {0}
recipeShapeless=\u00a76Combine \u00a7c{0}
playerChatDenied=\u00a76You do not have permission to speak.

View File

@ -233,7 +233,7 @@ commands:
msg: msg:
description: Sends a private message to the specified player. description: Sends a private message to the specified player.
usage: /<command> <to> <message> usage: /<command> <to> <message>
aliases: [m,t,emsg,tell,etell,whisper,ewhisper] aliases: [w,m,t,emsg,tell,etell,whisper,ewhisper]
mute: mute:
description: Mutes or unmutes a player. description: Mutes or unmutes a player.
usage: /<command> <player> [datediff] usage: /<command> <player> [datediff]
@ -278,6 +278,10 @@ commands:
description: Displays the username of a user based on nick. description: Displays the username of a user based on nick.
usage: /<command> <nickname> usage: /<command> <nickname>
aliases: [erealname] aliases: [erealname]
recipe:
description: Displays how to craft items.
usage: /<command> <item> [number]
aliases: [method, formula, recipes, emethod, eformula, erecipes, erecipe]
remove: remove:
description: Removes entities in your world description: Removes entities in your world
usage: /<command> <drops|arrows|boats|minecarts|xp|paintings> [radius] usage: /<command> <drops|arrows|boats|minecarts|xp|paintings> [radius]
@ -454,4 +458,4 @@ commands:
permissions: permissions:
essentials.*: essentials.*:
default: op default: op
description: Give players with op everything by default description: Give players with op everything by default

View File

@ -16,10 +16,7 @@ import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.inventory.InventoryType;
import org.bukkit.help.HelpMap; import org.bukkit.help.HelpMap;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.*;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.Recipe;
import org.bukkit.map.MapView; import org.bukkit.map.MapView;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.PluginManager;
@ -807,4 +804,16 @@ public class FakeServer implements Server
{ {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
@Override
public String getShutdownMessage()
{
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ItemFactory getItemFactory()
{
throw new UnsupportedOperationException("Not supported yet.");
}
} }

View File

@ -40,13 +40,13 @@ dist.jar=${dist.dir}/EssentialsGroupManager.jar
dist.javadoc.dir=${dist.dir}/javadoc dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath= endorsed.classpath=
excludes= excludes=
file.reference.craftbukkit.jar=../lib/craftbukkit.jar file.reference.bukkit.jar=../lib/bukkit.jar
includes=** includes=**
jar.archive.disabled=${jnlp.enabled} jar.archive.disabled=${jnlp.enabled}
jar.compress=true jar.compress=true
jar.index=${jnlp.enabled} jar.index=${jnlp.enabled}
javac.classpath=\ javac.classpath=\
${file.reference.craftbukkit.jar} ${file.reference.bukkit.jar}
# Space-separated list of extra javac options # Space-separated list of extra javac options
javac.compilerargs= javac.compilerargs=
javac.deprecation=false javac.deprecation=false

View File

@ -201,4 +201,6 @@ v 2.0:
- Remove info node support from GlobalGroups. It should not have them as GlobalGroups are only permission collections. - Remove info node support from GlobalGroups. It should not have them as GlobalGroups are only permission collections.
- Change order of data in Users.yml to [name, Group, SubGroup, Permissions, Info nodes]. - Change order of data in Users.yml to [name, Group, SubGroup, Permissions, Info nodes].
- Add alphabetically sorted user lists. - Add alphabetically sorted user lists.
- allWorldsDataList now returns fully mirrored worlds which are not identical mirrors (fixes the /manselect list). - allWorldsDataList now returns fully mirrored worlds which are not identical mirrors (fixes the /manselect list).
- Add support for Rcon.
- Prevent GM commands from being used on CommandBlocks.

View File

@ -34,9 +34,11 @@ import org.anjocaido.groupmanager.utils.Tasks;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.command.BlockCommandSender;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender; import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.command.RemoteConsoleCommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.ServicePriority; import org.bukkit.plugin.ServicePriority;
@ -380,6 +382,12 @@ public class GroupManager extends JavaPlugin {
Group senderGroup = null; Group senderGroup = null;
User senderUser = null; User senderUser = null;
boolean isOpOverride = config.isOpOverride(); boolean isOpOverride = config.isOpOverride();
// PREVENT GM COMMANDS BEING USED ON COMMANDBLOCKS
if (sender instanceof BlockCommandSender) {
sender.sendMessage(ChatColor.RED + "GM Commands can not be called from CommandBlocks");
return true;
}
if (sender.getClass().getName().equals("org.bukkit.craftbukkit.command.CraftBlockCommandSender")) { if (sender.getClass().getName().equals("org.bukkit.craftbukkit.command.CraftBlockCommandSender")) {
sender.sendMessage(ChatColor.RED + "GM Commands can not be called from CommandBlocks"); sender.sendMessage(ChatColor.RED + "GM Commands can not be called from CommandBlocks");
@ -403,7 +411,7 @@ public class GroupManager extends JavaPlugin {
if (isOpOverride || worldsHolder.getWorldPermissions(senderPlayer).has(senderPlayer, "groupmanager." + cmd.getName())) { if (isOpOverride || worldsHolder.getWorldPermissions(senderPlayer).has(senderPlayer, "groupmanager." + cmd.getName())) {
playerCanDo = true; playerCanDo = true;
} }
} else if (sender instanceof ConsoleCommandSender) { } else if ((sender instanceof ConsoleCommandSender) || (sender instanceof RemoteConsoleCommandSender)) {
if (!lastError.isEmpty() && !commandLabel.equalsIgnoreCase("manload")) { if (!lastError.isEmpty() && !commandLabel.equalsIgnoreCase("manload")) {
sender.sendMessage(ChatColor.RED + "All commands are locked due to an error." + ChatColor.BOLD + "" + ChatColor.UNDERLINE + "Check the log" + ChatColor.RESET + " and then try a '/manload'."); sender.sendMessage(ChatColor.RED + "All commands are locked due to an error." + ChatColor.BOLD + "" + ChatColor.UNDERLINE + "Check the log" + ChatColor.RESET + " and then try a '/manload'.");

View File

@ -204,10 +204,10 @@ public class WorldsHolder {
mirroredWorlds.add((String)key); mirroredWorlds.add((String)key);
} else } else
GroupManager.logger.log(Level.WARNING, "Mirroring error with " + (String)key + ". Recursive loop detected!"); throw new IllegalStateException("Unknown mirroring format for " + (String)key);
} else { } else {
throw new IllegalStateException("Unknown mirroring format for " + (String)key); GroupManager.logger.log(Level.WARNING, "Mirroring error with " + (String)key + ". Recursive loop detected!");
} }
} }

Binary file not shown.

Binary file not shown.