mirror of
https://github.com/essentials/Essentials.git
synced 2025-09-26 06:09:15 +02:00
Revert "Remove Transient :: Formatting Cleanup"
This commit is contained in:
@@ -1,18 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project-shared-configuration>
|
<project-shared-configuration>
|
||||||
<!--
|
<!--
|
||||||
This file contains additional configuration written by modules in the NetBeans IDE.
|
This file contains additional configuration written by modules in the NetBeans IDE.
|
||||||
The configuration is intended to be shared among all the users of project and
|
The configuration is intended to be shared among all the users of project and
|
||||||
therefore it is assumed to be part of version control checkout.
|
therefore it is assumed to be part of version control checkout.
|
||||||
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
||||||
-->
|
-->
|
||||||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
|
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
|
||||||
<!--
|
<!--
|
||||||
Properties that influence various parts of the IDE, especially code formatting and the like.
|
Properties that influence various parts of the IDE, especially code formatting and the like.
|
||||||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
|
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
|
||||||
That way multiple projects can share the same settings (useful for formatting rules for example).
|
That way multiple projects can share the same settings (useful for formatting rules for example).
|
||||||
Any value defined here will override the pom.xml file value but is only applicable to the current project.
|
Any value defined here will override the pom.xml file value but is only applicable to the current project.
|
||||||
-->
|
-->
|
||||||
<netbeans.compile.on.save>all</netbeans.compile.on.save>
|
<netbeans.compile.on.save>all</netbeans.compile.on.save>
|
||||||
</properties>
|
</properties>
|
||||||
</project-shared-configuration>
|
</project-shared-configuration>
|
||||||
|
@@ -49,34 +49,34 @@ import org.bukkit.plugin.InvalidDescriptionException;
|
|||||||
public class Essentials implements IEssentials
|
public class Essentials implements IEssentials
|
||||||
{
|
{
|
||||||
@Getter
|
@Getter
|
||||||
private ISettings settings;
|
private transient ISettings settings;
|
||||||
@Getter
|
@Getter
|
||||||
private IJails jails;
|
private transient IJails jails;
|
||||||
@Getter
|
@Getter
|
||||||
private IKits kits;
|
private transient IKits kits;
|
||||||
@Getter
|
@Getter
|
||||||
private IWarps warps;
|
private transient IWarps warps;
|
||||||
@Getter
|
@Getter
|
||||||
private IWorth worth;
|
private transient IWorth worth;
|
||||||
@Getter
|
@Getter
|
||||||
private IBackup backup;
|
private transient IBackup backup;
|
||||||
@Getter
|
@Getter
|
||||||
private IItemDb itemDb;
|
private transient IItemDb itemDb;
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
private IRanks ranks;
|
private transient IRanks ranks;
|
||||||
@Getter
|
@Getter
|
||||||
private SpawnsHolder spawns;
|
private transient SpawnsHolder spawns;
|
||||||
@Getter
|
@Getter
|
||||||
private final Methods paymentMethod = new Methods();
|
private transient final Methods paymentMethod = new Methods();
|
||||||
@Getter
|
@Getter
|
||||||
private IUserMap userMap;
|
private transient IUserMap userMap;
|
||||||
@Getter
|
@Getter
|
||||||
private final I18n i18n;
|
private final I18n i18n;
|
||||||
@Getter
|
@Getter
|
||||||
private ICommandHandler commandHandler;
|
private transient ICommandHandler commandHandler;
|
||||||
@Getter
|
@Getter
|
||||||
private Economy economy;
|
private transient Economy economy;
|
||||||
@Getter
|
@Getter
|
||||||
private final Server server;
|
private final Server server;
|
||||||
@Getter
|
@Getter
|
||||||
@@ -85,16 +85,16 @@ public class Essentials implements IEssentials
|
|||||||
private final IPlugin plugin;
|
private final IPlugin plugin;
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
private Metrics metrics;
|
private transient Metrics metrics;
|
||||||
@Getter
|
@Getter
|
||||||
private EssentialsTimer timer;
|
private transient EssentialsTimer timer;
|
||||||
@Getter
|
@Getter
|
||||||
private List<String> vanishedPlayers = new ArrayList<String>();
|
private transient List<String> vanishedPlayers = new ArrayList<String>();
|
||||||
@Getter
|
@Getter
|
||||||
private final StorageQueue storageQueue;
|
private final transient StorageQueue storageQueue;
|
||||||
private ExecuteTimer execTimer;
|
private transient ExecuteTimer execTimer;
|
||||||
public static boolean testing;
|
public static boolean testing;
|
||||||
private List<IReload> reloadList;
|
private transient List<IReload> reloadList;
|
||||||
|
|
||||||
public Essentials(final Server server, final Logger logger, final IPlugin plugin)
|
public Essentials(final Server server, final Logger logger, final IPlugin plugin)
|
||||||
{
|
{
|
||||||
|
@@ -12,10 +12,10 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
public class EssentialsTimer implements Runnable
|
public class EssentialsTimer implements Runnable
|
||||||
{
|
{
|
||||||
private final IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
private final Set<IUser> onlineUsers = new HashSet<IUser>();
|
private final transient Set<IUser> onlineUsers = new HashSet<IUser>();
|
||||||
private long lastPoll = System.currentTimeMillis();
|
private transient long lastPoll = System.currentTimeMillis();
|
||||||
private final LinkedList<Float> history = new LinkedList<Float>();
|
private final transient LinkedList<Float> history = new LinkedList<Float>();
|
||||||
|
|
||||||
EssentialsTimer(final IEssentials ess)
|
EssentialsTimer(final IEssentials ess)
|
||||||
{
|
{
|
||||||
|
@@ -19,13 +19,13 @@ public class I18n implements II18n
|
|||||||
{
|
{
|
||||||
private static I18n instance;
|
private static I18n instance;
|
||||||
private static final String MESSAGES = "messages";
|
private static final String MESSAGES = "messages";
|
||||||
private final Locale defaultLocale = Locale.getDefault();
|
private final transient Locale defaultLocale = Locale.getDefault();
|
||||||
private Locale currentLocale = defaultLocale;
|
private transient Locale currentLocale = defaultLocale;
|
||||||
private ResourceBundle customBundle;
|
private transient ResourceBundle customBundle;
|
||||||
private ResourceBundle localeBundle;
|
private transient ResourceBundle localeBundle;
|
||||||
private final ResourceBundle defaultBundle;
|
private final transient ResourceBundle defaultBundle;
|
||||||
private final Map<String, MessageFormat> messageFormatCache = new HashMap<String, MessageFormat>();
|
private final transient Map<String, MessageFormat> messageFormatCache = new HashMap<String, MessageFormat>();
|
||||||
private final IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
|
|
||||||
public I18n(final IEssentials ess)
|
public I18n(final IEssentials ess)
|
||||||
{
|
{
|
||||||
@@ -100,6 +100,7 @@ public class I18n implements II18n
|
|||||||
}
|
}
|
||||||
return messageFormat.format(objects);
|
return messageFormat.format(objects);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Pattern partSplit = Pattern.compile("[_\\.]");
|
private final Pattern partSplit = Pattern.compile("[_\\.]");
|
||||||
|
|
||||||
public void updateLocale(final String loc)
|
public void updateLocale(final String loc)
|
||||||
@@ -135,7 +136,7 @@ public class I18n implements II18n
|
|||||||
|
|
||||||
private static class FileResClassLoader extends ClassLoader
|
private static class FileResClassLoader extends ClassLoader
|
||||||
{
|
{
|
||||||
private final File dataFolder;
|
private final transient File dataFolder;
|
||||||
|
|
||||||
public FileResClassLoader(final ClassLoader classLoader, final IEssentials ess)
|
public FileResClassLoader(final ClassLoader classLoader, final IEssentials ess)
|
||||||
{
|
{
|
||||||
|
@@ -19,15 +19,16 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
public class ItemDb implements IItemDb
|
public class ItemDb implements IItemDb
|
||||||
{
|
{
|
||||||
private final IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
|
|
||||||
public ItemDb(final IEssentials ess)
|
public ItemDb(final IEssentials ess)
|
||||||
{
|
{
|
||||||
this.ess = ess;
|
this.ess = ess;
|
||||||
file = new ManagedFile("items.csv", ess);
|
file = new ManagedFile("items.csv", ess);
|
||||||
}
|
}
|
||||||
private final Map<String, Long> items = new HashMap<String, Long>();
|
|
||||||
private final ManagedFile file;
|
private final transient Map<String, Long> items = new HashMap<String, Long>();
|
||||||
|
private final transient ManagedFile file;
|
||||||
private static final Pattern SPLIT = Pattern.compile("[^a-zA-Z0-9]");
|
private static final Pattern SPLIT = Pattern.compile("[^a-zA-Z0-9]");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -94,6 +95,7 @@ public class ItemDb implements IItemDb
|
|||||||
retval.setAmount(quantity);
|
retval.setAmount(quantity);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Pattern idMatch = Pattern.compile("^\\d+[:+',;.]\\d+$");
|
private final Pattern idMatch = Pattern.compile("^\\d+[:+',;.]\\d+$");
|
||||||
private final Pattern metaSplit = Pattern.compile("[:+',;.]");
|
private final Pattern metaSplit = Pattern.compile("[:+',;.]");
|
||||||
private final Pattern conjoined = Pattern.compile("^[^:+',;.]+[:+',;.]\\d+$");
|
private final Pattern conjoined = Pattern.compile("^[^:+',;.]+[:+',;.]\\d+$");
|
||||||
|
@@ -30,7 +30,7 @@ import org.bukkit.plugin.PluginManager;
|
|||||||
|
|
||||||
public class Jails extends AsyncStorageObjectHolder<net.ess3.settings.Jails> implements IJails
|
public class Jails extends AsyncStorageObjectHolder<net.ess3.settings.Jails> implements IJails
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = Bukkit.getLogger();
|
private static final transient Logger LOGGER = Bukkit.getLogger();
|
||||||
|
|
||||||
public Jails(final IEssentials ess)
|
public Jails(final IEssentials ess)
|
||||||
{
|
{
|
||||||
@@ -110,9 +110,9 @@ public class Jails extends AsyncStorageObjectHolder<net.ess3.settings.Jails> imp
|
|||||||
throw new UnsupportedOperationException("Not supported yet.");
|
throw new UnsupportedOperationException("Not supported yet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private class JailBlockListener implements Listener
|
private class JailBlockListener implements Listener
|
||||||
{
|
{
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||||
public void onBlockBreak(final BlockBreakEvent event)
|
public void onBlockBreak(final BlockBreakEvent event)
|
||||||
{
|
{
|
||||||
|
@@ -25,8 +25,8 @@ import org.bukkit.material.Colorable;
|
|||||||
|
|
||||||
public class SpawnMob
|
public class SpawnMob
|
||||||
{
|
{
|
||||||
private static Pattern colon = Pattern.compile(":");
|
private static transient Pattern colon = Pattern.compile(":");
|
||||||
private static Pattern comma = Pattern.compile(",");
|
private static transient Pattern comma = Pattern.compile(",");
|
||||||
|
|
||||||
public static String mobList(final IUser user) throws NotEnoughArgumentsException
|
public static String mobList(final IUser user) throws NotEnoughArgumentsException
|
||||||
{
|
{
|
||||||
|
@@ -21,6 +21,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
|||||||
public class Teleport implements Runnable, ITeleport
|
public class Teleport implements Runnable, ITeleport
|
||||||
{
|
{
|
||||||
private static final double MOVE_CONSTANT = 0.3;
|
private static final double MOVE_CONSTANT = 0.3;
|
||||||
|
|
||||||
private IUser user;
|
private IUser user;
|
||||||
private IUser teleportUser;
|
private IUser teleportUser;
|
||||||
private int teleTimer = -1;
|
private int teleTimer = -1;
|
||||||
@@ -122,6 +123,7 @@ public class Teleport implements Runnable, ITeleport
|
|||||||
this.ess = ess;
|
this.ess = ess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void cooldown(boolean check) throws Exception
|
public void cooldown(boolean check) throws Exception
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -231,6 +233,7 @@ public class Teleport implements Runnable, ITeleport
|
|||||||
now(new Target(loc), cause);
|
now(new Target(loc), cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
//The now function is used when you want to skip tp delay when teleporting someone to a location or player.
|
//The now function is used when you want to skip tp delay when teleporting someone to a location or player.
|
||||||
public void now(Entity entity, boolean cooldown, TeleportCause cause) throws Exception
|
public void now(Entity entity, boolean cooldown, TeleportCause cause) throws Exception
|
||||||
|
@@ -4,13 +4,15 @@ import net.ess3.utils.FormatUtil;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instead of using this api directly, we recommend to use the register plugin: http://bit.ly/RegisterMethod
|
* Instead of using this api directly, we recommend to use the register plugin:
|
||||||
|
* http://bit.ly/RegisterMethod
|
||||||
*/
|
*/
|
||||||
public final class Economy
|
public final class Economy
|
||||||
{
|
{
|
||||||
private Economy()
|
private Economy()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IEssentials ess;
|
private static IEssentials ess;
|
||||||
private static final String noCallBeforeLoad = "Essentials API is called before Essentials is loaded.";
|
private static final String noCallBeforeLoad = "Essentials API is called before Essentials is loaded.";
|
||||||
|
|
||||||
@@ -165,7 +167,8 @@ public final class Economy
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Formats the amount of money like all other Essentials functions. Example: $100000 or $12345.67
|
* Formats the amount of money like all other Essentials functions.
|
||||||
|
* Example: $100000 or $12345.67
|
||||||
*
|
*
|
||||||
* @param amount The amount of money
|
* @param amount The amount of money
|
||||||
* @return Formatted money
|
* @return Formatted money
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package net.ess3.api;
|
package net.ess3.api;
|
||||||
|
|
||||||
|
|
||||||
public interface IComponent extends IReload
|
public interface IComponent extends IReload
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@@ -66,4 +66,5 @@ public interface IEssentials extends IComponent
|
|||||||
SpawnsHolder getSpawns();
|
SpawnsHolder getSpawns();
|
||||||
|
|
||||||
StorageQueue getStorageQueue();
|
StorageQueue getStorageQueue();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,7 @@ import org.bukkit.scheduler.BukkitTask;
|
|||||||
|
|
||||||
public interface IPlugin extends Plugin
|
public interface IPlugin extends Plugin
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an instance of essentials
|
* Get an instance of essentials
|
||||||
*
|
*
|
||||||
@@ -136,4 +137,5 @@ public interface IPlugin extends Plugin
|
|||||||
* @param module - Your plugin instance
|
* @param module - Your plugin instance
|
||||||
*/
|
*/
|
||||||
void registerModule(Plugin module);
|
void registerModule(Plugin module);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -15,11 +15,11 @@ import org.bukkit.command.CommandSender;
|
|||||||
|
|
||||||
public class Backup implements Runnable, IBackup
|
public class Backup implements Runnable, IBackup
|
||||||
{
|
{
|
||||||
private final Server server;
|
private transient final Server server;
|
||||||
private final IEssentials ess;
|
private transient final IEssentials ess;
|
||||||
private final AtomicBoolean running = new AtomicBoolean(false);
|
private transient final AtomicBoolean running = new AtomicBoolean(false);
|
||||||
private int taskId = -1;
|
private transient int taskId = -1;
|
||||||
private final AtomicBoolean active = new AtomicBoolean(false);
|
private transient final AtomicBoolean active = new AtomicBoolean(false);
|
||||||
|
|
||||||
public Backup(final IEssentials ess)
|
public Backup(final IEssentials ess)
|
||||||
{
|
{
|
||||||
@@ -82,7 +82,7 @@ public class Backup implements Runnable, IBackup
|
|||||||
|
|
||||||
private class BackupRunner implements Runnable
|
private class BackupRunner implements Runnable
|
||||||
{
|
{
|
||||||
private final String command;
|
private final transient String command;
|
||||||
|
|
||||||
public BackupRunner(final String command)
|
public BackupRunner(final String command)
|
||||||
{
|
{
|
||||||
|
@@ -11,9 +11,11 @@ import org.bukkit.enchantments.Enchantment;
|
|||||||
|
|
||||||
public final class Enchantments
|
public final class Enchantments
|
||||||
{
|
{
|
||||||
|
|
||||||
private Enchantments()
|
private Enchantments()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Map<String, Enchantment> ENCHANTMENTS = new HashMap<String, Enchantment>();
|
private static final Map<String, Enchantment> ENCHANTMENTS = new HashMap<String, Enchantment>();
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@@ -8,6 +8,7 @@ import org.bukkit.entity.EntityType;
|
|||||||
public class LivingEntities
|
public class LivingEntities
|
||||||
{
|
{
|
||||||
final private static Map<String, EntityType> entities = new HashMap<String, EntityType>();
|
final private static Map<String, EntityType> entities = new HashMap<String, EntityType>();
|
||||||
|
|
||||||
final private static EnumMap<EntityType, String> entityI18n = new EnumMap<EntityType, String>(EntityType.class);
|
final private static EnumMap<EntityType, String> entityI18n = new EnumMap<EntityType, String>(EntityType.class);
|
||||||
final private static EnumMap<EntityType, String> entityI18nPlural = new EnumMap<EntityType, String>(EntityType.class);
|
final private static EnumMap<EntityType, String> entityI18nPlural = new EnumMap<EntityType, String>(EntityType.class);
|
||||||
|
|
||||||
@@ -40,9 +41,9 @@ public class LivingEntities
|
|||||||
return count == 1 ? _(entityI18n.get(type)) : _(entityI18nPlural.get(type));
|
return count == 1 ? _(entityI18n.get(type)) : _(entityI18nPlural.get(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static class MobException extends Exception
|
public static class MobException extends Exception
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -109,7 +109,7 @@ public class Commandbalancetop extends EssentialsCommand
|
|||||||
|
|
||||||
private class Calculator implements Runnable
|
private class Calculator implements Runnable
|
||||||
{
|
{
|
||||||
private final Viewer viewer;
|
private final transient Viewer viewer;
|
||||||
private final boolean force;
|
private final boolean force;
|
||||||
|
|
||||||
public Calculator(final Viewer viewer, final boolean force)
|
public Calculator(final Viewer viewer, final boolean force)
|
||||||
@@ -176,9 +176,9 @@ public class Commandbalancetop extends EssentialsCommand
|
|||||||
|
|
||||||
private class Viewer implements Runnable
|
private class Viewer implements Runnable
|
||||||
{
|
{
|
||||||
private final CommandSender sender;
|
private final transient CommandSender sender;
|
||||||
private final int page;
|
private final transient int page;
|
||||||
private final boolean force;
|
private final transient boolean force;
|
||||||
|
|
||||||
public Viewer(final CommandSender sender, final int page, final boolean force)
|
public Viewer(final CommandSender sender, final int page, final boolean force)
|
||||||
{
|
{
|
||||||
|
@@ -10,11 +10,11 @@ import org.bukkit.TreeType;
|
|||||||
|
|
||||||
public class Commandbigtree extends EssentialsCommand
|
public class Commandbigtree extends EssentialsCommand
|
||||||
{
|
{
|
||||||
private static enum BigTree
|
private static enum BigTree {
|
||||||
{
|
|
||||||
REDWOOD(TreeType.TALL_REDWOOD),
|
REDWOOD(TreeType.TALL_REDWOOD),
|
||||||
TREE(TreeType.BIG_TREE),
|
TREE(TreeType.BIG_TREE),
|
||||||
JUNGLE(TreeType.JUNGLE);
|
JUNGLE(TreeType.JUNGLE);
|
||||||
|
|
||||||
private final TreeType bukkitType;
|
private final TreeType bukkitType;
|
||||||
|
|
||||||
private BigTree(final TreeType bukkitType)
|
private BigTree(final TreeType bukkitType)
|
||||||
@@ -27,6 +27,7 @@ public class Commandbigtree extends EssentialsCommand
|
|||||||
return bukkitType;
|
return bukkitType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final static EnumConverter<BigTree> BIGTREE_PARSER = EnumConverter.getInstance(BigTree.class);
|
private final static EnumConverter<BigTree> BIGTREE_PARSER = EnumConverter.getInstance(BigTree.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -10,7 +10,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
|
|
||||||
public class Commanddelhome extends EssentialsCommand
|
public class Commanddelhome extends EssentialsCommand
|
||||||
{
|
{
|
||||||
private final Pattern colon = Pattern.compile(":");
|
private final transient Pattern colon = Pattern.compile(":");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||||
|
@@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
public class Commandenderchest extends EssentialsCommand
|
public class Commandenderchest extends EssentialsCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void run(final IUser user, final String commandLabel, final String[] args) throws Exception
|
protected void run(final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||||
{
|
{
|
||||||
|
@@ -7,7 +7,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
|
|
||||||
public class Commandessentials extends EssentialsCommand
|
public class Commandessentials extends EssentialsCommand
|
||||||
{
|
{
|
||||||
private int taskid; // TODO: Needed?
|
private transient int taskid; // TODO: Needed?
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||||
|
@@ -13,31 +13,31 @@ public class Commandfireball extends EssentialsCommand
|
|||||||
Class<? extends Entity> clazz = Fireball.class;
|
Class<? extends Entity> clazz = Fireball.class;
|
||||||
if (args.length > 0)
|
if (args.length > 0)
|
||||||
{
|
{
|
||||||
if (args[0].equalsIgnoreCase("small"))
|
if(args[0].equalsIgnoreCase("small"))
|
||||||
{
|
{
|
||||||
clazz = SmallFireball.class;
|
clazz = SmallFireball.class;
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("arrow"))
|
else if(args[0].equalsIgnoreCase("arrow"))
|
||||||
{
|
{
|
||||||
clazz = Arrow.class;
|
clazz = Arrow.class;
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("skull"))
|
else if(args[0].equalsIgnoreCase("skull"))
|
||||||
{
|
{
|
||||||
clazz = WitherSkull.class;
|
clazz = WitherSkull.class;
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("egg"))
|
else if(args[0].equalsIgnoreCase("egg"))
|
||||||
{
|
{
|
||||||
clazz = Egg.class;
|
clazz = Egg.class;
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("snowball"))
|
else if(args[0].equalsIgnoreCase("snowball"))
|
||||||
{
|
{
|
||||||
clazz = Snowball.class;
|
clazz = Snowball.class;
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("expbottle"))
|
else if(args[0].equalsIgnoreCase("expbottle"))
|
||||||
{
|
{
|
||||||
clazz = ThrownExpBottle.class;
|
clazz = ThrownExpBottle.class;
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("large"))
|
else if(args[0].equalsIgnoreCase("large"))
|
||||||
{
|
{
|
||||||
clazz = LargeFireball.class;
|
clazz = LargeFireball.class;
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
|
|
||||||
public class Commandgamemode extends EssentialsSettingsCommand
|
public class Commandgamemode extends EssentialsSettingsCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
protected void setValue(final IUser player, GameMode value)
|
protected void setValue(final IUser player, GameMode value)
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null)
|
||||||
@@ -123,4 +124,5 @@ public class Commandgamemode extends EssentialsSettingsCommand
|
|||||||
}
|
}
|
||||||
return mode;
|
return mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
public class Commandgive extends EssentialsCommand
|
public class Commandgive extends EssentialsCommand
|
||||||
{
|
{
|
||||||
private final Pattern data = Pattern.compile("[:+',;.]");
|
private final transient Pattern data = Pattern.compile("[:+',;.]");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||||
|
@@ -15,7 +15,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
|||||||
|
|
||||||
public class Commandhome extends EssentialsCommand
|
public class Commandhome extends EssentialsCommand
|
||||||
{
|
{
|
||||||
private final Pattern colon = Pattern.compile(":");
|
private final transient Pattern colon = Pattern.compile(":");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(final IUser user, final String commandLabel, final String[] args) throws Exception
|
public void run(final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||||
|
@@ -11,7 +11,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
public class Commanditem extends EssentialsCommand
|
public class Commanditem extends EssentialsCommand
|
||||||
{
|
{
|
||||||
private final Pattern data = Pattern.compile("[:+',;.]");
|
private final transient Pattern data = Pattern.compile("[:+',;.]");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(final IUser user, final String commandLabel, final String[] args) throws Exception
|
public void run(final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||||
|
@@ -24,8 +24,7 @@ public class Commandmore extends EssentialsCommand
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stacks = new ItemStack[]
|
stacks = new ItemStack[]{
|
||||||
{
|
|
||||||
player.getItemInHand()
|
player.getItemInHand()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -14,6 +14,7 @@ import org.bukkit.inventory.*;
|
|||||||
|
|
||||||
public class Commandrecipe extends EssentialsCommand
|
public class Commandrecipe extends EssentialsCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
public void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||||
{
|
{
|
||||||
@@ -88,7 +89,7 @@ public class Commandrecipe extends EssentialsCommand
|
|||||||
for (int k = 0; k < recipe.getShape()[j].length(); k++)
|
for (int k = 0; k < recipe.getShape()[j].length(); k++)
|
||||||
{
|
{
|
||||||
final ItemStack item = recipe.getIngredientMap().get(recipe.getShape()[j].toCharArray()[k]);
|
final ItemStack item = recipe.getIngredientMap().get(recipe.getShape()[j].toCharArray()[k]);
|
||||||
if (item == null)
|
if(item == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -34,17 +34,17 @@ public class Commandseen extends EssentialsCommand
|
|||||||
final IUser u = ess.getUserMap().matchUserExcludingHidden(args[0], getPlayerOrNull(sender));
|
final IUser u = ess.getUserMap().matchUserExcludingHidden(args[0], getPlayerOrNull(sender));
|
||||||
u.setDisplayNick();
|
u.setDisplayNick();
|
||||||
sender.sendMessage(_("seenOnline", u.getPlayer().getDisplayName(), DateUtil.formatDateDiff(u.getTimestamp(TimestampType.LOGIN))));
|
sender.sendMessage(_("seenOnline", u.getPlayer().getDisplayName(), DateUtil.formatDateDiff(u.getTimestamp(TimestampType.LOGIN))));
|
||||||
if (u.getData().isAfk())
|
if(u.getData().isAfk())
|
||||||
{
|
{
|
||||||
sender.sendMessage(_("whoisAFK", _("true")));
|
sender.sendMessage(_("whoisAFK", _("true")));
|
||||||
}
|
}
|
||||||
if (u.getData().isJailed())
|
if(u.getData().isJailed())
|
||||||
{
|
{
|
||||||
sender.sendMessage(_("whoisJail", u.getTimestamp(TimestampType.JAIL) > 0
|
sender.sendMessage(_("whoisJail", u.getTimestamp(TimestampType.JAIL) > 0
|
||||||
? DateUtil.formatDateDiff(u.getTimestamp(TimestampType.JAIL))
|
? DateUtil.formatDateDiff(u.getTimestamp(TimestampType.JAIL))
|
||||||
: _("true")));
|
: _("true")));
|
||||||
}
|
}
|
||||||
if (u.getData().isMuted())
|
if(u.getData().isMuted())
|
||||||
{
|
{
|
||||||
sender.sendMessage(_("whoisMuted", u.getTimestamp(TimestampType.MUTE) > 0
|
sender.sendMessage(_("whoisMuted", u.getTimestamp(TimestampType.MUTE) > 0
|
||||||
? DateUtil.formatDateDiff(u.getTimestamp(TimestampType.MUTE))
|
? DateUtil.formatDateDiff(u.getTimestamp(TimestampType.MUTE))
|
||||||
|
@@ -9,7 +9,7 @@ import net.ess3.permissions.Permissions;
|
|||||||
|
|
||||||
public class Commandsethome extends EssentialsCommand
|
public class Commandsethome extends EssentialsCommand
|
||||||
{
|
{
|
||||||
private final Pattern colon = Pattern.compile(":");
|
private final transient Pattern colon = Pattern.compile(":");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(final IUser user, final String commandLabel, String[] args) throws Exception
|
public void run(final IUser user, final String commandLabel, String[] args) throws Exception
|
||||||
|
@@ -36,6 +36,7 @@ public class Commandsetwarp extends EssentialsCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (warpLoc == null || Permissions.WARP_OVERWRITE.isAuthorized(user, args[0]))
|
if (warpLoc == null || Permissions.WARP_OVERWRITE.isAuthorized(user, args[0]))
|
||||||
|
|
||||||
{
|
{
|
||||||
warps.setWarp(args[0], loc);
|
warps.setWarp(args[0], loc);
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
|
|
||||||
public class Commandsocialspy extends EssentialsToggleCommand
|
public class Commandsocialspy extends EssentialsToggleCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setValue(final IUser player, final boolean value)
|
protected void setValue(final IUser player, final boolean value)
|
||||||
{
|
{
|
||||||
|
@@ -46,7 +46,7 @@ public class Commandspawner extends EssentialsCommand
|
|||||||
throw new Exception(_("unableToSpawnMob"));
|
throw new Exception(_("unableToSpawnMob"));
|
||||||
}
|
}
|
||||||
int delay = 0;
|
int delay = 0;
|
||||||
if (args.length > 1 && Util.isInt(args[1]))
|
if(args.length > 1 && Util.isInt(args[1]))
|
||||||
{
|
{
|
||||||
delay = Integer.parseInt(args[1]);
|
delay = Integer.parseInt(args[1]);
|
||||||
}
|
}
|
||||||
|
@@ -7,6 +7,7 @@ import net.ess3.api.IUser;
|
|||||||
|
|
||||||
public class Commandspawnmob extends EssentialsCommand
|
public class Commandspawnmob extends EssentialsCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(final IUser user, final String commandLabel, final String[] args) throws Exception
|
public void run(final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||||
{
|
{
|
||||||
|
@@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
public class Commandspeed extends EssentialsCommand
|
public class Commandspeed extends EssentialsCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||||
{
|
{
|
||||||
|
@@ -8,6 +8,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
|
|
||||||
public class Commandtptoggle extends EssentialsToggleCommand
|
public class Commandtptoggle extends EssentialsToggleCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setValue(final IUser player, final boolean value)
|
protected void setValue(final IUser player, final boolean value)
|
||||||
{
|
{
|
||||||
|
@@ -16,12 +16,12 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
public abstract class EssentialsCommand extends AbstractSuperpermsPermission implements IEssentialsCommand
|
public abstract class EssentialsCommand extends AbstractSuperpermsPermission implements IEssentialsCommand
|
||||||
{
|
{
|
||||||
protected String commandName;
|
protected transient String commandName;
|
||||||
protected IEssentials ess;
|
protected transient IEssentials ess;
|
||||||
protected IEssentialsModule module;
|
protected transient IEssentialsModule module;
|
||||||
protected Server server;
|
protected transient Server server;
|
||||||
protected Logger logger;
|
protected transient Logger logger;
|
||||||
private String permission;
|
private transient String permission;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(final IEssentials ess, final String commandName)
|
public void init(final IEssentials ess, final String commandName)
|
||||||
|
@@ -14,15 +14,15 @@ import org.bukkit.plugin.Plugin;
|
|||||||
|
|
||||||
public class EssentialsCommandHandler implements ICommandHandler, TabExecutor
|
public class EssentialsCommandHandler implements ICommandHandler, TabExecutor
|
||||||
{
|
{
|
||||||
private final ClassLoader classLoader;
|
private final transient ClassLoader classLoader;
|
||||||
private final String commandPath;
|
private final transient String commandPath;
|
||||||
private final String permissionPrefix; // TODO: Needed?
|
private final transient String permissionPrefix;// TODO: Needed?
|
||||||
private final IEssentialsModule module;
|
private final transient IEssentialsModule module;
|
||||||
private static final Logger LOGGER = Bukkit.getLogger();
|
private static final transient Logger LOGGER = Bukkit.getLogger();
|
||||||
private final Map<String, List<PluginCommand>> altcommands = new HashMap<String, List<PluginCommand>>();
|
private final transient Map<String, List<PluginCommand>> altcommands = new HashMap<String, List<PluginCommand>>();
|
||||||
private final Map<String, String> disabledList = new HashMap<String, String>();
|
private final transient Map<String, String> disabledList = new HashMap<String, String>();
|
||||||
private final Map<String, IEssentialsCommand> commands = new HashMap<String, IEssentialsCommand>();
|
private final transient Map<String, IEssentialsCommand> commands = new HashMap<String, IEssentialsCommand>();
|
||||||
private final IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
|
|
||||||
public EssentialsCommandHandler(ClassLoader classLoader, String commandPath, String permissionPrefix, IEssentials ess)
|
public EssentialsCommandHandler(ClassLoader classLoader, String commandPath, String permissionPrefix, IEssentials ess)
|
||||||
{
|
{
|
||||||
|
@@ -8,6 +8,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
|
|
||||||
public abstract class EssentialsSettingsCommand extends EssentialsCommand
|
public abstract class EssentialsSettingsCommand extends EssentialsCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
abstract protected void informSender(final CommandSender sender, final boolean value, final IUser player);
|
abstract protected void informSender(final CommandSender sender, final boolean value, final IUser player);
|
||||||
|
|
||||||
abstract protected void informPlayer(final IUser player);
|
abstract protected void informPlayer(final IUser player);
|
||||||
@@ -81,4 +82,5 @@ public abstract class EssentialsSettingsCommand extends EssentialsCommand
|
|||||||
informSender(sender, true, matchPlayer);
|
informSender(sender, true, matchPlayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -5,6 +5,7 @@ import net.ess3.api.IUser;
|
|||||||
|
|
||||||
public abstract class EssentialsToggleCommand extends EssentialsSettingsCommand
|
public abstract class EssentialsToggleCommand extends EssentialsSettingsCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
abstract protected void setValue(final IUser player, final boolean value);
|
abstract protected void setValue(final IUser player, final boolean value);
|
||||||
|
|
||||||
abstract protected boolean getValue(final IUser player);
|
abstract protected boolean getValue(final IUser player);
|
||||||
|
@@ -17,3 +17,5 @@ public class WarpNotFoundException extends Exception
|
|||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -11,6 +11,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
* TODO: make sure this is up-to date
|
* TODO: make sure this is up-to date
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
public final class InventoryWorkaround
|
public final class InventoryWorkaround
|
||||||
{
|
{
|
||||||
private InventoryWorkaround()
|
private InventoryWorkaround()
|
||||||
@@ -27,7 +28,7 @@ public final class InventoryWorkaround
|
|||||||
for (int i = 0; i < stacks.length; i++)
|
for (int i = 0; i < stacks.length; i++)
|
||||||
{
|
{
|
||||||
final ItemStack cItem = stacks[i];
|
final ItemStack cItem = stacks[i];
|
||||||
if (cItem != null && cItem.getAmount() < maxAmount && cItem.isSimilar(item))
|
if(cItem != null && cItem.getAmount() < maxAmount && cItem.isSimilar(item))
|
||||||
{
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@@ -35,4 +35,6 @@ public class Money implements StorageObject
|
|||||||
balanceMap.remove(name);
|
balanceMap.remove(name);
|
||||||
balances = balanceMap;
|
balances = balanceMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -22,12 +22,12 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
public class Trade
|
public class Trade
|
||||||
{
|
{
|
||||||
private final String command;
|
private final transient String command;
|
||||||
private final String fallbackCommand;
|
private final transient String fallbackCommand;
|
||||||
private final Double money;
|
private final transient Double money;
|
||||||
private final ItemStack itemStack;
|
private final transient ItemStack itemStack;
|
||||||
private final Integer exp;
|
private final transient Integer exp;
|
||||||
private final IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
|
|
||||||
public Trade(final String command, final IEssentials ess)
|
public Trade(final String command, final IEssentials ess)
|
||||||
{
|
{
|
||||||
@@ -211,6 +211,7 @@ public class Trade
|
|||||||
}
|
}
|
||||||
return cost;
|
return cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static FileWriter fw = null;
|
private static FileWriter fw = null;
|
||||||
|
|
||||||
public static void log(String type, String subtype, String event, String sender, Trade charge, String receiver, Trade pay, Location loc, IEssentials ess)
|
public static void log(String type, String subtype, String event, String sender, Trade charge, String receiver, Trade pay, Location loc, IEssentials ess)
|
||||||
|
@@ -26,6 +26,7 @@ public class Worth implements StorageObject
|
|||||||
{
|
{
|
||||||
return sell == null ? Collections.<MaterialData, Double>emptyMap() : Collections.unmodifiableMap(sell);
|
return sell == null ? Collections.<MaterialData, Double>emptyMap() : Collections.unmodifiableMap(sell);
|
||||||
}
|
}
|
||||||
|
|
||||||
@MapKeyType(MaterialData.class)
|
@MapKeyType(MaterialData.class)
|
||||||
@MapValueType(Double.class)
|
@MapValueType(Double.class)
|
||||||
@Getter(AccessLevel.NONE)
|
@Getter(AccessLevel.NONE)
|
||||||
@@ -36,6 +37,7 @@ public class Worth implements StorageObject
|
|||||||
{
|
{
|
||||||
return buy == null ? Collections.<MaterialData, Double>emptyMap() : Collections.unmodifiableMap(buy);
|
return buy == null ? Collections.<MaterialData, Double>emptyMap() : Collections.unmodifiableMap(buy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@MapKeyType(EnchantmentLevel.class)
|
@MapKeyType(EnchantmentLevel.class)
|
||||||
@MapValueType(Double.class)
|
@MapValueType(Double.class)
|
||||||
@Getter(AccessLevel.NONE)
|
@Getter(AccessLevel.NONE)
|
||||||
|
@@ -6,8 +6,7 @@ import org.bukkit.plugin.Plugin;
|
|||||||
/**
|
/**
|
||||||
* Interface to be implemented by a payment method.
|
* Interface to be implemented by a payment method.
|
||||||
*
|
*
|
||||||
* @author Nijikokun <nijikokun@shortmail.com> (
|
* @author Nijikokun <nijikokun@shortmail.com> (@nijikokun)
|
||||||
* @nijikokun)
|
|
||||||
* @copyright Copyright (C) 2011
|
* @copyright Copyright (C) 2011
|
||||||
* @license AOL license <http://aol.nexua.org>
|
* @license AOL license <http://aol.nexua.org>
|
||||||
*/
|
*/
|
||||||
@@ -17,8 +16,7 @@ public interface Method
|
|||||||
* Encodes the Plugin into an Object disguised as the Plugin. If you want the original Plugin Class you must cast it
|
* Encodes the Plugin into an Object disguised as the Plugin. If you want the original Plugin Class you must cast it
|
||||||
* to the correct Plugin, to do so you have to verify the name and or version then cast.
|
* to the correct Plugin, to do so you have to verify the name and or version then cast.
|
||||||
* <p/>
|
* <p/>
|
||||||
* <
|
* <pre>
|
||||||
* pre>
|
|
||||||
* if(method.getName().equalsIgnoreCase("iConomy"))
|
* if(method.getName().equalsIgnoreCase("iConomy"))
|
||||||
* iConomy plugin = ((iConomy)method.getPlugin());</pre>
|
* iConomy plugin = ((iConomy)method.getPlugin());</pre>
|
||||||
*
|
*
|
||||||
@@ -50,7 +48,8 @@ public interface Method
|
|||||||
public String getVersion();
|
public String getVersion();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the amount of decimal places that get stored NOTE: it will return -1 if there is no rounding
|
* Returns the amount of decimal places that get stored
|
||||||
|
* NOTE: it will return -1 if there is no rounding
|
||||||
*
|
*
|
||||||
* @return <code>int</code> for each decimal place
|
* @return <code>int</code> for each decimal place
|
||||||
*/
|
*/
|
||||||
@@ -89,9 +88,7 @@ public interface Method
|
|||||||
public boolean hasAccount(String name);
|
public boolean hasAccount(String name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check to see if an account
|
* Check to see if an account <code>name</code> is tied to a <code>bank</code>.
|
||||||
* <code>name</code> is tied to a
|
|
||||||
* <code>bank</code>.
|
|
||||||
*
|
*
|
||||||
* @param bank Bank name
|
* @param bank Bank name
|
||||||
* @param name Account name
|
* @param name Account name
|
||||||
@@ -117,9 +114,7 @@ public interface Method
|
|||||||
public boolean createAccount(String name, Double balance);
|
public boolean createAccount(String name, Double balance);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a
|
* Returns a <code>MethodAccount</code> class for an account <code>name</code>.
|
||||||
* <code>MethodAccount</code> class for an account
|
|
||||||
* <code>name</code>.
|
|
||||||
*
|
*
|
||||||
* @param name Account name
|
* @param name Account name
|
||||||
* @return <code>MethodAccount</code> <em>or</em> <code>Null</code>
|
* @return <code>MethodAccount</code> <em>or</em> <code>Null</code>
|
||||||
@@ -127,9 +122,7 @@ public interface Method
|
|||||||
public MethodAccount getAccount(String name);
|
public MethodAccount getAccount(String name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a
|
* Returns a <code>MethodBankAccount</code> class for an account <code>name</code>.
|
||||||
* <code>MethodBankAccount</code> class for an account
|
|
||||||
* <code>name</code>.
|
|
||||||
*
|
*
|
||||||
* @param bank Bank name
|
* @param bank Bank name
|
||||||
* @param name Account name
|
* @param name Account name
|
||||||
@@ -138,7 +131,8 @@ public interface Method
|
|||||||
public MethodBankAccount getBankAccount(String bank, String name);
|
public MethodBankAccount getBankAccount(String bank, String name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks to verify the compatibility between this Method and a plugin. Internal usage only, for the most part.
|
* Checks to verify the compatibility between this Method and a plugin.
|
||||||
|
* Internal usage only, for the most part.
|
||||||
*
|
*
|
||||||
* @param plugin Plugin
|
* @param plugin Plugin
|
||||||
* @return <code>boolean</code>
|
* @return <code>boolean</code>
|
||||||
|
@@ -22,10 +22,8 @@ import org.bukkit.plugin.PluginManager;
|
|||||||
* preferred: "iConomy"
|
* preferred: "iConomy"
|
||||||
* </pre></blockquote>
|
* </pre></blockquote>
|
||||||
*
|
*
|
||||||
* @author: Nijikokun <nijikokun@shortmail.com> (
|
* @author: Nijikokun <nijikokun@shortmail.com> (@nijikokun) @copyright: Copyright (C) 2011 @license: AOL license
|
||||||
* @nijikokun)
|
* <http://aol.nexua.org>
|
||||||
* @copyright: Copyright (C) 2011
|
|
||||||
* @license: AOL license <http://aol.nexua.org>
|
|
||||||
*/
|
*/
|
||||||
public class Methods
|
public class Methods
|
||||||
{
|
{
|
||||||
@@ -257,7 +255,8 @@ public class Methods
|
|||||||
/**
|
/**
|
||||||
* Grab the existing and initialized (hopefully) Method Class.
|
* Grab the existing and initialized (hopefully) Method Class.
|
||||||
*
|
*
|
||||||
* @return <code>Method</code> <em>or</em> <code>Null</code>
|
* @return <code>Method</code> <em>or</em>
|
||||||
|
* <code>Null</code>
|
||||||
*/
|
*/
|
||||||
public static Method getMethod()
|
public static Method getMethod()
|
||||||
{
|
{
|
||||||
|
@@ -9,10 +9,8 @@ import org.bukkit.plugin.Plugin;
|
|||||||
* BOSEconomy 7 Implementation of Method
|
* BOSEconomy 7 Implementation of Method
|
||||||
*
|
*
|
||||||
* @author Acrobot
|
* @author Acrobot
|
||||||
* @author Nijikokun <nijikokun@shortmail.com> (
|
* @author Nijikokun <nijikokun@shortmail.com> (@nijikokun) @copyright (c) 2011 @license AOL license
|
||||||
* @nijikokun)
|
* <http://aol.nexua.org>
|
||||||
* @copyright (c) 2011
|
|
||||||
* @license AOL license <http://aol.nexua.org>
|
|
||||||
*/
|
*/
|
||||||
public class BOSE7 implements Method
|
public class BOSE7 implements Method
|
||||||
{
|
{
|
||||||
|
@@ -12,10 +12,8 @@ import org.bukkit.plugin.Plugin;
|
|||||||
/**
|
/**
|
||||||
* iConomy 5 Implementation of Method
|
* iConomy 5 Implementation of Method
|
||||||
*
|
*
|
||||||
* @author Nijikokun <nijikokun@shortmail.com> (
|
* @author Nijikokun <nijikokun@shortmail.com> (@nijikokun) @copyright (c) 2011 @license AOL license
|
||||||
* @nijikokun)
|
* <http://aol.nexua.org>
|
||||||
* @copyright (c) 2011
|
|
||||||
* @license AOL license <http://aol.nexua.org>
|
|
||||||
*/
|
*/
|
||||||
public class iCo5 implements Method
|
public class iCo5 implements Method
|
||||||
{
|
{
|
||||||
|
@@ -11,10 +11,8 @@ import org.bukkit.plugin.Plugin;
|
|||||||
/**
|
/**
|
||||||
* iConomy 6 Implementation of Method
|
* iConomy 6 Implementation of Method
|
||||||
*
|
*
|
||||||
* @author Nijikokun <nijikokun@shortmail.com> (
|
* @author Nijikokun <nijikokun@shortmail.com> (@nijikokun) @copyright (c) 2011 @license AOL license
|
||||||
* @nijikokun)
|
* <http://aol.nexua.org>
|
||||||
* @copyright (c) 2011
|
|
||||||
* @license AOL license <http://aol.nexua.org>
|
|
||||||
*/
|
*/
|
||||||
public class iCo6 implements Method
|
public class iCo6 implements Method
|
||||||
{
|
{
|
||||||
|
@@ -15,7 +15,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
public class EssentialsBlockListener implements Listener
|
public class EssentialsBlockListener implements Listener
|
||||||
{
|
{
|
||||||
private final IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
|
|
||||||
public EssentialsBlockListener(final IEssentials ess)
|
public EssentialsBlockListener(final IEssentials ess)
|
||||||
{
|
{
|
||||||
|
@@ -19,7 +19,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
public class EssentialsEntityListener implements Listener
|
public class EssentialsEntityListener implements Listener
|
||||||
{
|
{
|
||||||
private final IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
|
|
||||||
public EssentialsEntityListener(final IEssentials ess)
|
public EssentialsEntityListener(final IEssentials ess)
|
||||||
{
|
{
|
||||||
|
@@ -40,9 +40,9 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
public class EssentialsPlayerListener implements Listener
|
public class EssentialsPlayerListener implements Listener
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||||
private final Server server;
|
private final transient Server server;
|
||||||
private final IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
private final IUserMap userMap;
|
private final transient IUserMap userMap;
|
||||||
|
|
||||||
public EssentialsPlayerListener(final IEssentials parent)
|
public EssentialsPlayerListener(final IEssentials parent)
|
||||||
{
|
{
|
||||||
@@ -56,8 +56,7 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
public void onPlayerRespawn(final PlayerRespawnEvent event)
|
public void onPlayerRespawn(final PlayerRespawnEvent event)
|
||||||
{
|
{
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
if (!player.isOnline())
|
if (!player.isOnline()) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final IUser user = userMap.getUser(player);
|
final IUser user = userMap.getUser(player);
|
||||||
@@ -174,7 +173,7 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
delayedJoin(event.getPlayer());
|
delayedJoin(event.getPlayer());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
/* TODO: Make sure my update is good
|
/* TODO: Make sure my update is good
|
||||||
if (!event.getPlayer().isOnline())
|
if (!event.getPlayer().isOnline())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -331,19 +330,19 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
user.sendMessage(_("youHaveNewMail", mail.size()));
|
user.sendMessage(_("youHaveNewMail", mail.size()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Permissions.FLY_SAFELOGIN.isAuthorized(user))
|
if(Permissions.FLY_SAFELOGIN.isAuthorized(user))
|
||||||
{
|
{
|
||||||
final Location loc = user.getPlayer().getLocation();
|
final Location loc = user.getPlayer().getLocation();
|
||||||
final World world = loc.getWorld();
|
final World world = loc.getWorld();
|
||||||
final int x = loc.getBlockX();
|
final int x = loc.getBlockX();
|
||||||
int y = loc.getBlockY();
|
int y = loc.getBlockY();
|
||||||
final int z = loc.getBlockZ();
|
final int z = loc.getBlockZ();
|
||||||
while (LocationUtil.isBlockUnsafe(world, x, y, z) && y > -1)
|
while(LocationUtil.isBlockUnsafe(world, x, y, z) && y > -1)
|
||||||
{
|
{
|
||||||
y--;
|
y--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loc.getBlockY() - y > 1 || y < 0)
|
if(loc.getBlockY() - y > 1 || y < 0)
|
||||||
{
|
{
|
||||||
user.getPlayer().setAllowFlight(true);
|
user.getPlayer().setAllowFlight(true);
|
||||||
user.getPlayer().setFlying(true);
|
user.getPlayer().setFlying(true);
|
||||||
@@ -352,6 +351,7 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
public void onPlayerLogin(final PlayerLoginEvent event)
|
public void onPlayerLogin(final PlayerLoginEvent event)
|
||||||
{
|
{
|
||||||
@@ -449,6 +449,7 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Pattern spaceSplit = Pattern.compile(" ");
|
private final Pattern spaceSplit = Pattern.compile(" ");
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
@@ -620,7 +621,7 @@ public class EssentialsPlayerListener implements Listener
|
|||||||
}
|
}
|
||||||
if (event.getView().getTopInventory().getType() == InventoryType.WORKBENCH)
|
if (event.getView().getTopInventory().getType() == InventoryType.WORKBENCH)
|
||||||
{
|
{
|
||||||
final IUser user = userMap.getUser((Player)event.getWhoClicked());
|
final IUser user = userMap.getUser((Player) event.getWhoClicked());
|
||||||
if (user.isRecipeSee())
|
if (user.isRecipeSee())
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@@ -19,7 +19,7 @@ import org.bukkit.plugin.Plugin;
|
|||||||
|
|
||||||
public class EssentialsPluginListener implements Listener, IReload
|
public class EssentialsPluginListener implements Listener, IReload
|
||||||
{
|
{
|
||||||
private final IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
|
|
||||||
public EssentialsPluginListener(final IEssentials ess)
|
public EssentialsPluginListener(final IEssentials ess)
|
||||||
{
|
{
|
||||||
@@ -36,8 +36,7 @@ public class EssentialsPluginListener implements Listener, IReload
|
|||||||
if (!Methods.hasMethod() && Methods.setMethod(ess.getServer().getPluginManager()))
|
if (!Methods.hasMethod() && Methods.setMethod(ess.getServer().getPluginManager()))
|
||||||
{
|
{
|
||||||
ess.getLogger().log(
|
ess.getLogger().log(
|
||||||
Level.INFO, "Payment method found ({0} version: {1})", new Object[]
|
Level.INFO, "Payment method found ({0} version: {1})", new Object[]{
|
||||||
{
|
|
||||||
Methods.getMethod().getName(), Methods.getMethod().getVersion()
|
Methods.getMethod().getName(), Methods.getMethod().getVersion()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -14,8 +14,8 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
|||||||
|
|
||||||
public class MetricsListener implements Listener
|
public class MetricsListener implements Listener
|
||||||
{
|
{
|
||||||
private final IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
private final MetricsStarter starter;
|
private final transient MetricsStarter starter;
|
||||||
|
|
||||||
public MetricsListener(final IEssentials parent, final MetricsStarter starter)
|
public MetricsListener(final IEssentials parent, final MetricsStarter starter)
|
||||||
{
|
{
|
||||||
|
@@ -14,7 +14,7 @@ import net.ess3.metrics.Metrics.Plotter;
|
|||||||
public class MetricsStarter implements Runnable
|
public class MetricsStarter implements Runnable
|
||||||
{
|
{
|
||||||
private final IEssentials ess;
|
private final IEssentials ess;
|
||||||
private Boolean start;
|
private transient Boolean start;
|
||||||
|
|
||||||
|
|
||||||
private enum Modules
|
private enum Modules
|
||||||
@@ -30,7 +30,10 @@ public class MetricsStarter implements Runnable
|
|||||||
EssentialsProtect,
|
EssentialsProtect,
|
||||||
EssentialsGeoIP,
|
EssentialsGeoIP,
|
||||||
EssentialsXMPP
|
EssentialsXMPP
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
public MetricsStarter(final IEssentials plugin)
|
public MetricsStarter(final IEssentials plugin)
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package net.ess3.permissions;
|
package net.ess3.permissions;
|
||||||
|
|
||||||
|
|
||||||
public class BasePermission extends AbstractSuperpermsPermission
|
public class BasePermission extends AbstractSuperpermsPermission
|
||||||
{
|
{
|
||||||
protected String permission;
|
protected String permission;
|
||||||
|
@@ -121,7 +121,7 @@ public enum Permissions implements IPermission
|
|||||||
private static final String base = "essentials.";
|
private static final String base = "essentials.";
|
||||||
private final String permission;
|
private final String permission;
|
||||||
private final PermissionDefault defaultPerm;
|
private final PermissionDefault defaultPerm;
|
||||||
private String parent = null;
|
private transient String parent = null;
|
||||||
|
|
||||||
private Permissions()
|
private Permissions()
|
||||||
{
|
{
|
||||||
@@ -164,6 +164,7 @@ public enum Permissions implements IPermission
|
|||||||
{
|
{
|
||||||
return PermissionFactory.checkPermission(sender, this);
|
return PermissionFactory.checkPermission(sender, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DotStarPermission ENCHANT = new DotStarPermission("essentials.enchant");
|
public static DotStarPermission ENCHANT = new DotStarPermission("essentials.enchant");
|
||||||
public static MaterialDotStarPermission GIVE = new MaterialDotStarPermission("essentials.give", PermissionDefault.TRUE);
|
public static MaterialDotStarPermission GIVE = new MaterialDotStarPermission("essentials.give", PermissionDefault.TRUE);
|
||||||
public static DotStarPermission RANKS = new DotStarPermission("essentials.ranks");
|
public static DotStarPermission RANKS = new DotStarPermission("essentials.ranks");
|
||||||
|
@@ -12,8 +12,8 @@ import org.bukkit.plugin.Plugin;
|
|||||||
|
|
||||||
public class GMGroups extends AbstractRanks implements IRanks
|
public class GMGroups extends AbstractRanks implements IRanks
|
||||||
{
|
{
|
||||||
private final IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
private final GroupManager groupManager;
|
private final transient GroupManager groupManager;
|
||||||
|
|
||||||
public GMGroups(final IEssentials ess, final Plugin groupManager)
|
public GMGroups(final IEssentials ess, final Plugin groupManager)
|
||||||
{
|
{
|
||||||
|
@@ -17,6 +17,7 @@ public class Ranks implements StorageObject
|
|||||||
final RankOptions defaultOptions = new RankOptions();
|
final RankOptions defaultOptions = new RankOptions();
|
||||||
ranks.put("default", defaultOptions);
|
ranks.put("default", defaultOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Comment(
|
@Comment(
|
||||||
{
|
{
|
||||||
"The order of the ranks matters, the ranks are checked from top to bottom.", "All rank names have to be lower case.",
|
"The order of the ranks matters, the ranks are checked from top to bottom.", "All rank names have to be lower case.",
|
||||||
|
@@ -23,6 +23,7 @@ public class Backup implements StorageObject
|
|||||||
"ex: say \"Hello World\" will make the server say Hello World"
|
"ex: say \"Hello World\" will make the server say Hello World"
|
||||||
})
|
})
|
||||||
private List<String> commandsBeforeBackup;
|
private List<String> commandsBeforeBackup;
|
||||||
|
|
||||||
@Comment(
|
@Comment(
|
||||||
{
|
{
|
||||||
"Runs these commands after a backup.", "This will run every time time (in minutes) you specify in the interval setting.",
|
"Runs these commands after a backup.", "This will run every time time (in minutes) you specify in the interval setting.",
|
||||||
@@ -48,4 +49,5 @@ public class Backup implements StorageObject
|
|||||||
{
|
{
|
||||||
return commandsAfterBackup == null ? Collections.<String>emptyList() : Collections.unmodifiableList(commandsAfterBackup);
|
return commandsAfterBackup == null ? Collections.<String>emptyList() : Collections.unmodifiableList(commandsAfterBackup);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -26,7 +26,8 @@ public class Economy implements StorageObject
|
|||||||
{
|
{
|
||||||
return currencySymbol == null || currencySymbol.isEmpty() ? "$" : currencySymbol.substring(0, 1);
|
return currencySymbol == null || currencySymbol.isEmpty() ? "$" : currencySymbol.substring(0, 1);
|
||||||
}
|
}
|
||||||
private final static double MAXMONEY = 10000000000000.0;
|
|
||||||
|
private final transient static double MAXMONEY = 10000000000000.0;
|
||||||
@Comment(
|
@Comment(
|
||||||
{
|
{
|
||||||
"Set the maximum amount of money a player can have",
|
"Set the maximum amount of money a player can have",
|
||||||
@@ -38,6 +39,7 @@ public class Economy implements StorageObject
|
|||||||
{
|
{
|
||||||
return Math.abs(maxMoney) > MAXMONEY ? MAXMONEY : Math.abs(maxMoney);
|
return Math.abs(maxMoney) > MAXMONEY ? MAXMONEY : Math.abs(maxMoney);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Comment(
|
@Comment(
|
||||||
{
|
{
|
||||||
"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).",
|
||||||
@@ -49,6 +51,7 @@ public class Economy implements StorageObject
|
|||||||
{
|
{
|
||||||
return Math.abs(minMoney) > MAXMONEY ? -MAXMONEY : minMoney;
|
return Math.abs(minMoney) > MAXMONEY ? -MAXMONEY : minMoney;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Comment("Enable this to log all interactions with trade/buy/sell signs and sell command")
|
@Comment("Enable this to log all interactions with trade/buy/sell signs and sell command")
|
||||||
private boolean logEnabled = false;
|
private boolean logEnabled = false;
|
||||||
private Worth worth = new Worth();
|
private Worth worth = new Worth();
|
||||||
|
@@ -42,6 +42,8 @@ public class General implements StorageObject
|
|||||||
{
|
{
|
||||||
FILE, GROUPMANAGER, VAULT
|
FILE, GROUPMANAGER, VAULT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Comment(
|
@Comment(
|
||||||
{
|
{
|
||||||
"Sets the place where group options should be stored:", " FILE: Options are stored inside groups.yml in the Essentials folder",
|
"Sets the place where group options should be stored:", " FILE: Options are stored inside groups.yml in the Essentials folder",
|
||||||
@@ -69,6 +71,7 @@ public class General implements StorageObject
|
|||||||
{
|
{
|
||||||
this.loginAttackDelay = loginAttackDelay / 1000;
|
this.loginAttackDelay = loginAttackDelay / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Boolean metricsEnabled = null;
|
private Boolean metricsEnabled = null;
|
||||||
@Comment("The join message when players join the server")
|
@Comment("The join message when players join the server")
|
||||||
private String joinMessage = "&e{PLAYER} has joined the game";
|
private String joinMessage = "&e{PLAYER} has joined the game";
|
||||||
|
@@ -25,6 +25,7 @@ public class Kits implements StorageObject
|
|||||||
kits = new HashMap<String, Kit>();
|
kits = new HashMap<String, Kit>();
|
||||||
kits.put("tools", kit);
|
kits.put("tools", kit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@MapValueType(Kit.class)
|
@MapValueType(Kit.class)
|
||||||
@Getter(AccessLevel.NONE)
|
@Getter(AccessLevel.NONE)
|
||||||
@Setter(AccessLevel.NONE)
|
@Setter(AccessLevel.NONE)
|
||||||
|
@@ -8,7 +8,7 @@ import net.ess3.storage.AsyncStorageObjectHolder;
|
|||||||
|
|
||||||
public class SettingsHolder extends AsyncStorageObjectHolder<Settings> implements ISettings
|
public class SettingsHolder extends AsyncStorageObjectHolder<Settings> implements ISettings
|
||||||
{
|
{
|
||||||
private volatile boolean debug = false;
|
private transient volatile boolean debug = false;
|
||||||
|
|
||||||
public SettingsHolder(final IEssentials ess)
|
public SettingsHolder(final IEssentials ess)
|
||||||
{
|
{
|
||||||
|
@@ -174,8 +174,8 @@ public class SpawnsHolder extends AsyncStorageObjectHolder<Spawns> implements IE
|
|||||||
|
|
||||||
private class SpawnPlayerListener implements Listener // TODO: What is this for?
|
private class SpawnPlayerListener implements Listener // TODO: What is this for?
|
||||||
{
|
{
|
||||||
private final IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
private final SpawnsHolder spawns;
|
private final transient SpawnsHolder spawns;
|
||||||
|
|
||||||
public SpawnPlayerListener(final IEssentials ess, final SpawnsHolder spawns)
|
public SpawnPlayerListener(final IEssentials ess, final SpawnsHolder spawns)
|
||||||
{
|
{
|
||||||
@@ -187,6 +187,8 @@ public class SpawnsHolder extends AsyncStorageObjectHolder<Spawns> implements IE
|
|||||||
public void onPlayerRespawn(final PlayerRespawnEvent event)
|
public void onPlayerRespawn(final PlayerRespawnEvent event)
|
||||||
{
|
{
|
||||||
final IUser user = ess.getUserMap().getUser(event.getPlayer());
|
final IUser user = ess.getUserMap().getUser(event.getPlayer());
|
||||||
|
|
||||||
|
final ISettings settings = ess.getSettings();
|
||||||
boolean respawnAtHome = ess.getSettings().getData().getCommands().getHome().isRespawnAtHome();
|
boolean respawnAtHome = ess.getSettings().getData().getCommands().getHome().isRespawnAtHome();
|
||||||
if (respawnAtHome)
|
if (respawnAtHome)
|
||||||
{
|
{
|
||||||
@@ -238,7 +240,7 @@ public class SpawnsHolder extends AsyncStorageObjectHolder<Spawns> implements IE
|
|||||||
|
|
||||||
private class NewPlayerTeleport implements Runnable
|
private class NewPlayerTeleport implements Runnable
|
||||||
{
|
{
|
||||||
private final IUser user;
|
private final transient IUser user;
|
||||||
|
|
||||||
public NewPlayerTeleport(final IUser user)
|
public NewPlayerTeleport(final IUser user)
|
||||||
{
|
{
|
||||||
|
@@ -26,6 +26,7 @@ public class WorldOptions implements StorageObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Comment("Disables godmode for all players if they teleport to this world.")
|
@Comment("Disables godmode for all players if they teleport to this world.")
|
||||||
private boolean godmode = true;
|
private boolean godmode = true;
|
||||||
@Comment("Prevent creatures spawning")
|
@Comment("Prevent creatures spawning")
|
||||||
|
@@ -9,4 +9,5 @@ import net.ess3.storage.StorageObject;
|
|||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class Worlds implements StorageObject
|
public class Worlds implements StorageObject
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
@@ -32,8 +32,7 @@ public class Alert implements StorageObject
|
|||||||
|
|
||||||
public void setupDefaults()
|
public void setupDefaults()
|
||||||
{
|
{
|
||||||
Material[] mat =
|
Material[] mat = {
|
||||||
{
|
|
||||||
Material.LAVA, Material.STATIONARY_LAVA, Material.TNT, Material.LAVA_BUCKET
|
Material.LAVA, Material.STATIONARY_LAVA, Material.TNT, Material.LAVA_BUCKET
|
||||||
};
|
};
|
||||||
alertOnPlacement.addAll(Arrays.asList(mat));
|
alertOnPlacement.addAll(Arrays.asList(mat));
|
||||||
|
@@ -27,6 +27,8 @@ public class AntiBuild implements StorageObject
|
|||||||
"Should we tell people they are not allowed to build"
|
"Should we tell people they are not allowed to build"
|
||||||
})
|
})
|
||||||
private boolean warnOnBuildDisallow = true;
|
private boolean warnOnBuildDisallow = true;
|
||||||
|
|
||||||
private Alert alert = new Alert();
|
private Alert alert = new Alert();
|
||||||
private BlackList blacklist = new BlackList();
|
private BlackList blacklist = new BlackList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -49,8 +49,7 @@ public class BlackList implements StorageObject
|
|||||||
|
|
||||||
public void setupDefaults()
|
public void setupDefaults()
|
||||||
{
|
{
|
||||||
Material[] mat =
|
Material[] mat = {
|
||||||
{
|
|
||||||
Material.LAVA, Material.STATIONARY_LAVA, Material.TNT, Material.LAVA_BUCKET
|
Material.LAVA, Material.STATIONARY_LAVA, Material.TNT, Material.LAVA_BUCKET
|
||||||
};
|
};
|
||||||
placement.addAll(Arrays.asList(mat));
|
placement.addAll(Arrays.asList(mat));
|
||||||
|
@@ -27,5 +27,6 @@ public class Afk implements StorageObject
|
|||||||
"You have to add a message to your welcome message or help page,", "since the player will not get a message, if he tries to move."
|
"You have to add a message to your welcome message or help page,", "since the player will not get a message, if he tries to move."
|
||||||
})
|
})
|
||||||
private boolean freezeAFKPlayers = false;
|
private boolean freezeAFKPlayers = false;
|
||||||
|
|
||||||
private boolean disableItemPickupWhileAfk = true;
|
private boolean disableItemPickupWhileAfk = true;
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package net.ess3.settings.commands;
|
package net.ess3.settings.commands;
|
||||||
|
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import net.ess3.storage.Comment;
|
import net.ess3.storage.Comment;
|
||||||
|
@@ -21,6 +21,7 @@ public class SocialSpy implements StorageObject
|
|||||||
socialspyCommands.addAll(Arrays.asList("msg", "r", "mail", "m", "t", "emsg", "tell", "er", "reply", "ereply", "email"));
|
socialspyCommands.addAll(Arrays.asList("msg", "r", "mail", "m", "t", "emsg", "tell", "er", "reply", "ereply", "email"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ListType
|
@ListType
|
||||||
@Comment("Commands to listen for in socialspy")
|
@Comment("Commands to listen for in socialspy")
|
||||||
private List<String> socialspyCommands = new ArrayList<String>();
|
private List<String> socialspyCommands = new ArrayList<String>();
|
||||||
|
@@ -10,14 +10,9 @@ import net.ess3.storage.StorageObject;
|
|||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class Speed implements StorageObject
|
public class Speed implements StorageObject
|
||||||
{
|
{
|
||||||
@Comment(
|
@Comment({"Set the max fly speed, values range from 0.2 to 1.0"})
|
||||||
{
|
|
||||||
"Set the max fly speed, values range from 0.2 to 1.0"
|
|
||||||
})
|
|
||||||
private double maxFlySpeed = 1.0f;
|
private double maxFlySpeed = 1.0f;
|
||||||
@Comment(
|
|
||||||
{
|
@Comment({"Set the max walk speed, values range from 0.1 to 1.0"})
|
||||||
"Set the max walk speed, values range from 0.1 to 1.0"
|
|
||||||
})
|
|
||||||
private double maxWalkSpeed = 0.8f;
|
private double maxWalkSpeed = 0.8f;
|
||||||
}
|
}
|
||||||
|
@@ -15,10 +15,7 @@ public class Teleport implements StorageObject
|
|||||||
"Set timeout in seconds for players to accept tpa before request is cancelled.", "Set to 0 for no timeout."
|
"Set timeout in seconds for players to accept tpa before request is cancelled.", "Set to 0 for no timeout."
|
||||||
})
|
})
|
||||||
private int requestTimeout = 120;
|
private int requestTimeout = 120;
|
||||||
@Comment(
|
@Comment({"Cancels a request made by tpa / tphere on world change to prevent cross world tp"})
|
||||||
{
|
|
||||||
"Cancels a request made by tpa / tphere on world change to prevent cross world tp"
|
|
||||||
})
|
|
||||||
private boolean cancelRequestsOnWorldChange = false;
|
private boolean cancelRequestsOnWorldChange = false;
|
||||||
@Comment(
|
@Comment(
|
||||||
{
|
{
|
||||||
|
@@ -10,6 +10,7 @@ import net.ess3.storage.StorageObject;
|
|||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class Prevent implements StorageObject
|
public class Prevent implements StorageObject
|
||||||
{
|
{
|
||||||
|
|
||||||
private boolean lavaFlow = false;
|
private boolean lavaFlow = false;
|
||||||
private boolean waterFlow = false;
|
private boolean waterFlow = false;
|
||||||
// private boolean waterbucketFlow = false; TODO: Test if this still works
|
// private boolean waterbucketFlow = false; TODO: Test if this still works
|
||||||
|
@@ -18,8 +18,10 @@ public class Protect implements StorageObject
|
|||||||
"Set prevent.creeper-explosion to true, if you want to disable creeper explosions."
|
"Set prevent.creeper-explosion to true, if you want to disable creeper explosions."
|
||||||
})
|
})
|
||||||
private int creeperMaxHeight = -1;
|
private int creeperMaxHeight = -1;
|
||||||
|
|
||||||
@Comment("Disable weather options")
|
@Comment("Disable weather options")
|
||||||
private boolean disableStorm = false;
|
private boolean disableStorm = false;
|
||||||
private boolean disableThunder = false;
|
private boolean disableThunder = false;
|
||||||
private boolean disableLighting = false;
|
private boolean disableLighting = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -11,8 +11,8 @@ import org.bukkit.Bukkit;
|
|||||||
|
|
||||||
public abstract class AbstractDelayedYamlFileReader<T extends StorageObject> implements Runnable
|
public abstract class AbstractDelayedYamlFileReader<T extends StorageObject> implements Runnable
|
||||||
{
|
{
|
||||||
private final Class<T> clazz;
|
private final transient Class<T> clazz;
|
||||||
private final IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
|
|
||||||
public AbstractDelayedYamlFileReader(final IEssentials ess, final Class<T> clazz)
|
public AbstractDelayedYamlFileReader(final IEssentials ess, final Class<T> clazz)
|
||||||
{
|
{
|
||||||
|
@@ -11,8 +11,8 @@ import org.bukkit.Bukkit;
|
|||||||
|
|
||||||
public abstract class AbstractDelayedYamlFileWriter implements Runnable
|
public abstract class AbstractDelayedYamlFileWriter implements Runnable
|
||||||
{
|
{
|
||||||
private final IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
private final ReentrantLock lock = new ReentrantLock(); // TODO: Needed?
|
private final transient ReentrantLock lock = new ReentrantLock(); // TODO: Needed?
|
||||||
|
|
||||||
public AbstractDelayedYamlFileWriter(final IEssentials ess)
|
public AbstractDelayedYamlFileWriter(final IEssentials ess)
|
||||||
{
|
{
|
||||||
|
@@ -10,14 +10,14 @@ import org.bukkit.Bukkit;
|
|||||||
|
|
||||||
public abstract class AsyncStorageObjectHolder<T extends StorageObject> implements IStorageObjectHolder<T>
|
public abstract class AsyncStorageObjectHolder<T extends StorageObject> implements IStorageObjectHolder<T>
|
||||||
{
|
{
|
||||||
private T data;
|
private transient T data;
|
||||||
private final Class<T> clazz;
|
private final transient Class<T> clazz;
|
||||||
protected final IEssentials ess;
|
protected final transient IEssentials ess;
|
||||||
private final StorageObjectDataWriter writer;
|
private final transient StorageObjectDataWriter writer;
|
||||||
private final StorageObjectDataReader reader;
|
private final transient StorageObjectDataReader reader;
|
||||||
private final AtomicBoolean loaded = new AtomicBoolean(false);
|
private final transient AtomicBoolean loaded = new AtomicBoolean(false);
|
||||||
private volatile long savetime = 0;
|
private volatile long savetime = 0;
|
||||||
private final File file;
|
private final transient File file;
|
||||||
|
|
||||||
public AsyncStorageObjectHolder(final IEssentials ess, final Class<T> clazz, final File file)
|
public AsyncStorageObjectHolder(final IEssentials ess, final Class<T> clazz, final File file)
|
||||||
{
|
{
|
||||||
|
@@ -21,9 +21,9 @@ import org.yaml.snakeyaml.nodes.*;
|
|||||||
|
|
||||||
public class BukkitConstructor extends Constructor
|
public class BukkitConstructor extends Constructor
|
||||||
{
|
{
|
||||||
private final Pattern DATAPATTERN = Pattern.compile("[:+',;.]");
|
private final transient Pattern DATAPATTERN = Pattern.compile("[:+',;.]");
|
||||||
private final Pattern WORD = Pattern.compile("\\W");
|
private final transient Pattern WORD = Pattern.compile("\\W");
|
||||||
private final IPlugin plugin;
|
private final transient IPlugin plugin;
|
||||||
|
|
||||||
public BukkitConstructor(final Class<?> clazz, final IPlugin plugin)
|
public BukkitConstructor(final Class<?> clazz, final IPlugin plugin)
|
||||||
{
|
{
|
||||||
|
@@ -18,7 +18,7 @@ import org.bukkit.Bukkit;
|
|||||||
public class ManagedFile
|
public class ManagedFile
|
||||||
{
|
{
|
||||||
private final static int BUFFERSIZE = 1024 * 8;
|
private final static int BUFFERSIZE = 1024 * 8;
|
||||||
private final File file;
|
private final transient File file;
|
||||||
|
|
||||||
public ManagedFile(final String filename, final IEssentials ess)
|
public ManagedFile(final String filename, final IEssentials ess)
|
||||||
{
|
{
|
||||||
|
@@ -26,11 +26,11 @@ import org.apache.commons.io.IOUtils;
|
|||||||
|
|
||||||
public abstract class StorageObjectMap<I> extends CacheLoader<String, I> implements IStorageObjectMap<I>
|
public abstract class StorageObjectMap<I> extends CacheLoader<String, I> implements IStorageObjectMap<I>
|
||||||
{
|
{
|
||||||
protected final IEssentials ess;
|
protected final transient IEssentials ess;
|
||||||
private final File folder;
|
private final transient File folder;
|
||||||
protected final Cache<String, I> cache = CacheBuilder.newBuilder().softValues().build(this);
|
protected final transient Cache<String, I> cache = CacheBuilder.newBuilder().softValues().build(this);
|
||||||
protected final ConcurrentSkipListSet<String> keys = new ConcurrentSkipListSet<String>();
|
protected final transient ConcurrentSkipListSet<String> keys = new ConcurrentSkipListSet<String>();
|
||||||
protected final ConcurrentSkipListMap<String, File> zippedfiles = new ConcurrentSkipListMap<String, File>();
|
protected final transient ConcurrentSkipListMap<String, File> zippedfiles = new ConcurrentSkipListMap<String, File>();
|
||||||
private final Pattern zipCheck = Pattern.compile("^[a-zA-Z0-9]*-?[a-zA-Z0-9]+\\.yml$");
|
private final Pattern zipCheck = Pattern.compile("^[a-zA-Z0-9]*-?[a-zA-Z0-9]+\\.yml$");
|
||||||
|
|
||||||
public StorageObjectMap(final IEssentials ess, final String folderName)
|
public StorageObjectMap(final IEssentials ess, final String folderName)
|
||||||
|
@@ -15,7 +15,7 @@ public class StorageQueue implements Runnable
|
|||||||
private DelayQueue<WriteRequest> queue = new DelayQueue<WriteRequest>();
|
private DelayQueue<WriteRequest> queue = new DelayQueue<WriteRequest>();
|
||||||
public final static long DELAY = TimeUnit.NANOSECONDS.convert(1, TimeUnit.SECONDS);
|
public final static long DELAY = TimeUnit.NANOSECONDS.convert(1, TimeUnit.SECONDS);
|
||||||
private final AtomicBoolean enabled = new AtomicBoolean(false);
|
private final AtomicBoolean enabled = new AtomicBoolean(false);
|
||||||
private final Object lock = new Object();
|
private final transient Object lock = new Object();
|
||||||
private final IPlugin plugin;
|
private final IPlugin plugin;
|
||||||
|
|
||||||
public StorageQueue(IPlugin plugin)
|
public StorageQueue(IPlugin plugin)
|
||||||
|
@@ -13,10 +13,10 @@ import org.yaml.snakeyaml.introspector.BeanAccess;
|
|||||||
|
|
||||||
public class YamlStorageReader implements IStorageReader
|
public class YamlStorageReader implements IStorageReader
|
||||||
{
|
{
|
||||||
private static final Map<Class<?>, Yaml> PREPARED_YAMLS = Collections.synchronizedMap(new HashMap<Class<?>, Yaml>());
|
private transient static final Map<Class<?>, Yaml> PREPARED_YAMLS = Collections.synchronizedMap(new HashMap<Class<?>, Yaml>());
|
||||||
private static final Map<Class<?>, ReentrantLock> LOCKS = new HashMap<Class<?>, ReentrantLock>();
|
private transient static final Map<Class<?>, ReentrantLock> LOCKS = new HashMap<Class<?>, ReentrantLock>();
|
||||||
private final Reader reader;
|
private transient final Reader reader;
|
||||||
private final IPlugin plugin;
|
private transient final IPlugin plugin;
|
||||||
|
|
||||||
public YamlStorageReader(final Reader reader, final IPlugin plugin)
|
public YamlStorageReader(final Reader reader, final IPlugin plugin)
|
||||||
{
|
{
|
||||||
|
@@ -20,9 +20,9 @@ import org.yaml.snakeyaml.Yaml;
|
|||||||
|
|
||||||
public class YamlStorageWriter implements IStorageWriter
|
public class YamlStorageWriter implements IStorageWriter
|
||||||
{
|
{
|
||||||
private static final Pattern NON_WORD_PATTERN = Pattern.compile("\\W");
|
private transient static final Pattern NON_WORD_PATTERN = Pattern.compile("\\W");
|
||||||
private final PrintWriter writer;
|
private transient final PrintWriter writer;
|
||||||
private static final Yaml YAML = new Yaml();
|
private transient static final Yaml YAML = new Yaml();
|
||||||
|
|
||||||
public YamlStorageWriter(final PrintWriter writer)
|
public YamlStorageWriter(final PrintWriter writer)
|
||||||
{
|
{
|
||||||
@@ -51,7 +51,7 @@ public class YamlStorageWriter implements IStorageWriter
|
|||||||
for (Field field : clazz.getDeclaredFields())
|
for (Field field : clazz.getDeclaredFields())
|
||||||
{
|
{
|
||||||
final int modifier = field.getModifiers();
|
final int modifier = field.getModifiers();
|
||||||
if (Modifier.isPrivate(modifier) && !Modifier.isStatic(modifier))
|
if (Modifier.isPrivate(modifier) && !Modifier.isTransient(modifier) && !Modifier.isStatic(modifier))
|
||||||
{
|
{
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
|
|
||||||
|
@@ -3,10 +3,12 @@ package net.ess3.user;
|
|||||||
|
|
||||||
public class CooldownException extends Exception
|
public class CooldownException extends Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final long serialVersionUID = 913632836257457319L;
|
private static final long serialVersionUID = 913632836257457319L;
|
||||||
|
|
||||||
public CooldownException(String timeLeft)
|
public CooldownException(String timeLeft)
|
||||||
{
|
{
|
||||||
super(timeLeft);
|
super(timeLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,7 @@ public interface IOfflinePlayer
|
|||||||
String getDisplayName();
|
String getDisplayName();
|
||||||
|
|
||||||
//Location getBedSpawnLocation();
|
//Location getBedSpawnLocation();
|
||||||
|
|
||||||
void setBanned(boolean bln);
|
void setBanned(boolean bln);
|
||||||
|
|
||||||
boolean hasPermission(Permission perm);
|
boolean hasPermission(Permission perm);
|
||||||
|
@@ -5,4 +5,5 @@ import net.ess3.storage.IStorageObjectHolder;
|
|||||||
|
|
||||||
public interface IOfflineUser extends IStorageObjectHolder<UserData>//, IOfflinePlayer
|
public interface IOfflineUser extends IStorageObjectHolder<UserData>//, IOfflinePlayer
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -5,6 +5,7 @@ import static net.ess3.I18n._;
|
|||||||
|
|
||||||
public class PlayerNotFoundException extends Exception
|
public class PlayerNotFoundException extends Exception
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final long serialVersionUID = -510752839980332640L;
|
private static final long serialVersionUID = -510752839980332640L;
|
||||||
|
|
||||||
public PlayerNotFoundException()
|
public PlayerNotFoundException()
|
||||||
|
@@ -31,22 +31,22 @@ public class User extends UserBase implements IUser
|
|||||||
{
|
{
|
||||||
private CommandSender replyTo = null;
|
private CommandSender replyTo = null;
|
||||||
@Getter
|
@Getter
|
||||||
private IUser teleportRequester;
|
private transient IUser teleportRequester;
|
||||||
@Getter
|
@Getter
|
||||||
private boolean tpRequestHere;
|
private transient boolean tpRequestHere;
|
||||||
@Getter
|
@Getter
|
||||||
private final ITeleport teleport;
|
private transient final ITeleport teleport;
|
||||||
@Getter
|
@Getter
|
||||||
private long teleportRequestTime;
|
private transient long teleportRequestTime;
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
private long lastOnlineActivity;
|
private transient long lastOnlineActivity;
|
||||||
private long lastActivity = System.currentTimeMillis();
|
private transient long lastActivity = System.currentTimeMillis();
|
||||||
/*@Getter
|
/*@Getter
|
||||||
@Setter
|
@Setter
|
||||||
private boolean hidden = false;*/
|
private boolean hidden = false;*/
|
||||||
@Getter
|
@Getter
|
||||||
private boolean vanished;
|
private transient boolean vanished;
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
private boolean invSee = false;
|
private boolean invSee = false;
|
||||||
@@ -54,7 +54,7 @@ public class User extends UserBase implements IUser
|
|||||||
@Setter
|
@Setter
|
||||||
private boolean enderSee = false;
|
private boolean enderSee = false;
|
||||||
private long lastThrottledAction;
|
private long lastThrottledAction;
|
||||||
private Location afkPosition;
|
private transient Location afkPosition;
|
||||||
private AtomicBoolean gotMailInfo = new AtomicBoolean(false);
|
private AtomicBoolean gotMailInfo = new AtomicBoolean(false);
|
||||||
private WeakReference<Player> playerCache;
|
private WeakReference<Player> playerCache;
|
||||||
@Getter
|
@Getter
|
||||||
@@ -592,7 +592,8 @@ public class User extends UserBase implements IUser
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
private long teleportInvulnerabilityTimestamp = 0;
|
|
||||||
|
private transient long teleportInvulnerabilityTimestamp = 0;
|
||||||
|
|
||||||
public void enableInvulnerabilityAfterTeleport()
|
public void enableInvulnerabilityAfterTeleport()
|
||||||
{
|
{
|
||||||
@@ -634,7 +635,7 @@ public class User extends UserBase implements IUser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ess.getVanishedPlayers().add(getName());
|
ess.getVanishedPlayers().add(getName());
|
||||||
if (Permissions.VANISH_EFFECT.isAuthorized(this))
|
if(Permissions.VANISH_EFFECT.isAuthorized(this))
|
||||||
{
|
{
|
||||||
getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1, false));
|
getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1, false));
|
||||||
}
|
}
|
||||||
@@ -646,7 +647,7 @@ public class User extends UserBase implements IUser
|
|||||||
p.showPlayer(getPlayer());
|
p.showPlayer(getPlayer());
|
||||||
}
|
}
|
||||||
ess.getVanishedPlayers().remove(getName());
|
ess.getVanishedPlayers().remove(getName());
|
||||||
if (Permissions.VANISH_EFFECT.isAuthorized(this))
|
if(Permissions.VANISH_EFFECT.isAuthorized(this))
|
||||||
{
|
{
|
||||||
getPlayer().removePotionEffect(PotionEffectType.INVISIBILITY);
|
getPlayer().removePotionEffect(PotionEffectType.INVISIBILITY);
|
||||||
}
|
}
|
||||||
|
@@ -6,7 +6,6 @@ import net.ess3.storage.*;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class UserData implements StorageObject
|
public class UserData implements StorageObject
|
||||||
@@ -15,6 +14,8 @@ public class UserData implements StorageObject
|
|||||||
{
|
{
|
||||||
JAIL, MUTE, LASTHEAL, LASTTELEPORT, LOGIN, LOGOUT, KIT, COMMAND
|
JAIL, MUTE, LASTHEAL, LASTTELEPORT, LOGIN, LOGOUT, KIT, COMMAND
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private String nickname;
|
private String nickname;
|
||||||
private Double money;
|
private Double money;
|
||||||
@MapValueType(StoredLocation.class)
|
@MapValueType(StoredLocation.class)
|
||||||
@@ -26,6 +27,7 @@ public class UserData implements StorageObject
|
|||||||
{
|
{
|
||||||
return homes == null ? Collections.<String, StoredLocation>emptyMap() : Collections.unmodifiableMap(homes);
|
return homes == null ? Collections.<String, StoredLocation>emptyMap() : Collections.unmodifiableMap(homes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ListType(Material.class)
|
@ListType(Material.class)
|
||||||
@Getter(AccessLevel.NONE)
|
@Getter(AccessLevel.NONE)
|
||||||
@Setter(AccessLevel.NONE)
|
@Setter(AccessLevel.NONE)
|
||||||
@@ -35,6 +37,7 @@ public class UserData implements StorageObject
|
|||||||
{
|
{
|
||||||
return unlimited == null ? Collections.<Material>emptySet() : Collections.unmodifiableSet(unlimited);
|
return unlimited == null ? Collections.<Material>emptySet() : Collections.unmodifiableSet(unlimited);
|
||||||
}
|
}
|
||||||
|
|
||||||
@MapValueType(List.class)
|
@MapValueType(List.class)
|
||||||
@MapKeyType(Material.class)
|
@MapKeyType(Material.class)
|
||||||
@Getter(AccessLevel.NONE)
|
@Getter(AccessLevel.NONE)
|
||||||
@@ -45,6 +48,7 @@ public class UserData implements StorageObject
|
|||||||
{
|
{
|
||||||
return powerTools == null ? Collections.<Material, List<String>>emptyMap() : Collections.unmodifiableMap(powerTools);
|
return powerTools == null ? Collections.<Material, List<String>>emptyMap() : Collections.unmodifiableMap(powerTools);
|
||||||
}
|
}
|
||||||
|
|
||||||
private StoredLocation lastLocation;
|
private StoredLocation lastLocation;
|
||||||
@MapKeyType(String.class)
|
@MapKeyType(String.class)
|
||||||
@MapValueType(Long.class)
|
@MapValueType(Long.class)
|
||||||
@@ -56,6 +60,7 @@ public class UserData implements StorageObject
|
|||||||
{
|
{
|
||||||
return timestamps == null ? Collections.<String, Long>emptyMap() : Collections.unmodifiableMap(timestamps);
|
return timestamps == null ? Collections.<String, Long>emptyMap() : Collections.unmodifiableMap(timestamps);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String jail;
|
private String jail;
|
||||||
@ListType
|
@ListType
|
||||||
@Getter(AccessLevel.NONE)
|
@Getter(AccessLevel.NONE)
|
||||||
@@ -66,6 +71,7 @@ public class UserData implements StorageObject
|
|||||||
{
|
{
|
||||||
return mails == null ? Collections.<String>emptyList() : Collections.unmodifiableList(mails);
|
return mails == null ? Collections.<String>emptyList() : Collections.unmodifiableList(mails);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Inventory inventory;
|
private Inventory inventory;
|
||||||
private boolean teleportEnabled;
|
private boolean teleportEnabled;
|
||||||
@ListType
|
@ListType
|
||||||
@@ -77,6 +83,7 @@ public class UserData implements StorageObject
|
|||||||
{
|
{
|
||||||
return ignore == null ? Collections.<String>emptySet() : Collections.unmodifiableSet(ignore);
|
return ignore == null ? Collections.<String>emptySet() : Collections.unmodifiableSet(ignore);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean godmode;
|
private boolean godmode;
|
||||||
private boolean muted;
|
private boolean muted;
|
||||||
private boolean jailed;
|
private boolean jailed;
|
||||||
|
@@ -141,6 +141,7 @@ public class UserMap extends StorageObjectMap<IUser> implements IUserMap
|
|||||||
{
|
{
|
||||||
return matchUsers(name, false, false, requester);
|
return matchUsers(name, false, false, requester);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Pattern comma = Pattern.compile(",");
|
private final Pattern comma = Pattern.compile(",");
|
||||||
|
|
||||||
public Set<IUser> matchUsers(final String name, final boolean includeHidden, final boolean includeOffline, final Player requester)
|
public Set<IUser> matchUsers(final String name, final boolean includeHidden, final boolean includeOffline, final Player requester)
|
||||||
|
@@ -30,12 +30,10 @@ public class DateUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
int[] types = new int[]
|
int[] types = new int[]{
|
||||||
{
|
|
||||||
Calendar.YEAR, Calendar.MONTH, Calendar.DAY_OF_MONTH, Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND
|
Calendar.YEAR, Calendar.MONTH, Calendar.DAY_OF_MONTH, Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND
|
||||||
};
|
};
|
||||||
String[] names = new String[]
|
String[] names = new String[]{
|
||||||
{
|
|
||||||
_("year"), _("years"), _("month"), _("months"), _("day"), _("days"), _("hour"), _("hours"), _("minute"), _("minutes"), _("second"), _("seconds")
|
_("year"), _("years"), _("month"), _("months"), _("day"), _("days"), _("hour"), _("hours"), _("minute"), _("minutes"), _("second"), _("seconds")
|
||||||
};
|
};
|
||||||
for (int i = 0; i < types.length; i++)
|
for (int i = 0; i < types.length; i++)
|
||||||
|
@@ -9,8 +9,9 @@ import java.util.Locale;
|
|||||||
|
|
||||||
public class ExecuteTimer
|
public class ExecuteTimer
|
||||||
{
|
{
|
||||||
private final List<ExecuteRecord> times;
|
private final transient List<ExecuteRecord> times;
|
||||||
private final DecimalFormat decimalFormat = new DecimalFormat("#0.000", DecimalFormatSymbols.getInstance(Locale.US));
|
private final transient DecimalFormat decimalFormat = new DecimalFormat("#0.000", DecimalFormatSymbols.getInstance(Locale.US));
|
||||||
|
|
||||||
|
|
||||||
public ExecuteTimer()
|
public ExecuteTimer()
|
||||||
{
|
{
|
||||||
|
@@ -13,15 +13,15 @@ import net.ess3.permissions.DotStarPermission;
|
|||||||
|
|
||||||
public class FormatUtil
|
public class FormatUtil
|
||||||
{
|
{
|
||||||
static final Pattern REPLACE_COLOR_PATTERN = Pattern.compile("&([0-9a-f])");
|
static final transient Pattern REPLACE_COLOR_PATTERN = Pattern.compile("&([0-9a-f])");
|
||||||
static final Pattern REPLACE_MAGIC_PATTERN = Pattern.compile("&(k)");
|
static final transient Pattern REPLACE_MAGIC_PATTERN = Pattern.compile("&(k)");
|
||||||
static final Pattern REPLACE_PATTERN = Pattern.compile("&([0-9a-fk-or])");
|
static final transient Pattern REPLACE_PATTERN = Pattern.compile("&([0-9a-fk-or])");
|
||||||
static final Pattern VANILLA_PATTERN = Pattern.compile("\u00a7+[0-9A-FK-ORa-fk-or]");
|
static final transient Pattern VANILLA_PATTERN = Pattern.compile("\u00a7+[0-9A-FK-ORa-fk-or]");
|
||||||
static final Pattern VANILLA_COLOR_PATTERN = Pattern.compile("\u00a7+[0-9A-Fa-f]");
|
static final transient Pattern VANILLA_COLOR_PATTERN = Pattern.compile("\u00a7+[0-9A-Fa-f]");
|
||||||
static final Pattern REPLACE_FORMAT_PATTERN = Pattern.compile("&([l-or])");
|
static final transient Pattern REPLACE_FORMAT_PATTERN = Pattern.compile("&([l-or])");
|
||||||
static final Pattern VANILLA_FORMAT_PATTERN = Pattern.compile("\u00a7+[L-ORl-or]");
|
static final transient Pattern VANILLA_FORMAT_PATTERN = Pattern.compile("\u00a7+[L-ORl-or]");
|
||||||
static final Pattern VANILLA_MAGIC_PATTERN = Pattern.compile("\u00a7+[Kk]");
|
static final transient Pattern VANILLA_MAGIC_PATTERN = Pattern.compile("\u00a7+[Kk]");
|
||||||
static final Pattern URL_PATTERN = Pattern.compile("((?:(?:https?)://)?[\\w-_\\.]{2,})\\.([a-z]{2,3}(?:/\\S+)?)");
|
static final transient Pattern URL_PATTERN = Pattern.compile("((?:(?:https?)://)?[\\w-_\\.]{2,})\\.([a-z]{2,3}(?:/\\S+)?)");
|
||||||
static DecimalFormat dFormat = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.US));
|
static DecimalFormat dFormat = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.US));
|
||||||
|
|
||||||
static String stripColor(final String input, final Pattern pattern)
|
static String stripColor(final String input, final Pattern pattern)
|
||||||
|
@@ -69,6 +69,7 @@ public class LocationUtil
|
|||||||
}
|
}
|
||||||
return block.getLocation();
|
return block.getLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static int RADIUS = 3;
|
public final static int RADIUS = 3;
|
||||||
public final static Vector3D[] VOLUME;
|
public final static Vector3D[] VOLUME;
|
||||||
|
|
||||||
@@ -81,11 +82,13 @@ public class LocationUtil
|
|||||||
this.y = y;
|
this.y = y;
|
||||||
this.z = z;
|
this.z = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int x;
|
public int x;
|
||||||
public int y;
|
public int y;
|
||||||
public int z;
|
public int z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
List<Vector3D> pos = new ArrayList<Vector3D>();
|
List<Vector3D> pos = new ArrayList<Vector3D>();
|
||||||
|
@@ -30,3 +30,4 @@ public class Target
|
|||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,6 +16,7 @@ public final class Util
|
|||||||
private Util()
|
private Util()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private final static Pattern INVALIDFILECHARS = Pattern.compile("[^\u0020-\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFC]");
|
private final static Pattern INVALIDFILECHARS = Pattern.compile("[^\u0020-\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFC]");
|
||||||
private final static Pattern INVALIDCHARS = Pattern.compile("[^\t\n\r\u0020-\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFC]");
|
private final static Pattern INVALIDCHARS = Pattern.compile("[^\t\n\r\u0020-\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFC]");
|
||||||
|
|
||||||
@@ -214,4 +215,5 @@ public final class Util
|
|||||||
}
|
}
|
||||||
return buf.toString();
|
return buf.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -2,26 +2,38 @@ package net.ess3.utils.gnu.inet.encoding;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
|
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||||
|
* Foundation, Inc.
|
||||||
*
|
*
|
||||||
* Author: Oliver Hitz
|
* Author: Oliver Hitz
|
||||||
*
|
*
|
||||||
* This file is part of GNU Libidn.
|
* This file is part of GNU Libidn.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
|
* This library is free software; you can redistribute it and/or
|
||||||
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
* any later version.
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
* This library is distributed in the hope that it will be useful, but
|
||||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* details.
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||||
|
* USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class offers static methods for encoding/decoding strings using the Punycode algorithm. <ul> <li>RFC3492
|
* This class offers static methods for encoding/decoding strings
|
||||||
* Punycode </ul> Note that this implementation only supports 16-bit Unicode code points.
|
* using the Punycode algorithm.
|
||||||
|
* <ul>
|
||||||
|
* <li>RFC3492 Punycode
|
||||||
|
* </ul>
|
||||||
|
* Note that this implementation only supports 16-bit Unicode code
|
||||||
|
* points.
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Changes by snowleo:
|
* Changes by snowleo:
|
||||||
@@ -112,7 +124,7 @@ public class Punycode
|
|||||||
{
|
{
|
||||||
int q = delta;
|
int q = delta;
|
||||||
|
|
||||||
for (int k = BASE;; k += BASE)
|
for (int k = BASE; ; k += BASE)
|
||||||
{
|
{
|
||||||
int t;
|
int t;
|
||||||
if (k <= bias)
|
if (k <= bias)
|
||||||
@@ -191,7 +203,7 @@ public class Punycode
|
|||||||
int oldi = i;
|
int oldi = i;
|
||||||
int w = 1;
|
int w = 1;
|
||||||
|
|
||||||
for (int k = BASE;; k += BASE)
|
for (int k = BASE; ; k += BASE)
|
||||||
{
|
{
|
||||||
if (d == input.length())
|
if (d == input.length())
|
||||||
{
|
{
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user