Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class AntiLeak extends JavaPlugin {
- PluginDescriptionFile pdffile = getDescription();
- public String version = pdffile.getVersion();
- @Override
- public void onEnable() {
- AntiLeakUtils antiLeakUtils = new AntiLeakUtils();
- List<String> iplist = antiLeakUtils.iplist();
- if(iplist.contains(Bukkit.getServer().getIp())){
- //LA IP SI ESTA EN LA LISTA
- try {
- URL url = new URL("https://pastebin.com/raw/Rp2Tb8fa");
- BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
- String line;
- while ((line = in.readLine()) != null) {
- if(line.equals(version)){
- //LA VERSION DEL PLUGIN ES LA ACTUAL
- Bukkit.getConsoleSender().sendMessage("§a§lLA IP SI ESTA EN LA LISTA");
- //todo el codigo normal del onEnable
- }else{
- //LA VERSION DEL PLUGIN ES ANTIGUA
- Bukkit.getConsoleSender().sendMessage("§c§lTIENES UNA VERSION DESACTUALIZADA DEL PLUGIN.");
- Bukkit.shutdown();
- }
- }
- } catch (IOException ignored) { }
- } else {
- //LA IP NO ESTA EN LA LISTA
- Bukkit.getConsoleSender().sendMessage("§c§lLA IP NO ESTA EN LA LISTA");
- Bukkit.shutdown();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment