Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.80 KB | None | 0 0
  1. import java.text.SimpleDateFormat;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.World;
  5. import org.bukkit.entity.Player;
  6. import org.bukkit.event.EventHandler;
  7. import org.bukkit.event.Listener;
  8. import org.bukkit.event.player.PlayerJoinEvent;
  9. import org.bukkit.plugin.Plugin;
  10. import org.bukkit.plugin.PluginManager;
  11. import org.bukkit.plugin.java.JavaPlugin;
  12. import org.bukkit.scheduler.BukkitRunnable;
  13. import org.mcsg.double0negative.tabapi.TabAPI;
  14.  
  15. import magiccase.command.CaseCommand;
  16. import magiccase.listeners.CaseDropListener;
  17. import magiccase.listeners.CaseKickQuitListener;
  18. import magiccase.listeners.CasePlaceListener;
  19. import net.redinginer.core.commands.Command;
  20. import net.redinginer.core.commands.CommandManager;
  21. import net.redinginer.core.commands.cmd.AutoMsgCommand;
  22. import net.redinginer.core.commands.cmd.BCGCommand;
  23. import net.redinginer.core.commands.cmd.BackupCommand;
  24. import net.redinginer.core.commands.cmd.BanCommand;
  25. import net.redinginer.core.commands.cmd.BanIPCommand;
  26. import net.redinginer.core.commands.cmd.BoyFamerCommand;
  27. import net.redinginer.core.commands.cmd.ChatCommand;
  28. import net.redinginer.core.commands.cmd.ClearCommand;
  29. import net.redinginer.core.commands.cmd.ClearEnderchestCommand;
  30. import net.redinginer.core.commands.cmd.CobblexCommand;
  31. import net.redinginer.core.commands.cmd.ConfigCommand;
  32. import net.redinginer.core.commands.cmd.CraftCommand;
  33. import net.redinginer.core.commands.cmd.DajYTCommand;
  34. import net.redinginer.core.commands.cmd.DayCommand;
  35. import net.redinginer.core.commands.cmd.EfektyCommand;
  36. import net.redinginer.core.commands.cmd.EggCommand;
  37. import net.redinginer.core.commands.cmd.EnableCommand;
  38. import net.redinginer.core.commands.cmd.EnchantCommand;
  39. import net.redinginer.core.commands.cmd.EnderchestCommand;
  40. import net.redinginer.core.commands.cmd.FlyCommand;
  41. import net.redinginer.core.commands.cmd.GamemodeCommand;
  42. import net.redinginer.core.commands.cmd.GcCommand;
  43. import net.redinginer.core.commands.cmd.GetSponsorKitCommand;
  44. import net.redinginer.core.commands.cmd.GiveCommand;
  45. import net.redinginer.core.commands.cmd.GodCommand;
  46. import net.redinginer.core.commands.cmd.GroupCommand;
  47. import net.redinginer.core.commands.cmd.HcCommand;
  48. import net.redinginer.core.commands.cmd.HeadCommand;
  49. import net.redinginer.core.commands.cmd.HealCommand;
  50. import net.redinginer.core.commands.cmd.HelpCommand;
  51. import net.redinginer.core.commands.cmd.HelpOpCommand;
  52. import net.redinginer.core.commands.cmd.HomeCommand;
  53. import net.redinginer.core.commands.cmd.InvCommand;
  54. import net.redinginer.core.commands.cmd.IsCommand;
  55. import net.redinginer.core.commands.cmd.ItemCommand;
  56. import net.redinginer.core.commands.cmd.KickAllCommand;
  57. import net.redinginer.core.commands.cmd.KickCommand;
  58. import net.redinginer.core.commands.cmd.KitCommand;
  59. import net.redinginer.core.commands.cmd.KitsCommand;
  60. import net.redinginer.core.commands.cmd.LevelCommand;
  61. import net.redinginer.core.commands.cmd.ListCommand;
  62. import net.redinginer.core.commands.cmd.NetherCommand;
  63. import net.redinginer.core.commands.cmd.NightCommand;
  64. import net.redinginer.core.commands.cmd.PayCommand;
  65. import net.redinginer.core.commands.cmd.RankingCommand;
  66. import net.redinginer.core.commands.cmd.RenameCommand;
  67. import net.redinginer.core.commands.cmd.RepairCommand;
  68. import net.redinginer.core.commands.cmd.ReplyCommand;
  69. import net.redinginer.core.commands.cmd.SetHomeCommand;
  70. import net.redinginer.core.commands.cmd.SetSpawnCommand;
  71. import net.redinginer.core.commands.cmd.ShopCommand;
  72. import net.redinginer.core.commands.cmd.SlotCommand;
  73. import net.redinginer.core.commands.cmd.SlowmodeCommand;
  74. import net.redinginer.core.commands.cmd.SmietnikCommand;
  75. import net.redinginer.core.commands.cmd.SpawnCommand;
  76. import net.redinginer.core.commands.cmd.SpeedCommand;
  77. import net.redinginer.core.commands.cmd.StatsCommand;
  78. import net.redinginer.core.commands.cmd.StoneCommand;
  79. import net.redinginer.core.commands.cmd.StpCommand;
  80. import net.redinginer.core.commands.cmd.StreamerCommand;
  81. import net.redinginer.core.commands.cmd.TeleportCommand;
  82. import net.redinginer.core.commands.cmd.TellCommand;
  83. import net.redinginer.core.commands.cmd.TpaCommand;
  84. import net.redinginer.core.commands.cmd.TpacceptCommand;
  85. import net.redinginer.core.commands.cmd.TpdenyCommmand;
  86. import net.redinginer.core.commands.cmd.TurboCommand;
  87. import net.redinginer.core.commands.cmd.UnBanCommand;
  88. import net.redinginer.core.commands.cmd.UnBanIpCommand;
  89. import net.redinginer.core.commands.cmd.VanishCommand;
  90. import net.redinginer.core.commands.cmd.VipCommand;
  91. import net.redinginer.core.commands.cmd.WhiteListCommand;
  92. import net.redinginer.core.commands.cmd.WhoIsCommand;
  93. import net.redinginer.core.commands.cmd.WorkBenchCommand;
  94. import net.redinginer.core.commands.cmd.YouTubeCommand;
  95. import net.redinginer.core.commands.cmd.YtlistCommand;
  96. import net.redinginer.core.commands.guild.AllyCommand;
  97. import net.redinginer.core.commands.guild.CreateCommand;
  98. import net.redinginer.core.commands.guild.DeleteCommand;
  99. import net.redinginer.core.commands.guild.EnlargeCommand;
  100. import net.redinginer.core.commands.guild.GaCommand;
  101. import net.redinginer.core.commands.guild.GuildHelpCommand;
  102. import net.redinginer.core.commands.guild.GuildHomeCommand;
  103. import net.redinginer.core.commands.guild.GuildSetHomeCommand;
  104. import net.redinginer.core.commands.guild.InfoCommand;
  105. import net.redinginer.core.commands.guild.InviteCommand;
  106. import net.redinginer.core.commands.guild.JoinCommand;
  107. import net.redinginer.core.commands.guild.LeaderCommand;
  108. import net.redinginer.core.commands.guild.LeaveCommand;
  109. import net.redinginer.core.commands.guild.OwnerCommand;
  110. import net.redinginer.core.commands.guild.ProlongCommand;
  111. import net.redinginer.core.commands.guild.PvpCommand;
  112. import net.redinginer.core.configuration.Config;
  113. import net.redinginer.core.configuration.Lang;
  114. import net.redinginer.core.listeners.AsyncPlayerChatListener;
  115. import net.redinginer.core.listeners.BoyListener;
  116. import net.redinginer.core.listeners.ChatGuildsListener;
  117. import net.redinginer.core.listeners.CheckLoginListener;
  118. import net.redinginer.core.listeners.CobblexListener;
  119. import net.redinginer.core.listeners.DropBlockBreakListener;
  120. import net.redinginer.core.listeners.EntityDamageByEntityListener;
  121. import net.redinginer.core.listeners.EntityDamageListener;
  122. import net.redinginer.core.listeners.EntityDeathListener;
  123. import net.redinginer.core.listeners.GuildExplodeListener;
  124. import net.redinginer.core.listeners.InCommbatInGuildListener;
  125. import net.redinginer.core.listeners.InventoryClickListener;
  126. import net.redinginer.core.listeners.InventoryListener;
  127. import net.redinginer.core.listeners.OpenInventoryListener;
  128. import net.redinginer.core.listeners.PlayerDeathListener;
  129. import net.redinginer.core.listeners.PlayerInteractListener;
  130. import net.redinginer.core.listeners.PlayerJoinListener;
  131. import net.redinginer.core.listeners.PlayerJoinListener1;
  132. import net.redinginer.core.listeners.PlayerMoveListener;
  133. import net.redinginer.core.listeners.PlayerQuitJoinListener;
  134. import net.redinginer.core.listeners.PunchPotyListener;
  135. import net.redinginer.core.listeners.SignChangeListener;
  136. import net.redinginer.core.listeners.TakeCrystalListener;
  137. import net.redinginer.core.listeners.UkownCommandListener;
  138. import net.redinginer.core.listeners.action.BlockBreakListener;
  139. import net.redinginer.core.listeners.action.BlockPlaceListener;
  140. import net.redinginer.core.listeners.action.PlayerBucketEmptyListener;
  141. import net.redinginer.core.listeners.action.PlayerBucketFillListener;
  142. import net.redinginer.core.managers.BanIPManager;
  143. import net.redinginer.core.managers.BanManager;
  144. import net.redinginer.core.managers.CombatManager;
  145. import net.redinginer.core.managers.DeathBanManager;
  146. import net.redinginer.core.managers.DropFile;
  147. import net.redinginer.core.managers.DropManager;
  148. import net.redinginer.core.managers.GuildManager;
  149. import net.redinginer.core.managers.NameTagManager;
  150. import net.redinginer.core.managers.TimerManager;
  151. import net.redinginer.core.managers.UserManager;
  152. import net.redinginer.core.mysql.store.Store;
  153. import net.redinginer.core.mysql.store.modes.StoreMode;
  154. import net.redinginer.core.mysql.store.modes.StoreMySQL;
  155. import net.redinginer.core.mysql.store.modes.StoreSQLITE;
  156. import net.redinginer.core.rank.TabThread;
  157. import net.redinginer.core.tasks.AutoMsgTask;
  158. import net.redinginer.core.tasks.CheckValidityTask;
  159. import net.redinginer.core.tasks.CombatTask;
  160. import net.redinginer.core.tasks.LimitTask;
  161. import net.redinginer.core.tasks.TabFreshRunnable;
  162. import net.redinginer.core.utils.CraftingUtil;
  163. import net.redinginer.core.utils.Logger;
  164. import net.redinginer.core.utils.Ticking;
  165.  
  166. public class CorePlugin extends JavaPlugin implements Listener{
  167.  
  168.  
  169. private static CorePlugin plugin;
  170. private static Store store;
  171. private static PluginManager pluginManager;
  172.  
  173.  
  174. public void onLoad() {
  175. CorePlugin.plugin = this;
  176. }
  177.  
  178. public void onEnable() {
  179. Bukkit.getPluginManager().registerEvents(this, this);
  180. // skrrt
  181. Config.reloadConfig();
  182. Lang.reloadLang();
  183. this.initTab();
  184. for (final Player p : Bukkit.getOnlinePlayers()) {
  185. final Combat c = CombatManager.getCombat(p);
  186. if (c == null) {
  187. CombatManager.createCombat(p);
  188. }
  189. }
  190. new Ticking().start();
  191. new TabThread();
  192. this.registerDatabase();
  193. this.registerManager();
  194. this.registerListener();
  195. this.registerTasks();
  196. registerCommand();
  197. CraftingUtil.registerRecipe();
  198. }
  199.  
  200. public void onDisable() {
  201. Bukkit.getScheduler().cancelTasks((Plugin)this);
  202. for (final Player p : Bukkit.getOnlinePlayers()) {
  203. CombatManager.removeCombat(p);
  204. }
  205. Bukkit.savePlayers();
  206. for (final World w : Bukkit.getWorlds()) {
  207. w.save();
  208. }
  209. try {
  210. Thread.sleep(2000L);
  211. }
  212. catch (InterruptedException e) {
  213. e.printStackTrace();
  214. }
  215. if (CorePlugin.store != null && CorePlugin.store.isConnected()) {
  216. CorePlugin.store.disconnect();
  217. }
  218. CorePlugin.plugin = null;
  219. }
  220.  
  221. public static CorePlugin getPlugin() {
  222. return CorePlugin.plugin;
  223. }
  224.  
  225. protected boolean registerDatabase() {
  226. switch (StoreMode.getByName(Config.DATABASE_MODE)) {
  227. case MYSQL: {
  228. CorePlugin.store = new StoreMySQL(Config.DATABASE_MYSQL_HOST, Config.DATABASE_MYSQL_PORT, Config.DATABASE_MYSQL_USER, Config.DATABASE_MYSQL_PASS, Config.DATABASE_MYSQL_NAME, Config.DATABASE_TABLEPREFIX);
  229. break;
  230. }
  231. case SQLITE: {
  232. CorePlugin.store = new StoreSQLITE(Config.DATABASE_SQLITE_NAME, Config.DATABASE_TABLEPREFIX);
  233. break;
  234. }
  235. default: {
  236. Logger.warning("Value of databse mode is not valid! Using SQLITE as database!");
  237. CorePlugin.store = new StoreSQLITE(Config.DATABASE_SQLITE_NAME, Config.DATABASE_TABLEPREFIX);
  238. break;
  239. }
  240. }
  241. final boolean conn = CorePlugin.store.connect();
  242. if (conn) {
  243. CorePlugin.store.update(true, "CREATE TABLE IF NOT EXISTS `{P}users` (" + ((CorePlugin.store.getStoreMode() == StoreMode.MYSQL) ? "`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT," : "`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,") + "`name` varchar(32) NOT NULL,`points` int(11) NOT NULL, `kills` int(11) NOT NULL, `deaths` int(11) NOT NULL, `assists` int(11) NOT NULL, `logouts` int(11) NOT NULL, `coins` int(11) NOT NULL, `group` varchar(32) NOT NULL, " + "`firstIP` varchar(64) NOT NULL, `lastIP` varchar(64) NOT NULL, `firstJoin` bigint(22) NOT NULL, `kit_start` bigint(64) NOT NULL, `kit_yt` bigint(22) NOT NULL, `kit_tw` bigint(22) NOT NULL, " + "`kit_vip` bigint(22) NOT NULL, `kit_svip` bigint(22) NOT NULL, `turboDrop` bigint(22) NOT NULL, `turboExp` bigint(22) NOT NULL,`home` varchar(255) NOT NULL, `lastKill` varchar(32) NOT NULL, `lastKillTime` bigint(22) NOT NULL, `god` int(1) NOT NULL, `lvl` int(11) NOT NULL, `exp` int(11) NOT NULL);");
  244. CorePlugin.store.update(true, "CREATE TABLE IF NOT EXISTS `{P}guilds` (" + ((CorePlugin.store.getStoreMode() == StoreMode.MYSQL) ? "`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT," : "`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,") + "`tag` varchar(5) NOT NULL, `name` varchar(32) NOT NULL, `owner` varchar(64) NOT NULL, `leader` varchar(64) NOT NULL, `cuboidX` int(11) NOT NULL, `cuboidZ` int(11) NOT NULL, `cuboidSize` int(11) NOT NULL, `life` int(11) NOT NULL, " + "`lifeLastAttack` bigint(22) NOT NULL, `prolong` bigint(22) NOT NULL, `pvp` int(2) NOT NULL, `createTime` bigint(22) NOT NULL, `homeX` double NOT NULL, `homeY` double NOT NULL, `homeZ` double NOT NULL, `ally` varchar(255) NOT NULL, `points` int(11) NOT NULL, `kills` int(11) NOT NULL, `deaths` int(11) NOT NULL, `pvpAlly` int(1) NOT NULL);");
  245. CorePlugin.store.update(true, "CREATE TABLE IF NOT EXISTS `{P}members` (" + ((CorePlugin.store.getStoreMode() == StoreMode.MYSQL) ? "`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT," : "`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,") + "`name` varchar(32) NOT NULL,`tag` varchar(5) NOT NULL);");
  246. CorePlugin.store.update(true, "CREATE TABLE IF NOT EXISTS `{P}bans` (" + ((CorePlugin.store.getStoreMode() == StoreMode.MYSQL) ? "`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT," : "`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,") + "`name` varchar(32) NOT NULL,`time` bigint(22) NOT NULL, `reason` text NOT NULL, `admin` varchar(32) NOT NULL, `start` BIGINT(22) NOT NULL);");
  247. CorePlugin.store.update(true, "CREATE TABLE IF NOT EXISTS `{P}bansip` (" + ((CorePlugin.store.getStoreMode() == StoreMode.MYSQL) ? "`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT," : "`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,") + "`ip` varchar(32) NOT NULL,`time` bigint(22) NOT NULL, `reason` text NOT NULL, `admin` varchar(32) NOT NULL, `start` BIGINT(22) NOT NULL);");
  248. CorePlugin.store.update(true, "CREATE TABLE IF NOT EXISTS `{P}backups` (" + ((CorePlugin.store.getStoreMode() == StoreMode.MYSQL) ? "`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT," : "`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,") + "`name` varchar(32) NOT NULL,`time` bigint(22) NOT NULL, `killer` varchar(32) NOT NULL, `ping` int(11) NOT NULL, `inventory` text NOT NULL, `armor` text NOT NULL, `enderchest` text NOT NULL);");
  249. CorePlugin.store.update(true, "CREATE TABLE IF NOT EXISTS `{P}warp` (" + ((CorePlugin.store.getStoreMode() == StoreMode.MYSQL) ? "`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT," : "`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,") + "`name` varchar(32) NOT NULL,`location` text NOT NULL, `group` varchar(32) NOT NULL NOT NULL);");
  250. CorePlugin.store.update(true, "CREATE TABLE IF NOT EXISTS `{P}deathbans` (" + ((CorePlugin.store.getStoreMode() == StoreMode.MYSQL) ? "`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT," : "`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,") + "`name` varchar(32) NOT NULL,`mode` int(1) NOT NULL, `time` bigint(11) NOT NULL NOT NULL);");
  251. return conn;
  252. }
  253. return conn;
  254. }
  255.  
  256. public static void registerCommand(final Command command) {
  257. CommandManager.register(command);
  258. }
  259.  
  260. public static void registerListener(final Plugin plugin, final Listener... listeners) {
  261. if (CorePlugin.pluginManager == null) {
  262. CorePlugin.pluginManager = Bukkit.getPluginManager();
  263. }
  264. for (final Listener listener : listeners) {
  265. CorePlugin.pluginManager.registerEvents(listener, plugin);
  266. }
  267. }
  268.  
  269.  
  270. public static Store getStore() {
  271. return CorePlugin.store;
  272. }
  273.  
  274. public static void registerCommand() {
  275. registerCommand(new ListCommand());
  276. registerCommand(new RankingCommand());
  277. registerCommand(new GodCommand());
  278. registerCommand(new BanCommand());
  279. registerCommand(new UnBanCommand());
  280. registerCommand(new UnBanIpCommand());
  281. registerCommand(new ChatCommand());
  282. registerCommand(new GamemodeCommand());
  283. registerCommand(new FlyCommand());
  284. registerCommand(new SpawnCommand());
  285. registerCommand(new SetSpawnCommand());
  286. registerCommand(new KitCommand());
  287. registerCommand(new TpacceptCommand());
  288. registerCommand(new TpdenyCommmand());
  289. registerCommand(new TpaCommand());
  290. registerCommand(new ClearCommand());
  291. registerCommand(new EnchantCommand());
  292. registerCommand(new GcCommand());
  293. registerCommand(new KitsCommand());
  294. registerCommand(new ItemCommand());
  295. registerCommand(new EggCommand());
  296. registerCommand(new GiveCommand());
  297. registerCommand(new HeadCommand());
  298. registerCommand(new HealCommand());
  299. registerCommand(new HelpOpCommand());
  300. registerCommand(new HomeCommand());
  301. registerCommand(new KickAllCommand());
  302. registerCommand(new KickCommand());
  303. registerCommand(new ListCommand());
  304. registerCommand(new SetHomeCommand());
  305. registerCommand(new RepairCommand());
  306. registerCommand(new TellCommand());
  307. registerCommand(new ReplyCommand());
  308. registerCommand(new InvCommand());
  309. registerCommand(new SlotCommand());
  310. registerCommand(new SlowmodeCommand());
  311. registerCommand(new StpCommand());
  312. registerCommand(new StreamerCommand());
  313. registerCommand(new VipCommand());
  314. registerCommand(new YouTubeCommand());
  315. registerCommand(new CraftCommand());
  316. registerCommand(new SmietnikCommand());
  317. registerCommand(new BCGCommand());
  318. registerCommand(new TpaCommand());
  319. registerCommand(new WhiteListCommand());
  320. registerCommand(new PayCommand());
  321. registerCommand(new WhoIsCommand());
  322. registerCommand(new StoneCommand());
  323. registerCommand(new TeleportCommand());
  324. registerCommand(new BackupCommand());
  325. registerCommand(new BanIPCommand());
  326. registerCommand(new RenameCommand());
  327. registerCommand(new BoyFamerCommand());
  328. registerCommand(new IsCommand());
  329. registerCommand(new CobblexCommand());
  330. registerCommand(new WorkBenchCommand());
  331. registerCommand(new EnderchestCommand());
  332. registerCommand(new SpeedCommand());
  333. registerCommand(new LevelCommand());
  334. registerCommand(new TurboCommand());
  335. registerCommand(new StatsCommand());
  336. registerCommand(new CaseCommand());
  337. registerCommand(new CobblexCommand());
  338. registerCommand(new EfektyCommand());
  339. registerCommand(new HcCommand());
  340. registerCommand(new DayCommand());
  341. registerCommand(new NightCommand());
  342. registerCommand(new NetherCommand());
  343. registerCommand(new EnableCommand());
  344. registerCommand(new ConfigCommand());
  345. registerCommand(new ClearEnderchestCommand());
  346. registerCommand(new GaCommand());
  347. registerCommand(new AllyCommand());
  348. registerCommand(new CreateCommand());
  349. registerCommand(new DeleteCommand());
  350. registerCommand(new GetSponsorKitCommand());
  351. registerCommand(new EnlargeCommand());
  352. registerCommand(new GuildSetHomeCommand());
  353. registerCommand(new GuildHomeCommand());
  354. registerCommand(new InfoCommand());
  355. registerCommand(new InviteCommand());
  356. registerCommand(new net.redinginer.core.commands.guild.ItemCommand());
  357. registerCommand(new JoinCommand());
  358. registerCommand(new net.redinginer.core.commands.guild.KickCommand());
  359. registerCommand(new KickCommand());
  360. registerCommand(new LeaderCommand());
  361. registerCommand(new OwnerCommand());
  362. registerCommand(new ProlongCommand());
  363. registerCommand(new PvpCommand());
  364. registerCommand(new AutoMsgCommand());
  365. registerCommand(new LeaveCommand());
  366. registerCommand(new HelpCommand());
  367. registerCommand(new GuildHelpCommand());
  368. registerCommand(new GroupCommand());
  369. registerCommand(new VanishCommand());
  370. registerCommand(new ShopCommand());
  371. registerCommand(new YtlistCommand());
  372. registerCommand(new DajYTCommand());
  373. }
  374.  
  375. public void registerTasks() {
  376. new CheckValidityTask().runTaskTimer((Plugin)this, 2400L, 2400L);
  377. new CombatTask().runTaskTimerAsynchronously((Plugin)this, 40L, 20L);
  378. new LimitTask().runTaskTimer((Plugin)this, 300L, 300L);
  379. new AutoMsgTask().runTaskTimerAsynchronously((Plugin)this, 1200L, 1200L);
  380. new TabFreshRunnable().runTaskTimerAsynchronously((Plugin)this, 600L, 600L);
  381. }
  382.  
  383. public void registerManager() {
  384. NameTagManager.enable();
  385. DropFile.saveDefaultConfig();
  386. DropManager.setup();
  387. UserManager.loadUsers();
  388. GuildManager.loadGuilds();
  389. DeathBanManager.loadDeathsBans();
  390. BanManager.loadBans();
  391. BanIPManager.loadBans();
  392. }
  393.  
  394. private void initTab() {
  395. /*BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new PointsVariable("points"));
  396. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new KillsVariable("kills"));
  397. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new DeathsVariable("deaths"));
  398. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new CoinsVariable("coins"));
  399. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new LvlVariable("lvl"));
  400. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new GuildVariable("guild"));
  401. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new GuildPointsVariable("gpoints"));
  402. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new GuildKillsVariable("gkills"));
  403. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new GuildDeathsVariable("gdeaths"));
  404. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new GuildSizeVariable("gsize"));
  405. for (int i = 1; i < 16; ++i) {
  406. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new TopVariable("top" + i, i));
  407. }
  408. for (int i = 1; i < 16; ++i) {
  409. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new AssistTopVariable("assiststop" + i, i));
  410. }
  411. for (int i = 1; i < 16; ++i) {
  412. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new DeathsTopVariable("deathstop" + i, i));
  413. }
  414. for (int i = 1; i < 16; ++i) {
  415. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new KillsTopVariable("killstop" + i, i));
  416. }
  417. for (int i = 1; i < 16; ++i) {
  418. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new LvlTopVariable("ltop" + i, i));
  419. }
  420. for (int i = 1; i < 16; ++i) {
  421. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new TopGuildVariable("gtop" + i, i));
  422. }
  423. for (int i = 1; i < 16; ++i) {
  424. BungeeTabListPlusBukkitAPI.registerVariable((Plugin)this, (Variable)new TopCoinsVariable("coinstop" + i, i));
  425. }
  426. */}
  427.  
  428.  
  429.  
  430. public void registerListener() {
  431. registerListener((Plugin)this, new InventoryClickListener(), new PlayerJoinListener1(), new PlayerQuitJoinListener(), new PlayerJoinListener(), new TimerManager(), new AsyncPlayerChatListener()
  432. , new ChatGuildsListener(), new PlayerMoveListener(), new BlockBreakListener(), new BlockPlaceListener(), new PlayerBucketEmptyListener(), new PlayerBucketFillListener()
  433. , new GuildExplodeListener(), new EntityDamageByEntityListener(), new EntityDamageListener(), new PlayerDeathListener(), new InCommbatInGuildListener(), new TakeCrystalListener()
  434. , new InventoryClickListener(), new CheckLoginListener(), new BoyListener(), new PlayerInteractListener(), new PunchPotyListener(), new DropBlockBreakListener(), new EntityDeathListener()
  435. , new InventoryListener(), new OpenInventoryListener(), new SignChangeListener(), new CaseDropListener(), new CasePlaceListener(), new CaseKickQuitListener()
  436. , new magiccase.listeners.InventoryClickListener(), new CobblexListener(), new UkownCommandListener());
  437. }
  438. @EventHandler
  439. public void onTab(PlayerJoinEvent e) {
  440. new BukkitRunnable() {
  441. public void run() {
  442. TabAPI.setPriority(CorePlugin.getPlugin(), e.getPlayer(), 2);
  443. TabAPI.setTabString(CorePlugin.getPlugin(),e.getPlayer(), 2, 2, "&4&lELO", 1);
  444. TabAPI.updatePlayer(e.getPlayer());
  445.  
  446. }
  447. }.runTaskLater(CorePlugin.getPlugin(), 3);
  448. }
  449. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement