Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler(priority=EventPriority.MONITOR)
- public void onDamage(EntityDamageByEntityEvent evnt)
- {
- if ((evnt.getDamager().equals(EntityType.PLAYER)) && (evnt.getEntity().equals(EntityType.PLAYER))) {
- getLogger().warning("trying event");
- Player p = (Player)evnt.getEntity();
- Player pdI = (Player)evnt.getDamager();
- Player pdII = DiaPlayer.getLastDia(p, pdI);
- if (Dia.isDia(pdI)) {
- getLogger().warning("trying event");
- DiaPlayer.setPlayerHit(pdI, p);
- if (!pdII.equals(pdI)) {
- getLogger().warning("/===================/ ADT-II Event: DiaTeam Confirmed /===================/");
- Player[] Staff = Dia.getStaff();
- for (int k = 0; k < Staff.length; k++) {
- JSONMESSAGES.sendJSONMessage(Staff[k], prefix + suffix + "{text:\" §6Players " + pdII.getName() + " and " + pdI.getName() + " Dia-Teamed agianst " + p.getName() + "\",hoverEvent:{action:show_text,value:{text:\"§b" + pdI.getName() + " = " + pdI.getCustomName() + "\n§b" + pdI.getName() + " = " + pdI.getCustomName() + "\"}}}");
- }
- if (Event.setEvent(pdI, pdII)) {
- getLogger().warning("/===================/ New ADT Record Created /===================/");
- }
- else {
- getLogger().warning("/===================/ ADT Record Exists, Updating /===================/");
- Event.addNumRec(Event.getNumEvent(pdI, pdII));
- getLogger().warning("/===================/ ADT Record Updated /===================/");
- }
- }
- }
- }
- }
- public void onDisable() { getLogger().info("/===================/ AntiDiaTeam II Disabled /===================/"); }
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
- {
- if (cmd.getName().equalsIgnoreCase("adtp")) {
- if (!sender.hasPermission("ADTII.P.Admin")) {
- JSONMESSAGES.sendJSONMessage((Player)sender, prefix + "{text:" + "\"§6 There are currently §b" + Dia.NumDia() + " §6people out in diamond armor\",hoverEvent:{action:show_text,value:{text:\"§c<You dont have permission to see who is in Dia>}}}");
- }
- else {
- JSONMESSAGES.sendJSONMessage((Player)sender, prefix + "{text:" + "\"§6 There are currently §b" + Dia.NumDia() + " §6people out in diamond armor\",hoverEvent:{action:show_text,value:{text:\"§c" + Dia.getDiaPlayers(N).toString() + "}}}");
- JSONMESSAGES.sendJSONMessage((Player)sender, "{text:\"§8[§4X§8]\",hoverEvent:{action:show_text,value:{text:\"§cRemove Record\"}},clickEvent:{action:run_command,value:\"/ADTRemove 1\"}},{text:\"§8[§2B§8]\",hoverEvent:{action:show_text,value:{text:\"§cBan Record\"}},clickEvent:{action:run_command,value:\"/ADTban 1\"}},{text:\"r1§6, §c2§6, §c3§6, §c4§6, §c5\"}");
- }
- }
- if ((cmd.getName().equalsIgnoreCase("adtlist")) &&
- (sender.hasPermission("ADT.List")) &&
- (args.length == 0)) {
- int a = Integer.parseInt(args[0]);
- String[][] b = Event.getRecords(a);
- for (int k = 0; k < b.length ; k++) {
- JSONMESSAGES.sendJSONMessage((Player)sender, "{text:\"§8[§4X§8]\",hoverEvent:{action:show_text,value:{text:\"§cRemove Record\"}},clickEvent:{action:run_command,value:\"/ADTRemove" + k + "\"}},{text:\"§8[§2B§8]\",hoverEvent:{action:show_text,value:{text:\"§cBan Record\"}},clickEvent:{action:run_command,value:\"/ADTban" + k + "\"}},{text:\"r" + b[k][0] + "§6, §c" + b[k][1] + "§6, §c" + b[k][2] + "§6, §c" + b[k][3] + "§6, §c" + b[k][4] + "\"}");
- }
- }
- if ((cmd.getName().equalsIgnoreCase("adtban")) &&
- (sender.hasPermission(STAFFPERM))) {
- if (args.length >= 1) {
- int a = Integer.parseInt(args[0]);
- //int a = Integer.parseInt(arg[0]);
- if (Event.recordExists(a)) {
- Player P = Bukkit.getPlayer("");
- Player P2 = Bukkit.getPlayer("");
- Date date = new Date();
- date.setDate(date.getDate() + 3);
- getServer().getBanList(BanList.Type.NAME).addBan(P.getName(), FormPre + FormSuf + "§4You are §lBANNED§4 for Diamond Teaming (record #" + args[0] + ")", date, "~Gary_S_Modd & Odiegaming staff(" + sender.getName() + ")");
- getServer().getBanList(BanList.Type.NAME).addBan(P2.getName(), FormPre + FormSuf + "§4You are §lBANNED§4 for Diamond Teaming (record #" + args[0] + ")", date, "~Gary_S_Modd & Odiegaming staff (" + sender.getName() + ")");
- P.kickPlayer(FormPre + FormSuf + "§4You are §lBANNED§4 for Diamond Teaming (record #" + args[0] + ")");
- P2.kickPlayer(FormPre + FormSuf + "§4You are §lBANNED§4 for Diamond Teaming (record #" + args[0] + ")");
- JSONMESSAGES.broadcastJson(prefix + "{text:\"§c Players §4" + P.getName() + "§c and §4" + P2.getName() + "§c were banned for diamond Teaming for 3 Days\"}");
- return true;
- }
- }
- JSONMESSAGES.sendJSONMessage((Player)sender, prefix + "{text:\"§6You dont have enough arguments!\",hoverEvent:{action:show_text,value:{text:\"§cYou must have at least one(1) argument for this command\n §7usage:§b /adtBan <Record Number>\"}}}");
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement