NotCachaaaaaaaaaa

Untitled

Mar 4th, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. public class AntiLeak extends JavaPlugin {
  2. PluginDescriptionFile pdffile = getDescription();
  3. public String version = pdffile.getVersion();
  4.  
  5. @Override
  6. public void onEnable() {
  7. AntiLeakUtils antiLeakUtils = new AntiLeakUtils();
  8. List<String> iplist = antiLeakUtils.iplist();
  9. if(iplist.contains(Bukkit.getServer().getIp())){
  10. //LA IP SI ESTA EN LA LISTA
  11. try {
  12. URL url = new URL("https://pastebin.com/raw/Rp2Tb8fa");
  13. BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
  14. String line;
  15. while ((line = in.readLine()) != null) {
  16. if(line.equals(version)){
  17. //LA VERSION DEL PLUGIN ES LA ACTUAL
  18. Bukkit.getConsoleSender().sendMessage("§a§lLA IP SI ESTA EN LA LISTA");
  19. //todo el codigo normal del onEnable
  20. }else{
  21. //LA VERSION DEL PLUGIN ES ANTIGUA
  22. Bukkit.getConsoleSender().sendMessage("§c§lTIENES UNA VERSION DESACTUALIZADA DEL PLUGIN.");
  23. Bukkit.shutdown();
  24. }
  25. }
  26. } catch (IOException ignored) { }
  27. } else {
  28. //LA IP NO ESTA EN LA LISTA
  29. Bukkit.getConsoleSender().sendMessage("§c§lLA IP NO ESTA EN LA LISTA");
  30. Bukkit.shutdown();
  31. }
  32.  
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment