Recode Class Names

This commit is contained in:
2024-07-04 22:03:13 +02:00
parent a74710ed9a
commit 8678eee675
86 changed files with 1560 additions and 1676 deletions

View File

@@ -1,9 +1,8 @@
package net.t2code.t2codelib.SPIGOT.api.update;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
import net.t2code.t2codelib.SPIGOT.system.config.config.T2CLibConfig;
import net.t2code.t2codelib.SPIGOT.system.config.config.T2C_LibConfig;
import net.t2code.t2codelib.UpdateType;
import net.t2code.t2codelib.T2CupdateObject;
import net.t2code.t2codelib.T2CupdateWebData;
@@ -16,7 +15,7 @@ import org.bukkit.scheduler.BukkitRunnable;
import java.util.HashMap;
public class T2CupdateAPI {
public class T2C_UpdateAPI {
public static HashMap<String, T2CupdateObject> pluginVersions = new HashMap<>();
public static void join(Plugin plugin, String prefix, String perm, Player player, Integer spigotID, String discord) {
@@ -86,7 +85,7 @@ public class T2CupdateAPI {
}
} else updateStatusVersion = UpdateType.STABLE.text;
T2Csend.player(player, st.replace("[prefix]", prefix).replace("[value]", updateStatusVersion).replace("[link]", webData.getUpdateUrl())
T2C_Send.player(player, st.replace("[prefix]", prefix).replace("[value]", updateStatusVersion).replace("[link]", webData.getUpdateUrl())
.replace("[plv]", pluginVersion).replace("[puv]", publicVersion).replace("[dc]", discord));
}
@@ -111,13 +110,13 @@ public class T2CupdateAPI {
String s3 = " <color:#6e90ff>You can download it here:</color> <yellow>" + webData.getUpdateUrl() + "</yellow>";
String s4 = " <color:#6e90ff>You can find more information on Discord:</color> <yellow>" + discord + "</yellow>";
T2Ctemplate.sendFrameCenter(prefix,s1,s2,s3,s4);
T2C_Send.sendFrameCenter(prefix,s1,s2,s3,s4);
}
public static String updateInfo(String[] args, Boolean player) {
T2CupdateObject object;
try {
object = T2CupdateAPI.pluginVersions.get(args[1]);
object = T2C_UpdateAPI.pluginVersions.get(args[1]);
} catch (Exception e) {
return Util.getPrefix() + " <red>The plugin <yellow>" + args[1] + "</yellow> is not registered in the update checker of T2Code!</red>";
}
@@ -126,8 +125,8 @@ public class T2CupdateAPI {
if (webData == null) {
return Util.getPrefix() + " <b><dark_red>It could not be checked for updates with the plugin <yellow>" + args[1] + "</yellow>!</dark_red></b>";
}
String pluginName = T2CupdateAPI.pluginVersions.get(args[1]).pluginName;
String pluginVersion = T2CupdateAPI.pluginVersions.get(args[1]).pluginVersion;
String pluginName = T2C_UpdateAPI.pluginVersions.get(args[1]).pluginName;
String pluginVersion = T2C_UpdateAPI.pluginVersions.get(args[1]).pluginVersion;
String updateTitle = webData.getUpdateTitle();
String updateVersion = webData.getVersion();
@@ -185,7 +184,7 @@ public class T2CupdateAPI {
}
public static void onUpdateCheck(Plugin plugin, String prefix, String gitKey, Integer spigotID, String discord, Boolean updateCheckOnJoin, Boolean seePreReleaseUpdates, Integer timeInterval) {
if ((boolean) T2CLibConfig.VALUES.updateCheckFullDisable.getValue()) return;
new T2CupdateCheckerGit((JavaPlugin) plugin, prefix, gitKey, spigotID, discord, updateCheckOnJoin, seePreReleaseUpdates, timeInterval);
if ((boolean) T2C_LibConfig.VALUES.updateCheckFullDisable.getValue()) return;
new T2C_UpdateCheckerGit((JavaPlugin) plugin, prefix, gitKey, spigotID, discord, updateCheckOnJoin, seePreReleaseUpdates, timeInterval);
}
}

View File

@@ -1,8 +1,8 @@
package net.t2code.t2codelib.SPIGOT.api.update;
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
import net.t2code.t2codelib.SPIGOT.system.config.config.T2CLibConfig;
import net.t2code.t2codelib.SPIGOT.system.config.config.T2C_LibConfig;
import net.t2code.t2codelib.T2CupdateObject;
import net.t2code.t2codelib.T2CupdateWebData;
import org.bukkit.Bukkit;
@@ -18,12 +18,12 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.function.Consumer;
public class T2CupdateCheckerGit {
public class T2C_UpdateCheckerGit {
private final JavaPlugin plugin;
private T2CupdateObject t2CupdateObject;
public T2CupdateCheckerGit(JavaPlugin plugin, String prefix, String gitKey, Integer spigotID, String discord, Boolean updateCheckOnJoin, Boolean seePreReleaseUpdates, Integer timeInterval) {
public T2C_UpdateCheckerGit(JavaPlugin plugin, String prefix, String gitKey, Integer spigotID, String discord, Boolean updateCheckOnJoin, Boolean seePreReleaseUpdates, Integer timeInterval) {
this.plugin = plugin;
String RepoURL = "https://git.t2code.net/api/v1/repos/" + gitKey + "/releases?limit=1";
@@ -40,7 +40,7 @@ public class T2CupdateCheckerGit {
Bukkit.getScheduler().runTaskTimerAsynchronously(plugin, new Runnable() {
@Override
public void run() {
if ((boolean) T2CLibConfig.VALUES.updateCheckFullDisable.getValue()) return;
if ((boolean) T2C_LibConfig.VALUES.updateCheckFullDisable.getValue()) return;
getVersion((webData) -> {
T2CupdateObject update = new T2CupdateObject(
plugin.getName(),
@@ -51,24 +51,24 @@ public class T2CupdateCheckerGit {
updateCheckOnJoin
);
T2CupdateAPI.pluginVersions.put(plugin.getName(), update);
if (T2CupdateAPI.pluginVersions.get(plugin.getName()) == null) {
T2Csend.debugmsg(T2CodeLibMain.getPlugin(), "'" + plugin.getName() + "' UpdateAPI T2CupdateAPI.pluginVersions.get(plugin.getName()) == null");
T2C_UpdateAPI.pluginVersions.put(plugin.getName(), update);
if (T2C_UpdateAPI.pluginVersions.get(plugin.getName()) == null) {
T2C_Send.debugmsg(T2CodeLibMain.getPlugin(), "'" + plugin.getName() + "' UpdateAPI T2CupdateAPI.pluginVersions.get(plugin.getName()) == null");
return;
}
if (T2CupdateAPI.pluginVersions.get(plugin.getName()).updateAvailable) {
if (T2C_UpdateAPI.pluginVersions.get(plugin.getName()).updateAvailable) {
if (!update.load) {
new BukkitRunnable() {
@Override
public void run() {
update.load = true;
T2CupdateAPI.sendUpdateMsg(prefix, discord, webData, plugin);
T2C_UpdateAPI.sendUpdateMsg(prefix, discord, webData, plugin);
}
}.runTaskLaterAsynchronously(plugin, 600L);
} else T2CupdateAPI.sendUpdateMsg(prefix, discord, webData, plugin);
} else T2C_UpdateAPI.sendUpdateMsg(prefix, discord, webData, plugin);
} else {
if (!update.load) {
T2Csend.console(prefix + " §e║ " + "§2No update found.");
T2C_Send.console(prefix + " §e║ " + "§2No update found.");
update.load = true;
}
}
@@ -132,8 +132,8 @@ public class T2CupdateCheckerGit {
consumer.accept(webData);
} catch (Exception exception) {
Boolean load = false;
if (T2CupdateAPI.pluginVersions.containsKey(plugin.getName())) {
load = T2CupdateAPI.pluginVersions.get(plugin.getName()).load;
if (T2C_UpdateAPI.pluginVersions.containsKey(plugin.getName())) {
load = T2C_UpdateAPI.pluginVersions.get(plugin.getName()).load;
}
T2CupdateObject update = new T2CupdateObject(
plugin.getName(),
@@ -143,9 +143,9 @@ public class T2CupdateCheckerGit {
false,
updateCheckOnJoin
);
T2CupdateAPI.pluginVersions.put(plugin.getName(), update);
T2C_UpdateAPI.pluginVersions.put(plugin.getName(), update);
T2Csend.error(this.plugin, "§4 Cannot look for updates: " + exception.getMessage());
T2C_Send.error(this.plugin, "§4 Cannot look for updates: " + exception.getMessage());
exception.printStackTrace();
}
});