From 03f70b8e885b091a717574e84d07f1d562982e02 Mon Sep 17 00:00:00 2001 From: toydotgame Date: Fri, 12 Feb 2021 20:59:00 +1000 Subject: [PATCH] Removed update checker, kept debug current version data output --- plugin.yml | 2 +- src/io/github/Toydotgame/DataStorage.java | 1 - src/io/github/Toydotgame/Main.java | 21 ++------------------- src/io/github/Toydotgame/Thisway.java | 11 +++-------- 4 files changed, 6 insertions(+), 29 deletions(-) diff --git a/plugin.yml b/plugin.yml index 7e91d46..fc60b4b 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,6 +1,6 @@ name: Thisway main: io.github.Toydotgame.Main -version: 1.2.2 +version: 1.2.3 description: Teleports the player in the direction they're facing. author: Toydotgam prefix: Thisway diff --git a/src/io/github/Toydotgame/DataStorage.java b/src/io/github/Toydotgame/DataStorage.java index b965132..f83c15b 100644 --- a/src/io/github/Toydotgame/DataStorage.java +++ b/src/io/github/Toydotgame/DataStorage.java @@ -4,7 +4,6 @@ public class DataStorage { public static String localVersion; - public static String serverVersion; public static boolean debug; public static String facing; diff --git a/src/io/github/Toydotgame/Main.java b/src/io/github/Toydotgame/Main.java index 24ce4d2..fb22b79 100644 --- a/src/io/github/Toydotgame/Main.java +++ b/src/io/github/Toydotgame/Main.java @@ -1,29 +1,12 @@ package io.github.Toydotgame; -import java.util.concurrent.CompletableFuture; - import org.bukkit.plugin.java.JavaPlugin; -import me.robertlit.spigotresources.api.Resource; -import me.robertlit.spigotresources.api.SpigotResourcesAPI; - public class Main extends JavaPlugin { @Override public void onEnable() { - SpigotResourcesAPI api = new SpigotResourcesAPI(false); - - CompletableFuture future = api.getResource(87115); - future.thenAccept(resource -> { - DataStorage.localVersion = this.getDescription().getVersion(); - DataStorage.serverVersion = resource.getVersion(); - - if(this.getDescription().getVersion().equals(resource.getVersion())) { // if(localVersion == serverVersion) {} - System.out.print("[Thisway] Plugin loaded successfully!"); - } else { - System.out.print("[Thisway] Thisway is out-of-date or you are using a beta version of the plugin. If it's the former; I strongly suggest that you update in case of any potential bugs in your copy of the plugin."); - System.out.print("[Thisway] The plugin was loaded anyway."); - } - }); + DataStorage.localVersion = this.getDescription().getVersion(); + System.out.print("[Thisway] Plugin loaded successfully!"); this.getCommand("thisway").setExecutor(new Thisway()); } diff --git a/src/io/github/Toydotgame/Thisway.java b/src/io/github/Toydotgame/Thisway.java index 02c8606..615c365 100644 --- a/src/io/github/Toydotgame/Thisway.java +++ b/src/io/github/Toydotgame/Thisway.java @@ -31,18 +31,13 @@ public boolean onCommand(CommandSender sender, Command command, String label, St if(args[1].equalsIgnoreCase("true")) { // If the second argument is "true': if(args[0].matches("^[0-9]*$") && args[0] != "0") { // If the first argument is an accepted number. DataStorage.debug = true; - sender.sendMessage(ChatColor.YELLOW + "=== THISWAY DEBUG START ==="); // Debug header in player chat. + sender.sendMessage(ChatColor.YELLOW + "=== THISWAY DEBUG START ==="); // Debug header in player chat. sender.sendMessage("Plugin version: " + DataStorage.localVersion); - sender.sendMessage("Latest Version: " + DataStorage.serverVersion); - if(DataStorage.localVersion.equals(DataStorage.serverVersion)) { - sender.sendMessage(ChatColor.GREEN + "Thisway is up-to-date."); - } else { - sender.sendMessage(ChatColor.RED + "Thisway is not up-to-date with the latest stable version!"); - } - + sender.sendMessage(/* ChatColor.GREY + */ "Always remember to check for updates!"); thisway(sender, args); sender.sendMessage(ChatColor.YELLOW + "=== THISWAY DEBUG END ==="); // Debug footer. + return true; } else { sender.sendMessage(ChatColor.RED + "Invalid teleportation distance! Not a number!");