Some small changes

This commit is contained in:
alexcrea 2024-07-25 04:26:42 +02:00
parent 91ea6115be
commit a165aa4068
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F
4 changed files with 9 additions and 10 deletions

View file

@ -12,12 +12,12 @@ import java.io.InputStream;
import java.util.*;
public class UpdateManager {
private final static Version MAX_KNOW_MINECRAFT_VERSION = new Version(1, 21, 0);
private static final Version MAX_KNOW_MINECRAFT_VERSION = new Version(1, 21, 0);
public final static String MINECRAFT_VERSION_PATH = "lowMinecraftVersion";
public final static String PLUGIN_VERSION_PATH = "configVersion";
private final static String UPDATE_FOLDER = "version";
private final static String VERSION_LIST_RESSOUCE = UPDATE_FOLDER+"/minecraftVersions.txt";
public static final String MINECRAFT_VERSION_PATH = "lowMinecraftVersion";
public static final String PLUGIN_VERSION_PATH = "configVersion";
private static final String UPDATE_FOLDER = "version";
private static final String VERSION_LIST_RESSOUCE = UPDATE_FOLDER+"/minecraftVersions.txt";
private List<Version> minecraftVersionList;
private Version minecraftVersion;

View file

@ -61,8 +61,7 @@ public class Version implements Comparable<Version>{
@Override
public boolean equals(Object obj) {
if(obj instanceof Version){
Version other = (Version) obj;
if(obj instanceof Version other){
return (other.major == this.major) && (other.minor == this.minor) && (other.build == this.build);
}
return false;

View file

@ -131,6 +131,8 @@ class CustomAnvil : JavaPlugin() {
return
}
// TODO use the update system config I guess
// Register enchantment of compatible plugin and load configuration change.
DependencyManager.handleCompatibilityConfig()

View file

@ -9,7 +9,6 @@ import xyz.alexcrea.cuanvil.api.event.CAConfigReadyEvent
import xyz.alexcrea.cuanvil.config.ConfigHolder
import xyz.alexcrea.cuanvil.dependency.DependencyManager
import xyz.alexcrea.cuanvil.gui.config.global.*
import xyz.alexcrea.cuanvil.update.Update_1_21
class ReloadExecutor : CommandExecutor {
override fun onCommand(sender: CommandSender, cmd: Command, cmdstr: String, args: Array<out String>): Boolean {
@ -48,8 +47,7 @@ class ReloadExecutor : CommandExecutor {
UnitRepairConfigGui.getCurrentInstance()?.reloadValues()
CustomRecipeConfigGui.getCurrentInstance()?.reloadValues()
// temporary: handle 1.21 update
Update_1_21.handleUpdate()
// TODO use the update system config I guess
// Handle dependency reload
DependencyManager.handleConfigReload()