· 8 years ago · Mar 20, 2018, 07:32 PM
1import java.text.SimpleDateFormat;
2
3import org.bukkit.Bukkit;
4import org.bukkit.World;
5import org.bukkit.entity.Player;
6import org.bukkit.event.EventHandler;
7import org.bukkit.event.Listener;
8import org.bukkit.event.player.PlayerJoinEvent;
9import org.bukkit.plugin.Plugin;
10import org.bukkit.plugin.PluginManager;
11import org.bukkit.plugin.java.JavaPlugin;
12import org.bukkit.scheduler.BukkitRunnable;
13import org.mcsg.double0negative.tabapi.TabAPI;
14
15import magiccase.command.CaseCommand;
16import magiccase.listeners.CaseDropListener;
17import magiccase.listeners.CaseKickQuitListener;
18import magiccase.listeners.CasePlaceListener;
19import net.redinginer.core.commands.Command;
20import net.redinginer.core.commands.CommandManager;
21import net.redinginer.core.commands.cmd.AutoMsgCommand;
22import net.redinginer.core.commands.cmd.BCGCommand;
23import net.redinginer.core.commands.cmd.BackupCommand;
24import net.redinginer.core.commands.cmd.BanCommand;
25import net.redinginer.core.commands.cmd.BanIPCommand;
26import net.redinginer.core.commands.cmd.BoyFamerCommand;
27import net.redinginer.core.commands.cmd.ChatCommand;
28import net.redinginer.core.commands.cmd.ClearCommand;
29import net.redinginer.core.commands.cmd.ClearEnderchestCommand;
30import net.redinginer.core.commands.cmd.CobblexCommand;
31import net.redinginer.core.commands.cmd.ConfigCommand;
32import net.redinginer.core.commands.cmd.CraftCommand;
33import net.redinginer.core.commands.cmd.DajYTCommand;
34import net.redinginer.core.commands.cmd.DayCommand;
35import net.redinginer.core.commands.cmd.EfektyCommand;
36import net.redinginer.core.commands.cmd.EggCommand;
37import net.redinginer.core.commands.cmd.EnableCommand;
38import net.redinginer.core.commands.cmd.EnchantCommand;
39import net.redinginer.core.commands.cmd.EnderchestCommand;
40import net.redinginer.core.commands.cmd.FlyCommand;
41import net.redinginer.core.commands.cmd.GamemodeCommand;
42import net.redinginer.core.commands.cmd.GcCommand;
43import net.redinginer.core.commands.cmd.GetSponsorKitCommand;
44import net.redinginer.core.commands.cmd.GiveCommand;
45import net.redinginer.core.commands.cmd.GodCommand;
46import net.redinginer.core.commands.cmd.GroupCommand;
47import net.redinginer.core.commands.cmd.HcCommand;
48import net.redinginer.core.commands.cmd.HeadCommand;
49import net.redinginer.core.commands.cmd.HealCommand;
50import net.redinginer.core.commands.cmd.HelpCommand;
51import net.redinginer.core.commands.cmd.HelpOpCommand;
52import net.redinginer.core.commands.cmd.HomeCommand;
53import net.redinginer.core.commands.cmd.InvCommand;
54import net.redinginer.core.commands.cmd.IsCommand;
55import net.redinginer.core.commands.cmd.ItemCommand;
56import net.redinginer.core.commands.cmd.KickAllCommand;
57import net.redinginer.core.commands.cmd.KickCommand;
58import net.redinginer.core.commands.cmd.KitCommand;
59import net.redinginer.core.commands.cmd.KitsCommand;
60import net.redinginer.core.commands.cmd.LevelCommand;
61import net.redinginer.core.commands.cmd.ListCommand;
62import net.redinginer.core.commands.cmd.NetherCommand;
63import net.redinginer.core.commands.cmd.NightCommand;
64import net.redinginer.core.commands.cmd.PayCommand;
65import net.redinginer.core.commands.cmd.RankingCommand;
66import net.redinginer.core.commands.cmd.RenameCommand;
67import net.redinginer.core.commands.cmd.RepairCommand;
68import net.redinginer.core.commands.cmd.ReplyCommand;
69import net.redinginer.core.commands.cmd.SetHomeCommand;
70import net.redinginer.core.commands.cmd.SetSpawnCommand;
71import net.redinginer.core.commands.cmd.ShopCommand;
72import net.redinginer.core.commands.cmd.SlotCommand;
73import net.redinginer.core.commands.cmd.SlowmodeCommand;
74import net.redinginer.core.commands.cmd.SmietnikCommand;
75import net.redinginer.core.commands.cmd.SpawnCommand;
76import net.redinginer.core.commands.cmd.SpeedCommand;
77import net.redinginer.core.commands.cmd.StatsCommand;
78import net.redinginer.core.commands.cmd.StoneCommand;
79import net.redinginer.core.commands.cmd.StpCommand;
80import net.redinginer.core.commands.cmd.StreamerCommand;
81import net.redinginer.core.commands.cmd.TeleportCommand;
82import net.redinginer.core.commands.cmd.TellCommand;
83import net.redinginer.core.commands.cmd.TpaCommand;
84import net.redinginer.core.commands.cmd.TpacceptCommand;
85import net.redinginer.core.commands.cmd.TpdenyCommmand;
86import net.redinginer.core.commands.cmd.TurboCommand;
87import net.redinginer.core.commands.cmd.UnBanCommand;
88import net.redinginer.core.commands.cmd.UnBanIpCommand;
89import net.redinginer.core.commands.cmd.VanishCommand;
90import net.redinginer.core.commands.cmd.VipCommand;
91import net.redinginer.core.commands.cmd.WhiteListCommand;
92import net.redinginer.core.commands.cmd.WhoIsCommand;
93import net.redinginer.core.commands.cmd.WorkBenchCommand;
94import net.redinginer.core.commands.cmd.YouTubeCommand;
95import net.redinginer.core.commands.cmd.YtlistCommand;
96import net.redinginer.core.commands.guild.AllyCommand;
97import net.redinginer.core.commands.guild.CreateCommand;
98import net.redinginer.core.commands.guild.DeleteCommand;
99import net.redinginer.core.commands.guild.EnlargeCommand;
100import net.redinginer.core.commands.guild.GaCommand;
101import net.redinginer.core.commands.guild.GuildHelpCommand;
102import net.redinginer.core.commands.guild.GuildHomeCommand;
103import net.redinginer.core.commands.guild.GuildSetHomeCommand;
104import net.redinginer.core.commands.guild.InfoCommand;
105import net.redinginer.core.commands.guild.InviteCommand;
106import net.redinginer.core.commands.guild.JoinCommand;
107import net.redinginer.core.commands.guild.LeaderCommand;
108import net.redinginer.core.commands.guild.LeaveCommand;
109import net.redinginer.core.commands.guild.OwnerCommand;
110import net.redinginer.core.commands.guild.ProlongCommand;
111import net.redinginer.core.commands.guild.PvpCommand;
112import net.redinginer.core.configuration.Config;
113import net.redinginer.core.configuration.Lang;
114import net.redinginer.core.listeners.AsyncPlayerChatListener;
115import net.redinginer.core.listeners.BoyListener;
116import net.redinginer.core.listeners.ChatGuildsListener;
117import net.redinginer.core.listeners.CheckLoginListener;
118import net.redinginer.core.listeners.CobblexListener;
119import net.redinginer.core.listeners.DropBlockBreakListener;
120import net.redinginer.core.listeners.EntityDamageByEntityListener;
121import net.redinginer.core.listeners.EntityDamageListener;
122import net.redinginer.core.listeners.EntityDeathListener;
123import net.redinginer.core.listeners.GuildExplodeListener;
124import net.redinginer.core.listeners.InCommbatInGuildListener;
125import net.redinginer.core.listeners.InventoryClickListener;
126import net.redinginer.core.listeners.InventoryListener;
127import net.redinginer.core.listeners.OpenInventoryListener;
128import net.redinginer.core.listeners.PlayerDeathListener;
129import net.redinginer.core.listeners.PlayerInteractListener;
130import net.redinginer.core.listeners.PlayerJoinListener;
131import net.redinginer.core.listeners.PlayerJoinListener1;
132import net.redinginer.core.listeners.PlayerMoveListener;
133import net.redinginer.core.listeners.PlayerQuitJoinListener;
134import net.redinginer.core.listeners.PunchPotyListener;
135import net.redinginer.core.listeners.SignChangeListener;
136import net.redinginer.core.listeners.TakeCrystalListener;
137import net.redinginer.core.listeners.UkownCommandListener;
138import net.redinginer.core.listeners.action.BlockBreakListener;
139import net.redinginer.core.listeners.action.BlockPlaceListener;
140import net.redinginer.core.listeners.action.PlayerBucketEmptyListener;
141import net.redinginer.core.listeners.action.PlayerBucketFillListener;
142import net.redinginer.core.managers.BanIPManager;
143import net.redinginer.core.managers.BanManager;
144import net.redinginer.core.managers.CombatManager;
145import net.redinginer.core.managers.DeathBanManager;
146import net.redinginer.core.managers.DropFile;
147import net.redinginer.core.managers.DropManager;
148import net.redinginer.core.managers.GuildManager;
149import net.redinginer.core.managers.NameTagManager;
150import net.redinginer.core.managers.TimerManager;
151import net.redinginer.core.managers.UserManager;
152import net.redinginer.core.mysql.store.Store;
153import net.redinginer.core.mysql.store.modes.StoreMode;
154import net.redinginer.core.mysql.store.modes.StoreMySQL;
155import net.redinginer.core.mysql.store.modes.StoreSQLITE;
156import net.redinginer.core.rank.TabThread;
157import net.redinginer.core.tasks.AutoMsgTask;
158import net.redinginer.core.tasks.CheckValidityTask;
159import net.redinginer.core.tasks.CombatTask;
160import net.redinginer.core.tasks.LimitTask;
161import net.redinginer.core.tasks.TabFreshRunnable;
162import net.redinginer.core.utils.CraftingUtil;
163import net.redinginer.core.utils.Logger;
164import net.redinginer.core.utils.Ticking;
165
166public 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}