plugin yml update

This commit is contained in:
BuildTools 2020-07-02 09:48:56 +10:00
parent 124e37d56d
commit 6b93dc1f85
3 changed files with 24 additions and 7 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# Project exclude paths
/out/

View File

@ -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]

View File

@ -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);
}
}
}