diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..21b4487 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Project exclude paths +/out/ \ No newline at end of file diff --git a/resource/plugin.yml b/resource/plugin.yml index 9adff47..5a800b3 100644 --- a/resource/plugin.yml +++ b/resource/plugin.yml @@ -1,7 +1,7 @@ +version: 3.2.0-pre3 name: CommandPanels main: me.rockyhawk.commandPanels.commandpanels author: RockyHawk -version: 3.2.0-pre3 api-version: 1.13 description: Fully Custom GUIs. Make your Server Professional. softdepend: [PlaceholderAPI, Vault, HeadDatabase, TokenManager, VotingPlugin] diff --git a/src/me/rockyhawk/commandPanels/commandpanels.java b/src/me/rockyhawk/commandPanels/commandpanels.java index b605934..3da14e3 100644 --- a/src/me/rockyhawk/commandPanels/commandpanels.java +++ b/src/me/rockyhawk/commandPanels/commandpanels.java @@ -6,11 +6,11 @@ import com.google.common.io.ByteStreams; import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; import com.mojang.authlib.properties.PropertyMap; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.Reader; + +import java.io.*; import java.lang.reflect.Field; +import java.net.HttpURLConnection; +import java.net.URL; import java.util.*; import me.arcaniax.hdb.api.HeadDatabaseAPI; @@ -140,7 +140,8 @@ public class commandpanels extends JavaPlugin { Bukkit.getConsoleSender().sendMessage("[CommandPanels]" + ChatColor.RED + " WARNING: Could not find config version! Your config may be missing some information!"); } - try { + githubNewUpdate(); + /*try { if (this.config.getString("config.update-notifications").trim().equalsIgnoreCase("true")) { if(!this.getDescription().getVersion().contains("-")) { Updater check = new Updater(this, 325941, this.getFile(), Updater.UpdateType.NO_DOWNLOAD, true); @@ -157,7 +158,7 @@ public class commandpanels extends JavaPlugin { } } catch (Exception var9) { Bukkit.getConsoleSender().sendMessage("[CommandPanels]" + ChatColor.RED + " Could not check for update online."); - } + }*/ //load panelFiles reloadPanelFiles(); @@ -1554,4 +1555,18 @@ public class commandpanels extends JavaPlugin { Reader targetReader = new CharSequenceReader(new String(buffer)); return targetReader; } + + public void githubNewUpdate(){ + HttpURLConnection connection; + String WRITE; + String gitVersion; + try{ + connection = (HttpURLConnection) new URL("https://raw.githubusercontent.com/rockyhawk64/CommandPanels/master/resource/plugin.yml").openConnection(); + connection.connect(); + gitVersion = new BufferedReader(new InputStreamReader(connection.getInputStream())).readLine().split("\\s")[1]; + getServer().getConsoleSender().sendMessage(ChatColor.GREEN + gitVersion); + }catch(IOException e){ + debug(e); + } + } }