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