PageRenderTime 96ms CodeModel.GetById 52ms RepoModel.GetById 8ms app.codeStats 0ms

/Essentials/src/com/earth2me/essentials/Essentials.java

https://github.com/YellowFellow/Essentials
Java | 688 lines | 594 code | 69 blank | 25 comment | 78 complexity | 6979518c836b44525275fe86f577a6da MD5 | raw file
  1. /*
  2. * Essentials - a bukkit plugin
  3. * Copyright (C) 2011 Essentials Team
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. package com.earth2me.essentials;
  19. import com.earth2me.essentials.api.Economy;
  20. import com.earth2me.essentials.commands.EssentialsCommand;
  21. import java.io.*;
  22. import java.util.*;
  23. import java.util.logging.*;
  24. import org.bukkit.*;
  25. import org.bukkit.command.Command;
  26. import org.bukkit.command.CommandSender;
  27. import com.earth2me.essentials.commands.IEssentialsCommand;
  28. import com.earth2me.essentials.commands.NoChargeException;
  29. import com.earth2me.essentials.commands.NotEnoughArgumentsException;
  30. import com.earth2me.essentials.perm.PermissionsHandler;
  31. import com.earth2me.essentials.register.payment.Methods;
  32. import com.earth2me.essentials.signs.SignBlockListener;
  33. import com.earth2me.essentials.signs.SignEntityListener;
  34. import com.earth2me.essentials.signs.SignPlayerListener;
  35. import java.math.BigInteger;
  36. import java.util.regex.Matcher;
  37. import java.util.regex.Pattern;
  38. import org.bukkit.command.PluginCommand;
  39. import org.bukkit.entity.Player;
  40. import org.bukkit.event.Event.Priority;
  41. import org.bukkit.event.Event.Type;
  42. import org.bukkit.plugin.*;
  43. import org.bukkit.plugin.java.*;
  44. import org.bukkit.scheduler.BukkitScheduler;
  45. public class Essentials extends JavaPlugin implements IEssentials
  46. {
  47. public static final int BUKKIT_VERSION = 1060;
  48. private static final Logger LOGGER = Logger.getLogger("Minecraft");
  49. private transient ISettings settings;
  50. private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this);
  51. private transient Spawn spawn;
  52. private transient Jail jail;
  53. private transient Warps warps;
  54. private transient Worth worth;
  55. private transient List<IConf> confList;
  56. private transient Backup backup;
  57. private transient ItemDb itemDb;
  58. private transient EssentialsUpdateTimer updateTimer;
  59. private transient final Methods paymentMethod = new Methods();
  60. private transient final static boolean enableErrorLogging = false;
  61. private transient final EssentialsErrorHandler errorHandler = new EssentialsErrorHandler();
  62. private transient PermissionsHandler permissionsHandler;
  63. private transient UserMap userMap;
  64. @Override
  65. public ISettings getSettings()
  66. {
  67. return settings;
  68. }
  69. public void setupForTesting(final Server server) throws IOException, InvalidDescriptionException
  70. {
  71. final File dataFolder = File.createTempFile("essentialstest", "");
  72. if (!dataFolder.delete())
  73. {
  74. throw new IOException();
  75. }
  76. if (!dataFolder.mkdir())
  77. {
  78. throw new IOException();
  79. }
  80. LOGGER.log(Level.INFO, Util.i18n("usingTempFolderForTesting"));
  81. LOGGER.log(Level.INFO, dataFolder.toString());
  82. this.initialize(null, server, new PluginDescriptionFile(new FileReader(new File("src" + File.separator + "plugin.yml"))), dataFolder, null, null);
  83. settings = new Settings(this);
  84. userMap = new UserMap(this);
  85. permissionsHandler = new PermissionsHandler(this, false);
  86. Economy.setEss(this);
  87. }
  88. @Override
  89. public void onEnable()
  90. {
  91. final String[] javaversion = System.getProperty("java.version").split("\\.", 3);
  92. if (javaversion == null || javaversion.length < 2 || Integer.parseInt(javaversion[1]) < 6)
  93. {
  94. LOGGER.log(Level.SEVERE, "Java version not supported! Please install Java 1.6. You have " + System.getProperty("java.version"));
  95. }
  96. if (enableErrorLogging)
  97. {
  98. LOGGER.addHandler(errorHandler);
  99. }
  100. final EssentialsUpgrade upgrade = new EssentialsUpgrade(this);
  101. upgrade.beforeSettings();
  102. confList = new ArrayList<IConf>();
  103. settings = new Settings(this);
  104. confList.add(settings);
  105. upgrade.afterSettings();
  106. Util.updateLocale(settings.getLocale(), this);
  107. userMap = new UserMap(this);
  108. confList.add(userMap);
  109. spawn = new Spawn(getServer(), this.getDataFolder());
  110. confList.add(spawn);
  111. warps = new Warps(getServer(), this.getDataFolder());
  112. confList.add(warps);
  113. worth = new Worth(this.getDataFolder());
  114. confList.add(worth);
  115. itemDb = new ItemDb(this);
  116. confList.add(itemDb);
  117. reload();
  118. backup = new Backup(this);
  119. final PluginManager pm = getServer().getPluginManager();
  120. for (Plugin plugin : pm.getPlugins())
  121. {
  122. if (plugin.getDescription().getName().startsWith("Essentials")
  123. && !plugin.getDescription().getVersion().equals(this.getDescription().getVersion()))
  124. {
  125. LOGGER.log(Level.WARNING, Util.format("versionMismatch", plugin.getDescription().getName()));
  126. }
  127. }
  128. final Matcher versionMatch = Pattern.compile("git-Bukkit-([0-9]+).([0-9]+).([0-9]+)-[0-9]+-[0-9a-z]+-b([0-9]+)jnks.*").matcher(getServer().getVersion());
  129. if (versionMatch.matches())
  130. {
  131. final int versionNumber = Integer.parseInt(versionMatch.group(4));
  132. if (versionNumber < BUKKIT_VERSION)
  133. {
  134. LOGGER.log(Level.WARNING, Util.i18n("notRecommendedBukkit"));
  135. }
  136. }
  137. else
  138. {
  139. LOGGER.log(Level.INFO, Util.i18n("bukkitFormatChanged"));
  140. }
  141. permissionsHandler = new PermissionsHandler(this, settings.useBukkitPermissions());
  142. final EssentialsPluginListener serverListener = new EssentialsPluginListener(this);
  143. pm.registerEvent(Type.PLUGIN_ENABLE, serverListener, Priority.Low, this);
  144. pm.registerEvent(Type.PLUGIN_DISABLE, serverListener, Priority.Low, this);
  145. confList.add(serverListener);
  146. final EssentialsPlayerListener playerListener = new EssentialsPlayerListener(this);
  147. pm.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this);
  148. pm.registerEvent(Type.PLAYER_QUIT, playerListener, Priority.Monitor, this);
  149. pm.registerEvent(Type.PLAYER_CHAT, playerListener, Priority.Lowest, this);
  150. pm.registerEvent(Type.PLAYER_COMMAND_PREPROCESS, playerListener, Priority.Lowest, this);
  151. pm.registerEvent(Type.PLAYER_MOVE, playerListener, Priority.High, this);
  152. pm.registerEvent(Type.PLAYER_LOGIN, playerListener, Priority.High, this);
  153. pm.registerEvent(Type.PLAYER_TELEPORT, playerListener, Priority.High, this);
  154. pm.registerEvent(Type.PLAYER_INTERACT, playerListener, Priority.High, this);
  155. pm.registerEvent(Type.PLAYER_EGG_THROW, playerListener, Priority.High, this);
  156. pm.registerEvent(Type.PLAYER_BUCKET_EMPTY, playerListener, Priority.High, this);
  157. pm.registerEvent(Type.PLAYER_ANIMATION, playerListener, Priority.High, this);
  158. final EssentialsBlockListener blockListener = new EssentialsBlockListener(this);
  159. pm.registerEvent(Type.BLOCK_PLACE, blockListener, Priority.Lowest, this);
  160. final SignBlockListener signBlockListener = new SignBlockListener(this);
  161. pm.registerEvent(Type.SIGN_CHANGE, signBlockListener, Priority.Highest, this);
  162. pm.registerEvent(Type.BLOCK_PLACE, signBlockListener, Priority.Low, this);
  163. pm.registerEvent(Type.BLOCK_BREAK, signBlockListener, Priority.Highest, this);
  164. pm.registerEvent(Type.BLOCK_IGNITE, signBlockListener, Priority.Low, this);
  165. pm.registerEvent(Type.BLOCK_BURN, signBlockListener, Priority.Low, this);
  166. pm.registerEvent(Type.BLOCK_PISTON_EXTEND, signBlockListener, Priority.Low, this);
  167. pm.registerEvent(Type.BLOCK_PISTON_RETRACT, signBlockListener, Priority.Low, this);
  168. final SignPlayerListener signPlayerListener = new SignPlayerListener(this);
  169. pm.registerEvent(Type.PLAYER_INTERACT, signPlayerListener, Priority.Low, this);
  170. final SignEntityListener signEntityListener = new SignEntityListener(this);
  171. pm.registerEvent(Type.ENTITY_EXPLODE, signEntityListener, Priority.Low, this);
  172. pm.registerEvent(Type.ENDERMAN_PICKUP, signEntityListener, Priority.Low, this);
  173. final EssentialsEntityListener entityListener = new EssentialsEntityListener(this);
  174. pm.registerEvent(Type.ENTITY_DAMAGE, entityListener, Priority.Lowest, this);
  175. pm.registerEvent(Type.ENTITY_COMBUST, entityListener, Priority.Lowest, this);
  176. pm.registerEvent(Type.ENTITY_DEATH, entityListener, Priority.Lowest, this);
  177. pm.registerEvent(Type.FOOD_LEVEL_CHANGE, entityListener, Priority.Lowest, this);
  178. jail = new Jail(this);
  179. final JailPlayerListener jailPlayerListener = new JailPlayerListener(this);
  180. confList.add(jail);
  181. pm.registerEvent(Type.BLOCK_BREAK, jail, Priority.Low, this);
  182. pm.registerEvent(Type.BLOCK_DAMAGE, jail, Priority.Low, this);
  183. pm.registerEvent(Type.BLOCK_PLACE, jail, Priority.Low, this);
  184. pm.registerEvent(Type.PLAYER_INTERACT, jailPlayerListener, Priority.Low, this);
  185. pm.registerEvent(Type.PLAYER_RESPAWN, jailPlayerListener, Priority.High, this);
  186. pm.registerEvent(Type.PLAYER_TELEPORT, jailPlayerListener, Priority.High, this);
  187. pm.registerEvent(Type.PLAYER_JOIN, jailPlayerListener, Priority.High, this);
  188. if (settings.isNetherEnabled() && getServer().getWorlds().size() < 2)
  189. {
  190. getServer().createWorld(settings.getNetherName(), World.Environment.NETHER);
  191. }
  192. pm.registerEvent(Type.ENTITY_EXPLODE, tntListener, Priority.High, this);
  193. final EssentialsTimer timer = new EssentialsTimer(this);
  194. getScheduler().scheduleSyncRepeatingTask(this, timer, 1, 100);
  195. Economy.setEss(this);
  196. if (getSettings().isUpdateEnabled())
  197. {
  198. updateTimer = new EssentialsUpdateTimer(this);
  199. getScheduler().scheduleAsyncRepeatingTask(this, updateTimer, 20 * 60 * 10, 20 * 3600 * 6);
  200. }
  201. LOGGER.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), Util.joinList(this.getDescription().getAuthors())));
  202. }
  203. @Override
  204. public void onDisable()
  205. {
  206. Trade.closeLog();
  207. LOGGER.removeHandler(errorHandler);
  208. }
  209. @Override
  210. public void reload()
  211. {
  212. Trade.closeLog();
  213. for (IConf iConf : confList)
  214. {
  215. iConf.reloadConfig();
  216. }
  217. Util.updateLocale(settings.getLocale(), this);
  218. // for motd
  219. getConfiguration().load();
  220. }
  221. @Override
  222. public String[] getMotd(final CommandSender sender, final String def)
  223. {
  224. return getLines(sender, "motd", def);
  225. }
  226. @Override
  227. public String[] getLines(final CommandSender sender, final String node, final String def)
  228. {
  229. List<String> lines = (List<String>)getConfiguration().getProperty(node);
  230. if (lines == null)
  231. {
  232. return new String[0];
  233. }
  234. String[] retval = new String[lines.size()];
  235. if (lines.isEmpty() || lines.get(0) == null)
  236. {
  237. try
  238. {
  239. lines = new ArrayList<String>();
  240. // "[]" in YaML indicates empty array, so respect that
  241. if (!getConfiguration().getString(node, def).equals("[]"))
  242. {
  243. lines.add(getConfiguration().getString(node, def));
  244. retval = new String[lines.size()];
  245. }
  246. }
  247. catch (Throwable ex2)
  248. {
  249. LOGGER.log(Level.WARNING, Util.format("corruptNodeInConfig", node));
  250. return new String[0];
  251. }
  252. }
  253. // if still empty, call it a day
  254. if (lines == null || lines.isEmpty() || lines.get(0) == null)
  255. {
  256. return new String[0];
  257. }
  258. for (int i = 0; i < lines.size(); i++)
  259. {
  260. String m = lines.get(i);
  261. if (m == null)
  262. {
  263. continue;
  264. }
  265. m = m.replace('&', '§').replace("§§", "&");
  266. if (sender instanceof User || sender instanceof Player)
  267. {
  268. User user = getUser(sender);
  269. m = m.replace("{PLAYER}", user.getDisplayName());
  270. m = m.replace("{IP}", user.getAddress().toString());
  271. m = m.replace("{BALANCE}", Double.toString(user.getMoney()));
  272. m = m.replace("{MAILS}", Integer.toString(user.getMails().size()));
  273. m = m.replace("{WORLD}", user.getLocation().getWorld().getName());
  274. }
  275. int playerHidden = 0;
  276. for (Player p : getServer().getOnlinePlayers())
  277. {
  278. if (getUser(p).isHidden())
  279. {
  280. playerHidden++;
  281. }
  282. }
  283. m = m.replace("{ONLINE}", Integer.toString(getServer().getOnlinePlayers().length - playerHidden));
  284. m = m.replace("{UNIQUE}", Integer.toString(userMap.getUniqueUsers()));
  285. if (m.matches(".*\\{PLAYERLIST\\}.*"))
  286. {
  287. StringBuilder online = new StringBuilder();
  288. for (Player p : getServer().getOnlinePlayers())
  289. {
  290. if (getUser(p).isHidden())
  291. {
  292. continue;
  293. }
  294. if (online.length() > 0)
  295. {
  296. online.append(", ");
  297. }
  298. online.append(p.getDisplayName());
  299. }
  300. m = m.replace("{PLAYERLIST}", online.toString());
  301. }
  302. if (sender instanceof Player)
  303. {
  304. try
  305. {
  306. Class User = getClassLoader().loadClass("bukkit.Vandolis.User");
  307. Object vuser = User.getConstructor(User.class).newInstance((Player)sender);
  308. m = m.replace("{RED:BALANCE}", User.getMethod("getMoney").invoke(vuser).toString());
  309. m = m.replace("{RED:BUYS}", User.getMethod("getNumTransactionsBuy").invoke(vuser).toString());
  310. m = m.replace("{RED:SELLS}", User.getMethod("getNumTransactionsSell").invoke(vuser).toString());
  311. }
  312. catch (Throwable ex)
  313. {
  314. m = m.replace("{RED:BALANCE}", "N/A");
  315. m = m.replace("{RED:BUYS}", "N/A");
  316. m = m.replace("{RED:SELLS}", "N/A");
  317. }
  318. }
  319. retval[i] = m + " ";
  320. }
  321. return retval;
  322. }
  323. @Override
  324. public boolean onCommand(final CommandSender sender, final Command command, final String commandLabel, final String[] args)
  325. {
  326. return onCommandEssentials(sender, command, commandLabel, args, Essentials.class.getClassLoader(), "com.earth2me.essentials.commands.Command", "essentials.");
  327. }
  328. @Override
  329. public boolean onCommandEssentials(final CommandSender sender, final Command command, final String commandLabel, final String[] args, final ClassLoader classLoader, final String commandPath, final String permissionPrefix)
  330. {
  331. // Allow plugins to override the command via onCommand
  332. if (!getSettings().isCommandOverridden(command.getName()) && !commandLabel.startsWith("e"))
  333. {
  334. for (Plugin p : getServer().getPluginManager().getPlugins())
  335. {
  336. if (p.getDescription().getMain().contains("com.earth2me.essentials"))
  337. {
  338. continue;
  339. }
  340. final PluginDescriptionFile desc = p.getDescription();
  341. if (desc == null)
  342. {
  343. continue;
  344. }
  345. if (desc.getName() == null)
  346. {
  347. continue;
  348. }
  349. final PluginCommand pc = getServer().getPluginCommand(desc.getName() + ":" + commandLabel);
  350. if (pc != null)
  351. {
  352. return pc.execute(sender, commandLabel, args);
  353. }
  354. }
  355. }
  356. try
  357. {
  358. User user = null;
  359. if (sender instanceof Player)
  360. {
  361. user = getUser(sender);
  362. LOGGER.log(Level.INFO, String.format("[PLAYER_COMMAND] %s: /%s %s ", ((Player)sender).getName(), commandLabel, EssentialsCommand.getFinalArg(args, 0)));
  363. }
  364. // New mail notification
  365. if (user != null && !getSettings().isCommandDisabled("mail") && !commandLabel.equals("mail") && user.isAuthorized("essentials.mail"))
  366. {
  367. final List<String> mail = user.getMails();
  368. if (mail != null && !mail.isEmpty())
  369. {
  370. user.sendMessage(Util.format("youHaveNewMail", mail.size()));
  371. }
  372. }
  373. // Check for disabled commands
  374. if (getSettings().isCommandDisabled(commandLabel))
  375. {
  376. return true;
  377. }
  378. IEssentialsCommand cmd;
  379. try
  380. {
  381. cmd = (IEssentialsCommand)classLoader.loadClass(commandPath + command.getName()).newInstance();
  382. cmd.setEssentials(this);
  383. }
  384. catch (Exception ex)
  385. {
  386. sender.sendMessage(Util.format("commandNotLoaded", commandLabel));
  387. LOGGER.log(Level.SEVERE, Util.format("commandNotLoaded", commandLabel), ex);
  388. return true;
  389. }
  390. // Check authorization
  391. if (user != null && !user.isAuthorized(cmd, permissionPrefix))
  392. {
  393. LOGGER.log(Level.WARNING, Util.format("deniedAccessCommand", user.getName()));
  394. user.sendMessage(Util.i18n("noAccessCommand"));
  395. return true;
  396. }
  397. // Run the command
  398. try
  399. {
  400. if (user == null)
  401. {
  402. cmd.run(getServer(), sender, commandLabel, command, args);
  403. }
  404. else
  405. {
  406. cmd.run(getServer(), user, commandLabel, command, args);
  407. }
  408. return true;
  409. }
  410. catch (NoChargeException ex)
  411. {
  412. return true;
  413. }
  414. catch (NotEnoughArgumentsException ex)
  415. {
  416. sender.sendMessage(command.getDescription());
  417. sender.sendMessage(command.getUsage().replaceAll("<command>", commandLabel));
  418. return true;
  419. }
  420. catch (Throwable ex)
  421. {
  422. showError(sender, ex, commandLabel);
  423. return true;
  424. }
  425. }
  426. catch (Throwable ex)
  427. {
  428. LOGGER.log(Level.SEVERE, Util.format("commandFailed", commandLabel), ex);
  429. return true;
  430. }
  431. }
  432. @Override
  433. public void showError(final CommandSender sender, final Throwable exception, final String commandLabel)
  434. {
  435. sender.sendMessage(Util.format("errorWithMessage", exception.getMessage()));
  436. final LogRecord logRecord = new LogRecord(Level.WARNING, Util.format("errorCallingCommand", commandLabel));
  437. logRecord.setThrown(exception);
  438. if (getSettings().isDebug())
  439. {
  440. LOGGER.log(logRecord);
  441. }
  442. else
  443. {
  444. if (enableErrorLogging)
  445. {
  446. errorHandler.publish(logRecord);
  447. errorHandler.flush();
  448. }
  449. }
  450. }
  451. @Override
  452. public BukkitScheduler getScheduler()
  453. {
  454. return this.getServer().getScheduler();
  455. }
  456. @Override
  457. public Jail getJail()
  458. {
  459. return jail;
  460. }
  461. @Override
  462. public Warps getWarps()
  463. {
  464. return warps;
  465. }
  466. @Override
  467. public Worth getWorth()
  468. {
  469. return worth;
  470. }
  471. @Override
  472. public Backup getBackup()
  473. {
  474. return backup;
  475. }
  476. @Override
  477. public Spawn getSpawn()
  478. {
  479. return spawn;
  480. }
  481. @Override
  482. public User getUser(final Object base)
  483. {
  484. if (base instanceof Player)
  485. {
  486. return getUser((Player)base);
  487. }
  488. if (base instanceof String)
  489. {
  490. try
  491. {
  492. return userMap.getUser((String)base);
  493. }
  494. catch (NullPointerException ex)
  495. {
  496. return null;
  497. }
  498. }
  499. return null;
  500. }
  501. private <T extends Player> User getUser(final T base)
  502. {
  503. if (base == null)
  504. {
  505. return null;
  506. }
  507. if (base instanceof User)
  508. {
  509. return (User)base;
  510. }
  511. try
  512. {
  513. return userMap.getUser(base.getName()).update(base);
  514. }
  515. catch (NullPointerException ex)
  516. {
  517. return new User(base, this);
  518. }
  519. }
  520. @Override
  521. public User getOfflineUser(final String name)
  522. {
  523. try
  524. {
  525. return userMap.getUser(name);
  526. }
  527. catch (NullPointerException ex)
  528. {
  529. return null;
  530. }
  531. }
  532. @Override
  533. public World getWorld(final String name)
  534. {
  535. if (name.matches("[0-9]+"))
  536. {
  537. final int worldId = Integer.parseInt(name);
  538. if (worldId < getServer().getWorlds().size())
  539. {
  540. return getServer().getWorlds().get(worldId);
  541. }
  542. }
  543. return getServer().getWorld(name);
  544. }
  545. @Override
  546. public void addReloadListener(final IConf listener)
  547. {
  548. confList.add(listener);
  549. }
  550. @Override
  551. public Methods getPaymentMethod()
  552. {
  553. return paymentMethod;
  554. }
  555. @Override
  556. public int broadcastMessage(final IUser sender, final String message)
  557. {
  558. if (sender == null) {
  559. return getServer().broadcastMessage(message);
  560. }
  561. if (sender.isHidden()) {
  562. return 0;
  563. }
  564. final Player[] players = getServer().getOnlinePlayers();
  565. for (Player player : players)
  566. {
  567. final User user = getUser(player);
  568. if (!user.isIgnoredPlayer(sender.getName()))
  569. {
  570. player.sendMessage(message);
  571. }
  572. }
  573. return players.length;
  574. }
  575. public Map<BigInteger, String> getErrors()
  576. {
  577. return errorHandler.getErrors();
  578. }
  579. @Override
  580. public int scheduleAsyncDelayedTask(final Runnable run)
  581. {
  582. return this.getScheduler().scheduleAsyncDelayedTask(this, run);
  583. }
  584. @Override
  585. public int scheduleSyncDelayedTask(final Runnable run)
  586. {
  587. return this.getScheduler().scheduleSyncDelayedTask(this, run);
  588. }
  589. @Override
  590. public int scheduleSyncDelayedTask(final Runnable run, final long delay)
  591. {
  592. return this.getScheduler().scheduleSyncDelayedTask(this, run, delay);
  593. }
  594. @Override
  595. public int scheduleSyncRepeatingTask(final Runnable run, final long delay, final long period)
  596. {
  597. return this.getScheduler().scheduleSyncRepeatingTask(this, run, delay, period);
  598. }
  599. @Override
  600. public TNTExplodeListener getTNTListener()
  601. {
  602. return tntListener;
  603. }
  604. @Override
  605. public PermissionsHandler getPermissionsHandler()
  606. {
  607. return permissionsHandler;
  608. }
  609. @Override
  610. public ItemDb getItemDb()
  611. {
  612. return itemDb;
  613. }
  614. @Override
  615. public UserMap getUserMap()
  616. {
  617. return userMap;
  618. }
  619. }